The 2018 releases of MacOS brings a new suite of compilers: homebrew binaries and any python packages involving C / Fortran will need to be rebuilt. There are also some changes to our build process.

We recommend building all the core dependencies using petsc which ensures that only compatible versions are used. This also ensures that we can use the compatible petsc version specified by underworld2 and appropriate (tested) versions of the extension packages.

When upgrading the OS , we always recommend purging homebrew altogether.

On a new machine, installing as follows:

We recommend brew doctor even for a clean installation of homebrew as this will coach you through any compiler requirements. Follow the instructions until brew doctor tells you “ready to brew”.

A non-system python installation, libxml2, and swig are the only homebrew requirements, but you might also make sure that you have wget to grab a compatible version of petsc. The gcc requirement is to allow fortran dependencies to be installed. This takes a while but is worth having for later !

If you have not done so already, you need to accept the Xcode licence (even for gcc as it builds upon the apple compilers). Try gcc --help to see if there is any issue. There are a number of python dependencies which we install via pip. If upgrading, these packages should be uninstalled and reinstalled. Note: cython is required for petsc4py which is not an underworld dependency but is worthwhile having.

We currently test against petsc-3.9.4 and we support 3.7.x, 3.8.x. You can install anywhere: the following instructions assume /usr/local/src but you can change this as necessary If you need petsc-3.10.x, you will need to access the development branch where we are currently testing compatibility.

You should set the following environment variables

The following is a relatively bare-bones configuration for petsc that should work with all the example notebooks we provide. From the \$PETSC_DIR run the configure script and make.

To ensure that we use the compatible packages installed by petsc and by homebrew, set the following (this is only for the configure / compile phase, no need to set these permanently )

Obtain the underworld source code from github The installation path for underworld is not especially important but you can specify it explicitly at this stage. Your python path will need to include this directory explicitly so that you can import the underworld modules.

The build process for underworld has been simplified slightly from earlier versions

Assuming that works flawlessly