Intel 2022.0.0 unconvinced that string literals are `constexpr` in `perf_test`
- [ ] I'm not sure why only the
perf_testbinaries have this problem. - [ ] Kokkos reports the compiler version is
2022.0.0but lmod says2022.1.2.
On Blake:
export ROOT_DIR=<put something here>
export KOKKOS_SHA=f8788ef2ae1940b627cc6ebc6abeef2c34e7e8dc # 2023 11 30
export KOKKOS_SRC="$ROOT_DIR/kokkos-${KOKKOS_SHA:0:8}"
export KOKKOS_BUILD="$ROOT_DIR/kokkos-build-${KOKKOS_SHA:0:8}"
export KOKKOS_INSTALL="$ROOT_DIR/kokkos-install-${KOKKOS_SHA:0:8}"
export KERNELS_SHA=a80eb9114ddda2d9454e4f3cc8a3dd5143ecdfc8 # 2023 11 30
export KERNELS_SRC="$ROOT_DIR/kernels-${KERNELS_SHA:0:8}"
export KERNELS_BUILD="$ROOT_DIR/kernels-build-${KERNELS_SHA:0:8}"
export MODULEPATH="$MODULEPATH:/projects/x86-64/modulefiles"
module load intel/oneAPI/hpc-toolkit/2022.1.2
module load cmake
# intel blows up SSH for some reason?
module del intel/oneAPI/hpc-toolkit/2022.1.2
git clone [email protected]:kokkos/kokkos.git "$KOKKOS_SRC" || true
(cd "$KOKKOS_SRC" && git checkout $KOKKOS_SHA) || true
git clone [email protected]:kokkos/kokkos-kernels.git "$KERNELS_SRC" || true
(cd "$KERNELS_SRC" && git checkout $KERNELS_SHA) || true
# re-set up our environment
module load intel/oneAPI/hpc-toolkit/2022.1.2
module load cmake
## Configure Kokkos
cmake -S "$KOKKOS_SRC" -B "$KOKKOS_BUILD" \
-DCMAKE_INSTALL_PREFIX="$KOKKOS_INSTALL" \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=icpx \
-DKokkos_ENABLE_OPENMP=ON \
-DKokkos_ARCH_SPR=ON
## Build & Install Kokkos
cmake --build "$KOKKOS_BUILD" -j "$(nproc)" -t install
## Configure Kernels
cmake -S "$KERNELS_SRC" -B "$KERNELS_BUILD" \
-DKokkos_DIR="$KOKKOS_INSTALL/lib64/cmake/Kokkos" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=icpx \
-DKokkosKernels_ENABLE_TPL_MKL=ON \
-DKokkosKernels_ENABLE_TESTS=ON \
-DKokkosKernels_ENABLE_PERFTESTS=ON \
-DKokkosKernels_ENABLE_BENCHMARK=ON
## Build Kernels
VERBOSE=1 cmake --build "$KERNELS_BUILD" -j "$(nproc)"
Yields errors like this (only in perf_test)
In file included from .../perf_test/BenchmarkMain.cpp:21:
In file included from .../perf_test/Benchmark_Context.hpp:31:
.../KokkosKernels_Version_Info.hpp:25:28: error: constexpr variable 'GIT_BRANCH' must be initialized by a constant expression
constexpr std::string_view GIT_BRANCH = R"branch(HEAD)branch";
A possible fix is to make KokkosKernels_Version_Info.hpp look like this:
namespace KokkosKernels {
namespace Impl {
using namespace std::string_view_literals; // add this
constexpr std::string_view GIT_BRANCH = R"branch(HEAD)branch"sv; // add sv
...
} // namespace Impl
} // namespace KokkosKernels
I am getting the same compilation error at a blake compute node. I used the latest versions of kokkos-core develop and kokkos-kernels develop, as of 2024-03-05, around 10:40 AM MT. Here are my steps:
ssh caraway module load cmake/3.25.2 module load intel/oneAPI/hpc-toolkit/2022.1.2 salloc -p all -N1
cmake
-S ${KOKKOS_CORE_SOURCE_DIR}
-B ${KOKKOS_CORE_BUILD_DIR}
-D CMAKE_INSTALL_PREFIX:PATH=${KOKKOS_CORE_INSTALL_DIR}
-D CMAKE_BUILD_TYPE:STRING=Release
-D CMAKE_CXX_COMPILER:STRING="icpx"
-D CMAKE_CXX_STANDARD:STRING="17"
-D CMAKE_CXX_FLAGS:STRING=""
-D CMAKE_CXX_EXTENSIONS:BOOL=OFF
-D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
-D Kokkos_ENABLE_SERIAL:BOOL=ON
-D Kokkos_ENABLE_OPENMP:BOOL=ON
-D Kokkos_ENABLE_THREADS:BOOL=OFF
-D Kokkos_ENABLE_DEPRECATED_CODE_3:BOOL=OFF
-D Kokkos_ENABLE_DEPRECATED_CODE_4:BOOL=OFF
-D Kokkos_ENABLE_DEBUG_BOUNDS_CHECK:BOOL=OFF
-D Kokkos_ENABLE_TESTS:BOOL=OFF
-D Kokkos_ENABLE_EXAMPLES:BOOL=OFF
-D Kokkos_ARCH_NATIVE=ON
make -j16
make install
cmake
-S ${KOKKOS_KERNELS_SOURCE_DIR}
-B ${KOKKOS_KERNELS_BUILD_DIR}
-D CMAKE_INSTALL_PREFIX:PATH=${KOKKOS_KERNELS_INSTALL_DIR}
-D CMAKE_BUILD_TYPE:STRING=Release
-D CMAKE_CXX_COMPILER:STRING="icpx"
-D CMAKE_CXX_STANDARD:STRING="17"
-D CMAKE_CXX_FLAGS:STRING="-Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized"
-D CMAKE_CXX_EXTENSIONS:BOOL=OFF
-D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
-D Kokkos_ROOT:PATH=${KOKKOS_CORE_INSTALL_DIR}
-D KokkosKernels_ENABLE_TPL_BLAS:BOOL=OFF
-D KokkosKernels_ENABLE_TPL_MKL:BOOL=OFF
-D KokkosKernels_ENABLE_COMPONENT_BLAS=ON
-D KokkosKernels_ENABLE_COMPONENT_BATCHED=OFF
-D KokkosKernels_ENABLE_COMPONENT_GRAPH=OFF
-D KokkosKernels_ENABLE_COMPONENT_SPARSE=OFF
-D KokkosKernels_INST_INT:BOOL=OFF
-D KokkosKernels_INST_FLOAT:BOOL=ON
-D KokkosKernels_INST_DOUBLE:BOOL=ON
-D KokkosKernels_INST_COMPLEX_FLOAT:BOOL=OFF
-D KokkosKernels_INST_COMPLEX_DOUBLE:BOOL=OFF
-D KokkosKernels_INST_OFFSET_SIZE_T:BOOL=ON
-D KokkosKernels_INST_OFFSET_INT:BOOL=ON
-D KokkosKernels_INST_ORDINAL_INT:BOOL=ON
-D KokkosKernels_INST_LAYOUTLEFT:BOOL=ON
-D KokkosKernels_INST_LAYOUTRIGHT:BOOL=ON
-D KokkosKernels_INST_LAYOUTSTRIDE:BOOL=OFF
-D KokkosKernels_ENABLE_TESTS:BOOL=ON
-D KokkosKernels_TEST_ETI_ONLY:BOOL=ON
-D KokkosKernels_ENABLE_EXAMPLES:BOOL=OFF
-D KokkosKernels_ENABLE_PERFTESTS:BOOL=ON
-D KokkosKernels_ENABLE_BENCHMARK:BOOL=ON
make -j 16
make install
Ernesto.
@cwpearson @eeprude I was curious and hopped on blake to check what was loaded with the intel compiler:
[ndellin@blake ~]$ export MODULEPATH="$MODULEPATH:/projects/x86-64/modulefiles"
[ndellin@blake ~]$ module load intel/oneAPI/hpc-toolkit/2022.1.2
[ndellin@blake ~]$ module list
Currently Loaded Modules:
1) binutils/2.30.0 2) gcc/7.2.0 3) intel/oneAPI/base-toolkit/2022.1.2 4) intel/oneAPI/hpc-toolkit/2022.1.2
gcc/7.2.0 does not support c++17 , can you try swapping for a newer gcc (e.g. module swap gcc/7.2.0 gcc/8.3.0) ? I'm not certain how this will interact with the toolchain, but it is worth a try. In any case, using the compiler with gcc/7.2.0 in the toolchain is not expected to work since the 4.0 release
Also, is there any reason to use intel/2022.1.2 (which I think is part of the older module system before blake's DST) as opposed to one of the recent installs like intel-oneapi-compilers/2023.1.0?
I would also recommend the newer intel compiler, I believe 2023.2.0 is actually the default so why not use that? It has worked well for me so far : )
@lucbv A "module avail" at caraway does not show any 2023.2.0 available.
@eeprude we were referring to blake. You should be able to check for modules with spider (e.g. module spider intel)
Sorry... My bad! Let me try again.
@eeprude there are a few different module systems available, if spider does not work or you don't see e.g. 2023.2.0 or 2023.1.0, you may need to run source /projects/x86-64-icelake-rocky8/spack-config/blake-setup-user-module-env.sh