Difference between revisions of "Compiling GMIN with CHARMM"

From CUC3
Jump to navigation Jump to search
import>Csw34
import>Csw34
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
So, you want to get the latest version of GMIN from the Wales Group repository. The GMIN code is managed by Subversion version control (SVN), and before you can access it, you need an account on the departmental SVN server.
+
The [[GMIN]] source is managed by Subversion version control (SVN), and before you can access it, you need an account on the departmental SVN server. A detailed tutorial documenting this process can be found on the [[SVN setup]] page.
   
  +
Once you have the source, you need to first compile [[CHARMM]]. This procedure is different from that when compiling [[OPTIM]], where a build.csh script recompiles [[CHARMM]] automatically if required. In the future, this may be extended to [[GMIN]].
===Getting an account on the SVN server===
 
The SVN server we use is run by the good people in the Unilever Centre, so you should email ucc-support@ch.cam.ac.uk, CCing in David (dw34) to request access to the Wales Group repository. Make sure you include your CRSID, the bit before @cam.ac.uk in your email address.
 
 
Once they reply, you should be able to set up your password [https://wwmm.ch.cam.ac.uk/svnpassword/modify.py here] after logging into Raven. To check you have access to the repository, try logging in [https://wwmm.ch.cam.ac.uk/svn2/ here]. If you can't, you've done something wrong! Get help!
 
 
===Setting up your SVN details===
 
Open a shell on the machine where you plan on using GMIN. To make subversion easy to use, you need to specify some locations in your .bashrc file as environment variables. We do this as follows:
 
<pre>
 
vi ~/.bashrc
 
</pre>
 
This opens the '''vi''' editor. Press '''SHIFT+G''' to go to the bottom of the file, then press '''I''' to enter insert mode. Add the following to the bottom:
 
<pre>
 
export SVN=https://wwmm.ch.cam.ac.uk/svn2/groups/wales/
 
export MYSVN=https://wwmm.ch.cam.ac.uk/svn2/users/CRSID/
 
</pre>
 
where CRSID is the user name you use to log into Raven with. When you're done, we need to save he changes, press '''ESC''' to exit insert mode (check 'Insert' isn't still showing at the bottom!) and then type:
 
<pre>
 
:wq
 
</pre>
 
and press '''ENTER'''. This should exit the editor, and return you to the directory you were in before. These variables will now be automatically set when you open a new shell, but for now, we need to load them manually. We do this using the source command:
 
<pre>
 
source ~/.bashrc
 
</pre>
 
We're now ready to check if you have access to the repository from your chosen machine. Lets try listing the contents of the GMIN trunk directory. Type the following ($SVN is the environmental variable we set to the location of the Wales Group repository above):
 
<pre>
 
svn ls $SVN/GMIN/trunk
 
</pre>
 
You will be prompted to validate a security certificate so press '''p''' and then '''ENTER''' to accept it permenantly. Now enter the password you set above (you only need to do this once!). You should see the files that make up GMIN displayed, ending in something like this:
 
<pre>
 
...
 
wenzel.f
 
wham_djw.f90
 
zwischen.f
 
</pre>
 
You're now good to download the GMIN code :)
 
 
==='Checking out' the GMIN code===
 
The first time you want to access the code, you need to 'check it out'. This will pull the entire code from the repository into a local directory for your use.
 
 
'''WARNING: It has been found that if you put the GMIN directory too far from your /home/CRSID/, you will not be able to compile the CHARMM source that is included. This is most likely due to the variable CHARMM uses to contain the locations of files is of a limited length! We hope to fix this problem, but for now you need to ensure it is close enough. The path below is the MAXIMUM length that allows CHARMM to still compile, adding one more x to the GMIN directory name leads to all sorts of silly errors!'''
 
<pre>
 
/home/csw34/GMINxxxxxxxxxx/
 
</pre>
 
The code is checked out as follows:
 
<pre>
 
svn co $SVN/GMIN/trunk ~/GMIN
 
</pre>
 
Notice that I'm transfering the code to:
 
<pre>
 
/home/csw34/GMIN
 
</pre>
 
This path is clearly shorter than that above, and so we should have no problem compiling CHARMM. You'll need to wait a while for the code to transfer! Once it has finished, you'll see a message like this:
 
<pre>
 
Checked out revision 9853.
 
</pre>
 
The number given is the version number you have just obtained. Whenever changes are make to the code and uploaded to the repository, this number is incremented. It might be increased by more than one between versions as the counter is common for all software, not just GMIN. That's it! You now have a copy of the GMIN code. Here are a few notes on its structure for new users.
 
 
* '''CHARMM31''' contains the CHARMM source code. You need to compile CHARMM before you compile GMIN with it, and you must use the same compiler in both cases. If you don't you'll get errors.
 
* '''CHARMMinterface''' contains the CHARMM interface files which link GMIN to the CHARMM source. We try to change the CHARMM source itself as little as possible, so most changes are made here.
 
* '''AMBER''' contains the AMBER9 source code.
 
* '''AMH''' contains the files used for the AMH potential as implemented by Dr Mike Prentiss.
 
* '''LAPACK''' and '''BLAS''' contain highly optimised maths algorithms used by GMIN.
 
   
 
===Compiling CHARMM===
 
===Compiling CHARMM===
As an example, lets compile GMIN with CHARMM from the code we just obtained. Before we do so, we need to compile CHARMM itself. Before we start, we need to make sure the right compiler is loaded. For this example, lets use a 64bit Portland compiler, which at the time of writing is done using the command
+
Before we start, we need to make sure the right compiler is loaded. For this example, lets use a 64bit Portland compiler, which at the time of writing is done using the command
 
<pre>
 
<pre>
 
module load pgi64/7.1-6
 
module load pgi64/7.1-6
Line 73: Line 12:
 
module swap pgi64/6.1-6 pgi64/7.1-6
 
module swap pgi64/6.1-6 pgi64/7.1-6
 
</pre>
 
</pre>
NOTE: These module names are from the mek-quake server and are NOT called the same thing on clust. You can see all possible modules availiable to load using
+
NOTE: These module names are from the mek-quake server and are NOT called the same thing on clust. You can see all possible modules available to load using
 
<pre>
 
<pre>
 
module av
 
module av
Line 79: Line 18:
 
Once the compiler is loaded, change to the CHARMM31 directory using
 
Once the compiler is loaded, change to the CHARMM31 directory using
 
<pre>
 
<pre>
cd CHARMM31
+
cd ~/svn/CHARMM31
 
</pre>
 
</pre>
 
CHARMM is compiled by a series of scripts which we run using a few simple commands. Firstly,
 
CHARMM is compiled by a series of scripts which we run using a few simple commands. Firstly,
Line 101: Line 40:
   
 
install.com> CHARMM Installation is completed.
 
install.com> CHARMM Installation is completed.
The CHARMM executable is /home/csw34/GMIN/CHARMM31/exec/gnu/charmm.
+
The CHARMM executable is /home/csw34/svn/CHARMM31/exec/gnu/charmm.
   
 
install.com> Phase 3 completed.
 
install.com> Phase 3 completed.
Line 109: Line 48:
   
 
===Compiling GMIN with CHARMM===
 
===Compiling GMIN with CHARMM===
Now it's time to compile GMIN itself. Before we do so, we need to ensure we have set the '''Makefile''' up correctly. The Makefile specifies how the code should compiled and then linked together. When you first open it, it looks pretty horrendous, but that's just becuase there are so many options contained within. Any line starting with a # is commented out and will not be used. Scroll down until you come to the section titled '''AMBER9'''. Two variables (AMB9SRC and SANDERSRC) are defined below and you need to update them to reflect the location of the code you just downloaded. Remember, you must use the FULL path here, so no ~'s!
+
Now it's time to compile GMIN itself. Before we do so, we need to ensure we have set the '''Makefile''' up correctly. The Makefile specifies how the code should compiled and then linked together. When you first open it, it looks pretty horrendous, but that's just because there are so many options contained within. Any line starting with a # is commented out and will not be used. The only thing you MIGHT need to change here is the path that points to the CHARMM31 directory. It is currently set to /home/CRSID/svn/CHARMM31 - and it is HIGHLY recommended that you don't place the source anywhere else.
   
  +
If you are compiling with AMBER instead, everything in the CHARMM sections should be commented out! There are also two extra flags (FREEFORMAT_FLAG and EXTRA_FLAGS) that need to be uncommented in the Makefile for an AMBGMIN compilation. Finally, you need to check that the correct bits are uncommented for the Portland compiler, pgf90. Assuming you still have the compiler from the CHARMM compilation loaded, you should be good to go. First, we want to make sure there are no random files lurking in the repository from a previous compilation. We do this using
In my case, I need to set the variables as follows:
 
<pre>
 
AMB9SRC = /home/csw34/GMIN/AMBER
 
SANDERSRC = /home/csw34/GMIN/AMBER/src/sander
 
</pre>
 
In the '''CHARMM31''' section, I am also going to set
 
<pre>
 
C31SRC = /home/csw34/GMIN/CHARMM31
 
</pre>
 
This variable specifies the location of the CHARMM source that will be used in the GMIN compilation. If you are compiling with AMBER, everything in the CHARMM sections should be commented out! Finally, I need to check that the correct bits are uncommented for the Portland compiler, pgf90. In the Makefile provided, they are. I now need to ensure that I have the correct compiler loaded, which at the time of writing is done using the command
 
<pre>
 
module load pgi64/7.1-6
 
</pre>
 
If you get a module conflict error message, you already have a version of pgf90 loaded and need to swap it out, for example:
 
<pre>
 
module swap pgi64/6.1-6 pgi64/7.1-6
 
</pre>
 
NOTE: These module names are from the mek-quake server and are NOT called the same thing on clust. You can see all possible modules availiable to load using
 
<pre>
 
module av
 
</pre>
 
Right! Lets try compiling some code! First, we want to make sure there are no random files lurking in the repository from a previous compilation. We do this using
 
 
<pre>
 
<pre>
 
make clean
 
make clean
 
</pre>
 
</pre>
If you get an infinite loop going on, exit using '''CTRL+C''' to escape and double check the variables we set above point to the right places! To compile GMIN with CHARMM, we then use the command
+
If you get an infinite loop going on, exit using '''CTRL+C''' to escape. Did you change any of the paths or save the code to somewhere other than ~/svn? Double check the variables point to the right places! To compile GMIN with CHARMM, we then use the command
 
<pre>
 
<pre>
make cgmin2
+
make chgmin
 
</pre>
 
</pre>
 
Cross your fingers! At present, there are some problems compiling with CHARMM and you'll see some linking errors at the end of the compilation like this:
 
Cross your fingers! At present, there are some problems compiling with CHARMM and you'll see some linking errors at the end of the compilation like this:
 
<pre>
 
<pre>
/usr/bin/ld: Warning: alignment 16 of symbol `mdi_' in /home/csw34/GMIN/CHARMM31/lib/gnu/minmiz.a(tnpack.o) is smaller than 32 in commons.o
+
/usr/bin/ld: Warning: alignment 16 of symbol `nmr_' in /home/csw34/GMIN/CHARMM31/lib/gnu/minmiz.a(tnpack.o) is smaller than 32 in commons.o
</pre>
 
Don't worry about this! They are the result of a naming clash between AMBER and CHARMM and will be resolved soon :) Unless you see any other errors, congratulations! You should now have a CGMIN executable in the GMIN directory! Go test it!
 
 
===Checking you have the lastest version===
 
If it has been a while since you downloaded the code, it is likely that you don't have the latest version. This could mean than the code you have contains bugs which have been fixed, or is missing performance or functionality increases that were added recently. You can update your code without having to download everything again using the update command.
 
 
'''WARNING!: You must be VERY careful using this command! If you have changed your code and not committed theose changes to the SVN repository, updating will most likely undo your changes!
 
 
While in the GMIN directory, simply type
 
<pre>
 
svn update
 
 
</pre>
 
</pre>
 
Don't worry about this! They are the result of a naming clash between [[AMBER]] and [[CHARMM]] and will be resolved soon :) Unless you see any other errors, congratulations! You should now have a CGMIN executable in the GMIN/bin directory! Go test it!
You will then be shown which files have been added, changed or removed and finally told which version number you now have. Committing and merging changes is covered on the [[SVN_page SVN page]].
 

Latest revision as of 10:24, 14 July 2008

The GMIN source is managed by Subversion version control (SVN), and before you can access it, you need an account on the departmental SVN server. A detailed tutorial documenting this process can be found on the SVN setup page.

Once you have the source, you need to first compile CHARMM. This procedure is different from that when compiling OPTIM, where a build.csh script recompiles CHARMM automatically if required. In the future, this may be extended to GMIN.

Compiling CHARMM

Before we start, we need to make sure the right compiler is loaded. For this example, lets use a 64bit Portland compiler, which at the time of writing is done using the command

module load pgi64/7.1-6

If you get a conflict error message, you already have a version of pgf90 loaded and need to swap it out, for example:

module swap pgi64/6.1-6 pgi64/7.1-6

NOTE: These module names are from the mek-quake server and are NOT called the same thing on clust. You can see all possible modules available to load using

module av

Once the compiler is loaded, change to the CHARMM31 directory using

cd ~/svn/CHARMM31

CHARMM is compiled by a series of scripts which we run using a few simple commands. Firstly,

./clean.csh

removes any files from a previous CHARMM installation. The installation is then started using

./compile.csh

It takes a while...so if you see it finish quickly, within a minute - you probably have problems! You can check by using

tail build.log

You should get something like this if all is well:

install.com> Phase 2 completed.

 install.com> Processing CHARMM source on gnu...


 install.com> CHARMM Installation is completed.
              The CHARMM executable is /home/csw34/svn/CHARMM31/exec/gnu/charmm.

 install.com> Phase 3 completed.
Tue Jul  1 20:46:11 BST 2008

If you do, congratulations! You have just compiled CHARMM :)

Compiling GMIN with CHARMM

Now it's time to compile GMIN itself. Before we do so, we need to ensure we have set the Makefile up correctly. The Makefile specifies how the code should compiled and then linked together. When you first open it, it looks pretty horrendous, but that's just because there are so many options contained within. Any line starting with a # is commented out and will not be used. The only thing you MIGHT need to change here is the path that points to the CHARMM31 directory. It is currently set to /home/CRSID/svn/CHARMM31 - and it is HIGHLY recommended that you don't place the source anywhere else.

If you are compiling with AMBER instead, everything in the CHARMM sections should be commented out! There are also two extra flags (FREEFORMAT_FLAG and EXTRA_FLAGS) that need to be uncommented in the Makefile for an AMBGMIN compilation. Finally, you need to check that the correct bits are uncommented for the Portland compiler, pgf90. Assuming you still have the compiler from the CHARMM compilation loaded, you should be good to go. First, we want to make sure there are no random files lurking in the repository from a previous compilation. We do this using

 
make clean

If you get an infinite loop going on, exit using CTRL+C to escape. Did you change any of the paths or save the code to somewhere other than ~/svn? Double check the variables point to the right places! To compile GMIN with CHARMM, we then use the command

make chgmin

Cross your fingers! At present, there are some problems compiling with CHARMM and you'll see some linking errors at the end of the compilation like this:

/usr/bin/ld: Warning: alignment 16 of symbol `nmr_' in /home/csw34/GMIN/CHARMM31/lib/gnu/minmiz.a(tnpack.o) is smaller than 32 in commons.o

Don't worry about this! They are the result of a naming clash between AMBER and CHARMM and will be resolved soon :) Unless you see any other errors, congratulations! You should now have a CGMIN executable in the GMIN/bin directory! Go test it!