thorvg / thorvg

Thor Vector Graphics is a lightweight portable library used for drawing vector-based scenes and animations including SVG and Lottie. It can be freely utilized across various software platforms and applications to visualize graphical contents.

Home Page:https://www.thorvg.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

arm-neon compile error

rinechran opened this issue · comments

Compilation error found while currently working on neon side.

I checked the code, and finally I tried to build with arm neon before pr. But I confirmed that the build is not possible when neon is activated.

https://github.com/rinechran/thorvg/blob/829236b27b36e1db1ae88e36fb8f3d203ab25b99/src/renderer/sw_engine/tvgSwRasterNeon.h#L34

The same error is currently occurring in thorvg[main]

rinechran@raspberrypi:~/project/thorvg $ meson setup builddir  -Dtests=true  -Dvector=true
The Meson build system
Version: 1.0.0
Source dir: /home/rinechran/project/thorvg
Build dir: /home/rinechran/project/thorvg/builddir
Build type: native build
Project name: thorvg
Project version: 0.12.99
C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
C++ linker for the host machine: c++ ld.bfd 2.35.2
Host machine cpu family: arm
Host machine cpu: armv7l
Configuring config.h using configuration
Library pthread found: YES
Message:

Summary:
    ThorVG version:          0.12.99
    Build Type:              debugoptimized
    Prefix:                  /usr/local
    Multi-Tasking:           true
    SIMD Instruction:        neon
    Raster Engine (SW):      true
    Raster Engine (GL_BETA): false
    Raster Engine (WG_BETA): false
    Loader (TVG):            true
    Loader (SVG):            true
    Loader (TTF):            false
    Loader (LOTTIE):         true
    Loader (PNG):            false
    Loader (JPG):            false
    Loader (WEBP):           false
    Saver (TVG):             false
    Saver (GIF):             false
    Binding (CAPI):          false
    Binding (WASM_BETA):     false
    Log Message:             false
    Tests:                   true
    Examples:                false
    Tool (Svg2Tvg):          false
    Tool (Svg2Png):          false
    Tool (Lottie2Gif):       false


Build targets in project: 2

thorvg 0.12.99

  User defined options
    tests : true
    vector: true

Found ninja-1.10.1 at /usr/bin/ninja
rinechran@raspberrypi:~/project/thorvg $ cmake
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

rinechran@raspberrypi:~/project/thorvg $ meson build  builddir

ERROR: Neither directory contains a build file meson.build.
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
rinechran@raspberrypi:~/project/thorvg $ ^C
rinechran@raspberrypi:~/project/thorvg $ meson compile -C builddir
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /home/rinechran/project/thorvg/builddir
ninja: Entering directory `/home/rinechran/project/thorvg/builddir'
[21/62] Compiling C++ object src/libthorvg.so.0.12.99.p/renderer_sw_engine_tvgSwRaster.cpp.o
FAILED: src/libthorvg.so.0.12.99.p/renderer_sw_engine_tvgSwRaster.cpp.o
c++ -Isrc/libthorvg.so.0.12.99.p -Isrc -I../src -Iinc -I../inc -I. -I.. -Isrc/loaders/lottie -I../src/loaders/lottie -Isrc/renderer -I../src/renderer -Isrc/renderer/sw_engine -I../src/renderer/sw_engine -Isrc/common -I../src/common -Isrc/loaders -I../src/loaders -Isrc/loaders/tvg -I../src/loaders/tvg -Isrc/loaders/svg -I../src/loaders/svg -Isrc/loaders/raw -I../src/loaders/raw -Isrc/savers -I../src/savers -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -Os -g '-DEXAMPLE_DIR="/home/rinechran/project/thorvg/examples/resources"' '-DTEST_DIR="/home/rinechran/project/thorvg/test/resources"' -fPIC -DTVG_EXPORT -DTVG_BUILD -mfpu=neon -fno-exceptions -fno-rtti -fno-stack-protector -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -Woverloaded-virtual -Wno-unused-parameter -MD -MQ src/libthorvg.so.0.12.99.p/renderer_sw_engine_tvgSwRaster.cpp.o -MF src/libthorvg.so.0.12.99.p/renderer_sw_engine_tvgSwRaster.cpp.o.d -o src/libthorvg.so.0.12.99.p/renderer_sw_engine_tvgSwRaster.cpp.o -c ../src/renderer/sw_engine/tvgSwRaster.cpp
In file included from ../src/renderer/sw_engine/tvgSwRaster.cpp:238:
../src/renderer/sw_engine/tvgSwRasterNeon.h: In function ‘bool neonRasterTranslucentRle(SwSurface*, const SwRleData*, uint8_t, uint8_t, uint8_t, uint8_t)’:
../src/renderer/sw_engine/tvgSwRasterNeon.h:59:35: error: request for member ‘join’ in ‘surface->SwSurface::blender’, which is of non-class type ‘SwBlender’ {aka ‘unsigned int (*)(unsigned int, unsigned int, unsigned char)’}
   59 |     auto color = surface->blender.join(r, g, b, a);
      |                                   ^~~~
../src/renderer/sw_engine/tvgSwRasterNeon.h:70:23: error: ‘IALPHA’ was not declared in this scope
   70 |         auto ialpha = IALPHA(src);
      |                       ^~~~~~
../src/renderer/sw_engine/tvgSwRasterNeon.h:85:32: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
   85 |         for (uint32_t x = 0; x < (span->len - align) / 2; ++x)
      |                              ~~^~~~~~~~~~~~~~~~~~~~~~~~~
../src/renderer/sw_engine/tvgSwRasterNeon.h: In function ‘bool neonRasterTranslucentRect(SwSurface*, const SwBBox&, uint8_t, uint8_t, uint8_t, uint8_t)’:
../src/renderer/sw_engine/tvgSwRasterNeon.h:104:35: error: request for member ‘join’ in ‘surface->SwSurface::blender’, which is of non-class type ‘SwBlender’ {aka ‘unsigned int (*)(unsigned int, unsigned int, unsigned char)’}
  104 |     auto color = surface->blender.join(r, g, b, a);
      |                                   ^~~~
[26/62] Compiling C++ object src/libthorvg.so.0.12.99.p/renderer_sw_engine_tvgSwStroke.cpp.o
ninja: build stopped: subcommand failed.