Trouble installing conf-openblas

Hello,

I’m trying to install Owl on an Intel mac, but I’m getting an error when it tries to install the conf-openblas dependency:

#=== ERROR while compiling conf-openblas.0.2.2 ================================#
# context     2.3.0 | macos/x86_64 | ocaml.5.2.1 | https://opam.ocaml.org#d1985569e2c0f406d535044b53c1fde79b558617
# path        ~/.opam/default/.opam-switch/build/conf-openblas.0.2.2
# command     ~/.opam/opam-init/hooks/sandbox.sh build sh -exc cc $CFLAGS $(PKG_CONFIG_PATH="$(brew --prefix openblas)/lib/pk
gconfig:$PKG_CONFIG_PATH" pkg-config --cflags openblas) test.c $(PKG_CONFIG_PATH="$(brew --prefix openblas)/lib/pkgconfig:$PK
G_CONFIG_PATH" pkg-config --libs openblas)
# exit-code   1
# env-file    ~/.opam/log/conf-openblas-33821-d9434e.env
# output-file ~/.opam/log/conf-openblas-33821-d9434e.out
### output ###
# +++ brew --prefix openblas
# ++ PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig:
# ++ pkg-config --cflags openblas
# +++ brew --prefix openblas
# ++ PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig:
# ++ pkg-config --libs openblas
# + cc -I/usr/local/Cellar/openblas/0.3.29/include -fopenmp test.c -L/usr/local/Cellar/openblas/0.3.29/lib -lopenblas
# clang: error: unsupported option '-fopenmp'
# clang: error: unsupported option '-fopenmp'

(I do have openblas and libomp installed on the system through homebrew).

The issue seems to be that it’s using the default macOS clang, which doesn’t support -fopenmp. I tried installing homebrew’s clang and the setting compiler environment variables, but the error persists, presumably because cc is invoked as sandbox.sh build sh -exc cc. I tried specifying a compiler on a new switch as well, following the instructions here, but still with no luck.

Any tips about how to get this working?

1 Like

this problem exists also on ARM macos. see here: conf-openblas does not build on macos ARM due to unsupported '-fopenmp' · Issue #27483 · ocaml/opam-repository · GitHub

afaik there is no resolution at the moment.

I was looking into if it might be possible to use conf-blas instead of conf-openblas. No successful results yet, but leaving some notes here in case I take another look. In the meantime, I’m dual-booting windows and then using WSL on that (linux on windows on a mac, kind of funny).

As trying to switch over to conf-blas, the relevant file seems to be owl/src/config/configure.ml . Switching from -fopenmp to -framework Accelerate in the relevant locations seems to get the BLAS parts to build, but it’s still missing the LAPACKE dependency (apparently Accelerate comes with LAPACK but not LAPACKE?). So I did brew install lapack which apparently does come with LAPACKE, but haven’t managed to get the build to use it yet.