Custom building Coot from source code: Difference between revisions

From CCP4 wiki
Jump to navigation Jump to search
(merged into first section)
(Undo revision 1930 by Mok (talk))
(25 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is an advanced task. Don't attempt it unless you are a Unix expert. The normal method installing Coot is to download a binary, or to use the autobuild scripts: [[Coot]].
Return to [[coot]]


====Install gpp4 and other dependencies on Linux.====
These instructions are current as of coot release 0.5.
 
The following is specific to Ubuntu linux, but should be generalizable to any recent linux distribution.
 
'''This is a so-called "advanced" task. Don't attempt it unless you would rather compile your own software than use pre-compiled versions. The standard (supported) method for installing Coot is to [[Coot#Installation_from_a_distributed_binary_tarball_package |download a pre-compiled binary]], or to use [[Coot#Installation_from_source_code_via_autobuild_scripts |the autobuild scripts]].'''
 
==Installing pre-compiled Coot binaries==
 
===Avoiding manual installation===
 
This page describes full manual installation, for those who want (or need) to do it.  It is not necessary on most systems. For autobuild and for installation of precompiled Coot binaries, see [[Coot#Installing_Coot | Installing Coot]]
 
===Debian packages for Coot and its Dependencies===
 
Please be aware that everything compiled below has been archived as [[Coot#Instalation_on_Debian.2FUbuntu_from_debian_archive_files | Debian archive files]] that you can easily install.
 
==Install gpp4 and other dependencies on Linux.==


Instead of using ccp4-onlylibs-dev, we want to use ssm, mmdb, gpp4 and clipper packages.     
Instead of using ccp4-onlylibs-dev, we want to use ssm, mmdb, gpp4 and clipper packages.     
Line 9: Line 25:
Install these in the order described:
Install these in the order described:


=====mmdb=====
===mmdb===
  wget http://www.ebi.ac.uk/~keb/cldoc/downloads/mmdb-1.19.tar.gz
  wget http://www.ebi.ac.uk/~keb/cldoc/downloads/mmdb-1.19.tar.gz
  ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
  ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
Line 15: Line 31:
  make install
  make install


=====ssm=====
===ssm===
  wget ftp://ftp.bioxray.au.dk/pub/mok/src/ssm-0.1.tar.gz
  wget ftp://ftp.bioxray.au.dk/pub/mok/src/ssm-0.1.tar.gz
  CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
  CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
Line 21: Line 37:
  make install
  make install


=====gpp4=====
===gpp4===
  wget ftp://ftp.bioxray.au.dk/pub/mok/src/gpp4-1.0.4.tar.gz
  wget http://launchpad.net/gpp4/1.3/1.3.1/+download/gpp4-1.3.1.tar.gz
  CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
  CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
  make
  make
  make install
  make install


=====fftw=====
===fftw===
We need to compile fftw in a way that differs from that used to make the standard linux distribution of fftw. So to do that, we will install our own in /usr/local/xtal/lib, so it will remain hidden from the rest of the system, unless directed to look for it there.
We need to compile fftw in a way that differs from that used to make the standard linux distribution of fftw. So to do that, we will install our own in /usr/local/xtal/lib, so it will remain hidden from the rest of the system, unless directed to look for it there.
  ftp://ftp.fftw.org/pub/fftw/old/fftw-2.1.5.tar.gz
  ftp://ftp.fftw.org/pub/fftw/old/fftw-2.1.5.tar.gz
Line 34: Line 50:
  make install
  make install


=====clipper=====
===clipper===
  wget http://www.ysbl.york.ac.uk/~cowtan/clipper/clipper20ac.latest.tar.gz
  wget http://www.ysbl.york.ac.uk/~cowtan/clipper/clipper20ac.latest.tar.gz
  CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include -enable-shared --with-gpp4=/usr/local/xtal --with-mmdb=/usr/local/xtal --with-fftw=/usr/local/xtal --enable-mmdb --enable-minimol --enable-cif --enable-cns --enable-gpp4
  CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include -enable-shared --with-gpp4=/usr/local/xtal --with-mmdb=/usr/local/xtal --with-fftw=/usr/local/xtal --enable-mmdb --enable-minimol --enable-cif --enable-cns --enable-gpp4
Line 40: Line 56:
  make install
  make install


=====guile-lib=====
Yet another little guile fragment that is not distributed (well actually there is a very old one that works with guile1.4 — we need this for guile1.8)
wget http://download.gna.org/guile-lib/guile-lib-0.1.6.tar.gz./configure --prefix=/usr
make
make install




Note that if the primary server for the source code is down, you can often find what you need mirrored elsewhere, eg:
http://distfiles.msn.wi.us.finkmirrors.net/mirrors/fink/distfiles


====Third, make sure the other needed dependencies are installed====
==Make sure the other needed dependencies are installed==


These include at least the following dependencies:
These include at least the following dependencies:


=====Ubuntu packages=====
===Ubuntu packages===


A [[list of coot dependencies]] that is probably only a subset
A [[list of coot dependencies]] that is probably only a subset


=====Others that you have to make yourself: =====
===Others that you have to make yourself: ===
[http://download.gna.org/guile-lib guile-lib] (I had to compile this myself as described below)


[http://arglist.com/guile/goosh-1.3/ goosh] (I had to compile this myself)
[http://arglist.com/guile/goosh-1.3/ goosh] (I had to compile this myself)
Line 66: Line 81:
[http://www.ysbl.york.ac.uk/~emsley/software/extras/net-http-0.3.1.tar.gz net-htttp] (I had to compile this myself)
[http://www.ysbl.york.ac.uk/~emsley/software/extras/net-http-0.3.1.tar.gz net-htttp] (I had to compile this myself)


To compile these, use the commands
 
 
To do so, I used


  configure --prefix=/usr
  configure --prefix=/usr
Line 75: Line 87:
  sudo make install
  sudo make install


   
This puts stuff into /usr, rather than /usr/local or /usr/local/xtal, which you might not want to do. The aim is to eventually get these into the standard system distribution, in which case they will reside in /usr with the other guile extensions. All of these should work with guile-1.8.
====Fourth, configure and build coot like this:====


Use sudo zsh (or whatever shell) to open a root shell, and issue the commands
==Configuring and building coot ==


===Start a root shell session===
If root is enabled, log into a root shell, or else if you have sudo (debian, ubuntu, etc), use the command
sudo zsh
(or whatever shell) to open a root shell, and issue the following commands as indicated.
===Fix a configure bug===
First, issue the following command to fix a configure bug when compiling with gpp4:
perl -pi -e 's|lccp4c|lgpp4|g' configure
===Now configure this way: ===
<pre>
PATH="/usr/local/xtal/bin:$PATH" \
CPPFLAGS="-I/usr/local/xtal/include -I/usr/local/xtal/include/clipper -I/usr/local/xtal/include/gpp4 -I/usr/local/xtal/include/mmdb -I/usr/local/xtal/include/ssm" \
./configure --prefix=$PWD \
--with-gpp4=/usr/local/xtal \
--with-mmdb-prefix=/usr/local/xtal \
--with-ssmlib-prefix=/usr/local/xtal \
--with-clipper-prefix=/usr/local/xtal \
--with-fftw=/usr/local/xtal \
--with-glut-prefix=/usr --with-gl-prefix=/usr/X11R6 \
--with-gtk2 --with-gnomecanvas-prefix=/usr \
--with-imlib-prefix=/usr --with-gtkgl-prefix=/usr \
--with-glib-prefix=/usr --with-guile-gtk \
--with-guile-gtk-prefix=/usr --with-gsl-prefix=/usr \
--with-guile --with-python
</pre>
===Then, remake the  src/coot_wrap_python.cc and src/coot_wrap_guile.cc files: ===


CPPFLAGS="-I$CLIB/src -I$CLIB/src/mmdb" ./configure --with-mmdb-prefix=$CCP4 --with-clipper-prefix=/usr/local/xtal \
--with-fftw=$CCP4 --with-glut-prefix=/usr --with-gl-prefix=/usr/X11R6 --with-gtk2 --with-gnomecanvas-prefix=/usr \
--with-ssmlib-prefix=$CCP4 --with-imlib-prefix=/usr --with-gtkgl-prefix=/usr --with-glib-prefix=/usr --with-guile-gtk \
--with-guile-gtk-prefix=/usr  --with-gsl-prefix=/usr --with-guile --with-python --prefix=$PWD
Remake the  src/coot_wrap_python.cc and src/coot_wrap_guile.cc files
  /bin/rm -f **/coot_wrap_**.cc
  /bin/rm -f **/coot_wrap_**.cc
  cd src
  cd src
Line 95: Line 135:
  cd ..
  cd ..


Now compile it:
===Now compile coot:===
  make  
  make  
  make -i install
  make -i install
===To make it play nice with python, I have had to do the following: ===
perl -pi -e 's|PYTHONHOME=\$COOT_PREFIX|\#PYTHONHOME=\$COOT_PREFIX|g' bin/coot
  cp src/coot.py python/.
  cp src/coot.py python/.
  cp src/coot.py share/coot/python/.
  cp src/coot.py share/coot/python/.
 
Now add the reference structures:
===Now add the reference structures: ===
  cd share/coot
  cd share/coot
  wget http://www.ysbl.york.ac.uk/~emsley/software/coot-reference-structures.tar.gz
  wget http://www.ysbl.york.ac.uk/~emsley/software/coot-reference-structures.tar.gz
  tar xvfz coot-reference-structures.tar.gz ; rm coot-reference-structures.tar.gz
  tar xvfz coot-reference-structures.tar.gz ; rm coot-reference-structures.tar.gz


Now add the refmac dictionaries (eg using coot-0.4.1 and refmac 5.4; change as required):
=== Now add the refmac dictionaries===
(eg using coot-0.5 and refmac 5.4; change as required):
 
  cd /tmp
  cd /tmp
wget wget http://www.ysbl.york.ac.uk/refmac/data/refmac5.4_dictionary.tar.gz
  wget http://www.ysbl.york.ac.uk/refmac/data/refmac_dictionary.tar.gz
  tar xvfz refmac5.4_dictionary.tar.gz
  tar xvfz refmac_dictionary.tar.gz
  mkdir -p  /usr/local/xtal/coot-0.4.1/lib/data
  mkdir -p  /usr/local/xtal/coot-0.5.2/lib/data
  cp -r dic /usr/local/xtal/coot-0.4.1/lib/data/monomers
  cp -r dic /usr/local/xtal/coot-0.5.2/lib/data/monomers


Export the COOT_REFMAC_LIB_DIR variable (you can edit bin/coot):
===Export the COOT_REFMAC_LIB_DIR variable ===
(you can edit bin/coot):  
   export COOT_REFMAC_LIB_DIR=$COOT_PREFIX/lib
   export COOT_REFMAC_LIB_DIR=$COOT_PREFIX/lib


===Notes on the above: ===
The configure command is all one line; I've escaped the return. Using --prefix=$PWD simply keeps everything self-contained.  You can use any install prefix you want to (it defaults to /usr/local; another sensible choice is /usr/local/xtal.  Avoid /usr as a prefix, as it can mess with your system).
The configure command is all one line; I've escaped the return. Using --prefix=$PWD simply keeps everything self-contained.  You can use any install prefix you want to (it defaults to /usr/local; another sensible choice is /usr/local/xtal.  Avoid /usr as a prefix, as it can mess with your system).


The make -i install is needed if you choose --prefix=$PWD because it tries to install some files where they are presently situated.
The''' make -i install''' is needed if you choose --prefix=$PWD because it tries to install some files where they are presently situated.


----
----


====If you want to make it portable====
==If you want to make it more portable==


You don't need to do this to run coot; this is only handy if you need to redistribute it (or make say a debian package).
You don't need to do this to run coot; this is only handy if you need to redistribute it (or make say a debian package).
Line 141: Line 188:


<pre>
<pre>
  cd /usr/local/xtal/coot-0.1.2/bin
  cd /usr/local/xtal/coot/bin
  foreach dylib in $(ldd coot-real | awk '{print $3}' | grep -v fff | grep -v "usr/local/xtal/coot" | sort -u )
  foreach dylib in $(ldd coot-real | awk '{print $3}' | grep -v fff | grep -v "usr/local/xtal/coot" | sort -u )
       print copying $dylib  
       print copying $dylib  
       sudo cp -i $dylib /usr/local/xtal/coot-0.1.2/lib/.
       sudo cp -i $dylib /usr/local/xtal/coot/lib/.
  end
  end
</pre>
</pre>
Line 150: Line 197:
In addition, the guile modules can all be put in one centralized location:
In addition, the guile modules can all be put in one centralized location:


  cp -R /usr/share/guile* /usr/local/xtal/coot-0.1.2/share/.
  cp -R /usr/share/guile* /usr/local/xtal/coot/share/.
 


Finally, you can give coot its own copy of the refmac monomers library:


mkdir -p /usr/local/xtal/coot-0.1.2/share/coot/lib/data
cp -R /usr/local/xtal/ccp4-6.0/lib/data/monomers /usr/local/xtal/coot-0.1.0-pre-3/share/coot/lib/data/.


Then edit /usr/local/xtal/coot-0.1.2/bin/coot and un-comment the appropriate environment variable lines (there are 2).
Return to [[coot]]

Revision as of 23:48, 27 February 2011

Return to coot

These instructions are current as of coot release 0.5.

The following is specific to Ubuntu linux, but should be generalizable to any recent linux distribution.

This is a so-called "advanced" task. Don't attempt it unless you would rather compile your own software than use pre-compiled versions. The standard (supported) method for installing Coot is to download a pre-compiled binary, or to use the autobuild scripts.

Installing pre-compiled Coot binaries

Avoiding manual installation

This page describes full manual installation, for those who want (or need) to do it. It is not necessary on most systems. For autobuild and for installation of precompiled Coot binaries, see Installing Coot

Debian packages for Coot and its Dependencies

Please be aware that everything compiled below has been archived as Debian archive files that you can easily install.

Install gpp4 and other dependencies on Linux.

Instead of using ccp4-onlylibs-dev, we want to use ssm, mmdb, gpp4 and clipper packages.

To keep things tidy, I suggest installing everything into /usr/local/xtal

Install these in the order described:

mmdb

wget http://www.ebi.ac.uk/~keb/cldoc/downloads/mmdb-1.19.tar.gz
./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
make
make install

ssm

wget ftp://ftp.bioxray.au.dk/pub/mok/src/ssm-0.1.tar.gz
CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
make
make install

gpp4

wget http://launchpad.net/gpp4/1.3/1.3.1/+download/gpp4-1.3.1.tar.gz
CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include
make
make install

fftw

We need to compile fftw in a way that differs from that used to make the standard linux distribution of fftw. So to do that, we will install our own in /usr/local/xtal/lib, so it will remain hidden from the rest of the system, unless directed to look for it there.

ftp://ftp.fftw.org/pub/fftw/old/fftw-2.1.5.tar.gz
CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include --enable-float
make
make install

clipper

wget http://www.ysbl.york.ac.uk/~cowtan/clipper/clipper20ac.latest.tar.gz
CPPFLAGS=-I/usr/local/xtal/include ./configure --prefix=/usr/local/xtal --includedir=/usr/local/xtal/include -enable-shared --with-gpp4=/usr/local/xtal --with-mmdb=/usr/local/xtal --with-fftw=/usr/local/xtal --enable-mmdb --enable-minimol --enable-cif --enable-cns --enable-gpp4
make
make install


Note that if the primary server for the source code is down, you can often find what you need mirrored elsewhere, eg:

http://distfiles.msn.wi.us.finkmirrors.net/mirrors/fink/distfiles

Make sure the other needed dependencies are installed

These include at least the following dependencies:

Ubuntu packages

A list of coot dependencies that is probably only a subset

Others that you have to make yourself:

guile-lib (I had to compile this myself as described below)

goosh (I had to compile this myself)

guile-gui (I had to compile this myself)

guile-gtk-2.0 (I had to compile this myself)

net-htttp (I had to compile this myself)

To compile these, use the commands

configure --prefix=/usr
make
sudo make install

This puts stuff into /usr, rather than /usr/local or /usr/local/xtal, which you might not want to do. The aim is to eventually get these into the standard system distribution, in which case they will reside in /usr with the other guile extensions. All of these should work with guile-1.8.

Configuring and building coot

Start a root shell session

If root is enabled, log into a root shell, or else if you have sudo (debian, ubuntu, etc), use the command

sudo zsh 

(or whatever shell) to open a root shell, and issue the following commands as indicated.


Fix a configure bug

First, issue the following command to fix a configure bug when compiling with gpp4:

perl -pi -e 's|lccp4c|lgpp4|g' configure 

Now configure this way:

PATH="/usr/local/xtal/bin:$PATH" \
CPPFLAGS="-I/usr/local/xtal/include -I/usr/local/xtal/include/clipper -I/usr/local/xtal/include/gpp4 -I/usr/local/xtal/include/mmdb -I/usr/local/xtal/include/ssm" \
./configure --prefix=$PWD \
--with-gpp4=/usr/local/xtal \
--with-mmdb-prefix=/usr/local/xtal \
--with-ssmlib-prefix=/usr/local/xtal \
--with-clipper-prefix=/usr/local/xtal \
--with-fftw=/usr/local/xtal \
--with-glut-prefix=/usr --with-gl-prefix=/usr/X11R6 \
--with-gtk2 --with-gnomecanvas-prefix=/usr \
--with-imlib-prefix=/usr --with-gtkgl-prefix=/usr \
--with-glib-prefix=/usr --with-guile-gtk \
--with-guile-gtk-prefix=/usr --with-gsl-prefix=/usr \
--with-guile --with-python

Then, remake the src/coot_wrap_python.cc and src/coot_wrap_guile.cc files:

/bin/rm -f **/coot_wrap_**.cc
cd src
touch c-interface-database.hh
make coot_wrap_guile.cc
make coot_wrap_python.cc
cp coot_wrap_guile_pre.cc coot_wrap_guile.cc
cd ..

Now compile coot:

make 
make -i install

To make it play nice with python, I have had to do the following:

perl -pi -e 's|PYTHONHOME=\$COOT_PREFIX|\#PYTHONHOME=\$COOT_PREFIX|g' bin/coot
cp src/coot.py python/.
cp src/coot.py share/coot/python/.

Now add the reference structures:

cd share/coot
wget http://www.ysbl.york.ac.uk/~emsley/software/coot-reference-structures.tar.gz
tar xvfz coot-reference-structures.tar.gz ; rm coot-reference-structures.tar.gz

Now add the refmac dictionaries

(eg using coot-0.5 and refmac 5.4; change as required):

cd /tmp
wget http://www.ysbl.york.ac.uk/refmac/data/refmac_dictionary.tar.gz
tar xvfz refmac_dictionary.tar.gz
mkdir -p  /usr/local/xtal/coot-0.5.2/lib/data
cp -r dic /usr/local/xtal/coot-0.5.2/lib/data/monomers

Export the COOT_REFMAC_LIB_DIR variable

(you can edit bin/coot):

 export COOT_REFMAC_LIB_DIR=$COOT_PREFIX/lib

Notes on the above:

The configure command is all one line; I've escaped the return. Using --prefix=$PWD simply keeps everything self-contained. You can use any install prefix you want to (it defaults to /usr/local; another sensible choice is /usr/local/xtal. Avoid /usr as a prefix, as it can mess with your system).

The make -i install is needed if you choose --prefix=$PWD because it tries to install some files where they are presently situated.


If you want to make it more portable

You don't need to do this to run coot; this is only handy if you need to redistribute it (or make say a debian package).

You can see what dynamic libraries coot needs to load by issuing the command


ldd coot-real 

or, if you just want to see the full path to the libraries, issue

ldd coot-real | awk '{print $3}' | grep -v fff | sort -u

You can use additional grep filters to select the ccp4 libs, clipper libs, eliminate coot's own libaries (that are already in the lib directory) and so forth.


(The ldd command is equivalent to otool -L on Mac OS X.) Then you can copy these into coot's lib directory. I used the following commands in zsh to copy in the needed directories (this is overkill, but wtf).

 cd /usr/local/xtal/coot/bin
 foreach dylib in $(ldd coot-real | awk '{print $3}' | grep -v fff | grep -v "usr/local/xtal/coot" | sort -u )
      print copying $dylib 
      sudo cp -i $dylib /usr/local/xtal/coot/lib/.
 end

In addition, the guile modules can all be put in one centralized location:

cp -R /usr/share/guile* /usr/local/xtal/coot/share/.



Return to coot