Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed build system to accomodate name change of bacio library in bacio-2.5.0 release #592

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS Fortran)
endif()

# Find the NCEPLIBS packages we need.
find_package(sfcio 1.4.0 REQUIRED)
find_package(w3nco 2.4.0 REQUIRED)
find_package(bacio 2.4.0 REQUIRED)
Expand All @@ -67,6 +68,16 @@ find_package(g2 3.4.0 REQUIRED)
find_package(wgrib2 2.0.8 REQUIRED)
find_package(sigio 2.3.0 REQUIRED)

# The name of the bacio library changed with the 2.5.0 release. The
# "_4" was removed from the library and include directory name in the
# bacio-2.5.0 release. Set a name variable to be used in the rest of
# the cmake build.
if(bacio_VERSION GREATER_EQUAL 2.5.0)
set(bacio_name bacio)
else()
set(bacio_name bacio_4)
endif()

# EMC requires executables in ./exec
set(exec_dir bin)
if(EMC_EXEC_DIR)
Expand Down
2 changes: 1 addition & 1 deletion sorc/chgres_cube.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target_link_libraries(
nemsio::nemsio
sfcio::sfcio
sigio::sigio
bacio::bacio_4
bacio::${bacio_name}
sp::sp_d
w3nco::w3nco_d
esmf
Expand Down
2 changes: 1 addition & 1 deletion sorc/emcsfc_ice_blend.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(exe_name emcsfc_ice_blend)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(
${exe_name}
bacio::bacio_4
bacio::${bacio_name}
g2::g2_4
w3nco::w3nco_4)

Expand Down
2 changes: 1 addition & 1 deletion sorc/emcsfc_snow2mdl.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ target_link_libraries(snow2mdl_lib
g2::g2_d
ip::ip_d
sp::sp_d
bacio::bacio_4
bacio::${bacio_name}
w3nco::w3nco_d)

if(OpenMP_Fortran_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion sorc/global_cycle.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ target_link_libraries(
global_cycle_lib
PUBLIC
w3nco::w3nco_d
bacio::bacio_4
bacio::${bacio_name}
ip::ip_d
sp::sp_d
MPI::MPI_Fortran
Expand Down
6 changes: 5 additions & 1 deletion sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is the CMake file for the orog.fd directory in UFS_UTILS.
#
# Mark Potts, Kyle Gerheiser, Rahul Mahajan, Ed Hartnett

set(lib_src netcdf_io.F90)
set(exe_src mtnlm7_oclsm.f)

Expand All @@ -22,7 +26,7 @@ target_include_directories(orog_lib INTERFACE ${mod_dir})
target_link_libraries(
orog_lib
PUBLIC
bacio::bacio_4
bacio::${bacio_name}
w3nco::w3nco_d
ip::ip_d
sp::sp_d
Expand Down