haskell-numerics / hmatrix

Linear algebra and numerical computation
381 stars 104 forks source link

cabal file is not right #246

Closed idontgetoutmuch closed 6 years ago

idontgetoutmuch commented 6 years ago

I think there are two issues:

  1. The paths for osx are hard-coded. I do not have e.g. /opt/local/lib/openblas/lib; I don't even have /opt. I am on OSX.

  2. If I use openblas via nix, it looks like it is taking one of the branches where "if flag(openblas)" is expect but the openblas flag isn't set and I get

Setup: hmatrix.cabal:120: 'then' branch of 'if' is empty
idontgetoutmuch commented 6 years ago

I don't know how to fix this yet. I am not authorised to assign tickets but @albertoruiz you can assign this to me.

peti commented 6 years ago

This issue would be solved, basically, if we could get a Hackage release of the current state from git: https://github.com/albertoruiz/hmatrix/issues/243.

idontgetoutmuch commented 6 years ago

I think this is now solved. I still think the cabal file is not quite right but the consequences are benign. I may create a ticket in the future if I can think of a better cabal.

alexanderkjeldaas commented 5 years ago

Is this solved? Seems like hmatrix still has the wrong hard-coded path. Or maybe it works out-of-the-box.

openblas is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS and LAPACK in the Accelerate framework.

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"

https://github.com/haskell-numerics/hmatrix/blob/master/packages/base/hmatrix.cabal#L105