Build fv3-jedi outside of jedi-bundle

Building fv3-jedi outside of jedi-bundle

-- ---------------------------------------------------------

-- Build summary

-- ---------------------------------------------------------

-- system : [host] [Linux-5.15.0-1088-azure] [linux.64]

-- processor        : [x86_64]

-- endiness         : Little Endian -- IEEE []

-- build type       : [Release]

-- timestamp        : [20251203175550]

-- install prefix   : [/path/to/fv3-jedi-develop]

--   bin dir        : [/path/to/fv3-jedi-develop/bin]

--   lib dir        : [/path/to/fv3-jedi-develop/lib]

--   include dir    : [/path/to/fv3-jedi-develop/include]

--   data dir       : [/path/to/fv3-jedi-develop/share/fv3jedi]

--   cmake dir      : [/path/to/fv3-jedi-develop/lib/cmake/fv3jedi]

-- ---------------------------------------------------------

-- C -- IntelLLVM 2024.2.1

--     compiler   : /path/to/oneapi/icx

--     flags      :  -O3 -DNDEBUG  

--     link flags : 

-- CXX -- IntelLLVM 2024.2.1

--     compiler   : /path/to/oneapi/icpx

--     flags      :  -O3 -DNDEBUG  

--     link flags : 

-- Fortran -- Intel 2021.1.0.20240703

--     compiler   : /path/to/oneapi/ifx

--     flags      :  -O3 -DNDEBUG -unroll -inline -heap-arrays 32  

--     link flags : 

-- linker : /path/to/ld

-- ar     : /usr/bin/ar

-- ranlib : /usr/bin/ranlib

-- link flags

--     executable [    -Wl,--disable-new-dtags ]

--     shared lib [ -Wl,--disable-new-dtags ]

--     static lib [ -Wl,--disable-new-dtags ]

-- install rpath  : /path/to/fv3-jedi-develop/lib /path/to/fv3-jedi-develop/lib64 $ORIGIN/../lib

-- common definitions: ENABLE_GSIBEC=1

-- ---------------------------------------------------------

-- Feature summary

-- ---------------------------------------------------------

-- The following features have been enabled:

 * TESTS, fv3jedi: Enable the unit tests

-- The following OPTIONAL packages have been found:


 * Git

 * jedicmake

 * MKL

 * PkgConfig

 * Perl


-- The following REQUIRED packages have been found:


 * ecbuild (required version >= 3.6)

 * atlas (required version >= 0.35.0)

 * BLAS

 * boost_headers (required version == 1.84.0)

 * oops (required version >= 1.10.0)

 * saber (required version >= 1.10.0)

 * crtm (required version >= 2.2.3)

 * gsibec (required version >= 1.2.1)

 * sp

 * Threads

 * ufo (required version >= 1.10.0)

 * vader (required version >= 1.7.0)

 * OpenMP

 * MPI

 * NetCDF

 * FMS (required version >= 2023.04)

 * fv3jedilm (required version >= 1.5.0)


-- The following OPTIONAL packages have not been found:


 * ropp-ufo


-- Configuring done (46.0s)

CMake Error at /path/to/ioda-develop/lib/cmake/ioda/ioda-targets.cmake:105 (set_target_properties):

  The link interface of target "ioda" contains:

    NetCDF::NetCDF_CXX

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.

    * A find_package call is missing for an IMPORTED target.

    * An ALIAS target is missing.

ioda is built against netcdf-cxx (which is distinct from netcdf-cxx4).

Unclear on how to proceed given the above error.

Hi @rickgrubin-noaa, we recently repaired a similar looking issue with a Met Office build process. The fix was to make sure that the FindNetCDF from jedi-cmake was being used. jedi-cmake uses the NOAA CMakeModules repo which supplies the FindNetCDF script:

You’ve already got jedicmake in the list you posted, and the fix we made was to move the find_package command for netCDF from before the find_package for jedicmake to after. This is what we have now:

find_package( jedicmake REQUIRED )
find_package( NetCDF REQUIRED COMPONENTS C Fortran CXX ) # Prefer find NetCDF by jedicmake

If you are already doing this, then could you post any more (if any) details/messages about this CMake error.

Thanks!

Hi @stephenh

If’ I’m not mistaken, what you’ve shown with respect to find_package() is from ioda@develop / CMakeLists.txt – true? If so, that’s what I see when building ioda, and that build succeeds.

For fv3-jedi:

fv3-jedi@develop / CMakeLists.txt

################################################################################
# Dependencies
################################################################################

# jedi-cmake
find_package( jedicmake QUIET )

# NetCDF

find_package( NetCDF REQUIRED COMPONENTS C Fortran )

and as shown in the original post, jedicmake is optional here (and is found), an NetCDF is required – though just the C and Fortran components, NOT the C++ component – and, further the requests to find said packages are in the preferential order you mention.

The question is why, after fv3-jedi successfully configures, is a cmake file from ioda that is looking for NetCDF_CXX playing a part in the build for fv3-jedi?

And ancillary to that: why does ioda require both netcdf-cxx (as evidenced by the aforementioned cmake file) to build? Is it somehow using both netcdf-cxx AND netcdf-cxx4?