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
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ target_compile_definitions(shum
PUBLIC
${SHUM_DEFINES})

# BUILD_OPENMP goes as far as find_package(OpenMP) in ShumOptions.cmake, but
# the imported targets have to be linked for the option to have any effect.
# Without this, no -fopenmp reaches a compile line, _OPENMP is never defined
# and the OpenMP regions are preprocessed away, so a CMake build produces a
# serial library where the Makefile build (SHUM_OPENMP ?= true) produces a
# threaded one.
#
# PRIVATE is sufficient: _OPENMP is used inside c_shum_byteswap.c, never in an
# installed header, so consumers of shumlib do not need OpenMP flags of their
# own.
if(BUILD_OPENMP)
target_link_libraries(shum
PRIVATE
OpenMP::OpenMP_C
OpenMP::OpenMP_Fortran)
endif()

# Install shumlib and the C header files for the sub-libraries that
# have them
install(TARGETS shum
Expand Down Expand Up @@ -95,6 +112,16 @@ if(BUILD_TESTS)
PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY})
target_link_libraries(shumlib-tests PUBLIC fruit shum)

# The thread_utils tests exercise the OpenMP paths directly, and shumlib's
# OpenMP linkage is PRIVATE, so the test executable needs the flags in its
# own right.
if(BUILD_OPENMP)
target_link_libraries(shumlib-tests
PRIVATE
OpenMP::OpenMP_C
OpenMP::OpenMP_Fortran)
endif()

add_subdirectory(fruit)
setup_shum_fruit()

Expand Down
13 changes: 7 additions & 6 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Contributors

| GitHub user | Real Name | Affiliation | Date |
| --------------- | ---------------- | ----------- | ---------- |
| james-bruten-mo | James Bruten | Met Office | 2025-12-09 |
| t00sa | Sam Clarke-Green | Met Office | 2026-02-10 |
| jennyhickson | Jenny Hickson | Met Office | 2026-03-02 |
| yaswant | Yaswant Pradhan | Met Office | 2026-07-17 |
| GitHub user | Real Name | Affiliation | Date |
| --------------- | ---------------- | ----------- | ---------- |
| james-bruten-mo | James Bruten | Met Office | 2025-12-09 |
| t00sa | Sam Clarke-Green | Met Office | 2026-02-10 |
| jennyhickson | Jenny Hickson | Met Office | 2026-03-02 |
| yaswant | Yaswant Pradhan | Met Office | 2026-07-17 |
| ickc | Kolen Cheung | University of Exeter | 2026-09-16 |