[gmx-users] PGI link error: unknown switch --rpath & attempted static link of dynamic object fftw/lib/libfftw3.so

Mark Abraham Mark.Abraham at anu.edu.au
Fri Nov 12 18:02:58 CET 2010

On 13/11/2010 3:15 AM, Yudong Sun wrote:
> Hi,
> I have some troubles when compiling GROMACS 4.5.3 using PGI compiler 
> on the -rpath flag and also a static link to dynamic libfftw3.so.
> I use the pre-installed FFTW library on my Linux system. The 
> FFTW library is managed by the Modules package. The fftw module 
> automatically sets the environ variable as:
> FFTW_POST_LINK_OPTS = -L/opt/fftw/ 
> -Wl,-rpath=/opt/fftw/ -lfftw3 -lfftw3f

So how does configure use this information? (hint: providing the 
configure command line is essential for us to understand any context!)

> When compiling, an error occurs on the -rpath:
> pgcc -fast -o grompp grompp.o  ./.libs/libgmxpreprocess_mpi_d.a 
> /usr/local/packages/nag/GROMACS/gromacs-4.5.3/src/mdlib/.libs/libmd_mpi_d.a 
> ../mdlib/.libs/libmd_mpi_d.a /opt/fftw/ 
> /usr/local/packages/nag/GROMACS/gromacs-4.5.3/src/gmxlib/.libs/libgmx_mpi_d.a 
> ../gmxlib/.libs/libgmx_mpi_d.a -ldl -lnsl -lm   --rpath 
> /opt/fftw/ --rpath /opt/fftw/
> pgcc-Error-Unknown switch: --rpath
> pgcc-Error-Unknown switch: --rpath
> Pgcc doesn't recognize --rpath. The correct format is a single dash 
> only -rpath.

Sounds like configure isn't handling pgcc properly. However, GROMACS is 
using very vanilla autoconf stuff, so I'm strongly of the opinion that 
the problem isn't on the GROMACS side.

> If I manually remove the extra '-' (-rpath /opt/fftw/ and 
> rerun the command line, a link error appears:
> /usr/bin/ld: attempted static link of dynamic object 
> `/opt/fftw/'
> The command line links the dynamic fftw library. As the 'configure 
> --help' shows the default is a static build. Why doesn't the configure 
> pick the libfftw3.a but the libfftw3.so? The fftw library on my system 
> contains both static and dynamic libraries.

Don't know. Ask the autoconf list.

> I have also tried to make the old GROMACS 4.0.7 which has shown the 
> same problems as above.
> Any workarounds to the problems or what options should I pass to the 
> configure?

Don't bother with PGI compilers. GROMACS performance is 99% 
compiler-independent, thanks to hand-coded assembly for the inner loops. 
Use gcc.


More information about the gromacs.org_gmx-users mailing list