From 49ccaf706adc5383ba9c5b8b61c6bb472e9a8fc2 Mon Sep 17 00:00:00 2001 From: Razvan Aguridan Date: Wed, 13 Nov 2024 13:29:45 +0200 Subject: [PATCH] Fix compilation with cce 17.0.1 --- src/multio/tools/CMakeLists.txt | 13 ++++++++----- tests/multio/CMakeLists.txt | 19 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/multio/tools/CMakeLists.txt b/src/multio/tools/CMakeLists.txt index 3b1f43c6..b2c1bdd1 100644 --- a/src/multio/tools/CMakeLists.txt +++ b/src/multio/tools/CMakeLists.txt @@ -49,11 +49,14 @@ ecbuild_add_executable( TARGET multio-feed SOURCES multio-feed.cc MultioTool.cc LIBS multio-api ) -# TODO ADD SOME FCKIT condition -ecbuild_add_executable( TARGET multio-replay-nemo-fapi - CONDITION HAVE_FORTRAN - SOURCES multio-replay-nemo-fapi.f90 - LIBS multio-fapi fckit MPI::MPI_Fortran ) +ecbuild_find_mpi(COMPONENTS Fortran) +if( HAVE_MPI AND TARGET MPI::MPI_Fortran ) + # TODO ADD SOME FCKIT condition + ecbuild_add_executable( TARGET multio-replay-nemo-fapi + CONDITION HAVE_FORTRAN + SOURCES multio-replay-nemo-fapi.f90 + LIBS multio-fapi fckit MPI::MPI_Fortran ) +endif() # TODO: add atlas condition/dependency ecbuild_add_executable( TARGET multio-generate-grib-template diff --git a/tests/multio/CMakeLists.txt b/tests/multio/CMakeLists.txt index 3034e3fe..1f925a9b 100644 --- a/tests/multio/CMakeLists.txt +++ b/tests/multio/CMakeLists.txt @@ -232,14 +232,17 @@ ecbuild_add_test( TARGET test_multio_replay_nemo_capi_initdefault_passdown ENVIRONMENT "${_test_environment}" ) -ecbuild_add_test( TARGET test_multio_replay_nemo_fapi - CONDITION HAVE_FORTRAN - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/replay-nemo.sh - TEST_DEPENDS multio_replay_get_test_data - ARGS $ - $ ${MPIEXEC_EXECUTABLE} ${MPI_ARGS} - ENVIRONMENT "${_test_environment}" -) +ecbuild_find_mpi(COMPONENTS Fortran) +if( HAVE_MPI AND TARGET MPI::MPI_Fortran ) + ecbuild_add_test( TARGET test_multio_replay_nemo_fapi + CONDITION HAVE_FORTRAN + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/replay-nemo.sh + TEST_DEPENDS multio_replay_get_test_data + ARGS $ + $ ${MPIEXEC_EXECUTABLE} ${MPI_ARGS} + ENVIRONMENT "${_test_environment}" + ) +endif() ecbuild_add_test( TARGET test_multio_replay_nemo_capi_masked COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/replay-nemo.sh