RashmiKumari / g_mmpbsa

MM-PBSA method for GROMACS. For full description, please visit homepage:
http://rashmikumari.github.io/g_mmpbsa/
GNU General Public License v3.0
64 stars 59 forks source link

Add support for GROMACS 2016+ #21

Open tildeslu opened 4 years ago

tildeslu commented 4 years ago

Had to migrate code to C++ and port some internal functions of GROMACS which are no longer public since version 2016.

rjdkmr commented 4 years ago

Thank you very much for the contribution. Does it compile with gromacs-2019 and gromacs-2020? I found that there is some changes from gromacs-2016 and gromacs-2019.

I will test it and merge as soon as possible.

tildeslu commented 4 years ago

I personally tested it on 2019.1 and 2019.5 with external APBS 1.5. Will try to test on older releases because I have them installed on HPC cluster.

tildeslu commented 4 years ago

I've compile-tested with 2016.6, 2018.1 and 2018.8 and made a few fixes based on GROMACS commit history.

maalbadri commented 4 years ago

Could you give some brief instructions for installation with GMX 2019/2020 please? Many thanks!

tildeslu commented 4 years ago

Just apply this patch and follow the original instructions. It should work seamlessly :)

maalbadri commented 4 years ago

Am I right in thinking that this installation doesn't support gmx mpi? If this is the case, please make this clear in the documentation (sorry if I missed this!).

tildeslu commented 4 years ago

It indeed supports MPI, but I don't get what you mean by gmx mpi. It does not call mdrun nor mdrun_mpi from gromacs. It instead calls APBS external binary which also can be built with MPI support. Just set APBS environment variable as stated in the documentation to "mpirun /path/to/apbs/binary" like this: export APBS="mpirun /opt/apbs/bin/apbs"

Debamitraiit commented 4 years ago

It is not working for GROMACS 2020. There are many errors while compiling with gromacs 2020. The include directory has changed. I do not know coding that well. May you please help me with the 2020.2 version. I have already ran long simulation.

tildeslu commented 4 years ago

GROMACS developers just deprecated the legacy API and did not transfer all the functionality to the new API. So in order to use g_mmpbsa you should build GROMACS 2020+ with -DGMX_INSTALL_LEGACY_API=ON CMake option. I've also added fixup replacements for private headers which is very fragile approach but allows building with GROMACS 2020

Debamitraiit commented 4 years ago

Thank you. I will try this and let you know.

On Sun, Jun 14, 2020, 12:57 PM Ievgen Sliusar notifications@github.com wrote:

GROMACS developers just deprecated the legacy API and did not transfer all the functionality to the new API. So in order to use g_mmpbsa you should build GROMACS 2020+ with -DGMX_INSTALL_LEGACY_API=ON CMake option. I've also added fixup replacements for private headers which is very fragile approach but allows building with GROMACS 2020

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/RashmiKumari/g_mmpbsa/pull/21#issuecomment-643730101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIS43INLZA2SI6SV3LAOIDDRWR3VNANCNFSM4K2MLFQQ .

maalbadri commented 3 years ago

We're having some issues compiling this PR. A fragment of the cmake configuration log shows:

-- Looking for C++ include gromacs/commandline/cmdlineinit.h
-- Looking for C++ include gromacs/commandline/cmdlineinit.h - not found
-- Installing fixup header: gromacs/commandline/cmdlineinit.h

It indicates that the header file "gromacs/commandline/cmdlineinit.h" is missing and cmake retrieves the missing header file from another source. This is a feature added to this PR. The issue is that the missing file is not included when a test code is compiled by cmake. The error log indicates:

/opt/cray/craype/2.5.10/bin/CC    -I/work/y07/y07/cse/gmx/2020.3/include    -o CMakeFiles/cmTryCompileExec1271502654.dir/CheckIncludeFile.cxx.o -c /work/z01/shared/q1421267/g_mmpbsa/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx
/work/z01/shared/q1421267/g_mmpbsa/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx:1:45: fatal error: gromacs/commandline/cmdlineinit.h: No such file or directory
#include <gromacs/commandline/cmdlineinit.h>

One can see that directory "/work/y07/y07/cse/gmx/2020.3/include" is specified but not directory "/work/z01/shared/q1421267/g_mmpbsa/build/include/".

Most of the GROMACS header files are missing. Do you have the updated configuration files related to cmake?

tildeslu commented 3 years ago

We're having some issues compiling this PR. A fragment of the cmake configuration log shows:

