Skip to content

Support building mVMC with Homebrew GCC on macOS #82

Description

@tmisawa

We have added support for building mVMC on macOS using Homebrew GCC, without requiring BLIS as an external dependency.

For actual implementations, see PR
#80

What's changed

New: config/mac_gcc.cmake

A CMake configuration file for macOS + Homebrew GCC that:

  • Auto-detects the latest Homebrew GCC via brew --prefix gcc, so you don't need to hardcode a specific GCC version (e.g., gcc-14, gcc-15).
  • Disables USE_GEMMT (OFF) to build without BLIS. The reference implementations of dskr2k/zskr2k are used instead.

Build system fixes

  • CMakeLists.txt: Updated cmake_minimum_required to version range syntax (3.5...3.10) and added CMAKE_POLICY_VERSION_MINIMUM for compatibility with CMake 4.0 and later.
  • src/ltl2inv/CMakeLists.txt: Made blalink_gemmt.c conditional on USE_GEMMT. This file depends on BLIS symbols (bli_*gemmt) and previously caused link errors when BLIS was not available.
  • src/mVMC/CMakeLists.txt: Removed redundant cmake_minimum_required from the subdirectory to avoid CMake policy warnings.

Prerequisites

Install GCC and required libraries via Homebrew:

brew install gcc cmake open-mpi

How to build

mkdir build && cd build
cmake -DCONFIG=mac_gcc ..
make -j$(sysctl -n hw.logicalcpu)

The binaries (vmc.out, vmcdry.out) will be built in build/src/mVMC/.

Notes

  • Why no BLIS? Building BLIS on macOS (especially on Apple Silicon) is difficult due to platform-specific issues. This configuration bypasses BLIS entirely by setting USE_GEMMT=OFF, falling back to the reference implementations of dskr2k/zskr2k. If BLIS support on macOS improves in the future, it can be re-enabled.

  • This configuration uses the system BLAS/LAPACK found by CMake's find_package(LAPACK). On macOS, this typically resolves to Apple's Accelerate framework.

  • If you prefer to use OpenBLAS, you can add the following to config/mac_gcc.cmake:

    set(BLA_VENDOR OpenBLAS CACHE STRING "BLAS vendor" FORCE)
  • PFAFFIAN_BLOCKED is not enabled by default. Enabling it requires BLIS.

Feedback

Comments, bug reports, and feature requests are welcome. Please feel free to open an issue or leave a comment.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions