= Checkout = To compile Earthworm you first need to checkout the project from the [http://earthworm.isti.com/trac/earthworm/wiki#EarthwormSubversionRepository 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 ~/earthworm/earthworm-working/environment/ew_linux.bash }}} Mac Intel: {{{ source ~/earthworm/earthworm-working/environment/ew_macosx_intel.sh }}} ---- = 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 }}} == 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 ~/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 = 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 }}}