mpimd-csc / flexiblas

FlexiBLAS - A BLAS and LAPACK wrapper library with runtime exchangeable backends. This is only a mirror of https://gitlab.mpi-magdeburg.mpg.de/software/flexiblas-release
https://www.mpi-magdeburg.mpg.de/projects/flexiblas
GNU Lesser General Public License v3.0
36 stars 7 forks source link

macOS support #30

Closed go-ski closed 2 years ago

go-ski commented 2 years ago

Is there a recommended build process for macOS? I have brew installed cmake and OpenBLAS (no brew recipe for FlexiBLAS), then following the FlexiBLAS README Install, cmake configure fails with:

CMake Error at src/CMakeLists.txt:486 (MESSAGE):
  Provided BLAS library does not contain a BLAS implementation or does not
  link.
Call Stack (most recent call first):
  src/CMakeLists.txt:609 (Build_Extra_BLAS)

I am running macOS Monterey on Intel I5. Both vecLib and OpenBLAS are swappable directly under R but I would like to insert FlexiBLAS. I find the R flexiblas package very convenient for dynamic core control on clusters, where I use a hierarchy of parallel components: MPI-fork-OpenBLAS. It would be great to have the same BLAS control in R across laptop platforms to simplify teaching a transition to clusters.

grisuthedragon commented 2 years ago

@go-ski I will organize myself a mac for testing. Can you provide the command lines how you installed all prerequisites?

go-ski commented 2 years ago

@grisuthedragon I download cmake from https://github.com/Kitware/CMake/releases/download/v3.24.0-rc3/cmake-3.24.0-rc3-macos-universal.dmg and install. For command line access to cmake, I add it to the PATH:

export PATH="/Applications/CMake.app/Contents/bin":"$PATH"

I install OpenBLAS with Homebrew:

brew install openblas

which puts the libraries into: /usr/local/opt/openblas/lib

At this point I download FlexiBLAS and follow installation instructions, which result in my initial post.

grisuthedragon commented 2 years ago

@go-ski I found the reason. The installation of OpenBLAS via brew is so-called keg-only, which means that is not linked into the standard locations. Therefore, when installing OpenBLAS a hint is shown. In order to get cmake finding OpenBLAS you have to set the CMAKE_PREFIX_PATH variable accordingly:

 export CMAKE_PREFIX_PATH=/usr/local/opt/openblas:$CMAKE_PREFIX_PATH

There might also be an issue with gfortran-11 and LAPACK, I am working on that.

grisuthedragon commented 2 years ago

This is fixed in v3.2.1