fraunhoferhhi / vvdec

VVdeC, the Fraunhofer Versatile Video Decoder
https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html
BSD 3-Clause Clear License
428 stars 85 forks source link

Failed to compile Linux armv7 vvdec binary for errors of new release vvdec 2.3.0 #175

Closed MartinEesmaa closed 1 month ago

MartinEesmaa commented 2 months ago

Hi!

I have an issue about cross-compiling Linux armv7 vvdec binary on my Linux x86_64 machine. The commit of https://github.com/fraunhoferhhi/vvdec/commit/edd47ab839a73e47d672b1f1ad071725eb955f93 doesn't work and it fails to compile armv7 vvdec binary for Linux, but last commit of https://github.com/fraunhoferhhi/vvdec/commit/85ed28d022f2aaca0e7721dca5f3d6b1b7f63c66 was successfully compiled of Linux arm64 binary.

I'm running on Ubuntu 22.04.3 LTS Server and also GCC 11.4.0 with g++.

Here is the log that may be helpful to you and used CMake Toolchain of ARMv7.

toolchain_armv7.cmake:

# name of the target operating system
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR armv7l)

set( GNU_MACHINE "arm-linux-gnueabihf" )

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER   /usr/bin/${GNU_MACHINE}-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/${GNU_MACHINE}-g++)

# Where is the target environment
SET(CMAKE_FIND_ROOT_PATH  /usr/bin/${GNU_MACHINE})

# Search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# For libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

CMake output logs:

