Bioinformatics ReviewBioinformatics Review
Notification Show More
Font ResizerAa
  •  Home
  • Docking
  • MD Simulation
  • Tools
  • More Topics
    • Softwares
    • Sequence Analysis
    • Algorithms
    • Bioinformatics Programming
    • Bioinformatics Research Updates
    • Drug Discovery
    • Phylogenetics
    • Structural Bioinformatics
    • Editorials
    • Tips & Tricks
    • Bioinformatics News
    • Featured
    • Genomics
    • Bioinformatics Infographics
  • Community
    • BiR-Research Group
    • Community Q&A
    • Ask a question
    • Join Telegram Channel
    • Join Facebook Group
    • Join Reddit Group
    • Subscription Options
    • Become a Patron
    • Write for us
  • About Us
    • About BiR
    • BiR Scope
    • The Team
    • Guidelines for Research Collaboration
    • Feedback
    • Contact Us
    • Recent @ BiR
  • Subscription
  • Account
    • Visit Dashboard
    • Login
Font ResizerAa
Bioinformatics ReviewBioinformatics Review
Search
Have an existing account? Sign In
Follow US
Molecular dynamicsSoftwareTools

Installing Gromacs on Ubuntu for MD Simulation

Tariq Abdullah
Last updated: May 17, 2022 10:08 am
Tariq Abdullah
Share
6 Min Read
SHARE

In bioinformatics, GROMACS is one of the most popular Molecular Dynamics simulation software with loads of features built-in. Installing GROMACS Version 5.x.x+ can be a tedious and cumbersome process on Ubuntu, especially if you are just starting out. For beginners, installing and getting GROMACS to work is more challenging due to unfamiliarity with Linux commands and GROMACS dependencies. Also, the installation instructions for version 5+ available on the GROMACS website does not seem to work first hand.

Contents
Getting StartedInstallationEasy MethodRegular Installation

In this quick tutorial, I will teach you how to install Gromacs on Ubuntu 14.04 LTS. It is expected to work on any version of Ubuntu. Post in comments if you face any problem.

I will also explain the meanings of different commands alongside.

To install GROMACS 5+, log into your Ubuntu system, and open a terminal by pressing Ctrl+Alt+T together.

You need a good internet connection as we will have to download various dependencies during the installation process. To install Gromacs, we need the following software installed on our system:

  1. A C & C++ Compiler which comes built-in with Ubuntu.
  2. CMake – A linux software to make binaries
  3. BuildEssential – It is a reference for all the packages needed to compile a package.
  4. FFTW Library: a library used by Gromacs to compute discrete Fourier transform
  5. DeRegressionTest Package

Getting Started

If you have freshly installed Ubuntu, don’t forget to update your repository information and software packages in your system. Press Ctrl+Alt+T and a terminal will open up. In the terminal, type:

sudo apt-get update
sudo apt-get upgrade

Installation

The first step in installing Gromacs is to get cmake, In the terminal, type:

sudo apt-get install cmake

If asked “After this operation, 16.5 MB of additional disk space will be used. Do you want to continue?”, Press y and then press Enter.
Easy Method Update: 2019

Easy Method

To make it even easier to install Gromacs, we have created an installer for you. If the following installer doesn’t work, you can proceed with the normal method

wget https://bioinformaticsreview.com/repository/gromacs-installer.sh

make installer executable

chmod +x gromacs-installer.sh

Start Installer

./gromacs-installer.sh

Regular Installation

When download and installation finishes up, you can check the version of cmake by the following command

cmake --version

Next, we need to install build-essential with this command

sudo apt-get install build-essential

Before we go any further, it is good to know the path of our current working directory, in the terminal, type:

pwd

Note down the path it shows, it is very important and will be used during real gromacs installation.

Now that we have cmake in place and we know the working directory. It’s time to download the Regression Tests Package. It is possible to automatically download this package during installation, but most of the time it throws me an error stating that the location of the file has changed, so let us do it the hard way to avoid any problem during installation. Copy and Paste the following commands in your terminal (Right Click to paste or Ctrl+shift+V). It basically downloads the file and saves it in your downloads folder.

cd Downloads/
wget http://gerrit.gromacs.org/download/regressiontests-5.1.1.tar.gz

We have the Regression test package in our downloads folder as a compressed tar.gz archive, let us extract it with

tar xvzf regressiontests-5.1.1.tar.gz

Now we need Fourier Transform Library on our system. You can download it on fftw.org or install it from repository with this following command

sudo apt-get install libfftw3-dev

Okay, Let us now download GROMACS 5.1.1 with this command, Alternatively, you can download the latest version from GROMACS website.

wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-5.1.1.tar.gz

Now extract GROMACS archive

tar xvzf gromacs-5.1.1.tar.gz

Now move inside the Gromacs folder,

cd gromacs-5.1.1/

Create a directory called “Build” where we will keep our compiled binaries

mkdir build

move inside the build directory

cd build

It’s time to make Gromacs, Replace “pwdpath” with the path of the working directory that you have noted earlier in the following command:

sudo cmake .. -DGMX_BUILD_OWN_FFTW=OFF -DREGRESSIONTEST_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc -DREGRESSIONTEST_PATH="PUT YOUR PWD PATH HERE WITHOUT QUOTES"/Downloads/regressiontests-5.1.1

Note: There is no space after any = (assignment operator) and there are no quote symbols. If you get “There is no CMakeList file in specified location”, then please check for space or incorrect path.

If everything goes well, the message in your terminal will say “Generating Done. Build files written… “. If not, make sure you have replaced the pwd path in command with the path of your home directory. If you have forgotten it, just open another terminal and type pwd.

Now let’s first check and make the real thing..

make check
sudo make install

Now, It may take some time depending on your configuration. After completion, execute it:

source /usr/local/gromacs/bin/GMXRC

After the successful installation, you may check the version of your Gromacs with a command to make sure the installation finished as expected.

gmx pdb2gmx --version

Was this tutorial helpful? Don’t forget to share it. enjoy! 🙂

