分享

Installation of GROMACS

 Secelia 2012-11-20

Installation of GROMACS

Here I am going to explain how to install Gromacs on your personal linux/OS X machine in few steps. If you follow these steps exactly as I wrote here, I am hundred percent sure you should not face any problems. Anyway, if you have any problems in doing this task, you could contact me at smanchu@. I would be more than happy to assist you.

First you need to have C/C++ compiler on your system to compile Gromacs. But since we are doing it on Unix-style computers Linux or OS X, we should not have any problems in compiling Gromacs. I mean every computer wiht unix-style operating system has default C compiler with it. For macbook you might have to download Apple Developer tools. I mean if you have never installed xcode from the apple development tools webpage, then google it using the serach term "apple development tools" and then there you see "Tools - xcode". Just download latest xcode for mac development from this page and install it on your mac. It has gcc compiler for compiling C programs which is what we need for compiling fftw programs written in C language.

Installation of FFTW

Important Note:  If you are installing both Lammps and Gromacs on your system make sure that you install FFTW 2.1.x version instead of FFTW 3.x version I explained below. Gromacs is compatible with both versions but Lammps is only compatible with 2.1.x version.

You need FFT library to perform Fourier transforms. First, you need to download FFTW package. You can download this package from this link. Before you download this package from the link I gave here, I strongly recommend to check this page whether there is any latest release/version than the one I mentioned here. Then blindly follow the steps I wrote below to install this package on your system. Here I am assuming that the package you downloaded just now is on your desktoop. By default most of the times all the browers download it on to desktop.Otherwise you need to bring to the desktop to follow these steps exactly. You need to open a termianl to do these commands. On Linux, you could simply right click on desktop and select "Open Terminal". On Mac you could either slect X11 terminal or just a old fashioned plain terminal application just like the one on Linux.

  • cd Desktop
  • tar -xzvf fftw-3.0.1.tar.gz
  • cd fftw-3.0.1

Wheter your system is linux or Mac or (i866 or x86-64 with either linux or mac) , you need to do these 3 initial steps at the beginning. Afterwards depending on what your system is, one or two steps change from linxu to mac. The only thing you need to do is just follow the steps under the right heading like "For Mac" and "For Linux", depending on what your system is.

Here you have two options in compling FFTW package. One is with single precision and the another one is with double precision.You could have either one. It is up to you. You could do both too. Here we start with single precision. By the way you don't have to be super user or root to compile. But it is must when you need to install something. I mean you won't see any problem when you are compiling even if you are not logged in as a root. But when you try to install, then right away you see a message like "permission denied". So make sure that you become root from the beginning it self. Otherwise you could become root right before you type the command "make install", I mean when you are about to install it. First of all you need to have root permission when ever you need to install something on your unix-based system unlike your windows personal computer. You need to type the command "su" for the linux and "sudo -s" for the mac to become root. Right away the system asks for your root password. Type in the password and hit enter button. That's it now you have root previleges. In case you don't have root password, then go and see the administrator and aks him for root password. Here I am getting root permissions not at the beginning but right before I install the package, I mean right after I compile the package. If your computers are either i686 or x86-64, scroll down the page. If you have bought new Macbook, then your computer is not one of them. Which means you don't have to worry about scrolling down the page.

FFTW for Mac

  • ./configure --enable-float --enable-threads
  • make
  • sudo -s
    • ---->Type in your root password and hit the enter button
  • make install

Now to do the double precision version, we need to clean up the tree.

  • make distclean
  • ./configure --enable-threads
  • make
  • make install

So now we have FFTW package installed on our system. Hey by the way, if you don't have any problems until now, that is ok. Othewise, try "./configure" instead of "./configure --enable-threads" for the double precision case and "./configure --enable-float" instead of "./configure --enable-float --enable-threads" for the single precision case.

Now it's up to you to exit from the root. I mean you can simply stay as root until you are done with Gromacs installation. Otherwise you decide to do the installation of gromacs later, then don't forget to exit from root by typing "exit". But make sure that you become root again when you come back to finish the installation of Gromacs

