Skip to content

Commit

Permalink
Fixes for ninja build race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Jan 17, 2024
1 parent 1aa5ab1 commit 7258aff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Explictly `use` some `iso_c_binding` types previously pulled in through ESMF. This is fixed in future ESMF versions (8.7+) and so
we anticipate this here
- Add explicit `Fortran_MODULE_DIRECTORY` to `CMakeLists.txt` in benchmarks to avoid race condition in Ninja builds

### Removed

Expand Down
4 changes: 3 additions & 1 deletion benchmarks/io/checkpoint_simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
set(exe checkpoint_simulator.x)
set(MODULE_DIRECTORY ${esma_include}/benchmarks/io/checkpoint_simulator)

ecbuild_add_executable (
TARGET ${exe}
SOURCES checkpoint_simulator.F90
SOURCES checkpoint_simulator.F90
DEFINITIONS USE_MPI)

target_link_libraries (${exe} PRIVATE MAPL.shared MPI::MPI_Fortran FARGPARSE::fargparse esmf )
target_include_directories (${exe} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${exe} PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/io/combo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(exe combo.x)
set(MODULE_DIRECTORY ${esma_include}/benchmarks/io/combo)

ecbuild_add_executable (
TARGET ${exe}
Expand All @@ -7,6 +8,7 @@ ecbuild_add_executable (

target_link_libraries (${exe} PRIVATE MAPL.shared MPI::MPI_Fortran FARGPARSE::fargparse)
target_include_directories (${exe} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (${exe} PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/io/gatherv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
set(MODULE_DIRECTORY ${esma_include}/benchmarks/io/gatherv)

ecbuild_add_executable (
TARGET gatherv.x
SOURCES GathervKernel.F90 GathervSpec.F90 driver.F90
DEFINITIONS USE_MPI)

target_link_libraries (gatherv.x PRIVATE MAPL.shared MPI::MPI_Fortran FARGPARSE::fargparse)
target_include_directories (gatherv.x PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (gatherv.x PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/io/raw_bw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
set(MODULE_DIRECTORY ${esma_include}/benchmarks/io/raw_bw)

ecbuild_add_executable (
TARGET raw_bw.x
SOURCES BW_Benchmark.F90 BW_BenchmarkSpec.F90 driver.F90
DEFINITIONS USE_MPI)

target_link_libraries (raw_bw.x PRIVATE MAPL.shared MPI::MPI_Fortran FARGPARSE::fargparse)
target_include_directories (raw_bw.x PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
set_target_properties (raw_bw.x PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
Expand Down

0 comments on commit 7258aff

Please sign in to comment.