forked from Srlive1201/LibRPA
-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (91 loc) · 4.82 KB
/
Copy pathci.yml
File metadata and controls
94 lines (91 loc) · 4.82 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build and run unittest with Intel oneAPI
on:
push:
pull_request:
# oneapi install adapted from the build_linux_apt_cpp of
# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml
env:
LINUX_CPP_COMPONENTS: intel-oneapi-dpcpp-cpp-compiler_intel-oneapi-compiler-fortran_intel-oneapi-mkl_intel-oneapi-mkl-devel_intel-oneapi-mpi_intel-oneapi-mpi-devel
jobs:
ONEAPI:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Intel oneAPI apt repo
run: |
# download the key to system keyring
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
# add signed entry to apt sources and configure the APT client to use Intel repository:
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
| sudo tee /etc/apt/sources.list.d/oneAPI.list
# --allow-unauthenticated to resolve Clearsigned file isn't valid, got 'NOSPLIT' error
# when fetching https://packages.microsoft.com/ubuntu/22.04/prod
# https://superuser.com/questions/1774745/kali-apt-get-update-fails-with-clearsigned-file-isnt-valid
# https://superuser.com/questions/1331936/how-can-i-get-past-a-repository-is-not-signed-message-when-attempting-to-upgr
sudo apt-get update --allow-unauthenticated -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0"
- name: Collect apt dependencies
run: |
echo "$LINUX_CPP_COMPONENTS" | sed "s/_/ /g" | xargs -n 1 apt-cache depends | tee depends.txt
- name: Cache install
id: cache-install
uses: actions/cache@v3
with:
path: /opt/intel/oneapi/
key: install-${{ env.LINUX_CPP_COMPONENTS }}-${{ hashFiles('**/depends.txt') }}
- name: Install build-essential and cmake
run: sudo apt-get install -y build-essential cmake
- name: Install python dependency
run: |
pip install --user pytest scipy
cd thirdparty/greenX/python && python setup.py install --verbose --user
- name: Install tools including oneAPI
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y $(echo "$LINUX_CPP_COMPONENTS" | sed "s/_/ /g")
- name: Initialize and update submodules recursively
run: git submodule update --init --recursive
- name: Check environment
run: |
echo -n "Size of /opt/intel/oneapi/: " && du -csh /opt/intel/oneapi
echo "PATH: $PATH"
which pytest
echo "PYTHONPATH: $PYTHONPATH"
- name: Build/test LibRPA without LibRI
run: |
source /opt/intel/oneapi/setvars.sh
export BUILDDIR="build"
CXX=mpiicpx FC=ifx cmake -DLIBRPA_USE_LIBRI=OFF -DBUILD_SHARED_LIBS=ON -B $BUILDDIR -DCMAKE_BUILD_TYPE=Debug -DENABLE_LIBRPA_FORTRAN_BIND=OFF -DENABLE_LIBRPA_TEST=ON -DENABLE_GREENX_CTEST=OFF
cmake --build $BUILDDIR -j 2
cmake --build $BUILDDIR --target test
- name: Build/test LibRPA with LibRI
run: |
source /opt/intel/oneapi/setvars.sh
export BUILDDIR="build_libri"
CXX=mpiicpx FC=ifx cmake -DLIBRPA_USE_LIBRI=ON -DBUILD_SHARED_LIBS=ON -B $BUILDDIR -DCMAKE_BUILD_TYPE=Debug -DENABLE_LIBRPA_FORTRAN_BIND=OFF -DENABLE_LIBRPA_TEST=ON
cmake --build $BUILDDIR -j 2
cmake --build $BUILDDIR --target test
cd regression_tests && ./run_regression.py full ../build_libri/chi0_main.exe -d workspace_libri_np4 --use-libri -n 4 | tee test_libri_np4.log
- name: Build Fortran binding (with LibRI), static library, and binding test
run: |
source /opt/intel/oneapi/setvars.sh
export BUILDDIR="build_fortran_bind"
CXX=mpiicpx FC=mpiifx cmake -DLIBRPA_USE_LIBRI=ON -DBUILD_SHARED_LIBS=OFF -B $BUILDDIR -DCMAKE_BUILD_TYPE=Debug -DENABLE_LIBRPA_FORTRAN_BIND=ON -DENABLE_LIBRPA_TEST=ON -DENABLE_LIBRPA_CPP_TEST=OFF -DENABLE_GREENX_CTEST=OFF
cmake --build $BUILDDIR -j 2
cmake --build $BUILDDIR --target test
- name: Save last test log for check
if: always()
uses: actions/upload-artifact@v4
with:
name: save-last-test
path: |
build/Testing/Temporary/LastTest.log
build_libri/Testing/Temporary/LastTest.log
regression_tests/test_libri_np4.log
regression_tests/workspace_libri_np4/testcases/*/librpa/librpa.out
regression_tests/workspace_libri_np4/testcases/*/librpa/librpa.err
regression_tests/workspace_libri_np4/testcases/*/librpa/*.dat