Skip to content

Instantly share code, notes, and snippets.

@johannah
Last active June 10, 2023 12:41
Show Gist options
  • Save johannah/bcff47d83fc4d86f3f1d50ee4f2ab2d2 to your computer and use it in GitHub Desktop.
Save johannah/bcff47d83fc4d86f3f1d50ee4f2ab2d2 to your computer and use it in GitHub Desktop.
Instructions for Installing MB-System for Sonar processing

This is documentation for installing MB-System-r2279 on Ubuntu 14.04 as of Nov 2016. Although documentation for mb-system has improved dramatically over the past few years, it can still be difficult. In particular, I have not found step 1.4 in the documentation and missing this step will result in being unable to use gmt shared libraries such as "gmt mbcontour" which is necessary for producing contour lines in maps.

##1) Install GMT 5.1.2 I am using directions from Andrew at: http://andrewjmoodie.com/2014/12/installing-the-generic-mapping-tools-5-gmt-5-1-x-on-ubuntu-linux/ I've added step 1.4 to get this to load shared libraries from mb-system.

##1.1) Install relvent dependencies sudo apt-get install -y subversion ghostscript build-essential cmake libnetcdf-dev libgdal1-dev libfftw3-dev libpcre3-dev

##1.2) Get the packages and then untar each into opt directory We'll store and build everything into /opt/ and then install into /usr/local

cd /opt
svn checkout svn://gmtserver.soest.hawaii.edu/gmt5/trunk gmt5-dev

Visit the GMT download page and download the latest versions of the packages titled “gshhg-gmt-x.x.x.tar.gz” and “dcw-gmt-x.x.x.tar.gz”.

##1.3) Setup Configs Enter into the gmt5 directory and make a copy of the cmake template and then edit it.

cd gmt-5.2.1/cmake
cp ConfigUserTemplate.cmake ConfigUser.cmake
gedit ConfigUser.cmake'

Change GSHHG_ROOT to be the absolute path to the gsh directory and set COPY_GSHHG to True. Change DCW_ROOT to be the absolute path to the gsh directory and set COPY_DCW to True. Then save and close ConfigUser.cmake.

 98 # Set path to GSHHG Shoreline Database [auto]:
 99 set (GSHHG_ROOT "/opt/gshhg-gmt-2.3.5/")
100 
101 # Copy GSHHG files to $/coast [FALSE]:
102 set (COPY_GSHHG TRUE)
103 
104 # Set path to DCW Digital Chart of the World for GMT     [auto]:                    
105 set (DCW_ROOT "/opt/dcw-gmt-1.1.2")
106 
107 # Copy DCW files to $/dcw [FALSE]:
108 set (COPY_DCW TRUE)

1.4 Tell GMT where to find future MB System libs

cd /opt/gmt-5.2.1/share/conf/ gedit gmt.conf.in Change GMT_CUSTOM_LIBS to be: GMT_CUSTOM_LIBS = /usr/local/lib/libmbgmt.so

1.5 Make and Install

The build may take a while.

cd /opt/gmt-5.2.1 
mkdir build 
cd build 
cmake ..  
make 
sudo make install 

1.6 Test GMT

gmt pscoast -R-130/-30/-50/50 -Jm0.025i -B30g30:.Mercator: -Di -W > mercator.ps

2 Installing MB-System

A somewhat outdated guide can be found at: https://www.ldeo.columbia.edu/res/pi/MB-System/html/mbsystem_how_to_get.html

This guide was developed with version MB-System-trunk.r2279.tar.gz You should be able to download the exact "trunk" revision from the SVN System at: http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System&rev=2279 However, I encourage you to download the most recent release and try to install it.

2.1 Move the file to /opt and then untar it

tar -xvf trunk.r2279 mv trunk.r2279 /opt/mb-system-r2279

2.2 Install dependencies

sudo apt-get install -y xorg-dev libmotif-dev libmotif4 libxp-dev mesa-common-dev libsdl1.2-dev libsdl-image1.2-dev build-essential gfortran nautilus-open-terminal libfftw3-3 libfftw3-dev libnetcdf-dev netcdf-bin gdal-bin gdal1-dev gv

2.3 Configure and install

These steps will take a while. Watch for any errors or warnings.

cd /opt/mb-system-r2279
./configure
sudo make
sudo make install

2.4 Test

Test with running mbinfo on any .mbXX file.

Conclusion

You may have to run step 1.5 again after you've installed mb-system. Also be sure that mbsystem binaries (mbprocess, mbedit) are found in /usr/local/bin if you have trouble. Your LD_LIBRARY_PATH should include /usr/local/lib. It should be this way be default on ubuntu, but if it isn't, you can add it to your ~/.bashrc file.

`export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib`

User guide: http://www3.mbari.org/products/mbsystem/mb-cookbook/index.html#d0e1863

Supported Data formats: https://www.ldeo.columbia.edu/res/pi/MB-System/html/mbsystem_formats.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment