-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_test_in_docker.sh
executable file
·58 lines (47 loc) · 1.69 KB
/
run_test_in_docker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -e
sudo apt update
sudo apt install python3 python3-pip python3-venv liblapacke-dev -y
python3 -m pip install --user pipx
python3 -m pipx ensurepath
export PATH="${PATH}:${HOME}/.local/bin"
pipx install conan
conan profile new default
conan profile update settings.compiler=gcc default
conan profile update settings.compiler.version=7 default
conan profile update settings.arch=x86_64 default
conan profile update settings.os=Linux default
conan profile update settings.compiler.libcxx=libstdc++11 default
sudo update-alternatives --install /usr/local/bin/python python /usr/bin/python3 99
FENICS_SHARED="${FENICS_HOME}/shared"
DEPS="${FENICS_HOME}/deps"
INCLUDE_DIR=$HOME/include
LIB_DIR=$HOME/lib
TEST_DIR=$HOME/test
mkdir $DEPS
mkdir $INCLUDE_DIR
mkdir $LIB_DIR
export PATH=$PATH:$INCLUDE_DIR:$LIB_DIR
# Install FunG
cd $DEPS
git clone https://github.com/lubkoll/FunG
cd FunG && mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$INCLUDE_DIR && cmake --build . --target install
# Install Spacy
cd ${DEPS}
git clone https://github.com/spacy-dev/Spacy.git
cd Spacy && mkdir -p build && cd build
conan install .. --build=missing
cmake .. -DDolfin=ON -DCMAKE_INSTALL_PREFIX=$HOME -DCMAKE_CXX_FLAGS=-I/usr/local/lib/python3.6/dist-packages/ffc/backends/ufc -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake
cmake --build . --target install
# Run tests
mkdir $TEST_DIR
cp -r $FENICS_SHARED/* $TEST_DIR
cd ${TEST_DIR}/FEniCS
ffc -l dolfin LinearHeat.ufl
ffc -l dolfin L2Functional.ufl
cd ${TEST_DIR}
mkdir -p build && cd build
conan install ..
cmake .. -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_FLAGS=-I/usr/local/lib/python3.6/dist-packages/ffc/backends/ufc -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake
make -j2 && ctest