build.sh 1.88 KB
Newer Older
Philipp  Trunschke's avatar
Philipp Trunschke committed
1
2
#!/bin/bash

Philipp  Trunschke's avatar
Philipp Trunschke committed
3
4
set -e  # exit when any command fails

5
6
7
8
9
10
11
cat <<EOF >config.mk
CXX = ${CXX}
COMPATIBILITY = -std=c++17
COMPILE_THREADS = 8                       # Number of threads to use during link time optimization.
HIGH_OPTIMIZATION = TRUE                  # Activates -O3 -march=native and some others
OTHER += -fopenmp

12
13
14
15
PYTHON3_CONFIG = `python3-config --cflags`
PYTHON3_CONFIG += `python3-config --ldflags`


16
17
18
19
20
21
LOGGING += -D XERUS_LOG_INFO              # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
LOGGING += -D XERUS_LOGFILE               # Use 'error.log' file instead of cerr
LOGGING += -D XERUS_LOG_ABSOLUTE_TIME     # Print absolute times instead of relative to program time

INSTALL_LIB_PATH = ${PREFIX}/lib          # Path where to install the libxerus.so shared library.
INSTALL_HEADER_PATH = ${PREFIX}/include   # Path where to install the xerus header files.
22
INSTALL_PYTHON3_PATH = ${PREFIX}/lib/python${PY_VER}
23
24
25
26
27
28

BLAS_LIBRARIES = -lopenblas -lgfortran    # Openblas, serial
LAPACK_LIBRARIES = -llapacke -llapack     # Standard Lapack + Lapacke libraries
SUITESPARSE = -lcholmod -lspqr
BOOST_LIBS = -lboost_filesystem

29
30
BOOST_PYTHON3 = -lboost_python37

31
OTHER+= -L${BUILD_PREFIX}/lib
32
33
EOF

Philipp  Trunschke's avatar
Philipp Trunschke committed
34
test ${CONDA_PY} = ${PY_VER//./}  # this should always be the case
35

Philipp  Trunschke's avatar
Philipp Trunschke committed
36
export CPP_INCLUDE_PATH=${BUILD_PREFIX}/include:${BUILD_PREFIX}/lib/python${PY_VER}/site-packages/numpy/core/include/
root's avatar
root committed
37
38
39
export CPLUS_INCLUDE_PATH=${BUILD_PREFIX}/include:${BUILD_PREFIX}/lib/python${PY_VER}/site-packages/numpy/core/include/
export CXX_INCLUDE_PATH=${BUILD_PREFIX}/include:${BUILD_PREFIX}/lib/python${PY_VER}/site-packages/numpy/core/include/
export LIBRARY_PATH=${BUILD_PREFIX}/lib
40

Philipp  Trunschke's avatar
Philipp Trunschke committed
41
ln -sfn ${BUILD_PREFIX}/include/ ${BUILD_PREFIX}/include/suitesparse  # overwrite existing symbolic links
42
mkdir -p ${PREFIX}/lib/python${PY_VER}
43

Philipp  Trunschke's avatar
Philipp Trunschke committed
44
make test -j$((${CPU_COUNT}-1))
45

Philipp  Trunschke's avatar
Philipp Trunschke committed
46
make install
47
rm config.mk