How to Build the SeaDAS Science Processing Code

These instructions are for building the science processing software used within OBPG. They are provided here with NO SUPPORT. For fully supported code, please use the binaries distributed with SeaDAS

OCSSW_bash.env (OCSSW.env for csh) is provided for setting needed environment variables to build the software.

REQUIREMENTS:

  • gcc (4.5 or higher)
  • g++ (matching gcc version)
  • gfortran (matching gcc version)
  • zlib
  • csh
  • tcsh
  • unzip
  • git
  • cmake
  • bison
  • flex
  • libX11-devel

additional known OS-specific requirements

  • Ubuntu 16.04

    • zlib1g-dev
  • CentOS 6 / 7

  • Mac:

    • libX11 can be installed by XQuartz

Building the code

CMake is used for the build system with a CMakeLists.txt file in each directory.

Here are the steps needed to build OCSSW using bash, cmake and make:

  1. Install Ubuntu 16.04
  2. Install cmake, Git and other libs

    $ apt install cmake git gfortran-5 tcsh
    $ apr install bison flex zlib1g-dev libx11-dev
    
  3. Download install_ocssw.py to your home directory.

  4. Install OCSSW binaries and source

    • Using the install_ocssw.py

      $ cd $HOME
      $ chmod +x install_ocssw.py
      $ ./install_ocssw.py -i ocssw -b v7.5 -s --aqua
      
    • or directly access the git repository

      $ git clone https://oceandata.sci.gsfc.nasa.gov/ocssw/ocssw-src.git [optional target directory name]
      
    • Grab the third party library sources and put them in opt

      $ cd $OCSSWROOT/opt
      $ wget https://oceandata.sci.gsfc.nasa.gov/ocssw/opt-src-<version>.tar
      $ tar -xvf opt-src-<version>.tar
      

      Note: the install_ocssw.py option for obtaining the source will do this for you

  5. Setup environment variables (usually in ~/.bashrc), e.g.:

    $ export CC=gcc-5
    $ export CXX=g++-5
    $ export FC=gfortran-5
    $ export OCSSWROOT=~/ocssw
    $ source $OCSSWROOT/OCSSW_bash.env
    
  6. Build the third party libraries

    $ cd $OCSSWROOT/opt
    $ rm -rf bin include lib share
    $ cd src
    $ ./BuildIt
    
  7. Download the VIIRS tar file containing the prebuilt VIIRS libraries to $OCSSWROOT

    $ cd $OCSSWROOT
    $ tar xzf viirs.ubuntu16.04.gcc5.v7.5.2.tar.gz
    

Note: for building on a Mac, use: VIIRS tar file

  1. Create build directory and run cmake CMake allows for out-of-source-tree builds. Make a directory for this and run cmake within it, e.g.:

    $ cd $OCSSWROOT/ocssw-src
    $ mkdir build
    $ cd build
    $ cmake ..
    

    Note: There are a few options you can give to cmake to control what extra software is built:_

    • BUILD_VIIRS_L1 - Build VIIRS L1 code (not yet open source, and will not work with SeaDAS yet …sorry…)
    • BUILD_HISTORICAL - Build the historical code (e.g. old seawifs binaries no longer needed)
    • BUILD_MISC - Build non-essential code

The “cmake ..” command is run like this to use one or more of these options:

```$ cmake .. -DBUILD_HISTORICAL=ON -DBUILD_MISC=ON```

Please be aware that not all the code required for these options
is available in the externally accessible source repository
  1. Build the OCSSW binaries

    $ cd $OCSSWROOT/ocssw-src/build
    $ export OCSSW_DEBUG=1 #could be set to 0 if not debugging
    $ make -j 20
    
  2. Install binaries into $OCSSWROOT/bin

    $ make install
    
  3. Grab all the data trees (if you want to use the binaries created, you’ll need these!)

See https://oceandata.sci.gsfc.nasa.gov/ocssw/ for manual installation or use install_ocssw.py or the SeaDAS GUI

Test the Shiny New Binraries

  • Download the benchmark package (314MB)
  • Un-tar the package:
    $ tar -xzvf seadas_benchmark.tar.gz
  • Change directories to the benchmark directory
    $ cd benchmark
  • Run the benchmark script:
    $ ./seadas_benchmark.bash