wiki:EarthwormCompile
Last modified 3 years ago Last modified on 11/13/14 15:11:00

Checkout

To compile Earthworm you first need to checkout the project from the Earthworm SVN Repository:

mkdir ~/earthworm
cd ~/earthworm
svn checkout svn://svn.isti.com/earthworm/trunk earthworm-working
cd ~/earthworm/earthworm-working

Setup Environment

You can set EW_INSTALL_HOME and EW_INSTALL_VERSION. The EW_INSTALL_HOME should match the directory that the project was checked out into. The EW_INSTALL_VERSION should match the directory name specified when you checked out the project, such as earthworm-working. The EW_INSTALL_HOME should be the parent of the EW_INSTALL_VERSION directory.

export EW_INSTALL_HOME=~/earthworm
export EW_INSTALL_VERSION=earthworm-working

Alternatively you can modify the EW_HOME and EW_VERSION settings in the environment script file for the OS you are running.


Read Environment

You then need to read in the environment script file for the OS you are running.

Linux:

source $EW_INSTALL_HOME/$EW_INSTALL_VERSION/environment/ew_linux.bash

Mac Intel:

source $EW_INSTALL_HOME/$EW_INSTALL_VERSION/environment/ew_macosx_intel.sh

Solaris:

source $EW_INSTALL_HOME/$EW_INSTALL_VERSION/environment/ew_sol_sparc.bash

Compilers

A Fortran compiler (g77, g95, f77 or gfortran) is needed and should be in the path.

Ubuntu Linux

For Ubuntu 10.10 I needed to compile with g77. I added the following lines to the end of /etc/apt/sources.list:

deb http://hu.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://hu.archive.ubuntu.com/ubuntu/ hardy universe
deb http://hu.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://hu.archive.ubuntu.com/ubuntu/ hardy-updates universe

I then ran the following commands:

apt-get install aptitude
aptitude update
aptitude install g77

Update July 9, 2012: To fix the "/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory" issue I ran the following command:

sudo apt-get install g++-multilib

For 64 bit Ubuntu (at least 12.04 up to 14.10), you will likely need to install the 32 bit libc6 like so:

sudo apt-get install libc6-dev-i386 

If this is not installed, earthworm commands will complain with a “Command not found” even though the file is in the PATH. Due to dynamic library not being found I think.

RHEL Linux

For Redhat Enterprise Linux, you will need to install the 32 bit libs for version 6.0 or greater as they do not come installed by default. To do that with yum:

yum install libgcc.i686

If gfortran is not installed, then you will need to install that too:

yum install gcc-gfortran

Solaris

For Solaris you need to make sure the Sun compiler is in the path before other compilers. For example add the following to your .cshrc file:

set path=(/opt/SUNWspro/bin $path)

Mac Snow Leopard

For Mac Snow Leopard I needed to install the g95 from http://www.macports.org/. The g95 compiler from http://www.g95.org/ did not work. You can specify g95 with the FC environment variable:

export FC=g95

Run Make

You then need to compile the earthworm project by running the Makefile in the src directory. The target names can be found in the Makefile:

cd $EW_INSTALL_HOME/$EW_INSTALL_VERSION/src

Run a make clean, make clean bin, make, and then make clean and make clean bin again for all platforms and trap the output and check it for errors. search for any .o or .obj files remaining, or executables remaining

Windows

 nmake clean_nt
 nmake clean_bin_nt
 nmake nt > make_output.txt 2>&1 

Solaris

For Solaris, since you use csh or tcsh to compile:

 make solaris >& make_output.txt 

Linux (or Mac OSX)

For Linux, since you use bash to compile:

 make unix &> make_output.txt 

Errors

Check for errors in the makes, and resolve them.

 grep -i error