Skip to content

Commit

Permalink
Build python bindings with the same cxx standard as kokkos.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkestene committed Nov 29, 2023
1 parent eb2f282 commit eb75657
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pykokkos/core/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ LIB_SUFFIX="${10}"
COMPILER_PATH="${11}"
SRC=$(find -name "*.cpp")

# set CXX standard to be the same as in KokkosCore_config.h
CXX_STANDARD=$(g++ -dM -E -DKOKKOS_MACROS_HPP ${KOKKOS_INCLUDE_PATH}/KokkosCore_config.h | grep KOKKOS_ENABLE_CXX | tr -d ' ' | sed -e 's/.*\(..\)$/\1/')

if [ "${COMPILER}" == "g++" ]; then
g++ \
Expand All @@ -21,7 +23,7 @@ if [ "${COMPILER}" == "g++" ]; then
-O3 \
-isystem "${KOKKOS_INCLUDE_PATH}" \
-fPIC \
-fopenmp -std=c++14 \
-fopenmp -std=c++${CXX_STANDARD} \
-DSPACE="${EXEC_SPACE}" \
-o "${SRC}".o \
-c "${SRC}" \
Expand All @@ -47,7 +49,7 @@ elif [ "${COMPILER}" == "nvcc" ]; then
-isystem "${KOKKOS_INCLUDE_PATH}" \
-arch="${COMPUTE_CAPABILITY}" \
--expt-extended-lambda -fPIC \
-Xcompiler -fopenmp -std=c++14 \
-Xcompiler -fopenmp -std=c++${CXX_STANDARD} \
-DSPACE="${EXEC_SPACE}" \
-o "${SRC}".o \
-c "${SRC}" \
Expand All @@ -74,7 +76,7 @@ elif [ "${COMPILER}" == "hipcc" ]; then
-O3 \
-isystem "${KOKKOS_INCLUDE_PATH}" \
-fPIC -fno-gpu-rdc \
-fopenmp -std=c++14 \
-fopenmp -std=c++${CXX_STANDARD} \
-DSPACE="${EXEC_SPACE}" \
-o "${SRC}".o \
-c "${SRC}" \
Expand All @@ -91,4 +93,4 @@ elif [ "${COMPILER}" == "hipcc" ]; then
"${SRC}".o -o "${MODULE}" \
"${KOKKOS_LIB_PATH}/libkokkoscontainers${LIB_SUFFIX}.so" \
"${KOKKOS_LIB_PATH}/libkokkoscore${LIB_SUFFIX}.so"
fi
fi

0 comments on commit eb75657

Please sign in to comment.