PaddlePaddle / FlyCV

FlyCV is a high-performance library for processing computer visual tasks.
Apache License 2.0
580 stars 59 forks source link

X86平台下编译报错 #199

Open JPChen2000 opened 1 year ago

JPChen2000 commented 1 year ago

编译分支: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 commented 1 year ago

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