Steps to rebuild a single executable?

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
bruce
Posts: 85
Joined: Thu Mar 17, 2005 4:36 pm America/New_York
Answers: 0

Steps to rebuild a single executable?

by bruce » Wed Jun 13, 2018 9:32 am America/New_York

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

Filters:

bruce
Posts: 85
Joined: Thu Mar 17, 2005 4:36 pm America/New_York
Answers: 0

Steps to rebuild a single executable?

by bruce » Wed Jun 13, 2018 4:01 pm America/New_York

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

OB SeaDAS - dshea
Subject Matter Expert
Subject Matter Expert
Posts: 271
Joined: Thu Mar 05, 2009 10:25 am America/New_York
Answers: 0
Been thanked: 2 times

Steps to rebuild a single executable?

by OB SeaDAS - dshea » Wed Jun 13, 2018 4:17 pm America/New_York

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

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

Steps to rebuild a single executable?

by gnwiii » Thu Jun 14, 2018 6:41 am America/New_York

l2gen needs many OCSSW (as opposed to 3rd party) libraries, so building everything is not much more work and is a well-trodden path.

bruce
Posts: 85
Joined: Thu Mar 17, 2005 4:36 pm America/New_York
Answers: 0

Steps to rebuild a single executable?

by bruce » Thu Jun 14, 2018 11:00 am America/New_York

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.

OB.DAACx - SeanBailey
Posts: 1519
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 9 times

Steps to rebuild a single executable?

by OB.DAACx - SeanBailey » Thu Jun 14, 2018 11:16 am America/New_York

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

bruce
Posts: 85
Joined: Thu Mar 17, 2005 4:36 pm America/New_York
Answers: 0

Steps to rebuild a single executable?

by bruce » Tue Jun 19, 2018 9:15 am America/New_York

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).

Post Reply