diff --git a/.github/workflows/build-hpc.yml b/.github/workflows/build-hpc.yml index 543ecf35..b5f50130 100644 --- a/.github/workflows/build-hpc.yml +++ b/.github/workflows/build-hpc.yml @@ -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 diff --git a/README.md b/README.md index 8ee1e9c8..cdc5efc6 100644 --- a/README.md +++ b/README.md @@ -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=`. 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=`. 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. diff --git a/package/bundle/bundle.yml b/package/bundle/bundle.yml index fa5a19ae..a61386dc 100644 --- a/package/bundle/bundle.yml +++ b/package/bundle/bundle.yml @@ -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 diff --git a/src/ecwam/CMakeLists.txt b/src/ecwam/CMakeLists.txt index db9b85e5..74ec9e87 100644 --- a/src/ecwam/CMakeLists.txt +++ b/src/ecwam/CMakeLists.txt @@ -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}