Skip to content

Commit 374ce0b

Browse files
committed
STATIC_LINKING: remove hard-coded static linking for GPU builds
1 parent 79299b6 commit 374ce0b

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

.github/workflows/build-hpc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
- -DENABLE_CUDA=ON
6868
- -DENABLE_GPU_AWARE_MPI=ON
6969
- -DENABLE_SINGLE_PRECISION=ON
70+
- -DBUILD_SHARED_LIBS=OFF
7071
dependencies:
7172
ecmwf/eccodes:
7273
version: develop

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ OpenACC programming model on Nvidia GPUs is supported.
230230
Building
231231
--------
232232
The recommended option for building the GPU enabled ecWAM is to use the provided bundle, and pass the
233-
`--with-loki --with-acc` options. Different Loki transformations can also be chosen at build-time via the following
234-
bundle option: `--loki-mode=<trafo>`. Direct GPU-to-GPU MPI communications can be enabled by passing the
235-
`--with-gpu-aware-mpi` option. CPU to GPU data transfers can be accelerated (via pinning of host-side allocations)
233+
`--with-loki --with-acc --with-static-linking` options. Different Loki transformations can also be chosen at
234+
build-time via the following bundle option: `--loki-mode=<trafo>`. Direct GPU-to-GPU MPI communications can be enabled by
235+
passing the `--with-gpu-aware-mpi` option. CPU to GPU data transfers can be accelerated (via pinning of host-side allocations)
236236
by building with the `--with-cuda` option.
237237

238238
The ecwam-bundle also provides appropriate arch files for the nvhpc suite on the ECMWF ATOS system.

package/bundle/bundle.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,7 @@ options :
9797
- with-fckit :
9898
help : Build fckit with Python virtual environment containing fypp and yaml parser
9999
cmake : BUILD_fckit=ON
100+
101+
- with-static-linking :
102+
help : Build static libraries by default
103+
cmake : ECWAM_BUILD_SHARED_LIBS=OFF

src/ecwam/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,16 +423,8 @@ if( HAVE_SINGLE_PRECISION )
423423
list(APPEND ECWAM_DEFINITIONS WAM_HAVE_SINGLE_PRECISION )
424424
endif()
425425

426-
# Using dynamic linking creates undefined references to the device
427-
# copies of module global variables
428-
set( LIBRARY_TYPE SHARED )
429-
if( HAVE_ACC )
430-
set( LIBRARY_TYPE STATIC )
431-
endif()
432-
433426
ecbuild_add_library(
434427
TARGET ${ecwam}
435-
TYPE ${LIBRARY_TYPE}
436428
SOURCES ${ecwam_srcs}
437429
PUBLIC_LIBS fiat parkind_${prec} ${ecwam}_intfb
438430
${MPI_Fortran_LIBRARIES}

0 commit comments

Comments
 (0)