{"id":665,"date":"2009-07-08T01:34:18","date_gmt":"2009-07-08T05:34:18","guid":{"rendered":"http:\/\/timony.com\/mickzblog\/?p=665"},"modified":"2009-07-08T01:34:18","modified_gmt":"2009-07-08T05:34:18","slug":"compiling-eigensoft-on-ubuntu-januty","status":"publish","type":"post","link":"http:\/\/timony.com\/mickzblog\/2009\/07\/08\/compiling-eigensoft-on-ubuntu-januty\/","title":{"rendered":"Compiling EIGENSOFT on Ubuntu Januty"},"content":{"rendered":"<p>These are rough notes on how to compile <a href=\"http:\/\/genepath.med.harvard.edu\/~reich\/Software.htm\">Eigensoft 3<\/a> on Ubuntu Jaunty.<\/p>\n<p><strong>Update<\/strong>, <em>Eigensoft 4 is available and should compile on more recent versions of Ubuntu:<\/em><br \/>\n<a href=\"http:\/\/www.hsph.harvard.edu\/faculty\/alkes-price\/software\/\">http:\/\/www.hsph.harvard.edu\/faculty\/alkes-price\/software\/<\/a><\/p>\n<p><strong>Create a location to build the code:<\/strong><\/p>\n<p><em>Warning:<\/em> \/tmp is for temporary files, and any files &amp; directories you create there will be remove upon some subsequent reboot.<\/p>\n<pre>cd \/tmp;<\/pre>\n<pre>mkdir EIGEN;<\/pre>\n<pre>cd\u00a0 EIGEN;<\/pre>\n<p><strong>Get the Eigensoft source code:<\/strong><\/p>\n<pre>wget\u00a0 http:\/\/www.hsph.harvard.edu\/faculty\/alkes-price\/files\/EIG3.0.tar.gz;<\/pre>\n<pre>tar xzvf EIG3.0.tar.gz;<\/pre>\n<p><strong>Install required dependences:<!--more--><\/strong><\/p>\n<pre>sudo apt-get install f2c libg2c0 libatlas-base-dev liblapack-dev;<\/pre>\n<p>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&#8217;m wrong, it&#8217;s late at night and I could be mistaken):<\/p>\n<pre>sudo ln -s \/usr\/lib\/libg2c.so.0 \/usr\/lib\/libg2c.so;<\/pre>\n<p><strong>Build the code:<\/strong><\/p>\n<pre>cd \/tmp\/EIGEN;<\/pre>\n<pre>cd src;<\/pre>\n<p><strong>Create a backup copy of the Makefile:<\/strong><\/p>\n<pre>cp Makefile\u00a0 Makefile.org;<\/pre>\n<p><strong>Edit the Makefile:<\/strong><\/p>\n<pre>emacs -nw Makefile;<\/pre>\n<p><em>Change this line (line 24):<\/em><\/p>\n<p>FF=g77<\/p>\n<p>To read as:<\/p>\n<p>FF=&#8221;gfortran -std-legacy&#8221;<\/p>\n<p>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.<\/p>\n<p><strong>Run make:<\/strong><\/p>\n<pre>make eigenstrat;<\/pre>\n<p>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&#8217;s left over from when the author was testing his code. Also, running &#8220;make clean&#8221; does not remove the binaries in the bin directory, but does remove those build in the src directory.<\/p>\n<pre>make install;<\/pre>\n<p>And that should be it run the example.perl in the EIGENSTRAT directory and you should see output like this:<\/p>\n<p style=\"padding-left: 30px;\"><em>.\/example.perl<br \/>\nsmartpca.perl -i example.geno\u00a0 -a example.snp\u00a0 -b example.ind\u00a0 -k 2\u00a0 -o example.pca\u00a0 -p example.plot\u00a0 -e example.eval\u00a0 -l example.log\u00a0 -m 5\u00a0 -t 2\u00a0 -s 6.0<br \/>\nsmartpca -p example.pca.par &gt;example.log<br \/>\nploteig -i example.pca.evec -c 1:2\u00a0 -p Case:Control\u00a0 -x\u00a0 -y\u00a0 -o example.plot.xtxt<br \/>\nevec2pca.perl 2 example.pca.evec example.ind example.pca<br \/>\nsmarteigenstrat.perl\u00a0 -i example.geno\u00a0 -a example.snp\u00a0 -b example.ind\u00a0 -p example.pca\u00a0 -k 1\u00a0 -o example.chisq\u00a0 -l example.log<br \/>\nsmarteigenstrat -p example.chisq.par &gt;example.loggc.perl example.chisq example.chisq.GC<\/em><\/p>\n<p>If you run into problems running and compiling the code, the README suggests running the following:<\/p>\n<pre>make pcatoy;<\/pre>\n<p>And, as per the README, contact your sys admin if it doesn&#8217;t work. \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These are rough notes on how to compile Eigensoft 3 on Ubuntu Jaunty. Update, Eigensoft 4 is available and should compile on more recent versions of Ubuntu: http:\/\/www.hsph.harvard.edu\/faculty\/alkes-price\/software\/ Create a location to build the code: Warning: \/tmp is for temporary files, and any files &amp; directories you create there will be remove upon some subsequent &hellip; <a href=\"http:\/\/timony.com\/mickzblog\/2009\/07\/08\/compiling-eigensoft-on-ubuntu-januty\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Compiling EIGENSOFT on Ubuntu Januty<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[48,56,22,33,41],"tags":[146,163,227,228,239,269,402],"class_list":["post-665","post","type-post","status-publish","format-standard","hentry","category-c","category-fortran","category-linux","category-programming","category-ubuntu-linux-2","tag-c","tag-chemical-computing","tag-eigensoft","tag-eigenstrat","tag-example-perl","tag-fortran","tag-make"],"_links":{"self":[{"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts\/665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/comments?post=665"}],"version-history":[{"count":0,"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts\/665\/revisions"}],"wp:attachment":[{"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/media?parent=665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/categories?post=665"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/tags?post=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}