top of page

Installing GAMIT/GLOBK on a Linux virtual machine

Total download requirements, including GAMIT_GLOBK: about 2GB

 

Last updated August 2019

 

​

Starting notes

 

These instructions have been designed to help new users of GAMIT/GLOBK install it on a Linux virtual machine in a safe environment where everything is controlled and we can guarantee expected results, like the compilers working correctly. If you are using this software for research or processing large amounts of data, using a virtual machine is not a good idea - it will slow things down significantly. You should use a native installation of Ubuntu or Mac OSX and follow the instructions for 'Linux Configuration' below.

​

If you have already been given a .vdi (Virtual Disk Image) file created by someone else, you just need to install Virtual Box, create a new virtual machine (Linux kernel, Ubuntu 64-bit) and then select 'existing file' and navigate to your .vdi file to start it up. No need to follow all these steps. You can get VirtualBox for free here. Easy!

​

​

Virtual Machine setup

​

f you are creating a new virtual machine, start here. Otherwise, skip down to the section “Linux configuration”.

 

First, install the latest version of VirtualBox on your computer. You can get VirtualBox for free here.

 

Next, download the operating system image you want to install; it may be named “lubuntu-18.04-desktop-amd64.iso”, or something similar. If you choose Lubuntu (a smaller-file-size, stripped-down version of Ubuntu), you can download it here. Another good option is CentOS, but I haven't tested these instructions on that OS yet. If you do, please let me know!

 

Now, run VirtualBox and create a new Virtual Machine. Give it a name, and choose the RAM/disk size. For mine, I chose, 4GB RAM, and a 25 GB Disk. I chose the option “VDI (VirtualBox Disk Image)” which is the most flexible. This is fine for setting up a test VM or to process intermittent survey GPS data, but for processing large amounts of continuous GPS data, the disk size requirements will be much larger. You may need 1TB or more.

 

Now, start the virtual machine by clicking on it. You will have to select the .iso file so that VirtualBox can open it and run the contents.

 

(If you are using a Lubuntu disk image on a MacBook with retina display and the display seems to be corrupted, edit the settings of your new VM and change the number of CPUs to 2, and the Video memory to 128MB. As of VirtualBox version 6.0 this was no longer necessary, but it was needed in version 5.2.)

​

Follow the on-screen instructions to install your OS (Note, do not choose “try without installing”). You have to choose “Install”. I created a username “geodesy” with the same password “geodesy”.

 

After it is done installing, it will need to reboot, and then ask you to update the software. It’s a good idea to do this right away, but note that it will require downloading about 300MB of data.

 

Now, install the virtual machine “guest additions” : 

from the VirtualBox “Devices” menu, choose “Insert Guest Additions CD Image”. It should appear on the desktop. You can open it in the desktop to find out the path where it is located, like /media/…/. Now run:

   cd <path of the CD (figure this out and enter the correct name)>

   sudo ./VBoxLinuxAdditions.run

   sudo adduser $USER vboxsf

 

We can now unmount the CD using the virtual box Devices menu. Now, restart the Virtual Machine again.

 

Now, we can create a shared folder in the “Devices” menu. Make sure to choose a new folder on your main computer that is easy to find, and give it a short name like “shared”. Also select “permanent” and “auto-mount” options.

 

​

Linux configuration

 

If you are not running on a virtual machine, but rather a pre-installed Linux version, you can start here. For a virtual machine, run this section after setting up the virtual machine in the section above.

 

Next, we need to install our own software. Open a linux terminal, and run the following commands (each one will download a small amount of data from the internet):

   sudo apt install make

   sudo apt install csh

   sudo apt install tcsh

   sudo apt install libx11-dev

​

For GAMIT, GCC versions 7 and later do not seem to work at the moment. We have to install old versions of the compilers: 4.8 is guaranteed to run, so let's use that:

   sudo apt install gcc-4.8

   sudo apt install gfortran-4.8

​

Since these compilers are old, they don’t automatically replace the default gcc compiler. We have to create links to these names in /usr/bin. Caution, this can overwrite your existing C and Fortran compiler! Run:

   cd /usr/bin

   sudo ln -sf gcc-4.8 gcc

   sudo ln -sf gfortran-4.8 gfortran

   cd ~

​

Install GMT (this is also a large download, about 200MB):

   sudo apt-get install gmt gmt-dcw gmt-gshhg

 

