Multiwfn is one of the most versatile software packages for electronic wave function analysis. Sadly, support for MacOS was dropped after version 3.7. This is an independent CMake-based build recipe which I have found to work reasonably well on an M1-based Mac running MacOS Monterey 12.4. Others have reproduced it on Intel Macs. No guarantees given for anything.
The easiest way to install is with the Homebrew tap.
The build has been tested with Homebrew-installed:
Apple's Accelerate for BLAS/LAPACK also seems to work. No guarantees are given for other combinations of compilers and linear algebra backends. The build recipe might break with future versions of Multiwfn.
The source_dist branch is updated daily based on the published Multiwfn source files. We clone this branch and build with cmake:
$ git clone --branch source_dist https://github.com/digital-chemistry-laboratory/multiwfn-mac-build.git
$ cd multiwfn-mac-build
$ cmake -B build
$ cmake --build build
$ cp build/multiwfn .
Alternatively, use cmake -B build -DCMAKE_BUILD_TYPE=Release
to fully optimize the build, but it will take additonal time.
We then need to add the Multiwfn path to ~/.zshrc
. Adapt the specific path to where you have installed Multiwfn on your system. See the Multiwfn manual for more specific instructions.
export PATH=$PATH:$HOME/bin/multiwfn-mac-build
export Multiwfnpath=$HOME/bin/multiwfn-mac-build
To build with OpenMP, set the flag cmake -B build -DWITH_OpenMP=ON
. Then you need to specify the number of processors in settings.ini
(see below).
To link against OpenBLAS rather than Apple's Accelerate, on Apple Silicon the following environment variables have to be set before calling CMake.
export LDFLAGS="-L/opt/homebrew/opt/openblas/lib"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openblas/lib/pkgconfig"
Use cmake --install build
to install the multiwfn
executable and settings.ini
. Change install prefix with the flag --prefix <dir>
The GUI version can be built on Intel machines. It is currently not possible to build the GUI on Apple Silicon machines, due to lack of a DISLIN distribution. The required libraries can be installed with homebrew:
The DISLIN package needs to be installed on the system. Follow these steps:
- Download the right distribution from the DISLIN download page
- Unpack the .tar.gz file and go into the folder
- Set the preferred install directory for DISLIN
- Run the installation script
- Patch the library install name
An example of how to do this is:
wget https://www.dislin.de/downloads/darwin/dislin-11.5.darwin.intel.64.tar.gz
tar -xvf dislin-11.5.darwin.intel.64.tar.gz
export DISLIN=$HOME/bin/dislin
cd dislin-11.5
./INSTALL
cd ..
install_name_tool -id $DISLIN/libdislin_d.dylib $DISLIN/libdislin_d.dylib
To build with the GUI, specify the following options to CMake,
$ cmake -B build -DWITH_GUI=ON -DDISLIN_DIR=$DISLIN
where $DISLIN
points to the same directory as during the installation. These options can be combined with OpenMP and the release build type for optimal performance (see above).