|
8 | 8 | branches: [ devel-tiny, devel, main ] |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - compile-with-pyccel-devel: |
12 | | - runs-on: ${{ matrix.os }} |
13 | | - strategy: |
14 | | - fail-fast: false |
15 | | - matrix: |
16 | | - os: [ ubuntu-latest ] |
17 | | - # TODO: Make sure that struphy works with python > 3.11, keep the lower bound to 3.10 |
18 | | - python-version: [ '3.10', '3.12', '3.13' ] |
19 | | - compile_language: ['c', 'fortran'] |
20 | | - isMerge: |
21 | | - - ${{ github.event_name == 'push' && github.ref == 'refs/heads/devel' }} |
22 | | - # exclude: |
23 | | - # - { isMerge: false, python-version: '3.10' } |
24 | | - # - { isMerge: false, python-version: '3.11' } |
25 | | - # include: |
26 | | - # - os: macos-14 |
27 | | - # python-version: '3.10' |
28 | | - # - os: macos-14 |
29 | | - # python-version: '3.13' |
30 | | - |
31 | | - name: Compile with pyccel devel on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }} |
32 | | - |
33 | | - steps: |
34 | | - - uses: actions/checkout@v4 |
35 | | - |
36 | | - - name: Set up Python ${{ matrix.python-version }} |
37 | | - uses: actions/setup-python@v5 |
38 | | - with: |
39 | | - python-version: ${{ matrix.python-version }} |
40 | | - cache: 'pip' |
41 | | - cache-dependency-path: | |
42 | | - pyproject.toml |
43 | | - requirements.txt |
44 | | -
|
45 | | - - name: Install non-Python dependencies on Ubuntu |
46 | | - if: matrix.os == 'ubuntu-latest' |
47 | | - uses: awalsh128/cache-apt-pkgs-action@latest |
48 | | - with: |
49 | | - packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev |
50 | | - version: 1.0 |
51 | | - execute_install_scripts: true |
52 | | - |
53 | | - # When loading cached apt packages, the default MPI compiler isn't set. |
54 | | - # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform |
55 | | - # installation (since openmpi-bin already exists), but instead reruns |
56 | | - # `update-alternatives` which fixes the symlinks to mpicc/mpif90. |
57 | | - - name: Reconfigure non-Python dependencies on Ubuntu |
58 | | - if: matrix.os == 'ubuntu-latest' |
59 | | - run: | |
60 | | - sudo apt-get update |
61 | | - sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev |
62 | | -
|
63 | | - - name: Install non-Python dependencies on macOS |
64 | | - if: matrix.os == 'macos-14' |
65 | | - run: | |
66 | | - brew install make |
67 | | - brew install open-mpi |
68 | | - brew install hdf5-mpi |
69 | | - brew install libomp |
70 | | - brew update |
71 | | - brew install python3 |
72 | | - brew install gcc |
73 | | - brew install openblas |
74 | | - brew install lapack |
75 | | - brew install git |
76 | | - brew install pandoc |
77 | | - GFORTRAN_HOME=$(which gfortran || true) |
78 | | - echo "GFORTRAN_HOME : $GFORTRAN_HOME" |
79 | | - if [[ ! -f "$GFORTRAN_HOME" ]]; then |
80 | | - gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true) |
81 | | - echo "Found $gfort" |
82 | | - gfort_path=$(which ${gfort}) |
83 | | - folder=$(dirname ${gfort_path}) |
84 | | - ln -s ${gfort_path} ${folder}/gfortran |
85 | | - fi |
86 | | - echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV |
87 | | - echo "/opt/homebrew/opt/make/libexec/gnubin" >> $GITHUB_PATH |
88 | | -
|
89 | | - - name: Print information on MPI and HDF5 libraries |
90 | | - run: | |
91 | | - ompi_info |
92 | | - h5pcc -showconfig -echo || true |
93 | | -
|
94 | | - - name: Upgrade pip |
95 | | - run: | |
96 | | - python -m pip install --upgrade pip |
97 | | -
|
98 | | - - name: Determine directory of parallel HDF5 library |
99 | | - run: | |
100 | | - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then |
101 | | - HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname) |
102 | | - elif [[ "${{ matrix.os }}" == "macos-14" ]]; then |
103 | | - HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname) |
104 | | - fi |
105 | | - echo $HDF5_DIR |
106 | | - echo "HDF5_DIR=$HDF5_DIR" >> $GITHUB_ENV |
107 | | -
|
108 | | - - name: Cache PETSc |
109 | | - uses: actions/cache@v4 |
110 | | - id: cache-petsc |
111 | | - env: |
112 | | - cache-name: cache-PETSc |
113 | | - with: |
114 | | - path: "./petsc" |
115 | | - key: petsc-${{ matrix.os }}-${{ matrix.python-version }} |
116 | | - |
117 | | - - if: steps.cache-petsc.outputs.cache-hit != 'true' |
118 | | - name: Download a specific release of PETSc |
119 | | - run: | |
120 | | - git clone --depth 1 --branch v3.23.3 https://gitlab.com/petsc/petsc.git |
121 | | -
|
122 | | - - if: steps.cache-petsc.outputs.cache-hit != 'true' |
123 | | - name: Install PETSc with complex support |
124 | | - working-directory: ./petsc |
125 | | - run: | |
126 | | - export PETSC_DIR=$(pwd) |
127 | | - export PETSC_ARCH=petsc-cmplx |
128 | | - ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 --download-fblaslapack=1 |
129 | | - make all |
130 | | - echo "PETSC_DIR=$PETSC_DIR" > petsc.env |
131 | | - echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env |
132 | | -
|
133 | | - # This step is not really necessary and could be combined with PETSc install |
134 | | - # step; however it's good to verify if the cached PETSc installation really works! |
135 | | - - name: Test PETSc installation |
136 | | - working-directory: ./petsc |
137 | | - run: | |
138 | | - source petsc.env |
139 | | - make check |
140 | | - echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV |
141 | | - echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV |
142 | | -
|
143 | | - - name: Install petsc4py |
144 | | - working-directory: ./petsc |
145 | | - run: | |
146 | | - python -m pip install wheel Cython numpy |
147 | | - python -m pip install src/binding/petsc4py |
148 | | -
|
149 | | - - name: Install Python dependencies |
150 | | - run: | |
151 | | - python -m pip install -r requirements.txt |
152 | | - python -m pip list |
153 | | -
|
154 | | - - name: Install project |
155 | | - run: | |
156 | | - python -m pip install ".[test]" --no-cache-dir |
157 | | - python -m pip freeze |
158 | | -
|
159 | | - - name: Set up environment variables |
160 | | - run: | |
161 | | - echo "PSYDAC_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV |
162 | | - echo "PYCCEL_DIR=$GITHUB_WORKSPACE/pyccel" >> $GITHUB_ENV |
163 | | - |
164 | | - - name: Clone pyccel from Github (devel branch) |
165 | | - run: | |
166 | | - git clone --recurse-submodules https://github.com/pyccel/pyccel.git $PYCCEL_DIR |
167 | | -
|
168 | | - - name: Install pyccel |
169 | | - working-directory: ${{ env.PYCCEL_DIR }} |
170 | | - run: | |
171 | | - echo "Pyccel location for this branch" |
172 | | - pip show pyccel |
173 | | - pip uninstall pyccel -y |
174 | | - python -m pip install ".[test]" --no-cache-dir |
175 | | - echo "Pyccel location after reinstalling" |
176 | | - pip show pyccel |
177 | | - |
178 | | - - name: Compile psydac kernels |
179 | | - run: | |
180 | | - psydac-accelerate --language ${{ matrix.compile_language }} |
181 | | -
|
182 | 11 | test: |
183 | 12 | runs-on: ${{ matrix.os }} |
184 | 13 | strategy: |
|
0 commit comments