config.mk.default 8.43 KB
Newer Older
Baum's avatar
Baum committed
1 2 3
#=================================================================================================
# Compiler Options
#=================================================================================================
4 5
# Xerus can be compiled either with G++ or the Clang++ frontend of the LLVM.
# Set the CXX variable to the one you want to use.
Philipp  Trunschke's avatar
Philipp Trunschke committed
6
# If you want to use OpenMP, make sure that your compiler supports OpenMP 4.0.
7 8
CXX = g++
# CXX = clang++
9 10 11 12 13 14 15 16

#=================================================================================================
# Python Settings
#=================================================================================================
# To build and test the python bindings for Xerus we need the python configs and the name of the
# pytest executable(s). If you installed these system-wide you likely don't need to change anything.
PYTHON2_CONFIG = `python2-config --cflags --ldflags`
PYTHON3_CONFIG = `python3-config --cflags --ldflags`
Philipp  Trunschke's avatar
Philipp Trunschke committed
17 18
PYTEST2 = pytest2
PYTEST3 = pytest3
19

20 21 22
#=================================================================================================
# C++ Version
#=================================================================================================
23 24 25
# Xerus requires at least C++11 language support. It is advised to use the c++14 or higher versions
# though to have access to all features of the Xerus library.
COMPATIBILITY = -std=c++14
Baum's avatar
Baum committed
26

27

Baum's avatar
Baum committed
28 29 30
#=================================================================================================
# Optimization
#=================================================================================================
31 32 33
# We suggest the use of one of the following optimization levels. The first uses -Og and is 
# primarly intended for debugging purposes. The second (recommended) level activates more or 
# less all optimization options that conform with the ISO C++ Standard.
34
# The last level activates all optimazations available, including non-ISO C++ conform optimization
Baum's avatar
Baum committed
35
# and optimazations that may result in a loss of numerical precicsion, use at your own risk.
36
# DEBUG_OPTIMIZATION = TRUE               # Activates -O0
37 38
HIGH_OPTIMIZATION = TRUE                # Activates -O3 -march=native and some others
# DANGEROUS_OPTIMIZATION = TRUE         # Activates everything of HIGH_OPTIMIZATION plus basically everything that is said to improve performance including several potentially unsafe optimizations
Baum's avatar
Baum committed
39 40

# Additionally Link Time Optimization support can be build into the library by uncommenting the following line.
41 42
# USE_LTO = TRUE                        # Activates -ftlo
COMPILE_THREADS = 8                     # Number of threads to use during link time optimization.
Baum's avatar
Baum committed
43

Sebastian Wolf's avatar
Sebastian Wolf committed
44
# Some parts of Xerus can use parallelization. This can be aktivated by using openMP.
Fuchsi*'s avatar
Fuchsi* committed
45
# OTHER += -fopenmp
Sebastian Wolf's avatar
Sebastian Wolf committed
46

Baum's avatar
Baum committed
47
#=================================================================================================
48
# Debug and Logging
Baum's avatar
Baum committed
49
#=================================================================================================
Fuchsi*'s avatar
Fuchsi* committed
50 51 52
# Use errors instead of warnings in many places.
# STRICT_WARNINGS = TRUE

Baum's avatar
Baum committed
53
# The Xerus library performs a number of runtime checks to ensure a valid input to all routines.
54
# While not recommended these runtime checks can be completly disabled by uncommenting the following
Baum's avatar
Baum committed
55
# line. This slighlty improves the performance.
56
# DEBUG += -D XERUS_DISABLE_RUNTIME_CHECKS  # Disable all runtime checks
Sebastian Wolf's avatar
Sebastian Wolf committed
57 58 59 60 61


# With the following option the callstack that is returned by get_call_stack (and thus all fatal errors)
# includes NO function names, source-filenames and line numbers.
# NOTE: activate this to remove the dependence on the binutils libraries -lbfd -liberty -lz and -ldl
62
# XERUS_NO_FANCY_CALLSTACK = TRUE               # Show simple callstacks only
Baum's avatar
Baum committed
63

64

65 66 67
# When performing tests it is useful to ensure that all of the code in covered. This is ensured by
# a set of macros including REQUIRE_TEST to mark lines that need to be tested. With the following
# definition this coverage is tested.
Sebastian Wolf's avatar
Sebastian Wolf committed
68
# ACTIVATE_CODE_COVERAGE = TRUE            # Enable coverage tests
69 70


Baum's avatar
Baum committed
71
# You can add all kind of debuging options. In the following are some examples
72 73 74 75 76 77 78 79
DEBUG += -g                            # Adds debug symbols
# DEBUG += -D _GLIBCXX_ASSERTIONS        # Activate GLIBCXX assertions

# Sanitization
# DEBUG += -fsanitize=undefined         # GCC only
# DEBUG += -fsanitize=memory            # Clang only
# DEBUG += -fsanitize=address           # find out of bounds access
# DEBUG += -pg                          # adds profiling code for the 'gprof' analyzer
Baum's avatar
Baum committed
80 81