-- Looking for C++ include gromacs/commandline/cmdlineinit.h
-- Looking for C++ include gromacs/commandline/cmdlineinit.h - not found
-- Installing fixup header: gromacs/commandline/cmdlineinit.h

It indicates that the header file "gromacs/commandline/cmdlineinit.h" is missing and cmake retrieves the missing header file from another source. This is a feature added to this PR. The issue is that the missing file is not included when a test code is compiled by cmake. The error log indicates:

/opt/cray/craype/2.5.10/bin/CC    -I/work/y07/y07/cse/gmx/2020.3/include    -o CMakeFiles/cmTryCompileExec1271502654.dir/CheckIncludeFile.cxx.o -c /work/z01/shared/q1421267/g_mmpbsa/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx
/work/z01/shared/q1421267/g_mmpbsa/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx:1:45: fatal error: gromacs/commandline/cmdlineinit.h: No such file or directory
#include <gromacs/commandline/cmdlineinit.h>

One can see that directory "/work/y07/y07/cse/gmx/2020.3/include" is specified but not directory "/work/z01/shared/q1421267/g_mmpbsa/build/include/".

Most of the GROMACS header files are missing. Do you have the updated configuration files related to cmake?

Which version of CMake are you using? Because BUILD_INCLUDE is added to include_directories early in the root CMakeLists.txt and I've tested it in different environments. Is file gromacs/commandline/cmdlineinit.h actually available in the build include dir?

Adarsh931 commented 3 years ago

