Skip to content

Latest commit

 

History

History
92 lines (64 loc) · 3.9 KB

README.md

File metadata and controls

92 lines (64 loc) · 3.9 KB

Introduction

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.

Homebrew tap

The easiest way to install is with the Homebrew tap.

Requirements

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.

Building from source distribution

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

Building with OpenMP

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).

Building with OpenBLAS

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"

Install

Use cmake --install build to install the multiwfn executable and settings.ini. Change install prefix with the flag --prefix <dir>

Building with GUI

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:

Install DISLIN

The DISLIN package needs to be installed on the system. Follow these steps:

  1. Download the right distribution from the DISLIN download page
  2. Unpack the .tar.gz file and go into the folder
  3. Set the preferred install directory for DISLIN
  4. Run the installation script
  5. 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

Building

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).