Beruflich Dokumente
Kultur Dokumente
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 Fink. 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:
cd mbsystem-5.4.2176
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 enviroment, 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 MacOsX 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
files.
value, prefix
is used only for architecture-independent
files.
[Default: /usr/local]
--exec_prefix
dependent files.
/usr/local/share]
--bindir
users run.
/usr/local/bin]
--libdir
/usr/local/lib]
--includedir
/usr/local/include]
MB-System depends on librarys from a number of different packages, including
NetCDF, GMT, 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-lib
--with-netcdf-include
--with-gmt-lib
--with-motif-include
--with-opengl-lib
--with-opengl-include
--with-otps-dir
The MB-System distribution includes the source code for the GSF and the PROJ4
packages. By default, the configure script seeks to build the GSF library as
libmbgsf and seeks to link with a libproj built external to MB-System. Configure
accepts commands to build MB-System without GSF or to use the included PROJ4
source.
--without-gsf
--enable-bundledproj
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.
Mac OS X
Many MacOsX users have their NetCDF, GMT, FFTW3, and OpenMotif installations
through the Fink package manager, which installs packages in /sw. The configure
script fails to find 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.
--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/tides/OTPS2
Ubuntu Linux
For Ubuntu Linux 12.04.02LTS, the following use of the apt-get utility will install
all of the MB-System prerequisites excepting OTPS:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib/gmt/bin:$PATH
By default, the Ubuntu GMT installation is not known to pkg-config, and the
installation points of the libraries and the header files must be specified:
# start gmt.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/gmt
ccompiler=gcc
cppcompiler=g++
Name: gmt
Description: GMT Libraries
Version: 4.5.6
Libs: -L${libdir} -lgmt -lgmtps -lpsl
Cflags: -I${includedir}
# end gmt.pc
If the GMT installation has been augmented with a /usr/lib/pkgconfig/gmt.pc file
so that pkg-config knows about GMT, then the configure call to install in /usr/local
is just:
sudo ./configure
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 ./configure
How to Install MB-System Using the Install_makefiles Script
For over two decades, the only means to build MB-System distributions was a
crude Perl script called install_makefiles that needed to be edited to set the
operating system and the locations of prerequisite packages. Although a
autoconf-type configure script is now provided, as described above, the old
install_makefiles script is still included in the MB-System distribution and remains
an alternative means to build and install MB-System.
In order to use this alternative build system, you must edit the perl script
mbsystem/install_makefiles, and set a number of parameters to reflect the
system architecture, the location of the installation, and the locations of certain
required libraries. This script will read template makefiles in the MB-System
source directories and create makefiles with the correct dependencies, compile
flags, and link flags. The important parameters to be set in install_makefiles are
listed below. The install_makefiles script includes comments suggesting
parameters to use for many common computer systems.
NETCDFLIBDIR
NETCDFINCDIR
MOTIFINCDIR
MOTIFLIBS
This parameter must be set to build the openGL tools mbgrdviz and mbeditviz:
OTPSDIR
CC
- C compiler to be used.
% cd mbsystem-5.3.1955
% install_makefiles
Because install_makefiles is a perl script, the executable perl must be available
in the installer's path. Once install_makefiles has been correctly configured and
run, give the command "make all" to generate the executable programs:
% make all
The make command will descend recursively down through the directory
structure, compiling source files, linking object files, and copying executables
and manual pages to the appropriate directories. The executables will be placed
in mbsystem-5.1.3/bin, the libraries in mbsystem-5.1.3/lib, and the manual pages
in mbsystem-5.1.3/man/man1.
Naturally, in order for users to use the MB-System utilities, the directory
containing the executables must be included in their path. Altering the user path
variable is generally 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.
Most users will also wish to specify which program they generally use to view
Postscript plots on their screen. This parameter is set with the mbdefaults
program (see the mbdefaults manual page for details). Popular open source
options for Postscript display include ghostview and gv. The postscript plots can
also be imported into proprietary tools like Adobe Illustrator, Adobe Acrobat, or
Preview on MacOs X. On old Unix machines, pageview worked well on Sun
workstations running Solaris, and xpsview on on Silicon Graphics machines
running Irix.