openAVproductions / openAV-ArtyFX

A repository for the ArtyFX plugin bundle
GNU General Public License v2.0
80 stars 19 forks source link

Please fix build system to allow building without SSE instructions #47

Open xctan opened 2 years ago

xctan commented 2 years ago

I'm trying to build this package from source code for Arch Linux RISC-V port. But I encountered errors like unrecognized command-line option '-msse'. This problem isn't disappeared when I changed BUILD_SSE from ON to OFF. After searching the commit that introduced BUILD_SSE, I found that the commit https://github.com/openAVproductions/openAV-ArtyFX/commit/3410625878f2098ac3aabd52355d8c412c4e4560 didn't completely resolve the problem. Even when -DBUILD_SSE=OFF is presented to cmake, it seems like src/avtk/CMakeLists.txt still inserts -msse -msse2 -mfpmath=sse into CMAKE_CXX_FLAGS.

Please provide additional checks for other architectures in src/avtk/CMakeLists.txt to fix this issue. https://github.com/openAVproductions/openAV-ArtyFX/blob/9b147f25c5b0e45e52c10d9b148ff04e7cc24951/src/avtk/CMakeLists.txt#L57-L63

harryhaaren commented 2 years ago

Hi,

Thanks for reporting. I don't have a RISC-V board/port to test on unfortunately, so its a little awkward to know what flags should be passed to the RISC-V compiler for SIMD support.

If you have the time would you propose the C_FLAGS to use, or even better, file a PR which makes the code changes required?

Regards, -Harry

xctan commented 2 years ago

Standard Extension for Packed-SIMD Instructions is still open as for now. So, I think -DBUILD_SSE=OFF should be able to turn off all SIMD flags as we don't have available SIMD instructions currently for rv64gc arch.

harryhaaren commented 2 years ago

Hi, as a new architecture, I would encourage the use of Meson build system instead of CMake. I'm actively moving all OpenAV projects to Meson for a while now - CMake is awkward and Meson is better in many ways.

Aside from that, current master branch seems to work as you describe, but use BUILD_SSE=0 not OFF. The below commands do not show -msse compiler-flags here.

mkdir build
cd build
cmake .. -DBUILD_SSE=0
make VERBOSE=1