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

3 4 5
set -x -e

cd xerus
Philipp  Trunschke's avatar
Philipp Trunschke committed
6

7 8 9 10 11 12 13
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

14
PYTHON3_CONFIG = \`python3-config --cflags --ldflags\`
15

16 17 18
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
19
XERUS_NO_FANCY_CALLSTACK = TRUE           # Show simple callstacks only
20 21 22 23 24 25

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

26 27
OTHER += -I${CONDA_PREFIX}/include -I${CONDA_PREFIX}/lib/python${PY_VER}/site-packages/numpy/core/include/
OTHER += -L${CONDA_PREFIX}/lib
28 29
EOF

30 31 32
ln -s ${CONDA_PREFIX}/include/ ${CONDA_PREFIX}/include/suitesparse
make python3
python3 setup.py install --prefix=${PREFIX}
33

34 35 36 37
# INCLUDE_PATH="${PREFIX}/include"
# mkdir -p ${INCLUDE_PATH}
# cp include/xerus.h ${INCLUDE_PATH}
# cp -r include/xerus ${INCLUDE_PATH}
38

39 40 41 42
# LIBRARY_PATH="${PREFIX}/lib"
# mkdir -p ${LIBRARY_PATH}
# cp build/libxerus.so ${LIBRARY_PATH}
# cp build/libxerus_misc.so ${LIBRARY_PATH}
43 44

rm config.mk