Feature #911

Updated by Mark Abraham about 5 years ago

On some systems like Cray statically linked binaries are either a must or highly recommended.

Below are the steps required to get static linking to work; the method is not foolproof, it can fail in some cases (e.g. if some external libraries get shared version detected). We should attempt to automate this as much as possible.

* set the target properties LINK_SEARCH_START_STATIC and LINK_SEARCH_END_STATIC, e.g:
set_target_properties(mdrun PROPERTIES LINK_SEARCH_START_STATIC ON)
set_target_properties(mdrun PROPERTIES LINK_SEARCH_END_STATIC ON)@

* configure with -static and disable CMake RPATH:
cmake /path/to/gromacs/source -DCMAKE_PREFIX_PATH=/path/to/fftw -DGMX_PREFER_STATIC_LIBS=ON -DCMAKE_C_FLAGS="-static" -CMAKE_C_FLAGS="-static" -DCMAKE_CXX_FLAGS="-static" -DCMAKE_SKIP_RPATH=YES@