From dominic at steinitz.org Wed Aug 28 12:42:53 2019 From: dominic at steinitz.org (dominic at steinitz.org) Date: Wed, 28 Aug 2019 13:42:53 +0100 Subject: [Numeric] Getting blas-ffi to build under nix References: <1BF2F1F8-45D2-443C-98F3-294EA745263D@steinitz.org> Message-ID: I thought I would broaden out the discussion Henning and I have been having. I have managed to get http://hackage.haskell.org/package/blas-ffi to build under nix. Ideally we would like cabal2nix to do this automatically for us. We can do this if We use openblas rather than blas. Replace `PkgConfig-Depends: blas` with `PkgConfig-Depends: lapack (as the lapack derivation in nix generates a blas.pc) in the cabal file. Fix nix to generate .pc files for blas - I don’t know the consequences of doing this but I can’t see any downside. Does anyone have any views on what might be the best approach? Dominic Steinitz dominic at steinitz.org http://idontgetoutmuch.org Twitter: @idontgetoutmuch > Begin forwarded message: > > From: dominic at steinitz.org > Subject: Getting blas-ffi to build under nix > Date: 28 August 2019 at 13:31:45 BST > To: Henning Thielemann > > Hi Henning, > > I think there are 3 options (in nix - they may not work elsewhere) > > Use openblas rather than blas > Replace `PkgConfig-Depends: blas` with `PkgConfig-Depends: lapack` > Fix nix to generate .pc files for blas (it does this for openblas and lapack, the latter also generates a blas.pc file > > I don’t have a strong preference but I think I’d go for using openblas. I can send a patch but of course it’s a 1 line change so maybe you could just do it yourself and release a new version to hackage? > > Dominic Steinitz > dominic at steinitz.org > http://idontgetoutmuch.org > Twitter: @idontgetoutmuch > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Wed Aug 28 14:17:03 2019 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Wed, 28 Aug 2019 16:17:03 +0200 (CEST) Subject: [Numeric] Getting blas-ffi to build under nix In-Reply-To: References: <1BF2F1F8-45D2-443C-98F3-294EA745263D@steinitz.org> Message-ID: On Wed, 28 Aug 2019, dominic at steinitz.org wrote: > I thought I would broaden out the discussion Henning and I have been having. > I have managed to get http://hackage.haskell.org/package/blas-ffi to build under nix. Ideally we would like > cabal2nix to do this automatically for us. We can do this if > > 1. We use openblas rather than blas. I suggest this anyway. > 2. Replace `PkgConfig-Depends: blas` with `PkgConfig-Depends: lapack (as the lapack derivation in nix generates > a blas.pc) in the cabal file. This sounds like a hack. blas-ffi depends only on the BLAS library and thus should need blas.pc only. OpenBLAS has its own blas.pc and otherwise plain BLAS library should provide blas.pc. In Debian you can even install both of them and select between them using Debian's alternatives system. > 3. Fix nix to generate .pc files for blas - I don’t know the consequences of doing this but I can’t see any > downside. This should be the right way. From dominic at steinitz.org Wed Aug 28 14:37:34 2019 From: dominic at steinitz.org (dominic at steinitz.org) Date: Wed, 28 Aug 2019 15:37:34 +0100 Subject: [Numeric] Getting blas-ffi to build under nix In-Reply-To: References: <1BF2F1F8-45D2-443C-98F3-294EA745263D@steinitz.org> Message-ID: <32CFC9AE-68CB-418C-9633-DAEF26739B4B@steinitz.org> https://github.com/NixOS/nixpkgs/pull/67629 Dominic Steinitz dominic at steinitz.org http://idontgetoutmuch.org Twitter: @idontgetoutmuch > On 28 Aug 2019, at 15:17, Henning Thielemann wrote: > > > On Wed, 28 Aug 2019, dominic at steinitz.org wrote: > >> I thought I would broaden out the discussion Henning and I have been having. >> I have managed to get http://hackage.haskell.org/package/blas-ffi to build under nix. Ideally we would like >> cabal2nix to do this automatically for us. We can do this if >> >> 1. We use openblas rather than blas. > > I suggest this anyway. > >> 2. Replace `PkgConfig-Depends: blas` with `PkgConfig-Depends: lapack (as the lapack derivation in nix generates >> a blas.pc) in the cabal file. > > This sounds like a hack. blas-ffi depends only on the BLAS library and thus should need blas.pc only. OpenBLAS has its own blas.pc and otherwise plain BLAS library should provide blas.pc. In Debian you can even install both of them and select between them using Debian's alternatives system. > >> 3. Fix nix to generate .pc files for blas - I don’t know the consequences of doing this but I can’t see any >> downside. > > This should be the right way. -------------- next part -------------- An HTML attachment was scrubbed... URL: