forked from libocca/occa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure-sycl-nv-cmake.sh
executable file
·50 lines (44 loc) · 1.42 KB
/
configure-sycl-nv-cmake.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# !/bin/bash
export OCCA_CC=clang
export OCCA_CXX=clang++
export SYCL_FLAGS="-fsycl -fsycl-targets=nvptx64-nvidia-cuda"
export OCCA_DPCPP_COMPILER=clang++
export OCCA_DPCPP_COMPILER_FLAGS="-fsycl -fsycl-targets=nvptx64-nvidia-cuda"
# Override default values here
CC=clang
CXX=clang++
#FC=
# Default build parameters
: ${BUILD_DIR:=`pwd`/build}
: ${INSTALL_DIR:=`pwd`/install}
: ${BUILD_TYPE:="RelWithDebInfo"}
: ${CC:="gcc"}
: ${CXX:="g++"}
: ${FC:="gfortran"}
: ${OCCA_ENABLE_DPCPP:="ON"}
: ${OCCA_ENABLE_OPENCL:="OFF"}
: ${OCCA_ENABLE_CUDA:="ON"}
: ${OCCA_ENABLE_HIP="OFF"}
: ${OCCA_ENABLE_OPENMP="OFF"}
: ${OCCA_ENABLE_METAL="OFF"}
: ${OCCA_ENABLE_FORTRAN="OFF"}
: ${OCCA_ENABLE_TESTS="ON"}
: ${OCCA_ENABLE_EXAMPLES="ON"}
cmake -S . -B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_Fortran_COMPILER=${FC} \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_C_FLAGS="${CFLAGS}" \
-DCMAKE_Fortran_FLAGS="${FFLAGS}" \
-DOCCA_ENABLE_OPENMP=${OCCA_ENABLE_OPENMP} \
-DOCCA_ENABLE_OPENCL=${OCCA_ENABLE_OPENCL} \
-DOCCA_ENABLE_DPCPP=${OCCA_ENABLE_DPCPP} \
-DOCCA_ENABLE_CUDA=${OCCA_ENABLE_CUDA} \
-DOCCA_ENABLE_HIP=${OCCA_ENABLE_HIP} \
-DOCCA_ENABLE_METAL=${OCCA_ENABLE_METAL} \
-DOCCA_ENABLE_FORTRAN=${OCCA_ENABLE_FORTRAN} \
-DOCCA_ENABLE_TESTS=${OCCA_ENABLE_TESTS} \
-DOCCA_ENABLE_EXAMPLES=${OCCA_ENABLE_EXAMPLES}