If you are successful with the installation of FFTW package on your system, then it's time for you to move on to Gromacs installation, since this is what you wanted to install on your system in the first place. Click on this link and it will take you to the gromacs installation instructions.

FFTW for Linux

  • ./configure --enable-float --enable-threads
  • make
  • su
    • ---->Type in your root password and hit the enter button
  • make install

Now to do the double precision version, we need to clean up the tree.

  • make distclean
  • ./configure --enable-threads
  • make
  • make install

So now we have FFTW package installed on our system. Hey by the way, if you don't have any problems until now, that is ok. Othewise, try "./configure" instead of "./configure --enable-threads" for the double precision case and "./configure --enable-float" instead of "./configure --enable-float --enable-threads" for the single precision case.

Now it's up to you to exit from the root. I mean you can simply stay as root until you are done with Gromacs installation. Otherwise you decide to do the installation of gromacs later, then don't forget to exit from root by typing "exit". But make sure that you become root again when you come back to finish the installation of Gromacs

If you are successful with the installation of FFTW package on your system, then it's time for you to move on to Gromacs installation, since this is what you wanted to install on your system in the first place. Click on this link and it will take you to the gromacs installation instructions.

FFTW for i866 or x86-64 Computers

  • ./configure --enable-float --enable-threads --enable-sse
  • make
  • sudo -s
  •          or
  • su
    • ---->First option is for mac and the second one is for linux. Type in your root password and hit the enter button)
  • make install

Now to do the double precision version, we need to clean up the tree.

  • make distclean
  • ./configure --enable-threads --enable-sse
  • make
  • make install

So now we have FFTW package installed on our system. Hey by the way, if you don't have any problems until now, that is ok. Othewise, try "./configure --enable-sse" instead of "./configure --enable-threads" for the double precision case and "./configure --enable-float --enable-sse" instead of "./configure --enable-float --enable-threads" for the single precision case.

Now it's up to you to exit from the root. I mean you can simply stay as root until you are done with Gromacs installation. Otherwise you decide to do the installation of gromacs later, then don't forget to exit from root by typing "exit". But make sure that you become root again when you come back to finish the installation of Gromacs

If you are successful with the installation of FFTW package on your system, then it's time for you to move on to Gromacs installation, since this is what you wanted to install on your system in the first place. Click on this link and it will take you to the gromacs installation instructions.

Finally, let's move on to Gromacs Installation

You need to download the latest version of Gromacs form the Gromacs website.Precisely you need to download the latest version of Gromacs source code from the Source Code page on the website at this link. If you are installing it right now (1st, October, 2008), then you can directly download the latest Gromacs source code from this link. I strongly suggest you to check the page for the latest release before you download it from the link I specified here.

Again I am assuming that you have downloaded the package on to your desktop. If you are still in the folder where you did installation of FFTW package, you need to type "cd ../" to go back on to Desktop. If you are using all the way new terminal for this installation then you need to type "cd Desktop" just like we did at the beginning for FFTW. This command will take you to the Desktop of your computer. So after typing one of these commands, now you are on Desktop. Now follow these commands to proceed with installation.

  • tar -xzvf gromacs-3.3.3.tar.gz

    Here you can simply type few first letters of the name of the file and then pressing Tab button will get you the full name of the file.

  • cd gromacs-3.3.3

    Here also do the same thing with Tab. Now you won't see anything until you hit the Tab button two times. After you hit it second time you see two file names suggested by system. One is tarred/zipped file and another one is unzipped/untarred folder, but not file. You need to get inside the folder. So you need to select the folder. Luckily here in our case, you just press the Tab, and right away it will take you to the Folder name before suggesting you the two names since the name of the folder is the common part in the folder's name and zipped file's name.

    Here by default it's going to compile in single precision. So to compile it with single precision, you just have to type the immediate next command. Otherwise, i.e., if you want to compile it with double precision, then skip the immediate step and type in the step followed by the immediate next step below this paragraph.

  • ./configure
    • ---->For single precision
  • ./configure --disable-float
    • ---->For double precision
  • make

    If you are still a super user/root from the last installation of FFTW, then skip the next command which is to make you the super user/root if you are not super user/root at present.

  • sudo -s
    • ---->This is for Mac
  • su
    • This is for Linux
  • make install

    Finally to creat the links to the Gromacs programs in /usr/local/bin, you need to type in the next command. Doing this will make your life much easier since when ever you need to run Gromacs, you will just have to type either "grompp" or "grompp-d" instead of going and finding the right executable file in the folder where we installed it and copy it each and every time to different folder where we want do the simulations. Even better, by doing this you can simply type in "gro" or "gr" and press the Tab and you get link/shortcut to your gromacs exectable file which is either "grompp" or "grompp-d" depending on what precision you have compiled your package. "grompp" is the executable file obtained with single precision, where as "grompp_d" is the executable file obtained with double precision compliation.

  • make links
  • Even after typing this command, when you press "grom" with out quotes at your command prompt and pressing tab, if you don't get name of your executable file "grompp" or "grompp_d", then you need to change your ".bashrc" file on your sytem to make it work this way. For doing this you need to have root permission. If this is the case check below on how to change the ".bashrc" profile.

    Now you make sure that you exit from the root by typing the next command.

  • exit

Now what ever the folder you are in, try typing something like "gr" or "gro" at the command prompt and press the tab button. You should immediately see either "grompp" or "grompp_d" depending on your compilation precision style. For now don't worry about input file for this application and hit the enter button once you have one of these two names next to your command prompt. If you see something ( I guess I should say not something but lot) about Gromacs, that's good. Which means Gromacs is successfully installed on your system. I guess I should say that if you see one of two names "grompp" or "grompp_d", then Gromacs is successfully installed on your system. Anyway just hit the enter button and see what is says about Gromacs. At the end of that message, there will be some thing saying that there is an error. Don't worry about it. It's because we haven't given any file as input to Gromacs executable to run.

So after all this, if you have successfully installed Gromacs on your system, then you are good to go. I mean you are ready to start simulations with Gromacs. Otherwise if you haven't had success with installation and you have few problems in installing it and don't know how to figure them out, try to drop me an email at smanchu@ and I would be more than happy to help you. Good luck.

Changing ".bashrc" file

Some times because of what ever reasons you don't see anything at your command prompt even after typing some part of name and pressing the tab. It doesn't display the full name of executable. Then you need to change the .bashrc file to get the full name of the executable when ever you type in part of the name and press the tab. For doing this you need to have root permission. You can always try to do this with out having permission. Some times it works.

  • cd
  • su
    • ---->for Linux
  • sudo -s
    • ---->for Mac
  • emacs .bashrc &
    • ---->This opens the file. If you already have it, you see some commands on this file. If you already don't have this file on your system, then it just shows up empty.
  • PATH=/usr/local/gromacs:$PATH; export PATH

Most of the times, emacs doesn't open a separate window, but on the screen it self. So try to change the file on the screen and save it before quitting. Type the line (4) in to the file and press "control x" and then "control c" to quit. It will ask you to save or not before quitting. Simply put "y" for yes and hit enter. If you are on linux, then you get separate window. Then you can simply use GUI buttons on the toolbar at the top like cut, paste (yank), copy, etc. (By the way if you want to know how to install emacs editor with X-window display, which means you get separate window when ever you open something with emacs, keep checking this website. I am going to write it here on my website pretty soon). That's it. The file is saved and the link is created to executable file by telling the system the path to the location of the executable file. When you try to type, for example "grom" and press tab, system will right away start looking in these folders and it something matches with this, it will give the full name next to commnad prompt. Don't forget to exit from the root.

In the end I request you to report me at smanchu@ the errors, in case you find any, with installation commands on this page.

Created by:

Sreedhar Manchu
Ph.D Student
Mechanical Engineering
University of Vermont
Farrel Hall, Trinity Campus.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多