Created attachment 562780 [details] emerge --info Hello people, I just tried to build sci-libs/fftw-3.3.6_p2 with clang, but I get this error message: checking for OpenMP flag of C compiler... unknown configure: error: don't know how to enable OpenMP !!! Please attach the following file when seeking support: !!! /var/tmp/portage/sci-libs/fftw-3.3.6_p2/work/fftw-3.3.6-pl2-single-abi_x86_64.amd64/config.log * ERROR: sci-libs/fftw-3.3.6_p2::gentoo failed (configure phase): * econf failed * * Call stack: * ebuild.sh, line 124: Called src_configure * environment, line 3053: Called multibuild_foreach_variant 'multilib-minimal_src_configure' * environment, line 2131: Called _multibuild_run 'multilib-minimal_src_configure' * environment, line 2129: Called multilib-minimal_src_configure * environment, line 2201: Called multilib_foreach_abi 'multilib-minimal_abi_src_configure' * environment, line 2416: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure' * environment, line 2131: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure' * environment, line 2129: Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_configure' * environment, line 541: Called multilib-minimal_abi_src_configure * environment, line 2195: Called multilib_src_configure * environment, line 2653: Called econf '--enable-shared' '--disable-static' '--disable-fma' '--enable-fortran' '--disable-mips-zbus-timer' '--disable-threads' '--enable-openmp' '--enable-single' '--disable-altivec' '--disable-avx' '--disable-avx2' '--enable-sse' '--enable-sse2' '--disable-neon' '--disable-mpi' 'MPICC=clang' * phase-helpers.sh, line 718: Called __helpers_die 'econf failed' * isolated-functions.sh, line 121: Called die * The specific snippet of code: * die "$@" * * If you need support, post the output of `emerge --info '=sci-libs/fftw-3.3.6_p2::gentoo'`, * the complete build log and the output of `emerge -pqv '=sci-libs/fftw-3.3.6_p2::gentoo'`. * The complete build log is located at '/var/tmp/portage/sci-libs/fftw-3.3.6_p2/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sci-libs/fftw-3.3.6_p2/temp/environment'. * Working directory: '/var/tmp/portage/sci-libs/fftw-3.3.6_p2/work/fftw-3.3.6-pl2-single-abi_x86_64.amd64' * S: '/var/tmp/portage/sci-libs/fftw-3.3.6_p2/work/fftw-3.3.6-pl2' In the config.log (attached) I read: configure:21412: clang -o conftest -O2 -pipe -march=native -Wno-unused-command-line-argument -fopenmp -Wl,-O1 -Wl,--as-needed -Wl,-O2 -Wl,--sort-common -Wl,-S conftest.c -lm >&5 /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64/libomp.so: undefined reference to `logb' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64/libomp.so: undefined reference to `logbl' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64/libomp.so: undefined reference to `logbf' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64/libomp.so: undefined reference to `fmaxl' The problem seems to be cause by the order in with --as-needed and -lm appear. As a workaround, I can build fftw with clang if I set this: LDFLAGS="-lm ${LDFLAGS}"
Created attachment 562782 [details] config.log
Is this still a problem?
It is, but in a different form with the latest stable version: >>> Verifying ebuild manifests >>> Running pre-merge checks for sci-libs/fftw-3.3.8-r1 * Your current compiler does not support OpenMP! * OpenMP support in sys-devel/clang is provided by sys-libs/libomp. * ERROR: sci-libs/fftw-3.3.8-r1::gentoo failed (pretend phase): * Active compiler does not have required support for OpenMP * * Call stack: * ebuild.sh, line 125: Called pkg_pretend * fftw-3.3.8-r1.ebuild, line 38: Called tc-check-openmp * toolchain-funcs.eclass, line 597: Called die * The specific snippet of code: * die "Active compiler does not have required support for OpenMP" * * If you need support, post the output of `emerge --info '=sci-libs/fftw-3.3.8-r1::gentoo'`, * the complete build log and the output of `emerge -pqv '=sci-libs/fftw-3.3.8-r1::gentoo'`. * The complete build log is located at '/var/tmp/portage/sci-libs/fftw-3.3.8-r1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sci-libs/fftw-3.3.8-r1/temp/die.env'. * Working directory: '/var/tmp/portage/sci-libs/fftw-3.3.8-r1/homedir' * S: '/var/tmp/portage/sci-libs/fftw-3.3.8-r1/work/fftw-3.3.8' tc-has-openmp() function in /usr/portage/eclass/toolchain-funcs.eclass should pass -lm option to the compiler, but also during the compile phase
How about 3.3.9?
I can confirm that the statement made in comment 3 is still generally true when attempting to use clang with openmp. Additionally, I can confirm that making the change proposed in that comment works around the issue. Output from attempting to compile 3.3.10: * Messages for package sci-libs/fftw-3.3.10: * Your current compiler does not support OpenMP! * OpenMP support in sys-devel/clang is provided by sys-libs/libomp. * ERROR: sci-libs/fftw-3.3.10::gentoo failed (pretend phase): * Active compiler does not have required support for OpenMP * * Call stack: * ebuild.sh, line 127: Called pkg_pretend * fftw-3.3.10.ebuild, line 37: Called tc-check-openmp * toolchain-funcs.eclass, line 613: Called die * The specific snippet of code: * die "Active compiler does not have required support for OpenMP" * * If you need support, post the output of `emerge --info '=sci-libs/fftw-3.3.10::gentoo'`, * the complete build log and the output of `emerge -pqv '=sci-libs/fftw-3.3.10::gentoo'`. * The complete build log is located at '/var/tmp/portage/sci-libs/fftw-3.3.10/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sci-libs/fftw-3.3.10/temp/die.env'. * Working directory: '/var/tmp/portage/sci-libs/fftw-3.3.10/empty' * S: '/var/tmp/portage/sci-libs/fftw-3.3.10/work/fftw-3.3.10' Adding -lm to tc-has-openmp fixes the issue.