FFTW / fftw3

DO NOT CHECK OUT THESE FILES FROM GITHUB UNLESS YOU KNOW WHAT YOU ARE DOING. (See below.)
GNU General Public License v2.0
2.7k stars 660 forks source link

Using --enable-threads reverts the compiler to xlc_r on OpenPOWER #149

Open RemiLacroix-IDRIS opened 6 years ago

RemiLacroix-IDRIS commented 6 years ago

Hello,

I'm noticing something odd when trying to compile FFTW 3.3.8 on OpenPOWER using PGI 18.5.

If I use the --enable-threads option when calling the configure script, the PGI compiler seems to be replaced by XLC.

Here are the relevant environment variables that are set before calling the configure script:

CPP=/opt/pgi/linuxpower/18.5/bin/pgcc -E
F90=/opt/pgi/linuxpower/18.5/bin/pgf90
F77=/opt/pgi/linuxpower/18.5/bin/pgfortran
CXX=/opt/pgi/linuxpower/18.5/bin/pgc++
FC=/opt/pgi/linuxpower/18.5/bin/pgfortran
CC=/opt/pgi/linuxpower/18.5/bin/pgcc

Here is the configuration log for ./configure: config.log, note that FFTW_CC is defined as "/opt/pgi/linuxpower/18.5/bin/pgcc -Masmkeyword -O3".

Now check the configuration log for ./configure --enable-threads: config_threads.log, note that FFTW_CC is now defined as "xlc_r -O3" and that for some reasons the script is looking for xlc_r:

configure:21902: checking for xlc_r
configure:21918: found /usr/bin/xlc_r
configure:21929: result: xlc_r

Is this a bug in the configuration script?

stevengj commented 6 years ago

That's do to this rule: https://github.com/FFTW/fftw3/blob/d59abdaaeb31af8a7d7f2d2ffa92931efd344e6c/m4/acx_pthread.m4#L222-L227 … this may be obsolete, as at the time it was written we were testing on ancient AIX versions.

A workaround is to configure with PTHREAD_CC=$CC

RemiLacroix-IDRIS commented 6 years ago

A workaround is to configure with PTHREAD_CC=$CC

That did the trick, maybe this rule should be somewhat relaxed.