Skip to content

Commit

Permalink
Merge branch 'jgfouca/cmake_mct_csm_share' into next (PR #5964)
Browse files Browse the repository at this point in the history
Fifth merge to next for this PR.

[BFB]
  • Loading branch information
jgfouca committed Oct 4, 2023
2 parents 90e4edb + 653b97b commit b90b908
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions components/cmake/modules/FindNETCDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,26 @@ function(get_netcdf_libs ncpath nfpath)
# Get C libs
if (EXISTS ${ncconfig})
execute_process(COMMAND ${ncconfig} --libs OUTPUT_VARIABLE nclibs OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
find_library(nclibs netcdf REQUIRED PATHS ${ncpath}/lib ${ncpath}/lib64)
endif()

# Fall back to find_library
if (NOT nclibs)
find_library(nclibs_temp netcdf REQUIRED PATHS ${ncpath}/lib ${ncpath}/lib64)
set(nclibs ${nclibs_temp})
endif()

# Get fortran libs
if (EXISTS ${nfconfig})
execute_process(COMMAND ${nfconfig} --flibs OUTPUT_VARIABLE nflibs OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
find_library(nflibs netcdff REQUIRED PATHS ${nfpath}/lib ${nfpath}/lib64)
endif()

if (NOT nflibs)
find_library(nflibs_temp netcdff REQUIRED PATHS ${nfpath}/lib ${nfpath}/lib64)
set(nflibs ${nflibs_temp})
endif()

# C libs need to come last
set(GET_NETCDF_LIBS_RESULT "${nflibs} ${nclibs}" PARENT_SCOPE)
set(GET_NETCDF_LIBS_RESULT ${nflibs} ${nclibs} PARENT_SCOPE)
endfunction()

function(create_netcdf_target)
Expand Down
2 changes: 1 addition & 1 deletion components/eam/src/physics/rrtmgp/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include(${YAKL_HOME}/yakl_utils.cmake)
yakl_process_target(rrtmgp_interface)

# Libraries to link
target_link_libraries(rrtmgp_interface netcdf rrtmgp yakl)
target_link_libraries(rrtmgp_interface spio rrtmgp yakl)

# Where to find includes
target_include_directories(rrtmgp_interface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../external/cpp)
Expand Down

0 comments on commit b90b908

Please sign in to comment.