-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·55 lines (47 loc) · 1.3 KB
/
build.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
51
52
53
54
55
#!/bin/bash
set -x
#-----
EXTERNAL_BLASLAPACK="OFF"
EXTERNAL_OCCA="ON"
PREFIX_PATHS=
# Default build parameters
: ${BUILD_DIR:=`pwd`/build}
: ${INSTALL_DIR:=`pwd`/install}
: ${BUILD_TYPE:="RelWithDebInfo"}
: ${CC:="gcc"}
: ${CXX:="g++"}
: ${FC:="gfortran"}
: ${MPICC:="mpicc"}
: ${MPICXX:="mpicxx"}
: ${MPIFC:="mpif77"}
: ${EXTERNAL_BLASLAPACK:="OFF"}
: ${EXTERNAL_OCCA:="ON"}
# OCCA Configuration
: ${ENABLE_DPCPP:="OFF"}
: ${ENABLE_OPENCL:="OFF"}
: ${ENABLE_CUDA:="ON"}
: ${ENABLE_HIP="OFF"}
: ${ENABLE_OPENMP="ON"}
: ${ENABLE_METAL="OFF"}
: ${ENABLE_MPI="ON"}
cmake -S . -B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
-DCMAKE_PREFIX_PATH=${PREFIX_PATHS} \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_Fortran_COMPILER=${FC} \
-DMPI_C_COMPILER=${MPICC} \
-DMPI_CXX_COMPILER=${MPICXX} \
-DMPI_Fortran_COMPILER=${MPIFC} \
-DEXTERNAL_BLASLAPACK=${EXTERNAL_BLASLAPACK} \
-DEXTERNAL_OCCA=${EXTERNAL_OCCA} \
-DENABLE_DPCPP=${ENABLE_DPCPP} \
-DENABLE_OPENCL=${ENABLE_OPENCL} \
-DENABLE_CUDA=${ENABLE_CUDA} \
-DENABLE_HIP=${ENABLE_HIP} \
-DENABLE_OPENMP=${ENABLE_OPENMP} \
-DENABLE_METAL=${ENABLE_METAL} \
-DENABLE_MPI=${ENABLE_MPI}
cmake --build ${BUILD_DIR} --parallel 4 && \
cmake --install ${BUILD_DIR} --prefix ${INSTALL_DIR}