[gmx-users] Static build

Mark Abraham Mark.Abraham at anu.edu.au
Sun Sep 27 04:39:50 CEST 2009


Jack Shultz wrote:
> Hello,
> 
> I am trying to build statically with the small source changes I made yesterday.
> 
> I'm building on 32 bit linux with single precision. I have libSM
> 
> [root at vps gromacs-4.0.5]# ls /usr/lib/libSM*
> /usr/lib/libSM.so  /usr/lib/libSM.so.6  /usr/lib/libSM.so.6.0.0
> 
> I get this error message
> 
> cc -O3 -fomit-frame-pointer -finline-functions -Wall -Wno-unused
> -funroll-all-loops -std=gnu99 -static -o grompp grompp.o  -L/usr/lib
> ./.libs/libgmxpreprocess.a ../mdlib/.libs/libmd.a
> /root/gromacs-4.0.5/src/gmxlib/.libs/libgmx.a ../gmxlib/.libs/libgmx.a
> -lnsl -lfftw3f -lm -lSM -lICE -lX11
> /usr/bin/ld: cannot find -lSM
> collect2: ld returned 1 exit status
> make[3]: *** [grompp] Error 1
> make[3]: Leaving directory `/root/gromacs-4.0.5/src/kernel'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/root/gromacs-4.0.5/src'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/root/gromacs-4.0.5/src'
> make: *** [all-recursive] Error 1
> 
> I used this flag
> ./configure CPPFLAGS="-L/usr/lib" --enable-all-static

You have libSM, but you have only the libraries suitable for dynamic 
linking. You need /usr/lib/libSM.a on your library search path for 
static linking. It's slightly superior to use ./configure 
LIBS="-L/xxx/yyy", but usually equivalent in practice.

Mark



More information about the gromacs.org_gmx-users mailing list