Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build fails with Clang on FreeBSD #85

Open
emaste opened this issue Mar 11, 2021 · 2 comments
Open

CMake build fails with Clang on FreeBSD #85

emaste opened this issue Mar 11, 2021 · 2 comments

Comments

@emaste
Copy link

emaste commented Mar 11, 2021

On FreeBSD 13 with Clang 11.0.1, cmake -GNinja -DENABLE_SHARED=on ..; ninja fails with:

FAILED: CMakeFiles/ffts_static.dir/src/ffts_real.c.o 
/usr/bin/cc -DFFTS_BUILD -DHAVE_ALIGNED_ALLOC -DHAVE_DECL_ALIGNED_ALLOC -DHAVE_DECL_MEMALIGN -DHAVE_DECL_POSIX_MEMALIGN -DHAVE_MALLOC_H -DHAVE_MEMALIGN -DHAVE_MM_MALLOC_H -DHAVE_PMMINTRIN_H -DHAVE_POSIX_MEMALIGN -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H -DHAVE_VALLOC -I../include -I../src -I. -O3 -DNDEBUG -MD -MT CMakeFiles/ffts_static.dir/src/ffts_real.c.o -MF CMakeFiles/ffts_static.dir/src/ffts_real.c.o.d -o CMakeFiles/ffts_static.dir/src/ffts_real.c.o -c ../src/ffts_real.c
../src/ffts_real.c:162:28: error: always_inline function '_mm_moveldup_ps' requires target feature 'sse3', but would be inlined into function 'ffts_execute_1d_real' that is compiled without support for 'sse3'
            _mm_mul_ps(t0, _mm_moveldup_ps(t2)),
                           ^

(identical errors elided)

Building with GCC10 (CC=gcc10 cmake -GNinja -DENABLE_SHARED=on ..) is successful.

@DanielO
Copy link

DanielO commented Jun 24, 2021

I built successfully on FreeBSD using clang with:
env CFLAGS=-march=native\ -fPIC cmake ..

@cyclaero
Copy link

In CMakeLists.txt the SSE feature sets are only enabled for the GNUCC. Before running cmake, do the following:
sed -e 's/CMAKE_COMPILER_IS_GNUCC/CMAKE_C_COMPILER_ID MATCHES "GNU|Clang"/g' -i ".orig" CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants