Commit 3c59d50d authored by Ben Huber's avatar Ben Huber

Merge branch 'v3'

parents c250eff1 db438b85
Pipeline #745 canceled with stages
in 1 minute and 28 seconds
......@@ -5,7 +5,7 @@ CXX = clang++
DEBUG += -g # Adds debug symbols
LOGGING += -D INFO_ # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour but might
#=================================================================================================
# External libraries
......
......@@ -7,8 +7,6 @@ STRICT_WARNINGS = TRUE
DEBUG += -g # Adds debug symbols
LOGGING += -D INFO_ # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
#=================================================================================================
# External libraries
#=================================================================================================
......@@ -16,7 +14,4 @@ BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial
LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries
SUITESPARSE = -lcholmod -lspqr
# custom include paths
# OTHER += -I /path/to/include
OTHER += -I /usr/include/python2.7/ -lboost_python -I/usr/lib64/python2.7/site-packages/numpy/core/include/ -lpython2.7 -fno-var-tracking-assignments
\ No newline at end of file
......@@ -6,13 +6,13 @@ CXX = g++
STRICT_WARNINGS = TRUE
HIGH_OPTIMIZATION = TRUE # Activates -O3 -march=native and some others
DEBUG += -D DISABLE_RUNTIME_CHECKS_ # Disable all runtime checks
DEBUG += -D REPLACE_ALLOCATOR
DEBUG += -D XERUS_DISABLE_RUNTIME_CHECKS # Disable all runtime checks
DEBUG += -D XERUS_REPLACE_ALLOCATOR
DEBUG += -g # Adds debug symbols
LOGGING += -D INFO_ # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour bu
#=================================================================================================
# External libraries
......
......@@ -13,12 +13,19 @@
!*.mk
!Makefile
!.gitignore
!*.sh
!*.rb
!*.py
!*.md
!*.xml
!*.dox
!*.css
!*.js
!*.yml
# ...even if they are in subdirectories
!*/
......@@ -26,6 +33,5 @@
# However we really want to ignore
lapacke/*
build/*
doc/latex/*
doc/html/*
config.mk
......@@ -3,8 +3,10 @@ stages:
- test_gcc
- build_gcc_nocheck
- test_gcc_nocheck
- build_python
- build_clang
- test_clang
- build_homepage
job_make_gcc:
stage: build_gcc
......@@ -23,6 +25,11 @@ job_test_gcc_nocheck:
stage: test_gcc_nocheck
script: "cp ../XerusTest .; ./XerusTest all"
job_build_python:
stage: build_python
script: "g++ --version; cp .config.mk.ci.gcc config.mk; make python"
when: always
job_make_clang:
stage: build_clang
script: "clang++ --version; cp .config.mk.ci.clang config.mk; make XerusTest; cp XerusTest ../"
......@@ -32,3 +39,10 @@ job_test_clang:
stage: test_clang
script: "cp ../XerusTest .; ./XerusTest all"
job_build_homepage:
stage: build_homepage
script: "make doc; scp -rv doc/html xerusweb:libxerus.org-443/html"
when: always
only:
- master
allow_failure: true
......@@ -2,6 +2,17 @@
Potentially breaking changes are marked with an exclamation point '!' at the begin of their description.
* 2017-05-29 v3.0.0
* Python wrapper now stable.
* ! REQUIRE macro now logs as error instead of fatal error.
* ! All macros and preprocessor defines now use the XERUS_ prefix. The config.mk file changed accordingly.
* ! TT::find_largest_entry and TT::dyadic_product left the TT scope.
* ! Tensor::modify_diag_elements renamed to Tensor::modify_diagonal_entries for naming consistency.
* Much faster solve of matrix equations Ax=b by exploiting symmetry and definiteness where possible. This directly speeds up the ALS as well.
* Added Tensor.one_norm() and one_norm(Tensor) to calculate the one norm of a Tensor.
* New documentation ('make doc') and homepage.
* Some minor bugfixes and performance improvements.
* 2016-06-23 v2.4.0
* Introduced nomeclature 'mode'. Marked all functions that will be renamed / removed in v3.0.0 as deprecated.
* Added an experimental python wrapper when 'OTHER += -DXERUS_EXPERIMENTAL_PYTHON_WRAPPER' is defined in the config file.
......@@ -18,7 +29,7 @@ Potentially breaking changes are marked with an exclamation point '!' at the beg
* Bug fix in the handling of fixed indices in TensorNetworks.
* Several static member function now warn if their return type is not used.
* Initial support for compilation with the intel ICC.
* 2016-03-11 v2.2.1
* Added support for 32bit systems.
......
# ------------------------------------------------------------------------------------------------------
# Set the names of the resulting binary codes
# Default rule should be the help message
# ------------------------------------------------------------------------------------------------------
help:
@printf "Possible make targets are:\n \
\t\tshared \t\t -- Build xerus as a shared library.\n \
\t\tstatic \t\t -- Build xerus as a static library.\n \
\t\tpython \t\t -- Build the xerus python wrappers.\n \
\t\tdoc \t\t -- Build the html documentation for the xerus library.\n \
\t\tinstall \t -- Install the shared library and header files (may require root).\n \
\t\ttest \t\t -- Build and run the xerus unit tests.\n \
\t\tclean \t\t -- Remove all object, library and executable files.\n"
# Names of the Library
LIB_NAME_SHARED = build/lib/libxerus.so
LIB_NAME_STATIC = build/lib/libxerus.a
# ------------------------------------------------------------------------------------------------------
# Set the names of the resulting binary codes
# ------------------------------------------------------------------------------------------------------
# Name of the test executable
TEST_NAME = XerusTest
......@@ -35,22 +45,33 @@ DEBUG += -DXERUS_VERSION_COMMIT=$(XERUS_COMMIT_V)
# Register source files for the xerus library
# ------------------------------------------------------------------------------------------------------
# Register all library source files
LIB_SOURCES = $(wildcard src/xerus/*.cpp)
LIB_SOURCES += $(wildcard src/xerus/*/*.cpp)
# Register the source files
XERUS_SOURCES = $(wildcard src/xerus/*.cpp)
XERUS_SOURCES += $(wildcard src/xerus/algorithms/*.cpp)
XERUS_SOURCES += $(wildcard src/xerus/examples/*.cpp)
MISC_SOURCES = $(wildcard src/xerus/misc/*.cpp)
PYTHON_SOURCES = $(wildcard src/xerus/python/*.cpp)
TEST_SOURCES = $(wildcard src/xerus/test/*.cpp)
# Register all unit test source files
UNIT_TEST_SOURCES = $(wildcard src/unitTests/*.cxx)
# Register all tutorial source files
TUTORIAL_SOURCES = $(wildcard tutorials/*.cpp)
# Create lists of the corresponding objects and dependency files
LIB_OBJECTS = $(LIB_SOURCES:%.cpp=build/.libObjects/%.o)
LIB_DEPS = $(LIB_SOURCES:%.cpp=build/.libObjects/%.d)
XERUS_OBJECTS = $(XERUS_SOURCES:%.cpp=build/.libObjects/%.o)
XERUS_DEPS = $(XERUS_SOURCES:%.cpp=build/.libObjects/%.d)
TEST_OBJECTS = $(LIB_SOURCES:%.cpp=build/.testObjects/%.o)
TEST_DEPS = $(LIB_SOURCES:%.cpp=build/.testObjects/%.d)
MISC_OBJECTS = $(MISC_SOURCES:%.cpp=build/.miscObjects/%.o)
MISC_DEPS = $(MISC_SOURCES:%.cpp=build/.miscObjects/%.d)
PYTHON_OBJECTS = $(PYTHON_SOURCES:%.cpp=build/.pythonObjects/%.o)
PYTHON_DEPS = $(PYTHON_SOURCES:%.cpp=build/.pyhtonObjects/%.d)
TEST_OBJECTS = $(TEST_SOURCES:%.cpp=build/.testObjects/%.o)
TEST_DEPS = $(TEST_SOURCES:%.cpp=build/.testObjects/%.d)
UNIT_TEST_OBJECTS = $(UNIT_TEST_SOURCES:%.cxx=build/.unitTestObjects/%.o)
UNIT_TEST_DEPS = $(UNIT_TEST_SOURCES:%.cxx=build/.unitTestObjects/%.d)
......@@ -70,31 +91,14 @@ include makeIncludes/optimization.mk
# ------------------------------------------------------------------------------------------------------
# Set additional compiler options
# Set additional compiler options
# ------------------------------------------------------------------------------------------------------
# SUGGEST_ATTRIBUTES = TRUE # Tell the compiler to suggest attributes
# OPTIMIZE += -fprofile-generate # Generate Profile output for optimization
# OPTIMIZE += -fprofile-use # Use a previously generated profile output
OTHER += -std=c++11 # Use the C++11 standard
OTHER += -D MISC_NAMESPACE=xerus # All misc function shall live in xerus namespace
# ------------------------------------------------------------------------------------------------------
# Load dependency files
# ------------------------------------------------------------------------------------------------------
-include $(LIB_DEPS)
-include $(TEST_DEPS)
-include $(UNIT_TEST_DEPS)
-include $(TUTORIAL_DEPS)
-include build/.preCompileHeaders/xerus.h.d
# ------------------------------------------------------------------------------------------------------
# Make Rules
# Convinience variables
# ------------------------------------------------------------------------------------------------------
# Small hack to get newlines...
......@@ -103,22 +107,26 @@ define \n
endef
# Convinience variables
FLAGS = $(strip $(WARNINGS) $(OPTIMIZE) $(LOGGING) $(DEBUG) $(ADDITIONAL_INCLUDE) $(OTHER))
PYTHON_FLAGS = $(strip $(WARNINGS) $(LOGGING) $(DEBUG) $(ADDITIONAL_INCLUDE) $(OTHER) -fno-var-tracking-assignments)
MINIMAL_DEPS = Makefile config.mk makeIncludes/general.mk makeIncludes/warnings.mk makeIncludes/optimization.mk
# ------------------------------------------------------------------------------------------------------
# Load dependency files
# ------------------------------------------------------------------------------------------------------
-include $(XERUS_DEPS)
-include $(MISC_DEPS)
-include $(TEST_DEPS)
-include $(UNIT_TEST_DEPS)
-include $(TUTORIAL_DEPS)
-include build/.preCompileHeaders/xerus.h.d
help:
@printf "Possible make targets are:\n \
\t\tall \t\t -- Build xerus both as a shared and a static library.\n \
\t\tshared \t\t -- Build xerus as a shared library.\n \
\t\tstatic \t\t -- Build xerus as a static library.\n \
\t\ttest \t\t -- Build and run the xerus unit tests.\n \
\t\tinstall \t -- Install the shared library and header files (may require root).\n \
\t\t$(TEST_NAME) \t -- Only build the xerus unit tests.\n \
\t\tclean \t\t -- Remove all object, library and executable files.\n"
# ------------------------------------------------------------------------------------------------------
# Make Rules
# ------------------------------------------------------------------------------------------------------
opt:
$(CXX) $(FLAGS) -Q --help=optimizers
......@@ -130,57 +138,80 @@ warn:
# Fake rule to create arbitary headers, to prevent errors if files are moved/renamed
%.h:
all: test $(LIB_NAME_SHARED) $(LIB_NAME_STATIC)
mkdir -p build/include/
cp include/xerus.h build/include/
cp -r include/xerus build/include/
ifdef BUILD_PYTHON_BINDINGS
shared: build/libxerus_misc.so build/libxerus.so build/xerus.so
else
shared: build/libxerus_misc.so build/libxerus.so
endif
build/libxerus_misc.so: $(MINIMAL_DEPS) $(MISC_SOURCES)
mkdir -p $(dir $@)
$(CXX) -shared -fPIC -Wl,-soname,libxerus_misc.so $(FLAGS) -I include $(MISC_SOURCES) -Wl,--as-needed $(CALLSTACK_LIBS) -o build/libxerus_misc.so
shared: $(LIB_NAME_SHARED)
build/libxerus.so: $(MINIMAL_DEPS) $(XERUS_SOURCES) build/libxerus_misc.so
mkdir -p $(dir $@)
$(CXX) -shared -fPIC -Wl,-soname,libxerus.so $(FLAGS) -I include $(XERUS_SOURCES) -L ./build/ -Wl,--as-needed -lxerus_misc $(SUITESPARSE) $(LAPACK_LIBRARIES) $(BLAS_LIBRARIES) -o build/libxerus.so
$(LIB_NAME_SHARED): $(MINIMAL_DEPS) $(LIB_SOURCES)
mkdir -p $(dir $@)
$(CXX) -shared -fPIC -Wl,-soname,libxerus.so $(FLAGS) -I include $(LIB_SOURCES) $(SUITESPARSE) $(LAPACK_LIBRARIES) $(BLAS_LIBRARIES) $(CALLSTACK_LIBS) -o $(LIB_NAME_SHARED)
python: build/xerus.so
build/xerus.so: $(MINIMAL_DEPS) $(PYTHON_SOURCES) build/libxerus.so
mkdir -p $(dir $@)
$(CXX) -shared -fPIC -Wl,-soname,xerus.so `python2-config --cflags --ldflags` $(PYTHON_FLAGS) -I include $(PYTHON_SOURCES) -L ./build/ -Wl,--as-needed -lxerus $(BOOST_PYTHON) -o build/xerus.so
static: $(LIB_NAME_STATIC)
static: build/libxerus_misc.a build/libxerus.a
# Support non lto build for outdated systems
ifdef USE_LTO
$(LIB_NAME_STATIC): $(MINIMAL_DEPS) $(LIB_OBJECTS)
build/libxerus_misc.a: $(MINIMAL_DEPS) $(MISC_OBJECTS)
mkdir -p $(dir $@)
gcc-ar rcs $(LIB_NAME_STATIC) $(LIB_OBJECTS)
else
$(LIB_NAME_STATIC): $(MINIMAL_DEPS) $(LIB_OBJECTS)
ifdef USE_LTO
gcc-ar rcs ./build/libxerus_misc.a $(MISC_OBJECTS)
else
ar rcs ./build/libxerus_misc.a $(MISC_OBJECTS)
endif
build/libxerus.a: $(MINIMAL_DEPS) $(XERUS_OBJECTS)
mkdir -p $(dir $@)
ar rcs $(LIB_NAME_STATIC) $(LIB_OBJECTS)
ifdef USE_LTO
gcc-ar rcs ./build/libxerus.a $(XERUS_OBJECTS)
else
ar rcs ./build/libxerus.a $(XERUS_OBJECTS)
endif
ifdef DESTDIR
INSTALL_LIB_PATH = $(DESTDIR)/lib/
INSTALL_HEADER_PATH = $(DESTDIR)/include/
INSTALL_PYTHON_PATH = $(DESTDIR)/lib/python/site-packages/
endif
ifdef INSTALL_LIB_PATH
ifdef INSTALL_HEADER_PATH
install: $(LIB_NAME_SHARED)
install: shared
@printf "Installing libxerus.so to $(strip $(INSTALL_LIB_PATH)) and storing the header files in $(strip $(INSTALL_HEADER_PATH)).\n"
mkdir -p $(INSTALL_LIB_PATH)
mkdir -p $(INSTALL_HEADER_PATH)
cp $(LIB_NAME_SHARED) $(INSTALL_LIB_PATH)
cp include/xerus.h $(INSTALL_HEADER_PATH)
cp -r include/xerus $(INSTALL_HEADER_PATH)
cp build/libxerus_misc.so $(INSTALL_LIB_PATH)
cp build/libxerus.so $(INSTALL_LIB_PATH)
ifdef BUILD_PYTHON_BINDINGS
cp build/xerus.so $(INSTALL_PYTHON_PATH)
endif
else
install:
@printf "INSTALL_HEADER_PATH not set correctly. Cannot install xerus.\n"
@printf "Cannot install xerus: INSTALL_HEADER_PATH not set. Please set the path in config file.\n"
endif
else
install:
@printf "INSTALL_LIB_PATH not set correctly. Cannot install xerus.\n"
@printf "Cannot install xerus: INSTALL_LIB_PATH not set. Please set the path in config file.\n"
endif
$(TEST_NAME): $(MINIMAL_DEPS) $(UNIT_TEST_OBJECTS) $(TEST_OBJECTS)
$(CXX) -D TEST_ $(FLAGS) $(UNIT_TEST_OBJECTS) $(TEST_OBJECTS) $(SUITESPARSE) $(LAPACK_LIBRARIES) $(BLAS_LIBRARIES) $(CALLSTACK_LIBS) -o $(TEST_NAME)
$(TEST_NAME): $(MINIMAL_DEPS) $(UNIT_TEST_OBJECTS) $(TEST_OBJECTS) build/libxerus.a build/libxerus_misc.a
$(CXX) -D XERUS_UNITTEST $(FLAGS) $(UNIT_TEST_OBJECTS) $(TEST_OBJECTS) build/libxerus.a build/libxerus_misc.a $(SUITESPARSE) $(LAPACK_LIBRARIES) $(BLAS_LIBRARIES) $(CALLSTACK_LIBS) -o $(TEST_NAME)
test: $(TEST_NAME)
......@@ -192,17 +223,29 @@ fullTest: $(TUTORIALS) $(TEST_NAME)
./$(TEST_NAME) all
.FORCE:
doc: .FORCE
make -C doc doc
clean:
rm -fr build
-rm -f $(TEST_NAME)
-rm -f include/xerus.h.gch
-rm -r doc/html
benchmark: $(MINIMAL_DEPS) $(LOCAL_HEADERS) benchmark.cxx $(LIB_NAME_STATIC)
$(CXX) $(FLAGS) benchmark.cxx $(LIB_NAME_STATIC) $(SUITESPARSE) $(LAPACK_LIBRARIES) $(BLAS_LIBRARIES) $(CALLSTACK_LIBS) -lboost_filesystem -lboost_system -o Benchmark
# Build rule for normal misc objects
build/.miscObjects/%.o: %.cpp $(MINIMAL_DEPS)
mkdir -p $(dir $@)
$(CXX) -I include $< -c $(FLAGS) -MMD -o $@
# Build rule for normal lib objects
build/.libObjects/%.o: %.cpp $(MINIMAL_DEPS)
mkdir -p $(dir $@)
......@@ -212,37 +255,37 @@ build/.libObjects/%.o: %.cpp $(MINIMAL_DEPS)
# Build rule for test lib objects
build/.testObjects/%.o: %.cpp $(MINIMAL_DEPS)
mkdir -p $(dir $@)
$(CXX) -D TEST_ -I include $< -c $(FLAGS) -MMD -o $@
$(CXX) -D XERUS_UNITTEST -I include $< -c $(FLAGS) -MMD -o $@
# Build rule for benchmark objects
build/%.o: %.cpp $(MINIMAL_DEPS)
mkdir -p $(dir $@)
$(CXX) -D TEST_ -I include $< -c $(FLAGS) -MMD -o $@
$(CXX) -D XERUS_UNITTEST -I include $< -c $(FLAGS) -MMD -o $@
# Build rule for unit test objects
ifdef USE_GCC
build/.unitTestObjects/%.o: %.cxx $(MINIMAL_DEPS) build/.preCompileHeaders/xerus.h.gch
mkdir -p $(dir $@)
$(CXX) -D TEST_ -I build/.preCompileHeaders $< -c $(FLAGS) -MMD -o $@
$(CXX) -D XERUS_UNITTEST -I build/.preCompileHeaders $< -c $(FLAGS) -MMD -o $@
else
build/.unitTestObjects/%.o: %.cxx $(MINIMAL_DEPS)
mkdir -p $(dir $@)
$(CXX) -D TEST_ -I include $< -c $(FLAGS) -MMD -o $@
$(CXX) -D XERUS_UNITTEST -I include $< -c $(FLAGS) -MMD -o $@
endif
# Build and execution rules for tutorials
build/.tutorialObjects/%: %.cpp $(MINIMAL_DEPS) $(LIB_NAME_STATIC)
build/.tutorialObjects/%: %.cpp $(MINIMAL_DEPS) build/libxerus.a build/libxerus_misc.a
mkdir -p $(dir $@)
$(CXX) -I include $< $(LIB_NAME_STATIC) $(SUITESPARSE) $(LAPACK_LIBRARIES) $(BLAS_LIBRARIES) $(CALLSTACK_LIBS) $(FLAGS) -MMD -o $@
$(CXX) -I include $< build/libxerus.a build/libxerus_misc.a $(SUITESPARSE) $(LAPACK_LIBRARIES) $(BLAS_LIBRARIES) $(CALLSTACK_LIBS) $(FLAGS) -MMD -o $@
# Build rule for the preCompileHeader
build/.preCompileHeaders/xerus.h.gch: include/xerus.h $(MINIMAL_DEPS) .git/ORIG_HEAD
mkdir -p $(dir $@)
$(CXX) -D TEST_ $< -c $(FLAGS) -MMD -o $@
$(CXX) -D XERUS_UNITTEST $< -c $(FLAGS) -MMD -o $@
# dummy rule in case files were downloaded without git
......
// Xerus - A General Purpose Tensor Library
// Copyright (C) 2014-2016 Benjamin Huber and Sebastian Wolf.
// Copyright (C) 2014-2017 Benjamin Huber and Sebastian Wolf.
//
// Xerus is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
......@@ -28,8 +28,7 @@
#include "include/xerus.h"
std::random_device rd;
std::mt19937_64 rnd(rd());
std::mt19937_64 rnd = xerus::misc::randomEngine;
std::normal_distribution<double> normalDist(0,1);
using namespace xerus;
......@@ -61,12 +60,12 @@ struct LeastSquaresProblem {
return TTOperator::identity(dim);
}
virtual TTTensor get_x() const {
TTTensor x = TTTensor::random(dimensions, x_ranks, rnd, normalDist);
TTTensor x = TTTensor::random(dimensions, x_ranks, normalDist);
x /= frob_norm(x);
return x;
};
virtual TTTensor get_b() const {
TTTensor b = TTTensor::random(dimensions, b_ranks, rnd, normalDist);
TTTensor b = TTTensor::random(dimensions, b_ranks, normalDist);
b /= frob_norm(b);
return b;
};
......@@ -98,7 +97,7 @@ namespace ls {
TTOperator get_a() const override {
std::vector<size_t> dim(dimensions);
dim.insert(dim.end(), dimensions.begin(), dimensions.end());
TTOperator A = TTOperator::random(dim, a_ranks, rnd, normalDist);
TTOperator A = TTOperator::random(dim, a_ranks, normalDist);
A /= frob_norm(A);
return A;
}
......@@ -119,7 +118,7 @@ namespace ls {
TTOperator get_a() const override {
std::vector<size_t> dim(dimensions);
dim.insert(dim.end(), dimensions.begin(), dimensions.end());
TTOperator A = TTOperator::random(dim, a_ranks, rnd, normalDist);
TTOperator A = TTOperator::random(dim, a_ranks, normalDist);
Index i,j,k;
A(i,j) = A(i,k) * A(j,k);
A /= frob_norm(A);
......@@ -175,7 +174,7 @@ std::vector<LeastSquaresProblem> leastSquaresProblems{
std::string generate_profile_name() {
std::string profileName;
#ifdef TEST_COVERAGE_
#ifdef XERUS_TEST_COVERAGE
static_assert(false, "test coverage checking nonsensical with benchmark run");
#endif
......@@ -200,13 +199,13 @@ std::string generate_profile_name() {
#ifdef USE_LTO
profileName += "_lto";
#endif
#ifdef DISABLE_RUNTIME_CHECKS_
#ifdef XERUS_DISABLE_RUNTIME_CHECKS
profileName += "_noChecks";
#endif
#ifdef REPLACE_ALLOCATOR
#ifdef XERUS_REPLACE_ALLOCATOR
profileName += "_replaceAlloc";
#endif
#ifdef PERFORMANCE_ANALYSIS
#ifdef XERUS_PERFORMANCE_ANALYSIS
profileName += "_perfAnalysis";
#endif
return profileName;
......
......@@ -7,6 +7,14 @@ CXX = g++
# CXX = clang++
#=================================================================================================
# Library Options
#=================================================================================================
# Xerus offers python bindings through boost python, which can be build in a seperate library object
# xerus.so
# BUILD_PYTHON_BINDINGS = TRUE
#=================================================================================================
# Optimization
#=================================================================================================
......@@ -35,62 +43,57 @@ COMPILE_THREADS = 8 # Number of threads to use during link time optimizatio
# The Xerus library performs a number of runtime checks to ensure a valid input to all routines.
# While not recommended these runtime checks can be completly disabled by uncommenting the following
# line. This slighlty improves the performance.
# DEBUG += -D DISABLE_RUNTIME_CHECKS_ # Disable all runtime checks
# In the default configuration xerus will throw exceptions if it encounters invalid inputs
# or (hopefully never) suffers an internal error. For some debugging purposes however it is
# more convinient to instruct xerus to directly exit in such cases.
# NO_XERUS_EXCEPTIONS = TRUE # Disable the use of exceptions by the xerus library
# DEBUG += -D XERUS_DISABLE_RUNTIME_CHECKS # Disable all runtime checks
# 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
# NO_FANCY_CALLSTACK = TRUE # Show simple callstacks only
# XERUS_NO_FANCY_CALLSTACK = TRUE # Show simple callstacks only
# 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.
# DEBUG += -D TEST_COVERAGE_ # Enable coverage tests
# DEBUG += -D XERUS_TEST_COVERAGE # Enable coverage tests
# Xerus uses many small objects (Indices, vectors of dimensions etc.) for which the standard allocator
# is not very efficient. With the following option, an experimental replacement allocator will be
# included in the library, which will _globally_ replace the 'new' and 'delete' operators in your program.
# Note also, that the replacement allocator is not (yet) thread safe!
# DEBUG += -D REPLACE_ALLOCATOR
# DEBUG += -D XERUS_REPLACE_ALLOCATOR
# You can add all kind of debuging options. In the following are some examples
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
# Xerus has a buildin logging system to provide runtime information. Here you can adjust the logging level used by the library.
# LOGGING += -D DEBUG_ # Debug infomation, can significantly slow down the library.
LOGGING += -D INFO_ # Information that is not linked to any unexpected behaviour but might nevertheless be of interest.
# LOGGING += -D WARNING_ # Informations that is linked to unexpected behaviour which indicates incorrect use of the library but are no errors as such.
# LOGGING += -D ERROR_ # Information about errors that occourt, assumedly by incorrect use of the library.
# LOGGING += -D CRITICAL_ # Information abount internal errors within the library.
# 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.
# LOGGING += -D XERUS_LOG_ERROR # Information about errors that occourt, assumedly by incorrect use of the library.
# Per default the logs are printed to cerr. Uncomment the following line to print the log messages to the file error.log instead.
# LOGGING += -D LOGFILE_ # Use error file instead of cerr
# LOGGING += -D XERUS_LOGFILE # Use error file instead of cerr
# Print absolute times instead of relative to program time
# LOGGING += -D LOG_ABSOLUTE_TIME
# LOGGING += -D XERUS_LOG_ABSOLUTE_TIME
# Uncomment the following line to save the last Logs in a circular buffer (without printing them) to allow detailed reports in case of errors.
# Note that this can significatly slow down the library.
# LOGGING += -D LOG_BUFFER_ # Activate the log buffer
# LOGGING += -D XERUS_LOG_BUFFER # Activate the log buffer
# 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.
# LOGGING += -D PERFORMANCE_ANALYSIS # Enable performance analysis
# LOGGING += -D XERUS_PERFORMANCE_ANALYSIS # Enable performance analysis