How To: Install GAMIT/GLOBK on a VirtualBox VM using Vagrant
Note: The # symbol in this guide denotes a command to be entered at the command line in Terminal.
Note: Text shown after a ! symbol indicates a comment. It should not be copied to the command line.
Requirements:
Note: Text shown after a ! symbol indicates a comment. It should not be copied to the command line.
Requirements:
- A licence to use GAMIT/GLOBK and access to the source code on their password protected FTP server. See: http://www-gpsg.mit.edu/~simon/gtgk/
- A good understanding of the UNIX command line.
- You’ll need to have enough disk space on your Mac to install the virtual machine and space for your experiment.
- A Mac with administrative access (Tested on Mavericks)
- A good connection to the internet.
- A couple of hours to complete the installation.
1) Install Vagrant and Virtual Box
- Go to https://www.virtualbox.org/wiki/Downloads and download the virtual box for OS X hosts.
- Double click on the downloaded .dmg file and follow instructions.
- Go to http://www.vagrantup.com and download the universal Mac OS X binary.
- Double click on the downloaded .dmg file and follow instructions.
2) Create a new virtual machine with Vagrant
- Open a Terminal window
- # mkdir gamit_vm
- # cd gamit_vm
- # vagrant init precise64 http://files.vagrantup.com/precise64.box ! Installs a 64-bit Ubuntu VM
- IMPORTANT: Increase the available RAM to 1024 in Virtual Box before starting up the VM.
- # vagrant up; vagrant ssh ! starts the VM and connects via ssh
- Note: Vagrant will create a file in gamit_vm. To run vagrant again you’ll need to return to the gamit_vm directory
- Note: vagrant halt will shutdown the VM. See vagrant -h for more information.
3) Install the dependencies for GAMIT/GLOBK/TRACK
- # sudo apt-get update
- # sudo apt-get install csh tcsh curl bc
- # sudo apt-get install gfortran
- # sudo apt-get install gmt ghostscript
- # sudo apt-get install libx11-dev
- # sudo apt-get install make
4) Create a directory and download GAMIT/GLOBK source code
- # mkdir ~/gamit
- # cd ~/gamit
- # wget --ftp-user=(must get from MIT) --ftp-password=(must get from MIT) ftp://chandler(dot)mit(dot)edu/updates/source/*
- # chmod 755 install*
- The following three commands edit libraries/Makefile.config for installation on a 64-bit Ubuntu machine.
- # sed -i.bak ’s%X11LIBPATH /usr/lib/X11%X11LIBPATH /usr/lib/x86_64-linux-gnu%g’ ~/gamit/libraries/Makefile.config
- # sed -i.bak ’s%#CFLAGS = -g -DADD64BIT%CFLAGS = -g -DADD64BIT%g’ ~/gamit/libraries/Makefile.config
- # sed -i.bak ’s%OS_ID Linux 0001 3000% OS_ID Linux 0001 4000%g’ ~/gamit/libraries/Makefile.config
- # ./install_software
- As the install_software script runs you’ll need to answer yes to the initial configuration questions, then get a cup of coffee, it will take a while for GAMIT and GLOBK to compile.
- If it fails durring installation, read the warnings and review the previous steps and make sure you’re not missing any of the required dependencies.
- Answer NO to the last question regarding creating a "gg" link (We’ll do that later)
6) Install GAMIT/GLOBK
- GAMIT/GLOBK relies on a link between your installation directory (/usr/local/gamit) and your home directory (~ or $HOME).
- The following commands add the required GAMIT/GLOBK directories to your path.
- In this example we install GAMIT/GLOBK in "/usr/local/".
- # cd ~
- # echo ’export PATH=$HOME/gg/com:$HOME/gg/kf/bin:$HOME/gg/gamit/bin:$PATH’ >> .profile
- # echo ’export HELP_DIR=$HOME/gg/help/’ >> .profile
- # echo ’export INSTITUTE=YOU’ >> .profile
- For a typical installation mv gamit directory to /usr/local/
- # sudo mv gamit /usr/local
- Link gg in your home directory to "/usr/local/gamit/".
- # ln -s /usr/local/gamit gg
- # source .profile ! This cmd updates your current terminal window’s path.
7) Download the Ocean Tidal Loading Grids from MIT
- cd ~/gg/tables
- wget ftp://everest(dot)mit(dot)edu/pub/GRIDS/otl_FES2004.grid ! This is a very large file and takes a while to download.