Build on Mac OS X.

This page describes how to build Netgen and NGsolve on Apple computers running OS X 10.9 or greater. These steps will give you a native OSX style framework and a These steps have been tested on MacOS version 10.12.

Here we describe how to build the latest version 6.2.2404-101-g23b98f5aa.


  • You need to have Xcode installed. We will build using the default clang compiler. If it is not in the default location/path, please set

    export CC=<MyPathtoClang>
    export CXX=<MyPathtoClang++>
  • You need to have make installed for command line use. Xcode Command Line Tools package comes with make. You can install Xcode Command Line Tools by xcode-select --install.

  • You need to have cmake installed. You can either download and install CMake. Make sure to install the command line tools: Open CMake, click on "How to Install For Command Line Use" in the "Tools" menu and execute one of the suggested options.

  • Install Python 3.8

Getting the source

Create a folder where your Netgen/NGsolve sources and builds will reside.

export NGROOT=<PathToTheFolderYouJustMade>

Move to the folder, git clone the NGSolve repository.

git clone --recurse-submodules ngsolve-src

Building from the source

Create a folder for the builds.

mkdir $NGROOT/ngsolve-build


Change into the directory for builds and call cmake with a link to the source directory

cd $NGROOT/ngsolve-build
cmake $NGROOT/ngsolve-src


Now, call


You may want to add "-jx" with x the number of threads you want to use for the compilation. If everything goes smooth you can install the resulting build calling

make install

Finishing the installation

Add the following line to your .bashrc file in your home directory

export PYTHONPATH=$PYTHONPATH:/Applications/
export NETGENDIR=/Applications/

and execute the file with

source .bashrc

to set all environment variable needed to start Netgen/NGSolve from the command line.