Unable to compile QMMM (MOPAC)
I'm not really sure if I am providing improper argument to cmake / make. I'm using the instructions for Gromacs 4.5 which are geared towards the configure tool rather than cmake. I'm roughly composing the arguments based on the prior instructions from 4.5 along with the advanced options for 5.0. Am I using the wrong documentation or is there something I'm missing? I'm
http://www.gromacs.org/Documentation/Installation_Instructions_4.5/compiling_QMMM - specifically I'm trying to use the instructions as follows roughly translating them to the -D[...]=... syntax of http://www.gromacs.org/Documentation/Installation_Instructions_5.0#cmake-advanced-options
If you are using Linux, simply download libmopac.a instead. Note, for SGI, download this gmxmop.f instead. I don't know why, but the way common blocks are handled seems a bit different on this architecture.
Then, configure GROMACS with:
LDFLAGS=-L(location of libmopac.a)
This proceeds through cmake without any issue but fails in make with the error that follows.
cmake .. -DCMAKE_LIBRARY_PATH=/home/tduser/apps/gromacs-5.0.5/lib -DGMX_QMMM_PROGRAM=MOPAC -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
This proceeds through cmake but says the argument LDFLAGS was disregarded.
cmake .. -DLDFLAGS=/home/tduser/apps/gromacs-5.0.5/lib -DGMX_QMMM_PROGRAM=MOPAC -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
cmake .. -DGMX_QMMM_PROGRAM=MOPAC -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=O
All attempts to run any variation of the three cmake commands noted above produce this error:
Linking CXX executable ../../bin/template ../../lib/libgromacs.so.0.0.0: undefined reference to `domop_' ../../lib/libgromacs.so.0.0.0: undefined reference to `domldt_' collect2: error: ld returned 1 exit status share/template/CMakeFiles/template.dir/build.make:88: recipe for target 'bin/template' failed make: *** [bin/template] Error 1 CMakeFiles/Makefile2:1343: recipe for target 'share/template/CMakeFiles/template.dir/all' failed make: *** [share/template/CMakeFiles/template.dir/all] Error 2 Makefile:146: recipe for target 'all' failed make: *** [all] Error 2
#1 Updated by Mark Abraham over 4 years ago
- Description updated (diff)
You can't use LDFLAGS with CMake - see http://stackoverflow.com/questions/6077414/cmake-how-to-set-the-ldflags-in-cmakelists-txt
I am unaware of any maintenance done on the QM/MM feature in GROMACS since 4.6 onward, so I expect the code as well as the build system is broken until someone proves otherwise. I would strongly advise using the GROMACS version that Gerrit Groenhof uses in his publications, and thus to build with configure. If you have issues, please ask on gmx-users, where he sometimes responds.