82
# Xerus has a buildin logging system to provide runtime information. Here you can adjust the logging level used by the library.
83 84 85
# LOGGING += -D XERUS_LOG_DEBUG                  # Debug infomation, can significantly slow down the library.
LOGGING += -D XERUS_LOG_INFO                     # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
# LOGGING += -D XERUS_LOG_WARNING                # Informations that is linked to unexpected behaviour which indicates incorrect use of the library but are no errors as such.
86
# LOGGING += -D XERUS_LOG_ERROR                  # Information about errors that occourt, assumedly by incorrect use of the library.
Baum's avatar
Baum committed
87 88

# Per default the logs are printed to cerr. Uncomment the following line to print the log messages to the file error.log instead.
89
# LOGGING += -D XERUS_LOGFILE               # Use error file instead of cerr
Baum's avatar
Baum committed
90

Sebastian Wolf's avatar
Sebastian Wolf committed
91
# Print absolute times instead of relative to program time
92
# LOGGING += -D XERUS_LOG_ABSOLUTE_TIME
93

94
# Uncomment the following line to save the last Logs in a circular buffer (without printing them) to allow detailed reports in case of errors.
Baum's avatar
Baum committed
95
# Note that this can significatly slow down the library.
96
# LOGGING += -D XERUS_LOG_BUFFER                    # Activate the log buffer
Baum's avatar
Baum committed
97

98
# Add time measurments for the relevant low level function calls. This allow to use get_analysis() to get a listing on all called low level fucntions and the time spend on them.
99
# LOGGING += -D XERUS_PERFORMANCE_ANALYSIS      # Enable performance analysis
100

Baum's avatar
Baum committed
101

102 103 104 105 106
#=================================================================================================
# Install paths
#=================================================================================================
# Set the directories to install libxerus.

107 108 109 110
# INSTALL_LIB_PATH = /usr/local/lib/         # Path where to install the libxerus.so shared library.
# INSTALL_HEADER_PATH = /usr/local/include/  # Path where to install the xerus header files.
# INSTALL_PYTHON2_PATH = /usr/local/lib/python2.7/site-packages/    # Path for the installation of the python2 bindings.
# INSTALL_PYTHON3_PATH = /usr/local/lib/python3.5/site-packages/    # Path for the installation of the python3 bindings.
111

Baum's avatar
Baum committed
112 113 114 115

#=================================================================================================
# External libraries
#=================================================================================================
116
# Xerus depends on several external libraries, namely blas, cblas, lapack, lapacke and suiteSparse
117 118 119
# and bfd, all of which are available through common GNU/Linux packaging systems. If you want to
# build a shared library or run the unit tests of Xerus you have to provide the corresponding
# libraries here (otherwise only when linking your own program using Xerus).
120
# Make sure to use a thread safe version of blas when compiling with -fopenmp.
Baum's avatar
Baum committed
121

122 123 124 125 126
# Uncomment or add the appropriate blas libraries
BLAS_LIBRARIES = -lopenblas -lgfortran                      # Openblas, serial
# BLAS_LIBRARIES = -lopenblasp -lgfortran                   # Openblas, parallel
# BLAS_LIBRARIES = /usr/lib64/atlas/libsatlas.so -lgfortran # Atlas
# BLAS_LIBRARIES = /usr/lib64/atlas/libf77blas.a /usr/lib64/atlas/libcblas.a /usr/lib64/atlas/libatlas.a -lgfortran # Custom
Baum's avatar
Baum committed
127 128


129 130 131
# Uncomment or add the appropriate lapack libraries
LAPACK_LIBRARIES = -llapacke -llapack                       # Standard Lapack + Lapacke libraries
# LAPACK_LIBRARIES = ../lib/lapack/liblapacke.a ../lib/lapack/liblapack.a   # Custom
Baum's avatar
Baum committed
132

133
# Uncomment or add the appropriate CXSparse library
134
SUITESPARSE = -lcholmod -lspqr
Baum's avatar
Baum committed
135

136
# Uncomment or add the approriate boost libraries
Sebastian Wolf's avatar
Sebastian Wolf committed
137
BOOST_LIBS = -lboost_filesystem -lboost_system
138 139

# (optional) Uncomment if needed, iterative eigenvalue solver ARPACK-ng, see https://github.com/opencollab/arpack-ng
140
# ARPACK_LIBRARIES = -larpack
Michael Goette's avatar
Michael Goette committed
141 142
# OTHER += -DARPACK_LIBRARIES

143
# Uncomment or add the appropriate boost python library
144 145
BOOST_PYTHON2 = -lboost_python-py27
BOOST_PYTHON3 = -lboost_python-py35
146

147
# Custom include paths
148
# OTHER += -I /path/to/include