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

Yudong Sun yudong at nag.co.uk
Fri Nov 12 17:15:54 CET 2010


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

When compiling, an error occurs on the -rpath:

pgcc -fast -o grompp grompp.o  ./.libs/libgmxpreprocess_mpi_d.a 
../mdlib/.libs/libmd_mpi_d.a /opt/fftw/ 
../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 

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 

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.

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 



The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 

More information about the gromacs.org_gmx-users mailing list