tng include/library/linking problems
There are some messy issues with the way we build and then manage the TNG libraries.
For example, the mdrun-only build currently installs some TNG libraries, which it should not. In principle, the normal build should not install these shared libraries if there is an existing TNG installation, but we can defer solving that part until after 5.0.
Using GMX_INSTALL_PREFIX with a normal build is also broken with TNG, because TNG doesn't get told about the new installation location for its header file.
Some of these issues are related to the way GROMACS re-manages (over-manages?) things like CMAKE_INSTALL_LIBDIR via GMX_LIB_INSTALL_DIR to LIB_INSTALL_DIR. For a component like TNG, which is intended also to build alone, to survive this treatment, it needs to get told where it will install in CMAKE_INSTALL_LIBDIR. I think that means the TNG build should be done external project, which I will try shortly.
Update TNG build system
GROMACS can now find and use a copy of TNG installed on the system.
The default is still to compile the version shipped with GROMACS.
That compilation is now handled using the BuildTNG.cmake script, so
there is no duplication between the GROMACS and TNG CMake code that
builds TNG, and the result is fully portable with all supported
environments and CMake versions.
Moved TNG handling into src/gromacs/CMakeLists.txt where it is
Bumped the version of the TNG library to 1.6. Corresponds to commit
ba9aea42b01 in the TNG repository.
Renamed md5 things with GROMACS prefixes, so that there is no internal
name clash with the md5 things in TNG, and no client of libgromacs can
get unexpected behaviour.
Updated GMX_USE_TNG=off to work, and silenced unused-parameter
warnings associated with that setting.
#2 Updated by Mark Abraham over 6 years ago
Rossen Apostolov wrote:
Yes, TNG should be treated as external project. Could we always compile GROMACS statically against the shipped TNG and thus there won't be any need to install the libraries?
It turns out that there's no good, platform-portable, CMake-version-portable way to do anything like this, and definitely none that can use the TNG repo as it is right now. Fix uploaded.