error with building gromacs-4.0.3

Hello,

I’ve got the following error when I was trying to compile the gromacs-4.0.3 package with pgcc:

File with unknown suffix passed to linker: .deps/
nb_kernel_x86_64_sse2.c:


My building process:

export CFLAGS=’-O3’
export CPPFLAGS=-I/usr/local/fftw3-3.1.2/include
export LDFLAGS=-L/usr/local/fftw3-3.1.2/lib
./configure --with-fft=fftw3 --enable-mpi --disable-float --prefix=/usr/local/src/md/gromacs-4.0.3/exe/

make


I’ve checked the directory, there is no such file nb_kernel_x86_64_sse2.Tpo Why the source code refers to such a file?

Thanks!
Yuan

Hi Yuan,

Try exporting “CC=pgcc” before configuring. I think what’s happening is the libtool is using gcc flags instead of pgcc.

Hope this helps,
Mat

Hi Mat,

Thanks for the suggestions. I tried exporting CC first, then configure and compile. The compiling goes further, but stops at:

File with unknown suffix passed to linker: /usr/local/fftw3-3.1.2/lib
File with unknown suffix passed to linker: /usr/local/fftw3-3.1.2/lib
/usr/local/fftw3-3.1.2/lib: file not recognized: Is a directory


What should I do to set up the environment variables and other flags?

Thanks!
Yuan

Hi Yuan,

What I did was follow your settings above and found that libtool thought I was using gcc so used the wrong flags (hence the unknown suffix error). I then started with a clean directory, set CC=pgcc, reconfigured, and then was able to successfully compile gromacs-4.0.3.

For this new error, please post the full compile line since this will help determine the issue. Though, my best guess is that your either missing the “-L” from your LDFLAGS or there’s a space between “-L” and “/usr/local/fftw3-3.1.2/lib”.

  • Mat

Hi Mat,

I download a fresh source package gromacs-4.0.5 and build as follows:

export CC=“pgcc”
export CFLAGS="-O3"
export CPPFLAGS="-I/usr/local/fftw3-3.1.2/include"
export LDFLAGS="-L/usr/local/fftw3-3.1.2/lib"

./configure --with-fft=fftw3 --enable-mpi --disable-float --prefix=/usr/local/src/md/gromacs-4.0.3/exe/

make


But still got the same error:

File with unknown suffix passed to linker: /usr/local/fftw3-3.1.2/lib
File with unknown suffix passed to linker: /usr/local/fftw3-3.1.2/lib
/usr/local/fftw3-3.1.2/lib: file not recognized: Is a directory


I am using pgi-7.0-4

Thanks for any suggestions!

Yuan

Hi Yuan,

Can you please post the full compile line that causes this error?

  • Mat

Is it the lines before the error occurs?

Here it is:

/bin/sh …/…/libtool --tag=CC --mode=link mpicc -O3 -L/usr/local/fftw3-3.1.2/lib -o grompp grompp.o libgmxpreprocess_mpi_d.la …/mdlib/libmd_mpi_d.la …/gmxlib/libgmx_mpi_d.la -lxml2 -lnsl -lfftw3 -lm -lSM -lICE -lX11
mpicc -O3 -o grompp grompp.o -L/usr/local/fftw3-3.1.2/lib ./.libs/libgmxpreprocess_mpi_d.a …/mdlib/.libs/libmd_mpi_d.a /usr/local/src/md/gromacs-4.0.3/src/gmxlib/.libs/libgmx_mpi_d.a …/gmxlib/.libs/libgmx_mpi_d.a -lxml2 -lnsl /usr/local/fftw3-3.1.2/lib/libfftw3.so -lm -lSM -lICE -lX11 --rpath /usr/local/fftw3-3.1.2/lib --rpath /usr/local/fftw3-3.1.2/lib
pgcc-Warning-Unknown switch: --rpath
pgcc-Warning-Unknown switch: --rpath
File with unknown suffix passed to linker: /usr/local/fftw3-3.1.2/lib
File with unknown suffix passed to linker: /usr/local/fftw3-3.1.2/lib
/usr/local/fftw3-3.1.2/lib: file not recognized: Is a directory

Hi Yuan,

You may need to move to a newer compiler version. libtool has trouble recognizing older versions of the PGI compilers hence is putting in gcc flags.

Though, you might be able to simply run the command yourself and remove the “–rpath” flag.

  • Mat

Hi Mark,

I switched to pgi-8.0-5, but I still got the same error:

mpicc -fast -pc 32 -o grompp grompp.o -L/usr/local/fftw3-3.1.2/lib ./.libs/libgmxpreprocess_mpi_d.a …/mdlib/.libs/libmd_mpi_d.a /usr/local/src/md/gromacs-4.0.3/src/gmxlib/.libs/libgmx_mpi_d.a …/gmxlib/.libs/libgmx_mpi_d.a -lxml2 -lnsl /usr/local/fftw3-3.1.2/lib/libfftw3.so -lm -lSM -lICE -lX11 --rpath /usr/local/fftw3-3.1.2/lib --rpath /usr/local/fftw3-3.1.2/lib
pgcc-Warning-Unknown switch: --rpath
pgcc-Warning-Unknown switch: --rpath
File with unknown suffix passed to linker: /usr/local/fftw3-3.1.2/lib
File with unknown suffix passed to linker: /usr/local/fftw3-3.1.2/lib


The steps I took to compile the program:

export CC=“pgcc”
export CPPFLAGS=-I/usr/local/fftw3-3.1.2/include
export LDFLAGS=-L/usr/local/fftw3-3.1.2/lib
./configure --with-fft=fftw3 --enable-mpi --disable-float --prefix=/usr/local/src/md/gromacs-4.0.3/exe/




I tried manually remove the -rpath flag, but there are too many. Is there a better way to remove it from configure file so that ./configure wouldn’t generate -rpath in the makefiles?

Thanks!
Yuan

Hi Yuan,

Unfortunately, I’m not too sure. Can you contact the maintainers of Gromacs? They’ll have better insights on Gromac’s build process.

  • Mat

When you compile Gromacs with --enable-mpi the configure script automatically changes the compiler “CC” to mpicc. At the same time as Mat suggested the configure script loses all knowledge of the underlying compiler and linker and believes that the mpicc linker accepts all GNU extensions.

One such extension is --rpath

The simplest way around this appears to be to edit the configure script, and replace all instances of --rpath with -R. After this edit, run configure as you did originally.

Note that if you are compiling Gromacs without the -enable-mpi flag, the configure file does not assume you have a linker that honors gnu extensions so you won’t see this issue pop up.