Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 676226 - sci-libs/fftw-3.3.6_p2 - configure:21412: clang -o conftest: /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64/libomp.so: undefined reference to `logb'
Summary: sci-libs/fftw-3.3.6_p2 - configure:21412: clang -o conftest: /usr/lib/gcc/x86...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-25 13:44 UTC by Patrik Osgnach
Modified: 2021-02-25 03:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,5.77 KB, text/plain)
2019-01-25 13:44 UTC, Patrik Osgnach
Details
config.log (config.log,146.65 KB, text/plain)
2019-01-25 13:46 UTC, Patrik Osgnach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrik Osgnach 2019-01-25 13:44:54 UTC
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}"
Comment 1 Patrik Osgnach 2019-01-25 13:46:01 UTC
Created attachment 562782 [details]
config.log
Comment 2 David Seifert gentoo-dev 2020-12-14 11:02:48 UTC
Is this still a problem?
Comment 3 Patrik Osgnach 2020-12-16 11:06:53 UTC
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
Comment 4 Sam James archtester gentoo-dev Security 2021-02-25 03:07:29 UTC
How about 3.3.9?