Version 9 (modified by stefan, 10 years ago) (diff)



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

mkdir ~/earthworm
cd ~/earthworm
svn checkout svn:// 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.


source ~/earthworm/earthworm-working/environment/ew_linux.bash

Mac Intel:

source ~/earthworm/earthworm-working/environment/


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 hardy universe
deb-src hardy universe
deb hardy-updates universe
deb-src hardy-updates universe

I then ran the following commands:

apt-get install aptitude
aptitude update
aptitude install g77


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 The g95 compiler from 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 ~/earthworm/earthworm-working/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


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


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

 make solaris >& make_output.txt 


For Linux, since you use bash to compile:

 make unix &> make_output.txt 


Check for errors in the makes, and resolve them.

 grep -i error