compile fftw3.0.1 with pgi7.0.4

Hi mkcolg,

  1. When I compiled fftw3.0.1 with pgi7.0.4, I used this configure:

./configure CC=“pgcc” CFLAGS="-O3 -fastsse -Mvect=sse -tp k8-64" F77=“pgf77” FFLAG="-O3 -m64",

but I found this warning: “configure: WARNING: *** Couldn’t figure out how to link C and Fortran; switching to --disable-fortran”. Therefore, any suggestions?

  1. The compiled fftw library will be used by a code writen in F90. I wonder if I should compile fftw with F77=“pgf90”?

  2. In order to improve the performace, can you tell me if the CFLAG and FFLAG is sufficient (the processor in my cluster is opteron x86_64)?

Thanks in advance,
Yi-An

Hi Yi-An,

  1. When I compiled fftw3.0.1 with pgi7.0.4, I used this configure:

./configure CC=“pgcc” CFLAGS="-O3 -fastsse -Mvect=sse -tp k8-64" F77=“pgf77” FFLAG="-O3 -m64",

Replace the GNU “-m64” flag with the PGI equivlent “-tp k8-64”.

  1. The compiled fftw library will be used by a code writen in F90. I wonder if I should compile fftw with F77=“pgf90”?

You could. However unless the code is actually written in F90, it is prefered to use a F77 compiler. This will make your library more portable and compatable with other compilers.

  1. In order to improve the performace, can you tell me if the CFLAG and FFLAG is sufficient (the processor in my cluster is opteron x86_64)?

FFTW is a highly optimized library, so adding additional compiler optimization may only give you marginal gains. Personally, I would favor precision at the cost of some performance and use “-fastsse -Kieee -tp k8-64”. However, it’s up to you if “-Kieee” is needed in your situation.

  • Mat

Thanks, mkcolg

  1. The code I am compiling using PGI is VASP, and it can be accelerated by the fftw code. The VASP code is indeed writen by F90, but I am not sure if “-Kieee” is needed.

  2. Now, I have tried configure:
    ./configure CC=“pgcc” CFLAGS=" -fast -tp k8-64" F77=“pgf90” FFLAG="-fast -tp k8-64"

However, the error also occurs:
checking for Fortran 77 libraries… -lm’ -L/home/vasp/opt/pgi7/linux86-64/7.0-4/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6 -lm -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc -lrt -lpthread
checking for dummy main to link with Fortran 77 libraries… unknown
configure: WARNING: *** Couldn’t figure out how to link C and Fortran; switching to --disable-fortran.

Thank you.

Yi-An

Hi Yi-An,

Even if your end application (VASP) is F90, it’s prefered that FFTW be compiled with pgf77. This will make your library more portable. F90 code can use F77 libraries.

I just tried your configure line using FFTW 3.1.2 and it worked fine. Try looking through the resulting config.log to determine what the actual error is. Hopefully then we can determine a solution.

  • Mat

Hi Mat,

I have also tried fftw3.1.2, and it works fine using my configure.

In my config.log file, I only find the errors: “PGC/x86-64 Linux 7.0-4: compilation completed with severe errors” and “PGC-S-0035-Syntax error: Recovery attempted by replacing identifier me by ‘;’ (conftest.c: 2)”. Can I send my config.log file to you?

Thank you very much for your kind attention.

Yi-An [/quote]

Hi Yi-An,

I was able to find a copy of FFTW 3.0.1 and reporduce the error. It looks like the configure file is failing to parse pgf77 verbose output correctly. As a work-around, comment out line 14873 from configure.

Change:

if test $ac_cv_lib_m_sin = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBM 1
_ACEOF

 LIBS="-lm $LIBS"

fi

to

if test $ac_cv_lib_m_sin = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBM 1
_ACEOF

#  LIBS="-lm $LIBS"

fi
  • Mat

Hi Mat,

Thank you! It works.

Yi-An