@tildeslu Thank you for providing the version which works with GROMACS 2019.3 Unfortunately I am not able to install g_mmpbsa with gromacs 2019.3 and APBS 1.3 (or 1.5). I am getting this error after running the following options with cmake (I am using the g_mmpbsa which you provided here- https://github.com/tildeslu/g_mmpbsa

command: cmake -DGMX_PATH=/opt/gromacs_2019 -DAPBS_INSTALL=/mnt/bf3327e2-4ccc-460d-a74f-db54b0c69a92/APBS-1.5-linux64 -DCMAKE_INSTALL_PREFIX=/opt/g_mmpbsa_2019 .. Error: CMake Deprecation Warning at CMakeLists.txt:39 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'libgromacs' -- Found libgromacs, version 2019.3 -- Found GROMACS: /opt/gromacs_2019/lib/libgromacs.so
-- Found Gromacs include directory: /opt/gromacs_2019/include CMake Error at src/CMakeLists.txt:108 (message):

Only external APBS invocation is supported for Gromacs-2019.3

-- Configuring incomplete, errors occurred! See also "/mnt/bf3327e2-4ccc-460d-a74f-db54b0c69a92/g_mmpbsa-edited_master/g_mmpbsa-master/build/CMakeFiles/CMakeOutput.log".

Also attaching CMakeOutput.log file if that helps. CMakeOutput.log

Please reply as soon as possible. Thanks!

tildeslu commented 3 years ago

Hi @Adarsh931 Just drop -DAPBS_INSTALL from cmake command as it is used only if you use internal APBS linkage which is not supported for GMX2k. You will need to specify apbs binary location in the APBS env var when you run g_mmpbsa tool.

Adarsh931 commented 3 years ago

Tried running: cmake -DGMX_PATH=/opt/gromacs_2019 -DCMAKE_INSTALL_PREFIX=/opt/g_mmpbsa_2019 .. Still getting the same error: CMake Deprecation Warning at CMakeLists.txt:39 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'libgromacs' -- Found libgromacs, version 2019.3 -- Found GROMACS: /opt/gromacs_2019/lib/libgromacs.so
-- Found Gromacs include directory: /opt/gromacs_2019/include CMake Error at src/CMakeLists.txt:108 (message):

Only external APBS invocation is supported for Gromacs-2019.3

-- Configuring incomplete, errors occurred! See also "/mnt/bf3327e2-4ccc-460d-a74f-db54b0c69a92/g_mmpbsa-edited_master/g_mmpbsa-master/build/CMakeFiles/CMakeOutput.log". CMakeOutput.log

Can you explain the second line?

tildeslu commented 3 years ago

Tried running: cmake -DGMX_PATH=/opt/gromacs_2019 -DCMAKE_INSTALL_PREFIX=/opt/g_mmpbsa_2019 .. Still getting the same error: CMake Deprecation Warning at CMakeLists.txt:39 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'libgromacs' -- Found libgromacs, version 2019.3 -- Found GROMACS: /opt/gromacs_2019/lib/libgromacs.so -- Found Gromacs include directory: /opt/gromacs_2019/include CMake Error at src/CMakeLists.txt:108 (message):

Only external APBS invocation is supported for Gromacs-2019.3

-- Configuring incomplete, errors occurred! See also "/mnt/bf3327e2-4ccc-460d-a74f-db54b0c69a92/g_mmpbsa-edited_master/g_mmpbsa-master/build/CMakeFiles/CMakeOutput.log". CMakeOutput.log

Can you explain the second line?

Use the following command: cmake -DEXT_APBS=ON -DGMX_PATH=/opt/gromacs_2019 -DCMAKE_INSTALL_PREFIX=/opt/g_mmpbsa_2019 ..

When compiled this way, g_mmpbsa calls APBS program by executing its binary internally in the computation process, not via a library call as it would be with internal APBS linkage. So you need to specify where apbs binary resides at runtime, not at compilation time. For detailed explanation see http://rashmikumari.github.io/g_mmpbsa/How-to-Run.html

Adarsh931 commented 3 years ago

Thanks a lot, @tildeslu, it has installed now. But now when I am running: g_mmpbsa -f md_0_10_center.xtc -s md_0_10.tpr -n index.ndx -i ../pbsa.mdp -pdie 2 -pbsa -decomp

I am getting this error: g_mmpbsa: error while loading shared libraries: libgromacs.so.4: cannot open shared object file: No such file or directory

Before running the above command on the terminal, I ran this: export APBS=/opt/apbs/bin/apbs (this is 1.3 version) and I put g_mmpbsa on the path as well.

Please reply as soon as possible. Thanks!!

tildeslu commented 3 years ago

I suppose you should load GROMACS environment before calling g_mmpbsa because it is not a stand-alone program and depends on GROMACS libraries. Usually it is done by sourcing gmxrc but the procedure may be different for your system.

Adarsh931 commented 3 years ago

Hi @tildeslu, thank you again for helping out before. I now realized I had done all other steps with gromacs 2020.1 instead of 2019.3. So, I download g_mmpbsa from here: https://github.com/tildeslu/g_mmpbsa/releases/tag/v1.7.1, and ran this command: cmake -DGMX_PATH=/opt/gromacs_2020 -DCMAKE_INSTALL_PREFIX=/opt/g_mmpbsa_2020 .. -DGMX_INSTALL_LEGACY_API=ON

I am getting this error: CMake Deprecation Warning at CMakeLists.txt:39 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'libgromacs' -- Found libgromacs, version 2020.1 -- Could NOT find GROMACS (missing: GROMACS_INCLUDE_DIR) -- Continue checking for other Gromacs version library file -- Checking for module 'libgmx' -- No package 'libgmx' found CMake Error at cmake/FindGROMACS.cmake:178 (if): if given arguments:

"NOT" "(" "/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/libfftw3f.so;-ldl;-lpthread;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/libfftw3f.so" "MATCHES" "fftw3" ")" "AND" "VERSION_GREATER" "4.6.0" "AND" "VERSION_LESS" "2016"

Unknown arguments specified Call Stack (most recent call first): src/CMakeLists.txt:69 (find_package)

-- Configuring incomplete, errors occurred! See also "/mnt/bf3327e2-4ccc-460d-a74f-db54b0c69a92/g_mmpbsa-1.7.1/build/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

Please reply as soon as possible. Once again, thanks for all the helps!

tildeslu commented 3 years ago

Seems that your GROMACS installation has been compiled without development headers and is missing include directory. It should contain e.g. include/gromacs/tpxio.h and other headers. I've checked compilation with GROMACS 2019, 2020.2 and 2020.4 and it worked if GROMACS is built with -DGMX_INSTALL_LEGACY_API=ON

Adarsh931 commented 3 years ago

Thanks a lot, @tildeslu, everything's working fine now (I recompiled gromacs 2020.1 with legacy API, and it's working fine now). Also, is there any way I can acknowledge in you my paper (I will need your name and affiliation), or maybe cite any paper of yours related to making g_mmpbsa compatible with gromacs 2020.1? We need more people like you getting appreciated for the great work you are doing for the science community. Email me: singh.adarsh931@gmail.com

To everyone else, please contact me if you are facing difficulty at any step of the installation or using the software.

Adarsh931 commented 3 years ago

Hey @tildeslu, can you help me with running in background like using nohup? If run this command: g_mmpbsa -f md_0_10_center.xtc -s md_0_10.tpr -n index.ndx -i ../pbsa.mdp -pdie 2 -pbsa -decomp then I won't be able to enter 1 and 13 (more details here: https://rashmikumari.github.io/g_mmpbsa/single_protein_ligand_binding_energy.html ). Can you tell me how to do that?