From fc8bf571052ad6b987ac10582da63fd03c8df85a Mon Sep 17 00:00:00 2001 From: Vassil Keremidchiev Date: Sun, 6 Sep 2015 15:59:10 +0300 Subject: Windows build with OpenBLAS Currently OpenBLAS building on Windows is not working. 1. Under Windows actual name of the library is libopenblas.dll and not openblas.dll 2. There were duplication of external dependencies: blas and lapack. Because extra-libraries was declared twice - for openstack condition and for OS condition. 3. I'm not sure how OpenBLAS is built on other OSes, so someone have to check this change on other OSes. --- packages/base/hmatrix.cabal | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/base/hmatrix.cabal b/packages/base/hmatrix.cabal index 31bea3e..3a11135 100644 --- a/packages/base/hmatrix.cabal +++ b/packages/base/hmatrix.cabal @@ -96,13 +96,13 @@ library cpp-options: -DBINARY - if flag(openblas) - extra-lib-dirs: /usr/lib/openblas/lib - extra-libraries: openblas - else - extra-libraries: blas lapack - if os(OSX) + if flag(openblas) + extra-lib-dirs: /opt/local/lib/openblas/lib + extra-libraries: openblas + else + extra-libraries: blas lapack + extra-lib-dirs: /opt/local/lib/ include-dirs: /opt/local/include/ extra-lib-dirs: /usr/local/lib/ @@ -112,14 +112,29 @@ library frameworks: Accelerate if os(freebsd) + if flag(openblas) + extra-lib-dirs: /usr/local/lib/openblas/lib + extra-libraries: openblas + else + extra-libraries: blas lapack + extra-lib-dirs: /usr/local/lib include-dirs: /usr/local/include - extra-libraries: blas lapack gfortran + extra-libraries: gfortran if os(windows) - extra-libraries: blas lapack + if flag(openblas) + extra-libraries: libopenblas + else + extra-libraries: blas lapack if os(linux) + if flag(openblas) + extra-lib-dirs: /usr/lib/openblas/lib + extra-libraries: openblas + else + extra-libraries: blas lapack + if arch(x86_64) cc-options: -fPIC -- cgit v1.2.3 From 653357942c9eb6878929c6b05fa0e49086938f64 Mon Sep 17 00:00:00 2001 From: Vassil Keremidchiev Date: Sun, 6 Sep 2015 16:13:26 +0300 Subject: Added alternative Windows installation instruction --- INSTALL.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 157036e..94964d2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -55,6 +55,11 @@ using this method. [winpack]: https://github.com/downloads/AlbertoRuiz/hmatrix/gsl-lapack-windows.zip +### Alternative Windows build +1) > cabal update +2) Download and unzip somewhere OpenBLAS http://www.openblas.net/ +3) > cabal install --flags=openblas --extra-lib-dirs=C:\...\OpenBLAS\lib --extra-include-dir=C:\...\OpenBLAS\include + ## Tests ############################################### After installation we can verify that the library works as expected: -- cgit v1.2.3