Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
xerus
xerus
Commits
93049c5f
Commit
93049c5f
authored
Apr 29, 2020
by
Philipp Trunschke
Browse files
bugfixes for conda
parent
071801dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
93049c5f
.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
...
...
conda/xerus-dev/build.sh
View file @
93049c5f
#!/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
-s
fn
${
BUILD_PREFIX
}
/include/
${
BUILD_PREFIX
}
/include/suitesparse
# overwrite existing symbolic links
mkdir
-p
${
PREFIX
}
/lib/python
${
PY_VER
}
make
test
-j
4
make
test
-j
$((${
CPU_COUNT
}
-
1
))
make
install
rm
config.mk
conda/xerus-dev/meta.yaml
View file @
93049c5f
...
...
@@ -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
:
...
...
src/unitTests/ttRounding.cxx
View file @
93049c5f
...
...
@@ -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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment