[gmx-developers] Re: help needed: static builds with cmake

Szilárd Páll szilard.pall at cbr.su.se
Fri Oct 29 00:42:50 CEST 2010


Hi,

>  Too me this looks like a bug in cmake. It has
> (in Modules/Platform/Linux.cmake) LINK_STATIC_C_FLAGS "-Wl,-Bstatic". But I
> think it should include the -static for gcc. It might have been sufficient
> to have the Wl,-Bstatic but at least now gcc requires also the static
> option. If you agree we should file a cmake bug report.

I'm not sure it's a bug. The man page of ld clearly states that
-Bstatic, -static, -dn, and -non_shared are equivalent. It's just that
while gcc -Bstatic gets simply passed down to the linker, -static
actually does something and this something makes things work -- I
guess. Also, asking on the CMake mailing list first might might be a
good idea.

> Does step 1 apply to the gromacs internal libraries (libmd, libgmx, ..)? If
> so, I think step 1 by itself is good enough.

No, for the gramcs internal libs there is the BUILD_SHARED_LIBS
option. This is for the external libraries (fftw3, libxml2, etc).

--
Szilárd



More information about the gromacs.org_gmx-developers mailing list