forked from modelon-community/PyFMI
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·63 lines (61 loc) · 2.57 KB
/
build.yml
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
58
59
60
61
62
63
on:
push:
pull_request:
permissions:
contents: read
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11.x'
- name: Setup Python
run: |
python3 -m pip install Cython numpy scipy matplotlib nose-py3 setuptools==69.1.0
- name: Install system
run: |
sudo apt-get -y install cmake liblapack-dev libsuitesparse-dev libhypre-dev
sudo cp -v /usr/lib/x86_64-linux-gnu/libblas.so /usr/lib/x86_64-linux-gnu/libblas_OPENMP.so
- name: Install superlu
run: |
cd /tmp
curl -fSsL https://portal.nersc.gov/project/sparse/superlu/superlu_mt_3.1.tar.gz | tar xz
cd SuperLU_MT_3.1
make CFLAGS="-O2 -fPIC -fopenmp" BLASLIB="-lblas" PLAT="_OPENMP" MPLIB="-fopenmp" lib -j1
sudo cp -v ./lib/libsuperlu_mt_OPENMP.a /usr/lib
sudo cp -v ./SRC/*.h /usr/include
- name: Install sundials
run: |
git clone --depth 1 -b v2.7.0 https://github.com/LLNL/sundials /tmp/sundials
cd /tmp/sundials
echo "target_link_libraries(sundials_idas_shared lapack blas superlu_mt_OPENMP)" >> src/idas/CMakeLists.txt
echo "target_link_libraries(sundials_kinsol_shared lapack blas superlu_mt_OPENMP)" >> src/kinsol/CMakeLists.txt
mkdir build && cd build
cmake -LAH -DSUPERLUMT_BLAS_LIBRARIES=blas -DSUPERLUMT_INCLUDE_DIR=/usr/include -DSUPERLUMT_LIBRARY=/usr/lib/libsuperlu_mt_OPENMP.a -DSUPERLUMT_THREAD_TYPE=OpenMP -DCMAKE_INSTALL_PREFIX=/usr -DSUPERLUMT_ENABLE=ON -DLAPACK_ENABLE=ON -DEXAMPLES_ENABLE=OFF ..
make -j4
sudo make install
- name: Install assimulo
run: |
git clone --depth 1 -b Assimulo-3.5.2 https://github.com/modelon-community/Assimulo /tmp/Assimulo
cd /tmp/Assimulo
rm setup.cfg
python3 setup.py install --user --sundials-home=/usr --blas-home=/usr/lib/x86_64-linux-gnu/ --lapack-home=/usr/lib/x86_64-linux-gnu/ --superlu-home=/usr
- name: Install fmilib
run: |
cd /tmp
curl -fSsL https://github.com/modelon-community/fmi-library/archive/2.4.1.tar.gz | tar xz
cd fmi-library-2.4.1
sed -i "/CMAKE_INSTALL_PREFIX/d" CMakeLists.txt
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install
- name: Build
run: python3 setup.py install --user --fmil-home=/usr
- name: Test
run: |
rm src/pyfmi/__init__.py
cp -rv src/pyfmi/tests/files tests
python3 -m nose --verbose tests/*.py