Building the 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.
- gcc (5 or higher)
- g++ (matching gcc version)
- gfortran (matching gcc version)
additional known OS-specific requirements:
- 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:
- Install Ubuntu 16.04
Install cmake, Git and other libs
apt install cmake git gcc-9 gfortran-9 tcsh apr install bison flex zlib1g-dev libx11-dev
Download install_ocssw and manifest.py to your home directory.
Install OCSSW binaries, benchmark and source
cd $HOME chmod +x install_ocssw ./install_ocssw -i ocssw -t V2020.2 --benchmark --src
Setup environment variables (usually in ~/.bashrc), e.g.:
export CC=gcc-9 export CXX=g++-9 export FC=gfortran-9 export OCSSWROOT=~/ocssw source $OCSSWROOT/OCSSW_bash.env
Build the third party libraries
cd $OCSSWROOT/opt rm -rf bin include lib share cd src ./BuildIt.py
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_HISTORICAL - Build the historical code (e.g. old seawifs binaries no longer needed)
- BUILD_MISC - Build non-essential code
- BUILD_AHMAD_FRASER - Build the AF radiative transfer code
- BUILD_ALL - Build ALL the 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
- Build and install the OCSSW binaries
cd $OCSSWROOT/ocssw-src/build export OCSSW_DEBUG=1 #could be set to 0 if not debugging make -j 20 install
Test the Shiny New Binaries
- Change directories to the benchmark directory
- Run the benchmark script: