Page 1 of 1

Steps to rebuild a single executable?

Posted: Wed Jun 13, 2018 9:32 am America/New_York
by bruce
There are plenty of discussions on the methods and pitfalls to recompile/rebuild "all" of SeaDAS.  Suppose I only want to recompile one image (l2gen in my case).  What steps are needed to do that?

Thanks!
Bruce

Steps to rebuild a single executable?

Posted: Wed Jun 13, 2018 4:01 pm America/New_York
by bruce
Decided I'd try and build it all, since I may want to do more than l2gen later.

CentOS 7.5

Figured I probably didn't need to do any of the 3rd party stuff so jumped right to

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 <ocssw source directory> (e.g. $OCSSWROOT/ocssw-src)
$ mkdir build
$ cd build
$ cmake ..

which gets me...
[bcb@modis build]$ cmake ..
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The Fortran compiler identification is GNU
-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.5")
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find Jansson (missing: JANSSON_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  oel_util/cmake/Modules/FindJansson.cmake:61 (find_package_handle_standard_args)
  oel_util/libgenutils/CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "/seadas/lcl/ocssw/ocssw-src/build/CMakeFiles/CMakeOutput.log".
[bcb@modis build]$

What's next?
attachment 1

Steps to rebuild a single executable?

Posted: Wed Jun 13, 2018 4:17 pm America/New_York
by OB SeaDAS - dshea
It would be easier to rebuild all of lib3(opt).  Many libraries need to be compiled by the same compiler, so lib3 must be compiled with the same compiler as OCSSW.  If you are a glutton for punishment you can try to rebuild only the lib3 parts you need. We do not distribute the include, so you need to install all of those.  This may not even work since the fortran libs are quite problematic.

Your first case you are missing the include files for the jansson library.

$ cd $OCSSWROOT/opt/src/jansson
$ ./BuildIt

There will be many more libs to build after this on is done.

don

Steps to rebuild a single executable?

Posted: Thu Jun 14, 2018 6:41 am America/New_York
by gnwiii
l2gen needs many OCSSW (as opposed to 3rd party) libraries, so building everything is not much more work and is a well-trodden path.

Steps to rebuild a single executable?

Posted: Thu Jun 14, 2018 11:00 am America/New_York
by bruce
Well, I bit the bullet, but I think it put it in my mouth backwards :-)

By default CentOS 7.5 comes with cmake xx.xxx.xx.xx, but HDF5 requires 3.1.0

Off on my next adventure.

Steps to rebuild a single executable?

Posted: Thu Jun 14, 2018 11:16 am America/New_York
by OB.DAACx - SeanBailey
Bruce,
We will have step-by-step instructions (with prerequisites defined) soon-ish.  Don was working on them but is off this week.  Hopefully by the end of the month we can point you to them.
BTW, you can install cmake locally - no need to rely on the system default version

Sean

Steps to rebuild a single executable?

Posted: Tue Jun 19, 2018 9:15 am America/New_York
by bruce
Yes, I could do a local build of cmake, but decided to switch from centos to ubuntu (18.04, not 16 - unity is an abomination).