Allow use of external lmfit package
commit9748639d8402319c823bbf09945efae489b1f134
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 7 Jun 2016 17:07:56 +0000 (7 19:07 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 23 Jun 2016 19:22:12 +0000 (23 21:22 +0200)
tree6984677857549dcb853b6aabddf7e1597d6ac0ba
parent4c5c4b1897428224040051b841ac051624470e1c
Allow use of external lmfit package

For packaging GROMACS for software distributions, we need to permit
maintainers to use external system libraries, rather than the versions
we bundle for convenience for general GROMACS users.

This patch implements the CMake option GMX_EXTERNAL_LMFIT. It
implements FindLmfit.cmake, which relies heavily on pkg-config, which
is supported by lmfit and widely available in the intended use case
(ie distribution maintainers), but can be worked around if lmfit is
available and pkg-config is not and somehow an external lmfit is
needed.

lmfit management now needs to happen at a higher point in the GROMACS
build system, so I have refactored the source code files that use
lmfit functionality. The former gmx_lmcurve.cpp in src/external was in
fact GROMACS code that calls the lmmin routine from lmfit and declares
a suitable callback, so it should never have been in
src/external. Moved it (and its header) to
src/gromacs/correlationfunctions.

Reverted the introduction of gmx_ prefixes in an earlier commit - that
approach permits a third party to link to their own lmfit without
symbol clashes, but doesn't resolve the distribution problem. If both
clients of lmfit can use the same external version, then the problem
is solved, and if each need a different version then there are various
further options. Updated the README accordingly, and noted various
other differences from stock lmfit 6.1.

Added file-level Doxygen for some files. Added mention to install
guide.

The implementation is quiet upon repeat cmake runs, and makes only
advanced or internal cache variables.

Fixes #1957

Change-Id: Ib05eee796c6cf13ea90d456cb9b54b166bfda717
17 files changed:
CMakeLists.txt
cmake/FindLmfit.cmake [new file with mode: 0644]
cmake/gmxManageLmfit.cmake [copied from src/gromacs/correlationfunctions/CMakeLists.txt with 55% similarity]
docs/CMakeLists.txt
docs/conf-vars.py.cmakein
docs/install-guide/index.rst
src/external/lmfit/README
src/external/lmfit/gmx_lmcurve.cpp [deleted file]
src/external/lmfit/gmx_lmcurve.h [deleted file]
src/external/lmfit/lmmin.cpp [moved from src/external/lmfit/gmx_lmmin.cpp with 98% similarity]
src/external/lmfit/lmmin.h [moved from src/external/lmfit/gmx_lmmin.h with 83% similarity]
src/external/lmfit/lmstruct.h [moved from src/external/lmfit/gmx_lmstruct.h with 92% similarity]
src/gromacs/CMakeLists.txt
src/gromacs/correlationfunctions/CMakeLists.txt
src/gromacs/correlationfunctions/expfit.cpp
src/gromacs/correlationfunctions/gmx_lmcurve.cpp [new file with mode: 0644]
src/gromacs/correlationfunctions/gmx_lmcurve.h [new file with mode: 0644]