​

GAMIT/GLOBK installation

 

Now, we are finally ready to install GAMIT/GLOBK: If you did not already download the software, follow these instructions:

   cd ~

   mkdir GAMIT_GLOBK

   cd GAMIT_GLOBK

   ftp -i chandler.mit.edu

 

Enter name/pwd: these passwords change every few months. You will need to email someone with permission who can tell you the password. If no person from your institution has permission, you can email the GAMIT authors at MIT to obtain a free academic license: see here for more details.

​

   cd updates/source

   pass

   ls

   mget *

   quit

 

Note that 'pass' turns off interactive prompting, to allow you to download many files without being asked about each one. The additional command 'bin' used to be needed to change the mode to binary, but this seems to be the default now. If you see a comment that the download mode is 'ASCII' you will need to stop and retry the download with 'bin'. Then we can simply use 'mget *' to download everything.

 

Now, we have the software ready to install. we first have to add permission for ourselves to run the software:

   chmod +x install_software

   chmod +x install_updates

 

Now run:

   ./install_software

 

During the first run, it will unpack all the files, but it won’t be able to find the libX11 paths. We have to open the file “libraries/Makefile.config”, and edit the line labeled “X11LIBPATH” to the following: X11LIBPATH /usr/lib/x86_64-linux-gnu/

(note: if you are running the 32-bit version, this will be /usr/lib/i386-linux-gnu/ instead)

Now run again:

   ./install_software

 

This takes a while, because it is compiling all the code from the source. If you followed all the steps above correctly, it should run OK. 

 

Next, we have to add several entries to our “PATH” variable. Edit the file “~/.bashrc” and add the lines:

   export 

   PATH="/home/geodesy/GAMIT_GLOBK/gamit/bin:/home/geodesy/GAMIT_GLOBK/com:/home/geodesy/GAMIT_GLOBK/kf/bin:${PATH}"

   export HELP_DIR="/home/geodesy/GAMIT_GLOBK/help/"

   export INTSITUTE="EOS"

 

Almost done. Before running the software, you will need to get a new copy of the file “otl_FES2004.grid” because the included one that comes with the download from chandler is corrupted. This file is large, about 700MB.

​

   cd ~/gg/tables/

   rm -f otl_FES2004.grid

   ftp everest.mit.edu

username: anonymous

password: can be anything

   cd pub/GRIDS

   prompt noprompt

   bin

   get otl_FES2004.grid

   exit

​

Recall that 'prompt noprompt' turns off prompting (optional here, since there is only one file), and 'bin' is required to avoid corrupting the file. If you want to use the VMF1 grids for removing hydrostatic delays, you can also use mget vmf1grd.[year] - note that each of these files is about 200 MB, so mget vmf1* is possible but will be a multi-GB download. Once this download completes, you should be ready to run!

 

 

Reducing the size of the Virtual Machine disk

 

If you have added and then removed a lot of data, you may find that the .VDI file has inflated to be much larger than the space you are actually using. You can follow these steps to reduce the size of the .VDI image:

 

On the Lubuntu virtual machine, we first need to write zeros to all the empty space on the drive. Run:

   dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k ; rm /var/tmp/bigemptyfile

 

Then shut down the virtual machine, and on your local computer (if it is a linux or Mac) run:

   VBoxManage modifymedium --compact /path/to/thedisk.vdi

 

If a windows machine, run the program VBoxManage.exe, which should open up a terminal window, and allow you to enter the same command.

​

You can also use this technique to resize the virtual hard drive, if you need more space in the virtual machine. That command is as follows with size in MB; this example sets it to 100 GB:

​

   VBoxManage modifyhd /path/to/thedisk.vdi --resize 100000

​

 

Other notes

​

Currently these instructions do not work for i386 (32-bit) lubuntu, because of a failure during the compile step related to gcc libraries. The libraries are said to be incompatible and compilation exits with an error. Unless absolutely necessary, GAMIT installation should only be attempted on a 64-bit operating system.

​

​

​

unm_small_logo_edited.png

Eric O. Lindsey

Assistant Professor

Department of Earth & Planetary Sciences

MSC 03 2040

University of New Mexico 

Albuquerque, NM 87131

Check out my other pages:

  • Google Scholar
  • Instagram
  • LinkedIn
  • Github

© 2021 by Eric Lindsey

bottom of page