How to Download and Install MB-System

Packaged MB-System Distributions

Poseidon Linux

MB-System is included in Poseidon Linux, the “Scientific GNU/Linux”. Poseidon is an Ubuntu Linux based distribution including a selection of open source software packages intended to support scientific research. In particular, it offers several specific tools in the areas of GIS, 3D Visualization, Mathematics, Statistics and several other fields of research.

UbuntuGIS for Ubuntu Linux

MB-System is one of the packages maintained in the UbuntuGIS repository.

HomeBrew for MacOs

MB-System has been packaged for MacOs X using the Homebrew package manager. If you have Homebrew installed, then MB-System and its prerequisites can be installed from the science “tap” using these two commands:

brew tap homebrew/sciencebrew install mbsystem

However, the MB-System package in homebrew/science frequently lags the most recent release and does not integrate with the OTPS tide modeling package. In order to install the current release and/or include  the tide correction functionality,  then install OTPS and MB-System from a private tap at:

brew install dwcaress/mbsystem/otps –with-tpxo8
brew install dwcaress/mbsystem/mbsystem

Note that installing OTPS requires a Fortran compiler, and may cause Homebrew to install all of the gcc compiler suite.

Fink for MacOs

MB-System has been packaged for MacOS X as part of the Fink ProjectUnfortunately, as of May 2017 there are library namespace issues associated with the OpenMotif package that result in MB-System graphical utilities not working. For now, we recommend installing MB-System on MacOS computers using the Homebrew package manager.

The MB-System Fink package can be found at:

http://pdb.finkproject.org/pdb/package.php/mbsystem

If the fink package manager is installed, then MB-System and its prerequisites can be installed using this command:

fink install mbsystem

Acknowledgements

Thanks to Christian Ferreira for creating and distributing Poseidon Linux, to Johan Van de Wauw for updating the MB-System package in UbuntuGIS, to Kurt Schwehr for maintaing the Fink MB-System package, to Anthony Lukach, Simon Dreutter, and Andrew Janke for maintaining the Homebrew MB-System package, and to Hamish Bowman for maintaining the OSGeo-Live MB-System package.

How to Get The MB-System Source Distribution

The source code for MB-System is available as a compressed tar archive from an ftp server operated by the Monterey Bay Aquarium Research Institute. This archive file is about 16 megabytes in size and, depending on the speed of your internet connection, may take a few minutes to transfer.

Click here to ftp the current MB-System release as a compressed tar archive.

Click here to get point-and-click ftp access to all of the available MB-System related files  (these may include data examples and beta distributions of MB-System).

If access through the above links fails, try running ftp from a terminal shell. The following commands represent a typical anonymous ftp session (note that literallyanythingornothing literally means to enter anything or nothing terminated by a return, and that many modern ftp clients do not require the “binary” command).

  • ftp mbsystemftp@ftp.mbari.org
  • Password: literallyanythingornothing
  • > binary
  • > get mbsystem-5.5.2319.tar.gz
  • > quit

Access MB-System Source Version Control System

The MB-System source code is archived and managed using Subversion, an open source version control system. The MB-System and MB-Cookbook Subversion repositories can be browsed through a web interface at:

http://svn.ilab.ldeo.columbia.edu/

The MB-System repository is at:

http://svn.ilab.ldeo.columbia.edu/listing.php?repname=MB-System

The entire repository, or individual files, can be downloaded through this web interface. Clicking the the link above to bring up the WebSVN interface showing the most recent revision to the MB-System code base, along with a list of paths including “branches”, “tags”, and “trunk”. To download the entire code base, click on the “Download” link to the right of “trunk”. To browse the structure and download individual files, click on the “trunk” link. Users can build MB-System using this downloaded code base, but should note that the repository stores a number of files that are not included in the MB-System distributions.

Other Required and Suggested Software and Data

MB-System requires a number of other software packages and databases to be fully functional. These are:

  • GMT version 5.2.1 or later: MB-System makes use of the Generic Mapping Tools (GMT) libraries and programs for much of its graphics. GMT also includes a detailed global coastline database. GMT has been developed by Professor Paul Wessel of SOEST (School of Ocean and Earth Science and Technology at the Univeristy of Hawaii) and Dr. Walter H. F. Smith of NOAA. The GMT source code is available from the GMT web page.
  • NetCDF version 3.5.1 or later: Both GMT and MB-System require the NCAR netCDF library.
  • GDAL 1.11 or later: GDAL (Geospatial Data Abstraction Library) is a translator library for raster and vector geospatial data, and is now a prerequisite for GMT. Source code and documentation are available at the GDAL web page.
  • Perl version 5.0 or later: Perl is a fast, well documented scripting language used widely in the Linux/Unix world. MB-System contains a number of perl scripts used both for installation and to ease common tasks. Most of the current Unix operating systems include perl. If you need to obtain the perl source code, first check with your local system administrator – you will probably find perl already available locally. The perl source code can be obtained from the GNU software archives of the Free Software Foundation.
  • Perl Parallel-Forkmanager module: this Perl module is required for the parallel processing macros mbm_multicopy, mbm_multidatalist, and mbm_multiprocess to work. An easily installed package is available from from www.cpan.org.
  • X11: The interactive graphical utilities in MB-System (MBedit, MBnavedit, MBvelocitytool, MBgrdviz, MBeditviz) use and require the X11 windowing system.
  • Motif: The interactive graphical utilities in MB-System (MBedit, MBnavedit, MBvelocitytool, MBgrdviz, MBeditviz) use version 2 of the Motif widget set, and Motif libraries are required for these utilities to be built and to run. Most current Unix/Linux operating systems include the required Motif libraries, either in the original proprietary form (Motif), or the not-quite-open-source form (OpenMotif). If you do not have these libraries, the OpenMotif 2 source is available through Motifzone. An old alternative open source Motif-compatible distribution called LessTif does not work with the current OpenGL based MB-System programs (MBgrdviz, MBeditviz) and should be avoided.
  • FFTW: The “Fastest Fourier Transform in the West” package is used by the sonagram calculation program MBbsegypsd to calculate, well, Fast Fourier Transforms. FFTW is commonly used and thus available on or for most current Unix operating systems.
  • OTPSnc: The Oregon State Ocean Tide Prediction Software package is required for the tidal modeling program MBotps (which in fact is just a convenient front end for the old-style-batch interface of OTPS). The OTPSnc package can be obtained from the tidal modeling group at Oregon State University.

MB-System produces Postscript based graphics. Most current Unix operating systems provide a program which serves as a screen-based Postscript viewer. If you do not have a Postscript viewer, one option is to obtain one of several Ghostscript-based packages from the Free Software Foundation. The best is gv:

  • gv: Open source screen Postscript viewer. This package is a bit more sophisticated than ghostview and can handle poster-sized plots. The source code can be obtained from the GNU software archives of the Free Software Foundation.

How to Unpack an MB-System Source Code Distribution

The MB-System source code is extracted from the distribution using the tar utility:

tar xvzf mbsystem-5.5.2319.tar.gz

or for some older systems with feature-limited versions of tar, a combination of gunzip and tar:

gunzip mbsystem-5.5.2319.tar.gz
tar xvf mbsystem-5.5.2319.tar

This will create a directory called (for the 5.5.2319 distribution):

mbsystem-5.5.2319

In order to build and install MB-System from an interactive shell, you need to change your current directory to the distribution:

cd mbsystem-5.5.2319

How to Install MB-System Using the Configure Script

General Instructions

The configure script has been generated using the autoconf package. The current configure script does not resolve all of the flags and locations needed to build MB-System on all platforms, but does allow for flexible installation and generation and use of shared libraries without requiring interactive editing. These improvements make MB-System distributions much more amenable to inclusion in package manager systems like Debian and Homebrew. We hope to improve the configure script so that less intervention is required.

The basic steps for building MB-System using the configure script are:

1. Move to the top of the MB-System distribution directory:

cd mbsystem-5.5.2319

2. Run the configure script to generate the Makefile files throughout the distribution directory structure. The command line options for configure are discussed below.

[…pre-options…]./configure […options…]

3. Run the make utility to build the software within the source distribution.

make

4. Run the make utility with the install option to install the software within the target location that was specified while running configure. This step copies the libraries, programs, scripts, manual pages, and web pages to the target destinations.

make install

The configure script is intended to discern the environment, locate prerequisite packages, and construct the makefiles with a minimum of user intervention. In practice, users generally need to set at least some options when using the configure script in order to successfully build, install, and run MB-System. If NetCDF and GMT installations cannot be located, MB-System cannot be built. If FFTW3, Motif, or OpenGL cannot be found MB-System will be built, but without the applications that depend on these packages.

Depending on how user permissions are set on your system and where the package is to be installed, it may be necessary to execute some or all of the above commands with superuser privileges. On older styles of Unix and Linux, this was typically accomplished by using the su command to become root, or superuser, a step that requires knowing the root password for the system. Following a successful invocation of su in a command shell, all commands have superuser privileges. On MacOS X and other “modern” flavors of Unix and Linux, it’s more common to use the sudo command in front of other commands in order to execute them with superuser privileges. An administrator password is required for the first instance of sudo, but not for subsequent instances (at least for a period of time, typically five minutes). In this case, the commands become:

sudo ./configure
sudo make
sudo make install

The default destination is /usr/local, and so one should find the MB-System executable programs and scripts in /usr/local/bin, the shared libraries in /usr/local/lib, the manual pages in /usr/local/man, and the projection and Levitus databases accessed by MB-System in /usr/local/share/mbsystem. However, one can control the installation destination of the configure script on the command line by using a “–prefix” argument. For example, to install MB-System into /Users/caress/sandbox/mbsystem, you can use:

sudo ./configure \
–prefix=/Users/caress/sandbox/mbsystem

The complete list of configure’s installation location options is:

–prefix
This is the common installation prefix for all files.
If exec_prefix is defined to a different value, prefix
is used only for architecture-independent files.
[Default: /usr/local]

–exec_prefix
The installation prefix for architecture-dependent files.
By default it’s the same as prefix. You should avoid
installing anything directly to exec_prefix. However,
the default value for directories containing
architecture-dependent files should be relative to
exec_prefix.
[Default: ${prefix} ==> /usr/local]

–datarootdir
The root of the directory tree for read-only architecture

-independent data files.
[Default: ${exec_prefix}/share ==> /usr/local/share]

–bindir
The directory for installing executables that users run.
[Default: ${exec_prefix}/bin ==> /usr/local/bin]

–libdir
The directory for installing object code libraries.
[Default: ${exec_prefix}/lib ==> /usr/local/lib]

–includedir
The directory for installing C header files.
[Default: ${exec_prefix}/include ==> /usr/local/include]

MB-System depends on librarys from a number of different packages, including NetCDF, GMT5, GDAL, FFTW3, X11, and Motif. Sometimes a user will have more than one installation of a package available, and specifying which is used is desirable. Also, unfortunately the configure script does not always successfully find all needed packages. Consequently, the configure script allows users to set the locations on the command line when necessary. The configure command line options controlling the locations of prerequisites are:

–with-netcdf-config
Location of NetCDF configuration script nc-config
–with-gdal-config
Location of GDAL configuration script gdal-config
–with-gmt-config
Location of GMT configuration script gmt-config
–with-proj-lib
Location of PROJ libs
–with-proj-include
Location of PROJ libs
–with-fftw-lib
Location of FFTW3 libs (optional)
–with-fftw-include
Location of FFTW3 headers (optional)
–with-motif-lib
Location of Motif libs (optional)
–with-motif-include
Location of Motif headers (optional)
–with-opengl-lib
Location of OpenGL libs (optional)
–with-opengl-include
Location of OpenGL headers (optional)
–with-otps-dir
Location of OTPS installation (optional)

Note that specification of FFTW3, Motif, and OpenGL is optional. If the configure script does not find these packages and the user does not specify their locations, then some MB-System programs will not be built. Lack of FFTW3 means that mbsegypsd is not built. No OpenGL results in the visualization programs mbgrdviz and mbeditviz not being built. Lack of Motif means that no graphical programs of any type are built.

User Environment Setup

Regardless of where the MB-System programs are installed, users must have that location included in their path environment variable in order to execute the programs from a command line. If MB-System has been installed using a package manager or installed manually into a common location (e.g. /usr/local/bin), the user path probably already references the needed location. If altering the user path variable is required, it can be accomplished by editing the initialization files hidden in the user’s home directory. Which files need to be edited depends on which command line shell is being used. If the user works with csh, then the .cshrc and .login files need to be changed. If the shell is bash, then the .bashrc and .profile files must be altered. See the manual pages for the relevant shell program to determine how to set the user environment. The executable perl must also be available in the user’s path for most of the macros to work.

The GMT version 5 plug-in modules mbcontour, mbswath, and mbgrdtiff are invoked as modules of the program gmt:

gmt mbcontour (….various arguments…..)
gmt mbswath (….various arguments…..)
gmt mbgrdtiff (….various arguments…..)

In order for GMT to successfully execute the MB-System modules, the location of the shared libraries containing the dynamically loaded modules must be known to GMT. This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter in the file gmt.conf that is part of the GMT installation, by setting this parameter in the file gmt.conf in the user’s home directory, or by using the GMT module gmtset to modify this parameter in the current working directory. The Mb-System GMT modules are included in a shared library file named mbsystem.so that is installed in the same location as the regular MB-System shared libraries (e.g. libmbio), which is typically a location such as /usr/local/lib. If mbsystem.so has been installed in  /usr/local/lib, then the GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:

GMT_CUSTOM_LIBS = /usr/local/lib/mbsystem.so

The parallel processing modules mbm_multiprocess, mbm_multidatalist, and mbm_multicopy require the perl module Parallel::ForkManager. This can be added to your local perl installation using the command line utility cpan:

cpan Parallel::ForkManager

The MB-System plotting macros mbm_grdplot, mbm_plot, etc all generate shellscripts that in turn execute a combination of GMT, MB-System, and other programs to generate and then display postscript plots or images. The MB-System program mbdefaults sets the programs you want to use to display postscript files and images on the screen. If, for instance, you want to use “gv” to display postscript and “feh” to display images, then run:

mbdefaults -Dgv -Ifeh -V

These defaults are stored in a hidden file called “.mbio_defaults” in the user’s home directory.

Prerequisite Installation using HomeBrew and Configure Arguments for MacOS

As noted above, MB-System has been packaged for MacOs X using the Homebrew package manager. One can also use Homebrew to install the prerequisite packages and then build and install MB-System from a local source code distribution.

MacOS does not include a compiler suite or the X11 windowing system by default. First install XCode (the Apple development environment architected using the LLDB compiler suite) from the Apple App Store. Then install the current version of XQuartz available from the web pagehttp://www.xquartz.org.

Next, install homebrew by following the directions at the website https://brew.sh

Once you have Homebrew installed, then the MB-System prerequisites can be installed using the following commands:

brew tap homebrew/science
brew install proj
brew install gdal
brew install netcdf
brew install fftw
brew install gmt
brew install gv
brew install openmotif
brew install zimonkaizoku/mbsystem/otps –with-tpxo8

Note: Installing OTPS requires a Fortran compiler and may cause Homebrew to install all of the gcc compiler suite.

Once all of the prerequisites are installed, get the current MB-System distribution from the ftp site:

% ftp ftp.mbari.org
Name: mbsystemftp
Password: literallycouldbeanything
> binary
> get mbsystem-5.5.2319.tar.gz
> quit

Put the distribution in /usr/local/src and unpack it:

% mkdir /usr/local/src
% cp mbsystem-5.5.2319.tar.gz
% cd /usr/local/src
% tar xvzf mbsystem-5.5.2319.tar.gz
% cd mbsystem-5.5.2319

Run the configure script to generate the makefiles:

% CFLAGS=-g -I/opt/X11/include -L/opt/X11/lib \
./configure \
–with-proj-include=/usr/local/include \
–with-proj-lib=/usr/local/lib \
–with-fftw-include=/usr/local/include \
–with-fftw-lib=/usr/local/lib \
–with-motif-include=/usr/local/include \
–with-motif-lib=/usr/local/lib \
–with-otps-dir=/usr/local/opt/otps

Now that the makefiles exist, run make:

% make install

Prerequisite Installation using Fink and Configure Arguments for MacOS

Many MacOsX users have their NetCDF, GDAL, PROJ, GMT5, FFTW3, and OpenMotif installations through the Fink package manager, which installs packages in /sw. To install the MB-System prerequisites:

sudo fink install \
gmt5 gmt5-dev \
gdal gdal-dev gdal-shlibs \
netcdf-c7 netcdf-c7-shlibs \
proj proj-bin proj-shlibs \
openmotif4 openmotif4-shlibs x11 x11-dev \
fftw3 fftw3-shlibs \
gv libicu55-shlibs

The configure script is able to find the NetCDF, GDAL and GMT5 installations because they install the programs nc-config, gdal-config, and gmt-config, respectively, in /sw/bin. However, the configure script fails to find the PROJ, FFTW3, and OpenMotif packages in /sw, and so the user must explicitly specify those packages. The OTPS tide modeling software used by mbotps is not packaged in Fink, and so must be manually installed by a user if mbotps is to work correctly. Installation of MB-System on a Mac will likely use a configure command that looks something like:

sudo CFLAGS=”-I/opt/X11/include -L/opt/X11/lib” \
./configure \
–with-proj-include=/sw/include \
–with-proj-lib=/sw/lib \
–with-fftw-include=/sw/include \
–with-fftw-lib=/sw/lib \
–with-motif-include=/sw/include \
–with-motif-lib=/sw/lib \
–with-otps-dir=/usr/local/OTPS2

As shown here, one can also add to the commands seen by the compiler (“CFLAGS”) and linker (“LDFLAGS”) if desired or necessary by prefacing the configure command with arguments setting the environment variables CFLAGS and LDFLAGS. Here the location of X11 header files and libraries in MacOS (in /opt) must be specified because this location is not known to the configure script. Another example is that in order to compile MB-System for user with a debugger, all compiler commands must include the “-g” argument. So, to enable use of the lldb debugger, the configure command becomes:

sudo CFLAGS=”-g -I/opt/X11/include -L/opt/X11/lib” \
./configure \
–with-proj-include=/sw/include \
–with-proj-lib=/sw/lib \
–with-fftw-include=/sw/include \
–with-fftw-lib=/sw/lib \
–with-motif-include=/sw/include \
–with-motif-lib=/sw/lib \
–with-otps-dir=/usr/local/OTPS2

Prerequisite Installation, Configure Arguments and Add-ons for Ubuntu Linux

For Ubuntu Linux 16, the following use of the apt-get utility will install all of the MB-System prerequisites excepting OTPS:

sudo apt-get install \
gmt libgmt5 libgmt-dev gmt-gshhg gmt-doc \
libx11-dev xorg-dev libmotif-dev libmotif4 \
libxp-dev mesa-common-dev libsdl1.2-dev libsdl-image1.2-dev \
sudo apt-get install build-essential gfortran nautilus-open-terminal \
libfftw3-3 libfftw3-dev libnetcdf-dev netcdf-bin \
libgdal-bin gdal-dev gv csh libgmt-dev libproj-dev

If the prerequisites have all been installed as shown above, and it is desired to install MB-System in /usr/local, then only a simple call to configure is required:

sudo ./configure

Once the makefiles have been generated by configure, build and install using:

