Commit 93049c5f authored by Philipp  Trunschke's avatar Philipp Trunschke

bugfixes for conda

parent 071801dd
.PHONY: help shared static python doc install test clean opt warn printBoostVersion
.PHONY: help version shared static python doc install test clean opt warn printBoostVersion
# ------------------------------------------------------------------------------------------------------
# Default rule should be the help message
......@@ -23,16 +23,17 @@ help:
TEST_NAME = XerusTest
# xerus version from VERSION file
XERUS_VERSION = $(shell git describe --tags --always 2>/dev/null || cat VERSION)
# XERUS_VERSION = $(shell git describe --tags --always 2>/dev/null || cat VERSION) # git should not be an explicit dependency
XERUS_VERSION = $(shell cat VERSION)
DEBUG += -D XERUS_VERSION="$(XERUS_VERSION)"
XERUS_MAJOR_V = $(word 1, $(subst ., ,$(XERUS_VERSION)) )
ifneq (,$(findstring v, $(XERUS_MAJOR_V)))
XERUS_MAJOR_V := $(strip $(subst v, ,$(XERUS_MAJOR_V)) )
endif
DEBUG += -DXERUS_VERSION_MAJOR=$(XERUS_MAJOR_V)
DEBUG += -D XERUS_VERSION_MAJOR="$(XERUS_MAJOR_V)"
XERUS_MINOR_V = $(word 2, $(subst ., ,$(XERUS_VERSION)) )
DEBUG += -DXERUS_VERSION_MINOR=$(XERUS_MINOR_V)
DEBUG += -D XERUS_VERSION_MINOR="$(XERUS_MINOR_V)"
XERUS_REVISION_V = $(word 3, $(subst ., ,$(XERUS_VERSION)) )
ifneq (,$(findstring -, $(XERUS_REVISION_V)))
XERUS_COMMIT_V := $(word 2, $(subst -, ,$(XERUS_REVISION_V)) )
......@@ -43,6 +44,13 @@ endif
DEBUG += -DXERUS_VERSION_REVISION=$(XERUS_REVISION_V)
DEBUG += -DXERUS_VERSION_COMMIT=$(XERUS_COMMIT_V)
version:
@echo $(XERUS_VERSION)
@echo MAYOR: $(XERUS_MAJOR_V)
@echo MINOR: $(XERUS_MINOR_V)
@echo REVISION: $(XERUS_REVISION_V)
@echo COMMIT: $(XERUS_COMMIT_V)
# ------------------------------------------------------------------------------------------------------
# Register source files for the xerus library
......@@ -229,7 +237,7 @@ build/print_boost_version: src/print_boost_version.cpp
printBoostVersion: build/print_boost_version
@build/print_boost_version
test: $(TEST_NAME)
test: $(TEST_NAME)
./$(TEST_NAME) all
......
#!/bin/bash
set -e # exit when any command fails
cat <<EOF >config.mk
CXX = ${CXX}
COMPATIBILITY = -std=c++17
......@@ -29,16 +31,17 @@ BOOST_PYTHON3 = -lboost_python37
OTHER+= -L${BUILD_PREFIX}/lib
EOF
test ${CONDA_PY} = ${PY_VER//./} # this should always be the case
export CPP_INCLUDE_PATH=${BUILD_PREFIX}/include:${BUILD_PREFIX}/lib/python${PY_VER}/site-packages/numpy/core/include/
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
ln -s ${BUILD_PREFIX}/include/ ${BUILD_PREFIX}/include/suitesparse
ln -sfn ${BUILD_PREFIX}/include/ ${BUILD_PREFIX}/include/suitesparse # overwrite existing symbolic links
mkdir -p ${PREFIX}/lib/python${PY_VER}
make test -j4
make test -j$((${CPU_COUNT}-1))
make install
rm config.mk
......@@ -17,6 +17,8 @@ requirements:
- python=3.7
- numpy>=1.16
- binutils
- gdb
- backward-cpp
- openmp
run:
......@@ -27,6 +29,8 @@ requirements:
- python=3.7
- numpy>=1.16
- binutils
- gdb
- backward-cpp
- openmp
test:
......
......@@ -94,7 +94,7 @@ static misc::UnitTest tt_noround("TT", "no_rounding", [](){
TTTensor a = TTTensor::random({2,2,2,2,2,2,2}, {2,2,2,2,2,2});
TTTensor b(a);
a.round(2);
TEST(approx_equal(Tensor(a),Tensor(b)));
TEST(approx_equal(Tensor(a),Tensor(b), 1e-14));
TTTensor c = TTTensor::random({2,2,2,2,2,2,2}, {2,2,2,2,2,2});
a(i&0) = a(i&0) + 0.0*c(i&0);
LOG(unit_test, a.ranks());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment