-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·20 lines (14 loc) · 1.38 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
STB_DIR="stb" # STB directory
SOURCE_DIR="src" # Starflood source directory
BUILD_DIR="build" # Build output directory
#CXX="clang++" # Use Clang as the compiler (maybe I'm using it wrong, but GCC uses less CPU Time on my machine)
#CXX="g++" # Use GCC as the compiler
#CXX="nvc++" # Use NVIDIA's compiler
#-g -Og
#CXX_FLAGS="-flto -fopenmp -march=native -O2 -pedantic -std=c++17 -Wall -Wextra -Wshadow -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable" # parameters for Clang/GCC
#CXX_FLAGS="-flto -v -fopenmp -fopenmp-targets=nvptx64 -foffload-lto=full -march=native -g -Og -pedantic -std=c++17 -Wall -Wextra -Wshadow -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable" # parameters for Clang (w/ OpenMP offloading)
#CXX_FLAGS="-fopenmp -march=native -mp=gpu -g -O2 -pedantic -std=c++17 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-variable -Isrc/ -Istb/ -o build/starflood.out src/rng.cpp -fopenmp src/barnes-hut.cpp -fopenmp src/main.cpp" # parameters for NVIDIA's HPC SDK
#${CXX} ${CXX_FLAGS} -I${SOURCE_DIR}/ -I${STB_DIR}/ -o ${BUILD_DIR}/starflood.out ${SOURCE_DIR}/rng.cpp ${SOURCE_DIR}/barnes-hut.cpp ${SOURCE_DIR}/graphics.cpp ${SOURCE_DIR}/main.cpp
#/usr/bin/time -v ${CXX} ${CXX_FLAGS} -I${SOURCE_DIR}/ -I${STB_DIR}/ -o ${BUILD_DIR}/starflood.out ${SOURCE_DIR}/rng.cpp ${SOURCE_DIR}/barnes-hut.cpp ${SOURCE_DIR}/main.cpp
make