Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/build-ci/manifests/gcc.spack.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ spack:
- path: $SPACK_MANIFEST_REPOSITORY_PATH/.github/build-ci/config
specs:
- cable@git.{{ ref }}
- cable@git.{{ ref }}+mpi+pio
packages:
all:
require:
Expand Down
1 change: 1 addition & 0 deletions .github/build-ci/manifests/intel.spack.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ spack:
- path: $SPACK_MANIFEST_REPOSITORY_PATH/.github/build-ci/config
specs:
- cable@git.{{ ref }}
- cable@git.{{ ref }}+mpi+pio
packages:
all:
require:
Expand Down
20 changes: 14 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,12 @@ else()
# third party libs
if(CABLE_MPI)
find_package(MPI REQUIRED COMPONENTS Fortran)
# PIO is an extension of the MPI build, and is used if it can be found
find_package(PIO COMPONENTS Fortran QUIET)
if(TARGET PIO::PIO_Fortran)
message(STATUS "Found PIO_Fortran: ${PIO_DIR}")
else()
message(STATUS "PIO_Fortran not found: building without PIO support")
endif()
endif()
if(CABLE_TESTS)
Expand All @@ -233,9 +236,11 @@ else()
set(fortuno_libs Fortuno::fortuno_serial)
endif ()
include(FetchContent)
# Use a locally installed Fortuno if one can be found, otherwise clone it
FetchContent_Declare(Fortuno
GIT_REPOSITORY https://github.com/fortuno-repos/fortuno
GIT_TAG eb61214fd76d6235a3072b6f8ed83d0380c2f266
FIND_PACKAGE_ARGS NAMES Fortuno
)
FetchContent_MakeAvailable(Fortuno)
endif()
Expand Down Expand Up @@ -384,13 +389,16 @@ else()
target_link_libraries(cable_common PRIVATE PkgConfig::NETCDF)

if(CABLE_MPI)
target_compile_definitions(cable_common PRIVATE __MPI__)
target_link_libraries(cable_common PRIVATE MPI::MPI_Fortran)
endif()
target_compile_definitions(cable_common PRIVATE __MPI__)
target_link_libraries(cable_common PRIVATE MPI::MPI_Fortran)

if(TARGET PIO::PIO_Fortran)
target_link_libraries(cable_common PRIVATE PIO::PIO_Fortran)
target_sources(cable_common PRIVATE src/util/netcdf/pio/cable_netcdf_pio.F90)
# PIO is only available as part of the MPI build
if(TARGET PIO::PIO_Fortran)
target_link_libraries(cable_common PRIVATE PIO::PIO_Fortran)
target_sources(cable_common PRIVATE src/util/netcdf/pio/cable_netcdf_pio.F90)
else()
target_sources(cable_common PRIVATE src/util/netcdf/pio/cable_netcdf_pio_stub.F90)
endif()
else()
target_sources(cable_common PRIVATE src/util/netcdf/pio/cable_netcdf_pio_stub.F90)
endif()
Expand Down
Loading