{"id":397,"date":"2009-08-07T16:42:43","date_gmt":"2009-08-07T14:42:43","guid":{"rendered":"http:\/\/blog.louic.nl\/?p=397"},"modified":"2015-08-12T08:53:35","modified_gmt":"2015-08-12T06:53:35","slug":"compiling-and-installing-molmol-under-linux","status":"publish","type":"post","link":"https:\/\/blog.louic.nl\/?p=397","title":{"rendered":"Compiling and installing MolMol under Linux"},"content":{"rendered":"<p>The molmol software that is available from the website of <a href=\"http:\/\/www.mol.biol.ethz.ch\/groups\/wuthrich_group\/software\">ETH Zurich<\/a> does not compile on Ubuntu Linux without some changes. It seems that it is no longer supported by ETH Zurich, but can be downloaded from several other websites (just google it). I describe below what I needed to do to get it to compile and run on Ubuntu Linux.<\/p>\n<p>A summary of the installation procedure as described in the readme file follows for reference, but it does not seem to work without the changes mentioned below:<\/p>\n<pre lang=\"bash\">\r\ntar xvzf molmol-2k.2.0-doc.tar.gz\r\ntar xfzf molmol-2k.2.0-src.tar.gz\r\n\r\ncd tiff-v3.4\r\n.\/configure\r\nmake\r\nsudo make install\r\ncd ..\r\n\r\ncp makedef.lnx makedef\r\n.\/INSTALL\r\nmake\r\nsed -i 's\/ksh\/sh\/g' molmol \r\ncd src\/main\r\nstrip molmol\r\ncp molmol ..\/..\/molmol.lnx\r\ncd ..\/..\r\n\r\n.\/molmol\r\n<\/pre>\n<p>First, some additional packages are needed in Ubuntu:<\/p>\n<pre lang=\"bash\">\r\nsudo apt-get install libmotif-dev x11proto-print-dev libxpm-dev libxt-dev\r\n<\/pre>\n<p>(depending on your current ubuntu installation, you may need some other packages as well. Some error messages during the installation may give you an indication of what else is needed.)<\/p>\n<p>However, when I tried to compile molmol, the following error occured:<\/p>\n<pre lang=\"text\">\r\n\/usr\/bin\/gcc -I..\/..\/tools\/include -Dsqrtf=sqrt -Dexpf=exp -Dlogf=log -Dpowf=pow -Dsinf=sin -Dcosf=cos -Dtanf=tan -Dasinf=asin -Dacosf=acos -Datanf=atan -Datan2f=atan2 -Dfabsf=fabs -Dceilf=ceil -O2 -I..\/..\/tools\/include -Dsqrtf=sqrt -Dexpf=exp -Dlogf=log -Dpowf=pow -Dsinf=sin -Dcosf=cos -Dtanf=tan -Dasinf=asin -Dacosf=acos -Datanf=atan -Datan2f=atan2 -Dfabsf=fabs -Dceilf=ceil  -c -o RandNum.o RandNum.c\r\nIn file included from \/usr\/include\/math.h:94,\r\n                 from RandNum.c:29:\r\n\/usr\/include\/bits\/mathcalls.h:55: error: conflicting types for \u2018acos\u2019\r\n\/usr\/include\/bits\/mathcalls.h:57: error: conflicting types for \u2018asin\u2019\r\n\/usr\/include\/bits\/mathcalls.h:59: error: conflicting types for \u2018atan\u2019\r\n\/usr\/include\/bits\/mathcalls.h:61: error: conflicting types for \u2018atan2\u2019\r\n\/usr\/include\/bits\/mathcalls.h:64: error: conflicting types for \u2018cos\u2019\r\n\/usr\/include\/bits\/mathcalls.h:66: error: conflicting types for \u2018sin\u2019\r\n\/usr\/include\/bits\/mathcalls.h:68: error: conflicting types for \u2018tan\u2019\r\n\/usr\/include\/bits\/mathcalls.h:101: error: conflicting types for \u2018exp\u2019\r\n\/usr\/include\/bits\/mathcalls.h:110: error: conflicting types for \u2018log\u2019\r\n\/usr\/include\/bits\/mathcalls.h:154: error: conflicting types for \u2018pow\u2019\r\n\/usr\/include\/bits\/mathcalls.h:157: error: conflicting types for \u2018sqrt\u2019\r\n\/usr\/include\/bits\/mathcalls.h:179: error: conflicting types for \u2018ceil\u2019\r\n\/usr\/include\/bits\/mathcalls.h:182: error: conflicting types for \u2018fabs\u2019\r\nmake[4]: *** [RandNum.o] Error 1\r\n<\/pre>\n<p>This was easily solved by editing the makedef file as follows:<\/p>\n<p>change<\/p>\n<pre lang=\"text\">\r\nMISSFUNC = -Dsqrtf=sqrt -Dexpf=exp -Dlogf=log -Dpowf=pow \\\r\n           -Dsinf=sin -Dcosf=cos -Dtanf=tan \\\r\n           -Dasinf=asin -Dacosf=acos -Datanf=atan -Datan2f=atan2 \\\r\n           -Dfabsf=fabs -Dceilf=ceil\r\n<\/pre>\n<p>to <\/p>\n<pre lang=\"text\">\r\n# MISSFUNC = -Dsqrtf=sqrt -Dexpf=exp -Dlogf=log -Dpowf=pow \\\r\n#         -Dsinf=sin -Dcosf=cos -Dtanf=tan \\\r\n#         -Dasinf=asin -Dacosf=acos -Datanf=atan -Datan2f=atan2 \\\r\n#         -Dfabsf=fabs -Dceilf=ceil\r\n<\/pre>\n<p>At this point, I got a second error<\/p>\n<pre lang=\"text\">\r\n\/usr\/bin\/sleep 2\r\nmake[6]: \/usr\/bin\/sleep: Command not found\r\n<\/pre>\n<p>This one is even easier to solve, by again editing makedef:<\/p>\n<p>change<\/p>\n<pre lang=\"bash\">\r\nWAIT   = \/usr\/bin\/sleep 2\r\n<\/pre>\n<p>to<\/p>\n<pre lang=\"bash\">\r\nWAIT   = \/bin\/sleep 2\r\n<\/pre>\n<p>Another error occurs that requires us to make some changes in the source code. The error message is:<\/p>\n<pre lang=\"text\">\r\n\/usr\/bin\/gcc -o molmol -I..\/..\/tools\/include -I..\/..\/sg\/include -I..\/..\/include  -O2 MolMol.o MolInit.o ..\/..\/lib\/libcip.a ..\/..\/lib\/libcmd.a ..\/..\/lib\/libui.a ..\/..\/lib\/libgraph.a ..\/..\/lib\/libio.a ..\/..\/lib\/libpu.a ..\/..\/lib\/libcalc.a ..\/..\/lib\/libprim.a ..\/..\/lib\/libdata.a ..\/..\/lib\/libattr.a ..\/..\/lib\/libfileio.a ..\/..\/lib\/libos.a ..\/..\/sg\/lib\/libsg.a ..\/..\/tools\/lib\/libtools.a  -L\/usr\/X11R6\/lib -lXm -lXt -lX11 -lm -lc -lieee\r\n..\/..\/lib\/libos.a(GFile.o): In function `raiseError':\r\nGFile.c:(.text+0x37): warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead\r\n\/usr\/bin\/ld: errno: TLS definition in \/lib\/libc.so.6 section .tbss mismatches non-TLS reference in ..\/..\/lib\/libos.a(GFile.o)\r\n\/lib\/libc.so.6: could not read symbols: Bad value\r\ncollect2: ld returned 1 exit status\r\nmake[4]: *** [molmol] Error 1\r\n<\/pre>\n<p>The following changes to the source-code solved the problem.<\/p>\n<p>Add the following line to the file .\/src\/os\/GFile.c<\/p>\n<pre lang=\"C\">\r\n#include <errno.h>\r\n<\/pre>\n<p>add it for example under the line that says<\/p>\n<pre lang=\"C\">\r\n#include <linlist.h>\r\n<\/pre>\n<p>Also change the following line (line 85 after the previous edit):<\/p>\n<pre lang=\"C\">\r\nmsg = sys_errlist[errno];\r\n<\/pre>\n<p>to<\/p>\n<pre lang=\"C\">\r\nmsg = strerror(errno);\r\n<\/pre>\n<p>Molmol shoud compile now, but unfortunately the problems are not finished yet. After having stripped and copied molmol from .\/src\/main to molmol.lnx as in the original instructions, when we try to run it, it says:<\/p>\n<pre lang=\"text\">\r\nMOLMOL 2K.2 \r\n\r\nVersion 2.1-2.6: Copyright (c) 1994-98 by\r\n    Institut fuer Molekularbiologie und Biophysik, ETH Zurich\r\n    Spectrospin AG, Faellanden, Switzerland\r\n\r\nVersion 2K.2: Custom version by Reto Koradi, 1999-2003\r\n\r\nusing Motif\/OpenGL\r\nunknown IO device\r\n<\/pre>\n<p>This can be solved by editing the startup script (the file called molmol):<\/p>\n<p>Comment out the following lines (line 192-209):<\/p>\n<pre lang=\"bash\">\r\n#if [ -n \"$nograph\" ]; then\r\n#  MOLMOLDEV=TTY\/NO\r\n#elif [ -n \"$MOLMOLDEV\" ]; then\r\n#  true  # already set\r\n#elif [ -n \"$localdev\" -a <span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script> ]; then\r\n#  MOLMOLDEV=$localdev\r\n#elif [ -x $xdpy ]; then\r\n#  xdpyout=`$xdpy -d $display 2>&1 | egrep 'GLX|unable'`\r\n#  case $xdpyout in\r\n#    *unable*) MOLMOLDEV=TTY\/NO\r\n#              nograph=y\r\n#              continue;;\r\n#    *GLX*)    if [ -n \"$glxdev\" ]; then\r\n#                MOLMOLDEV=$glxdev\r\n#              fi\r\n#              continue;;\r\n#  esac\r\n#fi\r\n<\/pre>\n<p>I hope this helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The molmol software that is available from the website of ETH Zurich does not compile on Ubuntu Linux without some changes. It seems that it is no longer supported by ETH Zurich, but can be downloaded from several other websites &hellip; <a href=\"https:\/\/blog.louic.nl\/?p=397\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[34,37,36],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/posts\/397"}],"collection":[{"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=397"}],"version-history":[{"count":24,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":744,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions\/744"}],"wp:attachment":[{"href":"https:\/\/blog.louic.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}