From a492d7a76fcc0dcd5672dfc512fa7f0fdce5eeb5 Mon Sep 17 00:00:00 2001 From: Marcel Mueller Date: Wed, 18 Sep 2024 16:26:05 +0200 Subject: [PATCH] Update README.md with hints for macOS (#1102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update README with hints for macOS Signed-off-by: Marcel Müller * extend warning for macOS Signed-off-by: Marcel Müller --------- Signed-off-by: Marcel Müller --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index d8f7260c1..f5725dbd2 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,27 @@ meson setup build --buildtype release --optimization 2 -Dfortran_link_args="-qop ninja -C build test ``` +> [!IMPORTANT] +> Compilation with `meson` on macOS differs slightly from the protocol for Linux-based systems. Different BLAS libraries can lead to deviating results in rare cases – please stick to the following instructions. + +
+ Setting up meson on macOS + +#### Compiling with meson on macOS + +1. **Use Homebrew for Package Management**: Install dependencies like `gcc`, `gfortran`, and `openblas` using Homebrew. +[Further information](https://brew.sh/) on how to setup `brew`. +Example: + ```bash + brew install gcc gfortran openblas + ``` +2. **meson setup call with appropriate environment variables**: Use the following adapted `meson setup` call to compile `xtb` on macOS. Obviously, the paths to the libraries might differ on your system. + ```bash + LDFLAGS="-L/opt/homebrew/opt/openblas/lib" CPPFLAGS="-I/opt/homebrew/opt/openblas/include" FC=gfortran-14 CC=gcc-14 meson setup _build --buildtype release -Dlapack=openblas + ``` +
+
+ Make sure the testsuite is running without errors. To install the `xtb` binaries to `/usr/local` use (might require `sudo`)