Share This Article
Facebook Copy Link Print
ByTariq Abdullah
Tariq is founder of Bioinformatics Review and Lead Developer at IQL Technologies. His areas of expertise include algorithm design, phylogenetics, MicroArray, Plant Systematics, and genome data analysis. If you have questions, reach out to him via his homepage.
17 Comments
  • villarrealer says:
    September 15, 2016 at 5:32 am

    Hello, Could you please write a example of this command sudo cmake .. -DGMX_BUILD_OWN_FFTW=OFF -DREGRESSIONTEST_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc -DREGRESSIONTEST_PATH=pwdpath/Downloads/regressiontests-5.1.1?
    Thank you in advance,
    Eduardo

    Log in to Reply
    • Tariq Abdullah says:
      November 12, 2016 at 12:59 pm

      Thank you for asking, it will make things clearer for everyone else.
      Example is as follow(Without Quotes):

      “sudo cmake .. -DGMX_BUILD_OWN_FFTW=OFF -DREGRESSIONTEST_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc -DREGRESSIONTEST_PATH=/Tariq/home/Downloads/regressiontests-5.1.1”

      Log in to Reply
  • rasikaradon says:
    March 14, 2017 at 5:39 am

    I followed your steps to install gromacs-5.1.4 it went well until i got to make check, the i got this error massage and cant figure out how to fix it. ( i have installed cmake version 3.5.2)

    Built target view_objlib
    Built target libgromacs
    Built target mdrun_objlib
    Built target gmx
    Scanning dependencies of target gmxtests
    CMake Error: Cannot open file for write: /home/rasikaradon/gromacs-5.1.4/build/tests/CMakeFiles/gmxtests.dir/depend.make.tmp
    CMake Error: : System Error: Permission denied
    tests/CMakeFiles/gmxtests.dir/build.make:74: recipe for target ‘tests/CMakeFiles/gmxtests.dir/depend’ failed
    make[3]: *** [tests/CMakeFiles/gmxtests.dir/depend] Error 2
    CMakeFiles/Makefile2:3226: recipe for target ‘tests/CMakeFiles/gmxtests.dir/all’ failed
    make[2]: *** [tests/CMakeFiles/gmxtests.dir/all] Error 2
    CMakeFiles/Makefile2:172: recipe for target ‘CMakeFiles/check.dir/rule’ failed
    make[1]: *** [CMakeFiles/check.dir/rule] Error 2
    Makefile:234: recipe for target ‘check’ failed
    make: *** [check] Error 2

    Log in to Reply
  • Muniba Faiza says:
    September 30, 2017 at 7:49 am

    Hi Rasikaradon,

    You should probably use sudo make check as it needs permission of the user to open a few files.

    Log in to Reply
  • tan.wenrui213@hotmail.com says:
    August 11, 2020 at 4:50 am

    Hi
    Thank you for the tutorial of installation.
    May i know how can i open gromacs after i have install through the easy method?
    Many thanks!

    Log in to Reply
    • Muniba Faiza says:
      August 11, 2020 at 12:01 pm

      Hi,
      You can run the commands the same way. Just type gmx followed by the module. For example, gmx pdb2gmx –version.

      Log in to Reply
      • tan.wenrui213@hotmail.com says:
        August 12, 2020 at 6:40 am

        i received ‘error in user input values’,and it mention ‘in option f Required option was not provided, and the default file eiwit’ does not exist or is not accessible. The following extensions were tried to complete the file name:.gro, .g96, .pdf, .brk, .ent, .esp, .tpr ‘

        How to solve this? need to reinstall all?

        Log in to Reply
  • samarairtaza@gmail.com says:
    March 18, 2021 at 6:05 pm

    kindly guide

    samara@DESKTOP-7GVBM1T:/mnt/c/Users/Samar/Desktop/grom/gromacs-5.1.1/build$ sudo cmake .. -DGMX_BUILD_OWN_FFTW=OFF -DREGRESSIONTEST_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc -DREGRESSIONTEST_PATH=/home/Samara/Desktop/regressiontests-5.1.1
    [sudo] password for samara:
    — No compatible CUDA toolkit found (v4.0+), disabling native GPU acceleration
    — Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
    CMake Error at tests/CMakeLists.txt:103 (message):
    REGRESSIONTEST_PATH invalid. The path needs to contain gmxtest.pl.

    — Configuring incomplete, errors occurred!
    See also “/mnt/c/Users/Samar/Desktop/grom/gromacs-5.1.1/build/CMakeFiles/CMakeOutput.log”.
    See also “/mnt/c/Users/Samar/Desktop/grom/gromacs-5.1.1/build/CMakeFiles/CMakeError.log”.
    samara@DESKTOP-7GVBM1T:/mnt/c/Users/Samar/Desktop/grom/gromacs-5.1.1/build$

    Log in to Reply
    • Muniba Faiza says:
      March 18, 2021 at 7:10 pm

      Hi,

      Your regressiontests path is incorrect. Check it and re-run the cmake command.

      Best

      Log in to Reply
  • edgar marquez says:
    April 30, 2021 at 7:25 am

    excellent!!! working very well with gromacs 2020.6

    Log in to Reply
  • rohit.bioinfo.11@gmail.com says:
    October 1, 2021 at 10:48 am

    Thanks for this tutorial. it’s very very helpful. I have a request for a simulation result analysis tutorial. will you plz explain the result partly of gromacs simulation like about what is rmsd ? how to analyze PCA, gyration, and SASA plot. plz, make a tutorial about this.

    Log in to Reply
  • Dr. Muniba Faiza says:
    October 1, 2021 at 7:45 pm

    Hi,

    Please visit the following links for the result analysis part:

    https://bioinformaticsreview.com/20201226/tutorial-md-simulation-output-analysis-of-a-complex-using-gromacs/

    https://bioinformaticsreview.com/20200609/md-simulation-output-analysis-of-protein-using-gromacs/

    Best

    Log in to Reply
  • mnav.tkonline@gmail.com says:
    November 6, 2021 at 8:51 am

    I am trying to install gromacs-5.1.1 with gcc version 9.3.0 and cmake version 3.16.3-1ubuntu1.
    I faced errors at the step of running “sudo make test”
    The following tests FAILED:
    3 – CommandLineUnitTests (SEGFAULT)
    7 – OnlineHelpUnitTests (SEGFAULT)
    8 – OptionsUnitTests (SEGFAULT)
    15 – AnalysisDataUnitTests (SEGFAULT)
    17 – TrajectoryAnalysisUnitTests (SEGFAULT)
    Errors while running CTest
    make[3]: *** [CMakeFiles/run-ctest.dir/build.make:58: CMakeFiles/run-ctest] Error 8
    make[2]: *** [CMakeFiles/Makefile2:1794: CMakeFiles/run-ctest.dir/all] Error 2
    make[1]: *** [CMakeFiles/Makefile2:1503: CMakeFiles/check.dir/rule] Error 2
    make: *** [Makefile:210: check] Error 2

    Please help me to solve it. Thank you.

    Log in to Reply
  • mnav.tkonline@gmail.com says:
    November 6, 2021 at 9:17 am

    More infor:
    4/26 Test #4: CommandLineUnitTests ………….***Exception: SegFault 0.09 sec
    [==========] Running 46 tests from 6 test cases.
    [———-] Global test environment set-up.
    [———-] 3 tests from CommandLineHelpModuleTest
    [ RUN ] CommandLineHelpModuleTest.PrintsGeneralHelp
    [ OK ] CommandLineHelpModuleTest.PrintsGeneralHelp (1 ms)
    [ RUN ] CommandLineHelpModuleTest.PrintsHelpOnTopic

    8/26 Test #8: OnlineHelpUnitTests …………..***Exception: SegFault 0.09 sec
    [==========] Running 22 tests from 4 test cases.
    [———-] Global test environment set-up.
    [———-] 6 tests from TextTableFormatterTest
    [ RUN ] TextTableFormatterTest.HandlesBasicCase
    [ OK ] TextTableFormatterTest.HandlesBasicCase (1 ms)
    [ RUN ] TextTableFormatterTest.HandlesEmptyColumnTitles
    [ OK ] TextTableFormatterTest.HandlesEmptyColumnTitles (0 ms)
    [ RUN ] TextTableFormatterTest.HandlesIndentation
    [ OK ] TextTableFormatterTest.HandlesIndentation (0 ms)
    [ RUN ] TextTableFormatterTest.HandlesOverflowingLines
    [ OK ] TextTableFormatterTest.HandlesOverflowingLines (0 ms)
    [ RUN ] TextTableFormatterTest.HandlesLastColumnFolding
    [ OK ] TextTableFormatterTest.HandlesLastColumnFolding (0 ms)
    [ RUN ] TextTableFormatterTest.HandlesEmptyColumns
    [ OK ] TextTableFormatterTest.HandlesEmptyColumns (0 ms)
    [———-] 6 tests from TextTableFormatterTest (1 ms total)

    [———-] 3 tests from HelpManagerTest
    [ RUN ] HelpManagerTest.HandlesRootTopic

    9/26 Test #9: OptionsUnitTests ……………..***Exception: SegFault 0.09 sec
    [==========] Running 74 tests from 10 test cases.
    [———-] Global test environment set-up.
    [———-] 5 tests from AbstractOptionStorageTest
    [ RUN ] AbstractOptionStorageTest.HandlesSetInFinish

    16/26 Test #16: AnalysisDataUnitTests …………***Exception: SegFault 0.09 sec
    [==========] Running 69 tests from 14 test cases.
    [———-] Global test environment set-up.
    [———-] 3 tests from AnalysisDataInitializationTest
    [ RUN ] AnalysisDataInitializationTest.BasicInitialization
    [ OK ] AnalysisDataInitializationTest.BasicInitialization (0 ms)
    [ RUN ] AnalysisDataInitializationTest.ChecksMultiColumnModules
    [ OK ] AnalysisDataInitializationTest.ChecksMultiColumnModules (0 ms)
    [ RUN ] AnalysisDataInitializationTest.ChecksMultipointModules
    [ OK ] AnalysisDataInitializationTest.ChecksMultipointModules (0 ms)
    [———-] 3 tests from AnalysisDataInitializationTest (0 ms total)

    [———-] 8 tests from AnalysisDataCommonTest/0, where TypeParam = (anonymous namespace)::SimpleInputData
    [ RUN ] AnalysisDataCommonTest/0.CallsModuleCorrectly

    18/26 Test #18: TrajectoryAnalysisUnitTests ……***Exception: SegFault 0.09 sec
    [==========] Running 48 tests from 8 test cases.
    [———-] Global test environment set-up.
    [———-] 11 tests from AngleModuleTest
    [ RUN ] AngleModuleTest.ComputesSimpleAngles

    WARNING: If there are molecules in the input trajectory file
    that are broken across periodic boundaries, they
    cannot be made whole (or treated as whole) without
    you providing a run input file.

    Log in to Reply
  • Dr. Muniba Faiza says:
    November 7, 2021 at 8:33 am

    Hi,

    Which version of Ubuntu are you using?
    Please install the latest version of GROMACS with the latest version of cmake.
    You will have to replace the name of the GROAMCS version and regressiontests version with the latest versions in this tutorial. Otherwise, you can try easy installation method. If you are using Ubuntu 18.04 or above, then read the following tutorial:
    https://bioinformaticsreview.com/20210616/easy-installation-of-gromacs-on-ubuntu-18-04-20-04/

    Log in to Reply
  • odhiramon@gmail.com says:
    November 26, 2021 at 11:46 am

    ~/Downloads/gromacs-5.1.1/build$ sudo make check
    [sudo] password for modi:
    Sorry, try again.
    [sudo] password for modi:
    Scanning dependencies of target mdrun_objlib
    [ 0%] Building CXX object src/programs/CMakeFiles/mdrun_objlib.dir/mdrun/md.cpp.o
    [ 1%] Building CXX object src/programs/CMakeFiles/mdrun_objlib.dir/mdrun/mdrun.cpp.o
    [ 1%] Building C object src/programs/CMakeFiles/mdrun_objlib.dir/mdrun/membed.c.o
    [ 1%] Building CXX object src/programs/CMakeFiles/mdrun_objlib.dir/mdrun/repl_ex.cpp.o
    [ 1%] Building CXX object src/programs/CMakeFiles/mdrun_objlib.dir/mdrun/resource-division.cpp.o
    [ 1%] Building CXX object src/programs/CMakeFiles/mdrun_objlib.dir/mdrun/runner.cpp.o
    [ 1%] Built target mdrun_objlib
    [ 1%] Building NVCC (Device) object src/gromacs/CMakeFiles/libgromacs.dir/gmxlib/cuda_tools/libgromacs_generated_copyrite_gpu.cu.o
    nvcc fatal : Unsupported gpu architecture ‘compute_20’
    CMake Error at libgromacs_generated_copyrite_gpu.cu.o.Release.cmake:220 (message):
    Error generating
    /home/modi/Downloads/gromacs-5.1.1/build/src/gromacs/CMakeFiles/libgromacs.dir/gmxlib/cuda_tools/./libgromacs_generated_copyrite_gpu.cu.o

    make[3]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:65: src/gromacs/CMakeFiles/libgromacs.dir/gmxlib/cuda_tools/libgromacs_generated_copyrite_gpu.cu.o] Error 1
    make[2]: *** [CMakeFiles/Makefile2:2825: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
    make[1]: *** [CMakeFiles/Makefile2:1482: CMakeFiles/check.dir/rule] Error 2
    make: *** [Makefile:210: check] Error 2

    Please help me to solve it, Thank you

    Log in to Reply
    • Dr. Muniba Faiza says:
      November 26, 2021 at 3:15 pm

      Hi,

      It seems you have turned on GPU support while it’s not available on your system.

      Best

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

- Advertisement -
Ad image
10 years of Bioinformatics Review: From a Blog to a Bioinformatics Knowledge Hub!
Editorial
Starting in Bioinformatics? Do This First!
Starting in Bioinformatics? Do This First!
Tips & Tricks
[Editorial] Is it ethical to change the order of authors’ names in a manuscript?
Editorial Opinion
Installing bbtools on Ubuntu
[Tutorial] Installing BBTools on Ubuntu (Linux).
Sequence Analysis Software Tools

You Might Also Like

VISPR- A new tool to visualize CRISPR screening experiments
GenomicsSoftwareTools

VISPR- A new tool to visualize CRISPR screening experiments

July 2, 2021
Sequence AnalysisSoftwareStructural Bioinformatics

Biotite: A bioinformatics framework for sequence and structure data analysis

May 20, 2020
How to solve ‘Could NOT find CUDA: Found unsuitable version “10.1”‘ error during GROMACS installation?
MD SimulationSoftwareTools

How to solve ‘Could NOT find CUDA: Found unsuitable version “10.1”‘ error during GROMACS installation?

April 18, 2023
How to generate topology from SMILES for MD Simulation?
SoftwareTools

How to generate topology from SMILES for MD Simulation?

August 6, 2023
Copyright 2024 IQL Technologies
  • Journal
  • Customer Support
  • Contact Us
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Cookie Policy
  • Sitemap
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?

Not a member? Sign Up