Skip to content

Commit

Permalink
STATIC_LINKING: remove hard-coded static linking for GPU builds
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed Feb 6, 2025
1 parent 79299b6 commit 374ce0b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-hpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
- -DENABLE_CUDA=ON
- -DENABLE_GPU_AWARE_MPI=ON
- -DENABLE_SINGLE_PRECISION=ON
- -DBUILD_SHARED_LIBS=OFF
dependencies:
ecmwf/eccodes:
version: develop
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ OpenACC programming model on Nvidia GPUs is supported.
Building
--------
The recommended option for building the GPU enabled ecWAM is to use the provided bundle, and pass the
`--with-loki --with-acc` options. Different Loki transformations can also be chosen at build-time via the following
bundle option: `--loki-mode=<trafo>`. Direct GPU-to-GPU MPI communications can be enabled by passing the
`--with-gpu-aware-mpi` option. CPU to GPU data transfers can be accelerated (via pinning of host-side allocations)
`--with-loki --with-acc --with-static-linking` options. Different Loki transformations can also be chosen at
build-time via the following bundle option: `--loki-mode=<trafo>`. Direct GPU-to-GPU MPI communications can be enabled by
passing the `--with-gpu-aware-mpi` option. CPU to GPU data transfers can be accelerated (via pinning of host-side allocations)
by building with the `--with-cuda` option.

The ecwam-bundle also provides appropriate arch files for the nvhpc suite on the ECMWF ATOS system.
Expand Down
4 changes: 4 additions & 0 deletions package/bundle/bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@ options :
- with-fckit :
help : Build fckit with Python virtual environment containing fypp and yaml parser
cmake : BUILD_fckit=ON

- with-static-linking :
help : Build static libraries by default
cmake : ECWAM_BUILD_SHARED_LIBS=OFF
8 changes: 0 additions & 8 deletions src/ecwam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -423,16 +423,8 @@ if( HAVE_SINGLE_PRECISION )
list(APPEND ECWAM_DEFINITIONS WAM_HAVE_SINGLE_PRECISION )
endif()

# Using dynamic linking creates undefined references to the device
# copies of module global variables
set( LIBRARY_TYPE SHARED )
if( HAVE_ACC )
set( LIBRARY_TYPE STATIC )
endif()

ecbuild_add_library(
TARGET ${ecwam}
TYPE ${LIBRARY_TYPE}
SOURCES ${ecwam_srcs}
PUBLIC_LIBS fiat parkind_${prec} ${ecwam}_intfb
${MPI_Fortran_LIBRARIES}
Expand Down

0 comments on commit 374ce0b

Please sign in to comment.