sudo make
sudo make install

In some cases the system and/or user environment impedes the successful use of the GMT and/or MB-System shared libraries. In order to manually allow shared libraries to be found for linking or running, one can either set the CFLAGS environment variable during building or set the LD_LIBRARY_PATH environment variable at login by adding a command to the user’s ~/.profile or ~/.bashrc files.

To set the CFLAGS environment variable during building include “-Wl,-rpath -Wl,LIBDIR” in the configure command as shown here:

sudo CFLAGS=”-Wl,-rpath -Wl,/usr/local/lib” ./configure

To augment the LD_LIBRARY_PATH environment variable during login add a line to the ~/.bashrc or ~/.profile file as shown here:

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

MB-System now requires GMT 5.2.1 or later. Although the standard Ubuntu package manager apt-get installs a current GMT on Ubuntu 16, on Ubuntu 12 and 14 the available GMT version is 5.1, with the consequence that a manual GMT installation is required before MB-System can be installed. Also, many of the prerequisite package names are different in the older Ubuntu distributions than in Ubuntu 16.

For Ubuntu Linux 12 or 14, the following use of the apt-get utility will install all of the MB-System prerequisites excepting GMT5 and OTPS:

sudo apt-get install \
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

Prerequisite Installation and Configure Arguments for CentOs or Red Hat Linux

The package manager usually used on CentOs or Red Hat Linux systems is yum. To install all of the MB-System prerequisites use the command:

sudo yum install \
openmotif openmotif-devel
fftw fftw-devel netcdf netcdf-devel \
proj proj-devel gdal-devel gmt gmt-devel gv nedit

If the prerequisites have all been installed with yum and it is desired to install MB-System in /usr/local, then only a simple call to configure is required:

sudo ./configure

Products

Data repository
Data policy
What is happening in Monterey Bay today?
Central and Northern California Ocean Observing System
Chemical data
Ocean float data
Slough data
Mooring ISUS measurements
Southern Ocean Data
Mooring data
M1 Mooring Summary Data
M1 ADCP (CeNCOOS)
M1 Asimet
M1 Download Info
M1 EMeter
M1 Fluorometer (CeNCOOS)
Molecular and genomics data
ESP Web Portal
Seafloor mapping
Upper ocean data
Spatial Temporal Oceanographic Query System (STOQS) Data
Image gallery
Video library
Seminars
Previous seminars
David Packard Distinguished Lecturers
Research software
Video Annotation and Reference System
System Overview
Knowledgebase
Annotation Interface
Video Tape User Guide
Video File User Guide
Annotation Glossary
Query Interface
Basic User Guide
Advanced User Guide
Results
Query Glossary
FAQ
VARS Publications
Oceanographic Decision Support System
MB-System seafloor mapping software
How to Download and Install MB-System
MB-System Documentation
MB-System Announcements
MB-System Announcements (Archive)
MB-System FAQ
MB-System Discussion Lists
MB-System YouTube Tutorials
Matlab scripts: Linear regressions
Introduction to Model I and Model II linear regressions
A brief history of Model II regression analysis
Index of downloadable files
Summary of modifications
Regression rules of thumb
Results for Model I and Model II regressions
Graphs of the Model I and Model II regressions
Which regression: Model I or Model II?
Matlab scripts: Oceanographic calculations
Matlab scripts: Sound velocity
Visual Basic for Excel: Oceanographic calculations
Educational resources
MBARI Summer Internship Program
2017 Summer Interns Blog
Education and Research: Testing Hypotheses (EARTH)
EARTH workshops
2016—New Brunswick, NJ
2015—Newport, Oregon
2016 Satellite workshop—Pensacola, FL
2016 Satellite workshop—Beaufort, NC
EARTH resources
EARTH lesson plans
Lesson plans—published
Lesson plans—development
Lesson drafts—2015
Lesson drafts—2016 Pensacola
Center for Microbial Oceanography: Research and Education (C-MORE) Science Kits
Publications
Sample archive