These are rough notes on how to compile Eigensoft on Ubuntu Jaunty.

Create a location to build the code:

Warning: /tmp is for temporary files, and any files & directories you create there will be remove upon some subsequent reboot.

cd /tmp;
mkdir EIGEN;
cd  EIGEN;

Get the Eigensoft source code:

wget  http://www.hsph.harvard.edu/faculty/alkes-price/files/EIG3.0.tar.gz;
tar xzvf EIG3.0.tar.gz;

Install required dependences:

sudo apt-get install f2c libg2c0 libatlas-base-dev liblapack-dev;

This symbolic link is needed as the Makefile links looks for the static version of the library and not the shared version (correct me if I’m wrong, it’s late at night and I could be mistaken):

sudo ln -s /usr/lib/libg2c.so.0 /usr/lib/libg2c.so;

Build the code:

cd /tmp/EIGEN;
cd src;

Create a backup copy of the Makefile:

cp Makefile  Makefile.org;

Edit the Makefile:

emacs -nw Makefile;

Change this line (line 24):

FF=g77

To read as:

FF=”gfortran -std-legacy”

This is needed as the g77 fortran compiler is not longer included with Ubuntu, but you can use the gfortan compiler instead, but you must run it in legacy mode.

Run make:

make eigenstrat;

This next step is essential, because binaries are included in the bin directory that appear to have been build against a 64-bit kernel and are probably artefact’s left over from when the author was testing his code. Also, running “make clean” does not remove the binaries in the bin directory, but does remove those build in the src directory.

make install;

And that should be it run the example.perl in the EIGENSTRAT directory and you should see output like this:

./example.perl
smartpca.perl -i example.geno  -a example.snp  -b example.ind  -k 2  -o example.pca  -p example.plot  -e example.eval  -l example.log  -m 5  -t 2  -s 6.0
smartpca -p example.pca.par >example.log
ploteig -i example.pca.evec -c 1:2  -p Case:Control  -x  -y  -o example.plot.xtxt
evec2pca.perl 2 example.pca.evec example.ind example.pca
smarteigenstrat.perl  -i example.geno  -a example.snp  -b example.ind  -p example.pca  -k 1  -o example.chisq  -l example.log
smarteigenstrat -p example.chisq.par >example.loggc.perl example.chisq example.chisq.GC

If you run into problems running and compiling the code, the README suggests running the following:

make pcatoy;

And, as per the README, contact your sys admin if it doesn’t work. ;)


13 Responses to “Compiling EIGENSOFT on Ubuntu Januty”  

  1. 1 gioby

    Nice tutorial, I would suggest to use make -B eigenstrat so make will recompile all the dependencies and ignore the old files left by the developer, and make -B pcatoy.

  2. 2 gioby

    By the way, I was able to build everything by using FF=”gfortran” and typing make -B install.
    When I have tried with the -std-legacy flag for the fortran compiler, I have got some errors, saying that my current gfortran version didn’t recognize such a flag.

    Ubuntu 9.04 with gfortran 4.3.3

  3. 3 Mick

    Thanks for the comments and suggestion Gioby. I’m glad you found this helpful. I’ll try and test on my Ubuntu 9.10 box and see if it behave the same (my original posting was on 9.04).

    Mick

  4. 4 Peter

    Well, i tried this as well, but i got no plot… Dont know why?
    Are there special libraries necessary for the plot?
    Thanks in advance
    Peter

  5. 5 Tiger

    Very useful guide, Mick, it was such a relief to see your post and hence get the program running on my laptop. I agree with gioby that FF = “gfortran” works fine but not the other way around.

  6. 6 Mick

    Peter, what version of Ubuntu (or other Linux disto) are you using?

    Recently I upgraded to Ubuntu 9.10 (Karmic) and it doesn’t have the libg2c0 and related libraries. This appears to because it was part of gcc3.x and gcc4 (which Karmic uses) uses gfortran instead. It looks like to use Eigensoft one will have to stick with an older distro, or install the libg2c0 and gcc3 from Ubuntu Jaunty.

    Anyone know if the Eigensoft author plans to move to gcc 4?

  7. 7 ross lazarus

    > anyone know if the Eigensoft author plans to move to gcc 4?

    I doubt that there are any plans – it’s legacy code – once published, not much pressure to maintain it. One of the many joys of pressure to publish vs benefits to your academic career of the hard yards of maintenance (which is usually zero). I’m a Galaxy developer for the record :)

    For doing ancestry PCA, there’s an interesting if quirky alternative called shellfish at http://www.stats.ox.ac.uk/~davison/software/shellfish/shellfish.php
    The error message at the end of that page is an ominous sign…but that seems to be what they’re using at the Welcome trust?

    At least it seems a little more up-to-date than eigensoft3 and the author does respond to email…

  8. 8 Peter

    Awesome tutorial, Mick!

  9. 9 Mick

    Cool! Thanks Peter. :)

  10. 10 Emily

    Thank you Mick for your helpful tutorial.
    I keep running into the same issue however, a segmentation fault when I try to “make eigenstrat” or “make pcatoy”

    The error is:
    collect2: ld terminated with signal 11 [Segmentation fault]
    /usr/bin/ld: i386:x86-64 architecture of input file `eigenstrat.o’ is incompatible with i386 output

    My naive understanding is that this is due to incompatibilities with a 64 bit OS.
    Do you have any suggestions?

    Thank you again.

  11. 11 Mick

    Try running “make clean”.

  12. 12 Emily

    Thank you so much! You have prevented my smashing an otherwise valuable computer.

  13. 13 Mick

    Hi Emily,

    I think what happened it that the zip file comes with precompiled binaries for 64-bit Linux. U have to run “make clean” to remove, then recompile.

    Cheers
    Mick

Leave a Reply


Powered by WP Hashcash


Lily FlowerLoons on LakeSummer rain storm on Canada LakeSummer RainDead Wood & FlowersLily Pacmen

Recently Played Tunes

Could not create images.

Google Search

Google

Categories