[gmx-users] MPI compilation without shared FFTW libraries

David van der Spoel spoel at xray.bmc.uu.se
Wed Feb 27 22:18:47 CET 2008


Hans Martin Senn wrote:
> Dear all
> 
> I am trying to compile a parallel executable of GROMACS using gcc and 
> the SCore MPI implementation on a Linux/Opteron cluster. (Essentially, 
> SCore is a highly efficient MPICH incarnation that circumvents the 
> TCP/IP stack; see: http://www.pccluster.org/.)
> 
> SCore MPI requires linking to some extra libraries that exist only as 
> static libraries. Hence, compiling GROMACS with --enable-shared fails 
> with the expected complaints along the lines of "relocation R_X86_64_32 
> against `a local symbol' can not be used when making a shared object; 
> recompile with -fPIC".
> 
> So I switched to --disable-shared to make a static executable. However, 
> this fails as well because the GROMACS build procedure still tries to 
> link explicitly to the shared version of the FFTW libraries (libfftw3.so):
> 
> mpicc -O3 -fomit-frame-pointer -finline-functions -Wall -Wno-unused 
> -funroll-all-loops -o mdrun glaasje.o gctio.o init_sh.o ionize.o 
> do_gct.o relax_sh.o repl_ex.o xutils.o compute_io.o md.o mdrun.o 
> genalg.o  -L/usr/local/lib ../mdlib/.libs/libmd_d.a -L/usr/X11R6/lib64 
> ../gmxlib/.libs/libgmx_d.a -lnsl /usr/local/lib/libfftw3.so -lm 
> /usr/X11R6/lib64/libXm.so -lXmu -lXext -lXp -lXt -lSM -lICE -lX11
> 
> Of course, the linker falls over, complaining that:
> ld: attempted static link of dynamic object `/usr/local/lib/libfftw3.so'
> 
> So my question is if and how I can convince the make procedure to use 
> the static version of the FFTW library, which is available on the system.
> Maybe somebody could also comment on why the FFTW lib needs to be linked 
> against explicitly at all, rather than using -lfftw3 and letting the 
> linker figure out whether to use the static or the shared version.
> 
> Any hints would be greatly appreciated!
> 
Just add the static library on the link command line explicitly:
mpicc -O3 -fomit-frame-pointer -finline-functions -Wall -Wno-unused
  -funroll-all-loops -o mdrun glaasje.o gctio.o init_sh.o ionize.o
  do_gct.o relax_sh.o repl_ex.o xutils.o compute_io.o md.o mdrun.o
  genalg.o  -L/usr/local/lib ../mdlib/.libs/libmd_d.a -L/usr/X11R6/lib64
  ../gmxlib/.libs/libgmx_d.a -lnsl /usr/local/lib/libfftw3.a -lm
  /usr/X11R6/lib64/libXm.so -lXmu -lXext -lXp -lXt -lSM -lICE -lX11


You also want to configure --without-motif-includes

-- 
David van der Spoel, Ph.D.
Molec. Biophys. group, Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205. Fax: +4618511755.
spoel at xray.bmc.uu.se	spoel at gromacs.org   http://folding.bmc.uu.se



More information about the gromacs.org_gmx-users mailing list