NCAR / obs2ioda

Converter developed by @jamiebresch to transform conventional and remote sensing observations in different formats to the IODA format needed in JEDI
4 stars 4 forks source link

Feature: CMake Build Support for obs2ioda-v2 #11

Closed amstokely closed 1 month ago

amstokely commented 1 month ago

TYPE: enhancement

KEYWORDS: cmake, build system, compiler compatibility

DESCRIPTION OF CHANGES:
Problem:
The obs2ioda-v2 library lacked support for CMake-based builds, which complicated the build process across different platforms and made compiler compatibility (GNU and Intel) more difficult to manage.

Solution:

These changes improve the ease of configuration and build process, while maintaining compatibility with multiple compilers.

junmeiban commented 1 month ago

@amstokely , I sourced gnu-derecho.csh before compile. I compiled bufr library successfully, but got failure when compile obs2ioda:

obs2ioda_20241001/build> make
Scanning dependencies of target v2
[  6%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/kinds.f90.o
[ 13%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/ufo_variables_mod.F90.o
[ 20%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/define_mod.f90.o
f951: Fatal Error: Reading module '/glade/work/jban/pandac/obs2ioda_20241001/obs2ioda/obs2ioda-v2/src/kinds.mod' at line 1 column 2: Unexpected EOF
compilation terminated.
make[2]: *** [obs2ioda-v2/CMakeFiles/v2.dir/build.make:75: obs2ioda-v2/CMakeFiles/v2.dir/src/define_mod.f90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: obs2ioda-v2/CMakeFiles/v2.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I must miss something. Do you have any idea? Many thanks (my build dir: /glade/work/jban/pandac/obs2ioda_20241001/build)

amstokely commented 1 month ago

@amstokely , I sourced gnu-derecho.csh before compile. I compiled bufr library successfully, but got failure when compile obs2ioda:


obs2ioda_20241001/build> make

Scanning dependencies of target v2

[  6%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/kinds.f90.o

[ 13%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/ufo_variables_mod.F90.o

[ 20%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/define_mod.f90.o

f951: Fatal Error: Reading module '/glade/work/jban/pandac/obs2ioda_20241001/obs2ioda/obs2ioda-v2/src/kinds.mod' at line 1 column 2: Unexpected EOF

compilation terminated.

make[2]: *** [obs2ioda-v2/CMakeFiles/v2.dir/build.make:75: obs2ioda-v2/CMakeFiles/v2.dir/src/define_mod.f90.o] Error 1

make[1]: *** [CMakeFiles/Makefile2:100: obs2ioda-v2/CMakeFiles/v2.dir/all] Error 2

make: *** [Makefile:136: all] Error 2

I must miss something. Do you have any idea? Many thanks (my build dir: /glade/work/jban/pandac/obs2ioda_20241001/build)

Could rebuild with -DCMAKE_VERBOSE_MAKEFILE and send me the cmake and make output?

amstokely commented 1 month ago

@amstokely , I sourced gnu-derecho.csh before compile. I compiled bufr library successfully, but got failure when compile obs2ioda:


obs2ioda_20241001/build> make

Scanning dependencies of target v2

[  6%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/kinds.f90.o

[ 13%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/ufo_variables_mod.F90.o

[ 20%] Building Fortran object obs2ioda-v2/CMakeFiles/v2.dir/src/define_mod.f90.o

f951: Fatal Error: Reading module '/glade/work/jban/pandac/obs2ioda_20241001/obs2ioda/obs2ioda-v2/src/kinds.mod' at line 1 column 2: Unexpected EOF

compilation terminated.

make[2]: *** [obs2ioda-v2/CMakeFiles/v2.dir/build.make:75: obs2ioda-v2/CMakeFiles/v2.dir/src/define_mod.f90.o] Error 1

make[1]: *** [CMakeFiles/Makefile2:100: obs2ioda-v2/CMakeFiles/v2.dir/all] Error 2

make: *** [Makefile:136: all] Error 2

I must miss something. Do you have any idea? Many thanks (my build dir: /glade/work/jban/pandac/obs2ioda_20241001/build)

@junmeiban 27f887f5Should fix this problem!

junmeiban commented 1 month ago

@amstokely It works. Thank you so much!