Closed nilsbecker closed 1 year ago
aha!
GSL_CBLAS_LIB=-L/usr/local/opt/openblas/lib/ -lopenblas
if i remove this environment setting, i can successfully dune build gsl
. however, i would like to continue using openblas.
next, in order to still use openblas, i tried to brew reinstall openblas
. this did not help.
next, i tried brew unlink openblas && brew link openblas
. this gave a potentially troublesome warning:
Unlinking /usr/local/Cellar/openblas/0.3.21... 0 symlinks removed.
Warning: Refusing to link macOS provided/shadowed software: openblas
For compilers to find openblas you may need to set:
export LDFLAGS="-L/usr/local/opt/openblas/lib"
export CPPFLAGS="-I/usr/local/opt/openblas/include"
For pkg-config to find openblas you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
i next tried setting all of these env vars. however, this did not produce a working build.
what can i do to make linking with openblas work again?
i now tried reinstalling openblas from source with
brew reinstall -s openblas
. this showed a message containing CC=gcc-12 FC=gfortran
suggesting that the homebrew installed compilers were used. still, no luck with dune build gsl
afterwards
it seems this is really a problem of properly installing openblas on my system -- still i would be grateful for advice. it used to work on this system before, but now i'm kind of lost
I got a bit further. Openblas is trying to link libquadmath.0.dylib
but that fails, although that shared library is installed in /usr/local/gfortran/lib
. I tried manually creating a link to that library in /usr/local/lib
. This indeed caused the library to be found by the linker; however now another library is reported as missing: libgcc_s.1.1.dylib
. That libary is here:
/usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgcc_s.1.1.dylib
/usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgcc_s.1.1.dylib
It appears the homebrew installation of gcc puts libraries in places where they aren't found by the clang toolchain used to build gsl-ocaml. Is this a bug in the homebrew package for gcc?
I was able to work around the issue, as follows:
export GSL_CBLAS_LIB=-L/usr/local/opt/openblas/lib/ -lopenblas -L/usr/local/gfortran/lib
opam install gsl
By specifying the gfortran library directory explicitly, the required shared libraries are then found and i can successfully install gsl-ocaml.
The last -L
include directive was not necessary when I installed gsl-ocaml previously on this machine, so I think this may still be a bug. Leaving it open for now.
After some update cycles of xcode etc, i tried reinstalling gsl-ocaml but it doesn't anymore.
I ended up getting the source with
opam source
and runningdune build
in the source directory. This gives the following error:I then tried to look for this shared library. I found some copies installed by homebrew:
The latter are part of homebrew-installed gcc. however, the system compiler is clang, and that is used during the installation process as far as i can tell.
gcc
is in fact clang as usual on macos.finds nothing (I don't know if that's the right place to look).
I also tried
brew reinstall gsl
and unlink followed by relink, without success.What could be the problem?
macos 12.6, current Xcode.