IPPL fails to compile for CUDA
Compiling IPPL for CUDA fails with the error message
ippl/src/Solver/SolverParams.h(68): error: structured binding cannot be captured
The relevant line is in the output function
friend
std::ostream& operator<<(std::ostream& os, const SolverParams& sp) {
for (const auto& [key, value] : sp.params_m) {
std::visit([&](auto&& arg){
os << std::left << std::setw(20) << key // line 68
<< " " << arg << '\n';
}, value);
}
return os;
}
A similar error is produced when compiling IPPL with the current master branch of IPPL Solvers, except it's ParameterList
that fails to compile.
Loaded modules:
Currently Loaded Modulefiles:
1) cmake/3.19.2 2) gcc/10.2.0 3) cuda/11.2.2 4) openmpi/4.0.5-1_slurm 5) boost/1.73.0-1_slurm 6) psi-python37/2018.12 7) kokkos/3.3.01_dgx
Install script:
#!/bin/bash
# recipe for
P=ippl
ENABLE_FFT=OFF
# Build options
build_type=cuda
BUILD=Release
# Paths
export SRC_DIR=/data/user/me
export Kokkos_DIR=$KOKKOS_DIR
export PREFIX=/data/user/me/ippl_$build_type
export NJOBS=8
# internal variables
compiler="$(which mpicxx)"
CUDA=OFF
SERIAL=OFF
OPENMP=OFF
CXXFLAGS=""
if [[ "$build_type" == "cuda" ]]; then
echo "Build Cuda mode."
compiler="${Kokkos_DIR}/bin/nvcc_wrapper"
CXXFLAGS="--expt-extended-lambda"
elif [[ "$build_type" == "serial" ]]; then
echo "Build serial mode."
elif [[ "$build_type" == "openmp" ]]; then
echo "Build OpenMP mode."
else
echo "Wrong build type."
fi
# configure
mkdir -p "${SRC_DIR}/$P/build_"$build_type && cd "$_"
cmake \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_CXX_COMPILER="$compiler" \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DENABLE_IPPLTESTS=ON \
-DBUILD_UNIT_TESTS=OFF \
-DENABLE_FFT="${ENABLE_FFT}" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_BUILD_TYPE=$BUILD \
"${SRC_DIR}/$P"
# compile & install
make -j ${NJOBS}
make install