FlyCV icon indicating copy to clipboard operation
FlyCV copied to clipboard

X86平台下编译报错

Open JPChen2000 opened this issue 2 years ago • 1 comments

编译分支:v1.2.0 编译环境: X86 Linux 编译器:gcc (GCC) 7.4.0

使用指令: cmake
-DBUILD_TEST=OFF
-DBUILD_BENCHMARK=OFF
-DCMAKE_INSTALL_PREFIX=${build_dir}/install
-DWITH_LIB_PNG=ON
-DWITH_LIB_JPEG_TURBO=ON
-DCMAKE_BUILD_TYPE=Release
-DENABLE_AVX=ON
.. make -j32 编译报错: /world/FlyCV/modules/core/base/include/common_avx.h: In member function ‘void fcv::Vld3_F32x8_Avx::load(const float*, __m256i*, __m256i*, __m256i*)’: /home/chenjunpin/world/FlyCV/modules/core/base/include/common_avx.h:366:25: error: ‘_mm256_loadu2_m128i’ was not declared in this scope __m256i bgr_0 = _mm256_loadu2_m128i((__m128i const*)(src_f32 + 12), (__m128i const*)(src_f32 + 0)); ^~~~~~~~~~~~~~~~~~~ /world/FlyCV/modules/core/base/include/common_avx.h:366:25: note: suggested alternative: ‘_mm256_loadu_si256’ __m256i bgr_0 = _mm256_loadu2_m128i((__m128i const*)(src_f32 + 12), (__m128i const*)(src_f32 + 0));

1、使用 gcc -march=native -E -v - </dev/null 2>&1 | grep avx 查看GCC支持,确认编译器支持-mavx -mavx2 2、请问是否是因为GCC版本不一致的原因导致报错?

JPChen2000 avatar May 09 '23 07:05 JPChen2000

cmake/linux/linux.cmake:line 18 取消注释add_definitions((-DELDER_COMPILER)) 解决

JPChen2000 avatar May 09 '23 11:05 JPChen2000