Recompiling SeaDAS processing C source code

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
paolocol
Posts: 6
Joined: Mon Nov 08, 2021 6:38 am America/New_York
Answers: 0

Recompiling SeaDAS processing C source code

by paolocol » Mon Nov 08, 2021 8:45 am America/New_York

As I need to run SeaDAS processing SW with some modifications, for research purposes, I'd need to modify some C source programs and recompile l2gen executable.
Is it possible to get somewhere the makefile or any other instruction to recompile l2gen (or all the SeaDAS processing executable)?
Thanks
Paolo

Tags:

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

Re: Recompiling SeaDAS processing C source code

by gnwiii » Mon Nov 08, 2021 10:16 am America/New_York

paolocol wrote: Mon Nov 08, 2021 8:45 am America/New_York As I need to run SeaDAS processing SW with some modifications, for research purposes, I'd need to modify some C source programs and recompile l2gen executable.
Is it possible to get somewhere the makefile or any other instruction to recompile l2gen (or all the SeaDAS processing executable)?
See: https://oceancolor.gsfc.nasa.gov/docs/ocssw/

You don't mention the platform. I have done this many times and it is not a simple process if you can't use the same OS version NASA used. I usually used a much newer OS version due to IT requirements/standards and other software we were using for the project (Matlab, R, IDL, ENVI, etc).

Note that some VIIRS L1 code is not (yet?) available as source, and you may need C++ and Fortran compilers. You need to be careful that your build doesn't use some distro or locally installed versions of the 3rd party libraries, as they are often built with different options than those used by NASA. On linux you should be able to use your platforms GNU C, C++, and Fortran compilers. I always start by building the 3rd party libraries with the platform tools. There are often some minor issues on a given platform so you may need to contact distro forums for help.

paolocol
Posts: 6
Joined: Mon Nov 08, 2021 6:38 am America/New_York
Answers: 0

Re: Recompiling SeaDAS processing C source code

by paolocol » Mon Nov 08, 2021 10:28 am America/New_York

Sorry, I run SeaDAS on Linux Cent OS (the same of the binary distribution from NASA).
I'm not interested in processing VIIRS products, so unavailability of VIIRS processing code is not a problem.
C compiler is a classic gcc.
I've to check the availability of the Fortran compiler.

I know that recompiling SeaDAS or part of it is not a easy task, therefore I'm wondering if a makefile to recompile the l2gen C source code is available (I suppose that exists as it has been used by NASA to generate binary executable of SeaDAS distribution).

Is it available somewhere?
Thanks
P

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

Re: Recompiling SeaDAS processing C source code

by gnwiii » Mon Nov 08, 2021 5:50 pm America/New_York

I doubt there is any reliable shortcut -- just follow NASA's instructions. If you stick with the same compiler versions NASA uses you should not encounter the problems that arise using different OS's. The build uses CMake, which does rather extensive checking to for the required libraries and header files before generating a Makefile that uses the proper libraries. It is usually better to let CMake discover any issues than to discover them while building l2gen, or worse, by ending up with bugs in l2gen from using the wrong versions of headers or libraries.
If you only need l2gen, instead of running Cmake and then make in the build directory, you can try running Cmake in the build directory and make in the build/src/l2gen directory. That should avoid building the programs you don't need. You can always go back and build other programs as you need them.

Post Reply