martineesmaa@martineesmaa:~/vvdec/build$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="../cmake/toolchains/toolchain_armv7.cmake" -DCMAKE_EXE_LINKER_FLAGS="-static" .. && cmake --build . -j 8
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_MODULE_PATH: updating module path to: /home/martineesmaa/vvdec/cmake/modules
-- Performing Test SUPPORTED_Werror_unused_command_line_argument
-- Performing Test SUPPORTED_Werror_unused_command_line_argument - Failed
-- Performing Test SUPPORTED_msse4_1
-- Performing Test SUPPORTED_msse4_1 - Failed
-- Performing Test SUPPORTED_msse2
-- Performing Test SUPPORTED_msse2 - Failed
-- Performing Test SUPPORTED_mavx
-- Performing Test SUPPORTED_mavx - Failed
-- Performing Test HAVE_INTRIN_mm_storeu_si16
-- Performing Test HAVE_INTRIN_mm_storeu_si16 - Success
-- Performing Test HAVE_INTRIN_mm_storeu_si32
-- Performing Test HAVE_INTRIN_mm_storeu_si32 - Success
-- Performing Test HAVE_INTRIN_mm_storeu_si64
-- Performing Test HAVE_INTRIN_mm_storeu_si64 - Success
-- Performing Test HAVE_INTRIN_mm_loadu_si32
-- Performing Test HAVE_INTRIN_mm_loadu_si32 - Success
-- Performing Test HAVE_INTRIN_mm_loadu_si64
-- Performing Test HAVE_INTRIN_mm_loadu_si64 - Success
-- Performing Test HAVE_INTRIN_mm256_zeroupper
-- Performing Test HAVE_INTRIN_mm256_zeroupper - Failed
-- Performing Test HAVE_INTRIN_mm256_loadu2_m128i
-- Performing Test HAVE_INTRIN_mm256_loadu2_m128i - Success
-- x86 SIMD intrinsics enabled (using SIMDE for non-x86 targets)
-- ARM SIMD intrinsics enabled
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test SUPPORTED_mxsave
-- Performing Test SUPPORTED_mxsave - Failed
-- Performing Test SUPPORTED_mavx2
-- Performing Test SUPPORTED_mavx2 - Failed
-- Some bitstream files are missing.
--   If you want to run tests, reconfigure with -DVVDEC_ENABLE_BITSTREAM_DOWNLOAD=ON
--   (or using top level Makefile: make test enable-bitstream-download=1)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/martineesmaa/vvdec/build
[  2%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec_x86_simd.dir/__/CommonLib/x86/sse41/Buffer_sse41.cpp.o
[  2%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec_x86_simd.dir/__/CommonLib/x86/sse41/AdaptiveLoopFilter_sse41.cpp.o
[  3%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec_x86_simd.dir/__/CommonLib/x86/sse41/InterPred_sse41.cpp.o
[  4%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec_x86_simd.dir/__/CommonLib/x86/sse41/IntraPred_sse41.cpp.o
[  6%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec_x86_simd.dir/__/CommonLib/x86/sse41/LoopFilter_sse41.cpp.o
[  7%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec_x86_simd.dir/__/CommonLib/x86/sse41/Picture_sse41.cpp.o
[  8%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec_x86_simd.dir/__/CommonLib/x86/sse41/InterpolationFilter_sse41.cpp.o
[  9%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec_arm_simd.dir/__/CommonLib/arm/neon/Buffer_neon.cpp.o
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h: In function ‘vvdec::applyLut_SIMD<(vvdec::arm_simd::ARM_VEXT)1>(short*, int, int, int, short const*)void’:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:13526:1: error: inlining failed in call to ‘always_inline’ ‘vst4q_s16’: target specific option mismatch
13526 | vst4q_s16 (int16_t * __a, int16x8x4_t __b)
      | ^~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:217:18: note: called from here
  217 |         vst4q_s16( &ptr[ x ], xtmp1 );
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:13526:1: error: inlining failed in call to ‘always_inline’ ‘vst4q_s16’: target specific option mismatch
13526 | vst4q_s16 (int16_t * __a, int16x8x4_t __b)
      | ^~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:218:18: note: called from here
  218 |         vst4q_s16( &ptr[ x + 1 * ptrStride ], xtmp2 );
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:13526:1: error: inlining failed in call to ‘always_inline’ ‘vst4q_s16’: target specific option mismatch
13526 | vst4q_s16 (int16_t * __a, int16x8x4_t __b)
      | ^~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:219:18: note: called from here
  219 |         vst4q_s16( &ptr[ x + 2 * ptrStride ], xtmp3 );
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:13526:1: error: inlining failed in call to ‘always_inline’ ‘vst4q_s16’: target specific option mismatch
13526 | vst4q_s16 (int16_t * __a, int16x8x4_t __b)
      | ^~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:220:18: note: called from here
  220 |         vst4q_s16( &ptr[ x + 3 * ptrStride ], xtmp4 );
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:6441:1: error: inlining failed in call to ‘always_inline’ ‘vsetq_lane_s16’: target specific option mismatch
 6441 | vsetq_lane_s16 (int16_t __a, int16x8_t __b, const int __c)
      | ^~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:238:40: note: called from here
  238 |         xtmp1.val[ 0 ] = vsetq_lane_s16( lut[ ptr[ x + 0 ] ], xtmp1.val[ 0 ], 0 );
      |                          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:6441:1: error: inlining failed in call to ‘always_inline’ ‘vsetq_lane_s16’: target specific option mismatch
 6441 | vsetq_lane_s16 (int16_t __a, int16x8_t __b, const int __c)
      | ^~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:239:40: note: called from here
  239 |         xtmp1.val[ 1 ] = vsetq_lane_s16( lut[ ptr[ x + 1 ] ], xtmp1.val[ 1 ], 0 );
      |                          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:6441:1: error: inlining failed in call to ‘always_inline’ ‘vsetq_lane_s16’: target specific option mismatch
 6441 | vsetq_lane_s16 (int16_t __a, int16x8_t __b, const int __c)
      | ^~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:240:40: note: called from here
  240 |         xtmp1.val[ 0 ] = vsetq_lane_s16( lut[ ptr[ x + 2 ] ], xtmp1.val[ 0 ], 1 );
      |                          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:6441:1: error: inlining failed in call to ‘always_inline’ ‘vsetq_lane_s16’: target specific option mismatch
 6441 | vsetq_lane_s16 (int16_t __a, int16x8_t __b, const int __c)
      | ^~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:241:40: note: called from here
  241 |         xtmp1.val[ 1 ] = vsetq_lane_s16( lut[ ptr[ x + 3 ] ], xtmp1.val[ 1 ], 1 );
      |                          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../CommonDefARM.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/../BufferARM.h:53,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/arm/neon/Buffer_neon.cpp:43:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include/arm_neon.h:6441:1: error: inlining failed in call to ‘always_inline’ ‘vsetq_lane_s16’: target specific option mismatch
 6441 | vsetq_lane_s16 (int16_t __a, int16x8_t __b, const int __c)
      | ^~~~~~~~~~~~~~

CMake output logs (disabled of x86 and ARM SIMD):

martineesmaa@martineesmaa:~/vvdec/build$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="../cmake/toolchains/toolchain_armv7.cmake" -DCMAKE_EXE_LINKER_FLAGS="-static" -DVVDEC_ENABLE_X86_SIMD=OFF -DVVDEC_ENABLE_ARM_SIMD=OFF .. && cmake --build . -j 8
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_MODULE_PATH: updating module path to: /home/martineesmaa/vvdec/cmake/modules
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Some bitstream files are missing.
--   If you want to run tests, reconfigure with -DVVDEC_ENABLE_BITSTREAM_DOWNLOAD=ON
--   (or using top level Makefile: make test enable-bitstream-download=1)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/martineesmaa/vvdec/build
[  3%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/AdaptiveLoopFilter.cpp.o
[  3%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/BitStream.cpp.o
[  5%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/CodingStructure.cpp.o
[  7%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/Contexts.cpp.o
[ 11%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/ContextModelling.cpp.o
[ 11%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/InterPrediction.cpp.o
[ 13%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/Buffer.cpp.o
[ 15%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/ChromaFormat.cpp.o
[ 16%] Building CXX object source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/InterpolationFilter.cpp.o
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/Slice.h:52,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/WeightPrediction.h:50,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/InterPrediction.h:51,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/InterPrediction.cpp:47:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h: In member function ‘void vvdec::InputBitstream::load_next_bits(int)’:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h:206:21: error: ‘simde_bswap64’ was not declared in this scope
  206 |       m_held_bits = simde_bswap64( *reinterpret_cast<uint64_t*>( &m_fifo[m_fifo_idx] ) );
      |                     ^~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/Slice.h:52,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/Picture.h:55,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/Buffer.cpp:54:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h: In member function ‘void vvdec::InputBitstream::load_next_bits(int)’:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h:206:21: error: ‘simde_bswap64’ was not declared in this scope
  206 |       m_held_bits = simde_bswap64( *reinterpret_cast<uint64_t*>( &m_fifo[m_fifo_idx] ) );
      |                     ^~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.cpp:47:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h: In member function ‘void vvdec::InputBitstream::load_next_bits(int)’:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h:206:21: error: ‘simde_bswap64’ was not declared in this scope
  206 |       m_held_bits = simde_bswap64( *reinterpret_cast<uint64_t*>( &m_fifo[m_fifo_idx] ) );
      |                     ^~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/Slice.h:52,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/ContextModelling.h:51,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/ContextModelling.cpp:47:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h: In member function ‘void vvdec::InputBitstream::load_next_bits(int)’:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h:206:21: error: ‘simde_bswap64’ was not declared in this scope
  206 |       m_held_bits = simde_bswap64( *reinterpret_cast<uint64_t*>( &m_fifo[m_fifo_idx] ) );
      |                     ^~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/Slice.h:52,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/CodingStructure.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/AdaptiveLoopFilter.cpp:49:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h: In member function ‘void vvdec::InputBitstream::load_next_bits(int)’:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h:206:21: error: ‘simde_bswap64’ was not declared in this scope
  206 |       m_held_bits = simde_bswap64( *reinterpret_cast<uint64_t*>( &m_fifo[m_fifo_idx] ) );
      |                     ^~~~~~~~~~~~~
In file included from /home/martineesmaa/vvdec/source/Lib/CommonLib/Slice.h:52,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/CodingStructure.h:54,
                 from /home/martineesmaa/vvdec/source/Lib/CommonLib/CodingStructure.cpp:47:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h: In member function ‘void vvdec::InputBitstream::load_next_bits(int)’:
/home/martineesmaa/vvdec/source/Lib/CommonLib/BitStream.h:206:21: error: ‘simde_bswap64’ was not declared in this scope
  206 |       m_held_bits = simde_bswap64( *reinterpret_cast<uint64_t*>( &m_fifo[m_fifo_idx] ) );
      |                     ^~~~~~~~~~~~~
gmake[2]: *** [source/Lib/vvdec/CMakeFiles/vvdec.dir/build.make:90: source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/BitStream.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [source/Lib/vvdec/CMakeFiles/vvdec.dir/build.make:174: source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/InterPrediction.cpp.o] Error 1
gmake[2]: *** [source/Lib/vvdec/CMakeFiles/vvdec.dir/build.make:146: source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/ContextModelling.cpp.o] Error 1
gmake[2]: *** [source/Lib/vvdec/CMakeFiles/vvdec.dir/build.make:104: source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/Buffer.cpp.o] Error 1
gmake[2]: *** [source/Lib/vvdec/CMakeFiles/vvdec.dir/build.make:76: source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/AdaptiveLoopFilter.cpp.o] Error 1
gmake[2]: *** [source/Lib/vvdec/CMakeFiles/vvdec.dir/build.make:132: source/Lib/vvdec/CMakeFiles/vvdec.dir/__/CommonLib/CodingStructure.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:170: source/Lib/vvdec/CMakeFiles/vvdec.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

So that's my two error logs, but here is a full log if you want it: fullerrorlogoflinuxarmv7vvdec.zip

Feel free to reply or ask question to me. Thank you! :)

Sincerely

adamjw24 commented 2 months ago

We'll have a look, thanks

K-os commented 2 months ago

Hi Martin,

Thanks for your report. Your toolchain file also needs to set the compiler flag -mfpu=neon-vfpv3, for example like this:

set( ARM_COMPILER_FLAGS "-mfpu=neon-vfpv3" )
set( CMAKE_C_FLAGS_INIT   "${ARM_COMPILER_FLAGS}" )
set( CMAKE_CXX_FLAGS_INIT "${ARM_COMPILER_FLAGS}" )

I'll add an armv7 toolchain file to code base, since we have some for aarch64 already.

But aside from getting the code to compile: If your CPU supports 64 bits, I recommend using that mode. I have seen significant performance differences (up to 50% if I remember correctly), when running the decoder either in ARMv7 mode or AARCH64 on the same CPU.

Best regards, Gabriel

MartinEesmaa commented 2 months ago

Hi Gabriel, thanks for additional command flags of CMake toolchain to me! :)

My CPU supports 64 bits, so yes I can use recommended mode if I cross compile or native. I can make pull request to add armv7 toolchain to vvdec if you like to.

Sincerely, Martin Eesmaa

K-os commented 2 months ago

I used the chance to clean up our provided toolchain files, so I'll create a PR for that myself. But thank you very much for the offer.

Can I close the issue?

MartinEesmaa commented 2 months ago

@K-os, yes you can close the issue. Thank you! :)

One thing, I tested it out and it worked with your additional flags, x86 SIMD and ARM SIMD on. When disabling x86 SIMD flag only to compile Linux armv7 binary, it will show results error like simde_bswap64, so we might to force enabling x86 SIMD or add some codes to patch the bug for compiling Linux armv7 if necessary.

K-os commented 2 months ago

Oh, good find! Something is not wrapped properly in #ifdef TARGET_SIMD_X86. I'll have a look and keep this issue open as a reminder.

MartinEesmaa commented 2 months ago

Okay @K-os, alright. Take your time :)

zhanghuicuc commented 1 month ago

got the same err with simde_bswap64 while disabling x86 SIMD flag. After copy the following code to Bitstream.h and wrap it with#ifndef TARGET_SIMD_X86, I'm able to compile correctly. But it might not be a nice solution.

uint64_t simde_bswap64(uint64_t v) { return ((v & (((uint64_t) 0xff) << 56)) >> 56) | ((v & (((uint64_t) 0xff) << 48)) >> 40) | ((v & (((uint64_t) 0xff) << 40)) >> 24) | ((v & (((uint64_t) 0xff) << 32)) >> 8) | ((v & (((uint64_t) 0xff) << 24)) << 8) | ((v & (((uint64_t) 0xff) << 16)) << 24) | ((v & (((uint64_t) 0xff) << 8)) << 40) | ((v & (((uint64_t) 0xff) )) << 56); }

adamjw24 commented 1 month ago

Just for my understanding. Why would you disable TARGET_SIMD_X86? The ARM implementation relies on that macro. Its confusing, I know, but thats the way it works.

zhanghuicuc commented 1 month ago

I'm building for wasm use case, and some browsers may not support wasm simd.

adamjw24 commented 1 month ago

Fixed/marked as non-operational in #177