macos installation of PETSc does not work

This commit is contained in:
Martin Diehl 2022-12-18 09:45:33 +01:00
parent 3a643d04c4
commit c2d63532df
1 changed files with 14 additions and 28 deletions

View File

@ -2,7 +2,7 @@ name: Grid and Mesh Solver
on: [push] on: [push]
env: env:
PETSC_VERSION: '3.18.1' PETSC_VERSION: '3.18.2'
HOMEBREW_NO_ANALYTICS: 'ON' # Make Homebrew installation a little quicker HOMEBREW_NO_ANALYTICS: 'ON' # Make Homebrew installation a little quicker
HOMEBREW_NO_AUTO_UPDATE: 'ON' HOMEBREW_NO_AUTO_UPDATE: 'ON'
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 'ON' HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 'ON'
@ -11,14 +11,14 @@ env:
jobs: jobs:
gcc: gcc_ubuntu:
runs-on: ${{ matrix.os }} runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] gcc_v: [9, 10, 11, 12]
gcc_v: [9, 10, 11] # Version of GCC compilers fail-fast: false
env: env:
GCC_V: ${{ matrix.gcc_v }} GCC_V: ${{ matrix.gcc_v }}
@ -27,8 +27,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: GCC - Install (Linux) - name: GCC - Install
if: contains( matrix.os, 'ubuntu')
run: | run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
@ -38,12 +37,6 @@ jobs:
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \ --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V} --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: GCC - Install (macOS)
if: contains( matrix.os, 'macos')
run: |
brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
brew link gcc@${GCC_V}
- name: PETSc - Cache download - name: PETSc - Cache download
id: petsc-download id: petsc-download
uses: actions/cache@v3 uses: actions/cache@v3
@ -63,28 +56,19 @@ jobs:
export PETSC_ARCH=gcc${GCC_V} export PETSC_ARCH=gcc${GCC_V}
printenv >> $GITHUB_ENV printenv >> $GITHUB_ENV
- name: PETSc - Cache installation - name: PETSc - Cache Installation
id: petsc-install id: petsc-install
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: petsc-${{ env.PETSC_VERSION }} path: petsc-${{ env.PETSC_VERSION }}
key: petsc-${{ env.PETSC_VERSION }}-${{ matrix.os }}-gcc${{ matrix.gcc_v }}-${{ hashFiles('**/petscversion.h') }} key: petsc-${{ env.PETSC_VERSION }}-gcc${{ matrix.gcc_v }}-${{ hashFiles('**/petscversion.h') }}
- name: PETSc - Install (Linux) - name: PETSc - Installation
if: contains( matrix.os, 'ubuntu')
run: | run: |
cd petsc-${PETSC_VERSION} cd petsc-${PETSC_VERSION}
./configure --with-fc=gfortran --with-cc=gcc --with-cxx=g++ \ ./configure --with-fc=gfortran --with-cc=gcc --with-cxx=g++ \
--download-mpich --download-fftw --download-hdf5 --download-hdf5-fortran-bindings=1 --download-zlib \ --download-openmpi --download-fftw --download-hdf5 --download-hdf5-fortran-bindings=1 --download-zlib \
--with-mpi-f90module-visibility=0 --with-mpi-f90module-visibility=1
make all
- name: PETSc - Install (macOS)
if: contains( matrix.os, 'macos')
run: |
cd petsc-${PETSC_VERSION}
./configure --with-fc=gfortran-${GCC_V} --with-cc=gcc-${GCC_V} --with-cxx=g++-${GCC_V} \
--download-openmpi --download-fftw --download-hdf5 --download-hdf5-fortran-bindings=1 --download-zlib
make all make all
- name: DAMASK - Compile - name: DAMASK - Compile
@ -100,6 +84,7 @@ jobs:
run: | run: |
./bin/DAMASK_grid -l tensionX.yaml -g 20grains16x16x16.vti -w examples/grid ./bin/DAMASK_grid -l tensionX.yaml -g 20grains16x16x16.vti -w examples/grid
intel: intel:
runs-on: [ubuntu-22.04] runs-on: [ubuntu-22.04]
@ -107,6 +92,7 @@ jobs:
strategy: strategy:
matrix: matrix:
intel_v: [classic, llvm] # Variant of Intel compilers intel_v: [classic, llvm] # Variant of Intel compilers
fail-fast: false
env: env:
INTEL_V: ${{ matrix.intel_v }} INTEL_V: ${{ matrix.intel_v }}
@ -143,7 +129,7 @@ jobs:
- name: PETSc - Prepare - name: PETSc - Prepare
run: | run: |
tar -xf download/petsc-${PETSC_VERSION}.tar.gz -C . tar -xf download/petsc-${PETSC_VERSION}.tar.gz -C .
sed -i "1715s/if not os.path.isfile(os.path.join(self.packageDir,'configure')):/if True:/g" \ sed -i "1718s/if not os.path.isfile(os.path.join(self.packageDir,'configure')):/if True:/g" \
./petsc-${PETSC_VERSION}/config/BuildSystem/config/package.py ./petsc-${PETSC_VERSION}/config/BuildSystem/config/package.py
export PETSC_DIR=${PWD}/petsc-${PETSC_VERSION} export PETSC_DIR=${PWD}/petsc-${PETSC_VERSION}
export PETSC_ARCH=intel-${INTEL_V} export PETSC_ARCH=intel-${INTEL_V}