-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcompile.sh
More file actions
34 lines (28 loc) · 984 Bytes
/
compile.sh
File metadata and controls
34 lines (28 loc) · 984 Bytes
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
#! /bin/bash
# Get directory this script is in
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Enter build directory
mkdir $DIR/build; cd $DIR/build
# Get Python interpreter
PYTHON_EXECUTABLE=$(which python)
# Get compilers
# COMPILER_CC=$(which gcc)
# COMPILER_CXX=$(which g++)
# if the compilers are not set, use the default gcc and g++ compilers
COMPILER_CC=${CC:-$(which gcc)}
COMPILER_CXX=${CXX:-$(which g++)}
# COMPILER_CC=$(which gcc-11)
# COMPILER_CXX=$(which g++-11)
#COMPILER_CC=$(which clang)
#COMPILER_CXX=$(which clang++)
# Run cmake
CC=$COMPILER_CC \
CXX=$COMPILER_CXX \
cmake \
-DPYTHON_EXECUTABLE:FILEPATH=$PYTHON_EXECUTABLE \
-DOMP_PARALLEL=ON \
-DMPI_PARALLEL=OFF \
-DGPU_ACCELERATION=OFF \
$DIR
# Run make
make -j4