Compiling QMMM

    Table of contents
    1. 1. Mopac 7
    2. 2. GAMESS-UK
    3. 3. Gaussian03

    Version as of 15:54, 30 Nov 2021

    to this version.

    Return to Version archive.

    View current version

    From version 3.3 onwards, Gromacs supports QM/MM.

    To activate the QM/MM interfaces to a quantum chemistry program, configure gromacs with the

    --with-qmmm-<QM PROGRAM NAME>

    To compile gromacs you will need also the source codes of mopac7, gaussian0x and/or GAMESS-UK. As these codes are owned by their respective copyright holders, I cannot distribute them myself. You have to obtain them yourself therefore. Here is where you can find them:




    In addition, you need the following bits of code to link mdrun to these QM packages (from

    Mopac 7

    Compile all mopac files (f77 -O2 -c *.f), except mopac.f, moldat.f and deriv.f (thes ones are to be replaced by gmxmop.f), and collect the objects (*.o) into a library (ar rcv libmopac.a *.o;ranlib libmopac.a). Or 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

    • LIBS=-lmopac
    • LDFLAGS=-L(location of libmopac.a)
    • ./configure --with-qmmm-mopac


    Add the files to the GAMESS-UK/m4 subdir, update the Makefile to match the configuration on your computer system and compile the code.

    Then, configure gromacs with

    • LDFLAGS=-L(location of libgamess.a)
    • LIBS='-lgamess -lg2c -lm'
    • ./configure --with-qmmm-gamess


    To run gromacs with gaussian a few modifications are required in links 301, 510, 701 and 9999. Because we cannot distribute source code which is part of gaussian, we have made available a set of instructions to build these yourself, which is allowed as long as you have a legal version of the gaussian source code. Binary distributions won't work until gaussian has included the required modifications.

    Gaussian provides a convenient way of building and using modified links. You should make a new subdirectory, say modlinks, in which you make directories for each of the links you want to modify. Then extract from the gaussian source tree, those functions that need modification into these directories and build an alternative executable by linking you objects with the original gaussian objects. With the

    %subst lxxx /home/user/modlinks/lxxx

    in the input file, gaussian will use your modified lxxx.exe instead of the original.

    Gromacs requires gradients on the point charges, and thus modifications are required to l701.exe. Also to make these gradients available for gromacs, l9999, which controls the output of gaussian are essential. In addition a small modification should be made to l301, to exclude point charge - point charge interactions. Finally, link 510 that performs the MCSCF has to be altered if you are interested in excited state dynamics.

    After creating a subdirectory for these links in the modlinks directory, i.e.

    the modified executables have to be built. Therefore, a makefile is required in each lxxx subdirectory. See for example the l301.make" make file.
    With the gaussian utility gau-fsplit, you can extract the subroutines that have to be changed, e.g.
    gau-fsplit -e d1e $GAUSS_DIR/l701.F
    To find the fortran source file that contains the function you need, you can use the grep command:
    grep -i d1e $GAUSS_DIR/*.F
    An overview of which functions have to be modified and how can be be found here: roadmap.pdf. After the modified links have been created, and gromacs has been configured with --with-qmmm-gaussian, the $DEVEL_DIR environment has to be set to the path of the modlinks subdir. Gromacs is now ready for doing QM/MM with gaussian.

    Page last modified 20:14, 11 Aug 2010 by rossen