Skip to content

Commit

Permalink
Fix for macOS build (#2401)
Browse files Browse the repository at this point in the history
* Install petsc4py from tarball

* Tweak

* macOS not Mac OS or MacOS

* bison keg-only, although my macOS has `/usr/bin/bison`.

* Tell PETSc where homebrew bison is

* Try this.

* Fix.
  • Loading branch information
jhale committed Oct 14, 2022
1 parent a1416ab commit d6c4d87
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
47 changes: 26 additions & 21 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: MacOS build
name: macOS build

on:
schedule:
Expand All @@ -9,7 +9,7 @@ on:

jobs:
mac-os-build:
name: MacOS Homebrew install and test
name: macOS Homebrew install and test
strategy:
matrix:
os: [macos-12, macos-11]
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Install Homebrew dependencies
run: |
brew install boost cmake hdf5-mpi ninja open-mpi pkg-config pugixml python@3.10 # FEniCS
brew install bison flex # PETSc
brew install flex # PETSc
brew list --versions
# This 'activates' Python 3.10 from Homebrew
Expand All @@ -31,24 +31,6 @@ jobs:
with:
python-version: '3.10'

- name: Install minimal PETSc
run: |
curl -L -O http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.17.3.tar.gz
mkdir petsc
tar -xf petsc-lite-3.17.3.tar.gz -C petsc --strip-components=1
cd petsc
python ./configure \
--with-64-bit-indices=no \
--with-debugging=no \
--with-fortran-bindings=no \
--with-scalar-type=real \
--with-shared-libraries \
--with-scalar-type=real \
--with-make-np=3 \
--download-metis \
--download-ptscotch
make all
- name: Create virtualenv
run: |
python -m venv create fenicsx
Expand All @@ -58,6 +40,29 @@ jobs:
echo "VIRTUAL ENV:" $VIRTUAL_ENV
echo '$(which python):' $(which python)
# bison > 3 required. Could not get PETSc to find keg-only Homebrew
# bison. Instead let PETSc build bison.
- name: Install minimal PETSc
run: |
curl -L -O http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.18.0.tar.gz
mkdir petsc
tar -xf petsc-lite-3.18.0.tar.gz -C petsc --strip-components=1
cd petsc
python ./configure \
--with-64-bit-indices=no \
--with-debugging=no \
--with-fortran-bindings=no \
--with-scalar-type=real \
--with-shared-libraries \
--with-scalar-type=real \
--with-make-np=3 \
--download-bison \
--download-metis \
--download-ptscotch
make all
cd src/binding/petsc4py
PETSC_DIR=$GITHUB_WORKSPACE/petsc PETSC_ARCH=arch-darwin-c-opt pip3 install --no-cache-dir .
- name: Install Basix
run: |
source fenicsx/bin/activate
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Actions Docker images](https://github.com/FEniCS/dolfinx/actions/workflows/docker.yml/badge.svg)](https://github.com/FEniCS/dolfinx/actions/workflows/docker.yml)
[![Actions Spack build](https://github.com/FEniCS/dolfinx/actions/workflows/spack.yml/badge.svg)](https://github.com/FEniCS/dolfinx/actions/workflows/spack.yml)
[![Actions Conda install](https://github.com/FEniCS/dolfinx/actions/workflows/conda.yml/badge.svg)](https://github.com/FEniCS/dolfinx/actions/workflows/conda.yml)
[![Actions MacOS/Homebrew install](https://github.com/FEniCS/dolfinx/actions/workflows/macos.yml/badge.svg)](https://github.com/FEniCS/dolfinx/actions/workflows/macos.yml)
[![Actions macOS/Homebrew install](https://github.com/FEniCS/dolfinx/actions/workflows/macos.yml/badge.svg)](https://github.com/FEniCS/dolfinx/actions/workflows/macos.yml)

DOLFINx is the computational environment of
[FEniCSx](https://fenicsproject.org) and implements the FEniCS Problem
Expand Down Expand Up @@ -53,7 +53,7 @@ For detailed instructions, see

#### Operating System Recommendations

- Mac OS: use [conda](#conda).
- macOS: use [conda](#conda).
- Linux: use [apt](#ubuntu-packages) ([Ubuntu](#ubuntu-packages)/[Debian](#debian-packages)), [docker](#docker-images) or [conda](#conda). See also [Spack](#spack).
- Windows: use [docker](#docker-images), or install Microsoft's [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install) and use [Ubuntu](#ubuntu-packages).

Expand Down

0 comments on commit d6c4d87

Please sign in to comment.