4

Windows 10 x64 Cabal 1.22

I'm following steps in Windows section https://github.com/AlbertoRuiz/hmatrix/blob/master/INSTALL.md

I downloaded hmatrix sources and gsl-lapack-windows.zip. When I try to install hmatrix with:

D:\Projects\workspace\hmatrix-0.16.1.5>cabal install --extra-include-dirs=D:\Projects\workspace\gsl-lapack-windows\ --extra-lib-dirs=d:\Projects\workspace\gsl-lapack-windows\

I got this message that I'm still cannot solve:

Configuring hmatrix-0.16.1.5... Failed to install hmatrix-0.16.1.5 Build log ( D:\Projects\workspace\hmatrix-0.16.1.5.cabal-sandbox\logs\hmatrix-0.16.1.5.log ): Configuring hmatrix-0.16.1.5... setup-Simple-Cabal-1.22.4.0-x86_64-windows-ghc-7.10.2.exe: Missing dependencies on foreign libraries: * Missing C libraries: blas, lapack, blas, lapack This problem can usually be solved by installing the system packages that provide these libraries (you may need the "-dev" versions). If the libraries are already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are. cabal: Error: some packages failed to install: hmatrix-0.16.1.5 failed during the configure step. The exception was: ExitFailure 1

"-dev versions" I think is only for *nix based OSes. In folders I give to cabal there are blas.dll and lapack.dll.

What could be the problem?

TheCriticalImperitive
  • 1,457
  • 1
  • 10
  • 23
The_Ghost
  • 2,070
  • 15
  • 26
  • I just ran into this problem as well. It seems we aren't the only ones. Did you have any luck fixing it? Also see: https://github.com/albertoruiz/hmatrix/issues/125 – TheCriticalImperitive Sep 09 '15 at 00:07
  • I have fixed a bit OpenBLAS cabal support. But there are still a compilation issues: https://github.com/albertoruiz/hmatrix/pull/147 – The_Ghost Sep 10 '15 at 19:40

1 Answers1

1

Try this:

  1. Install mingw from https://sourceforge.net/projects/mingw-w64/files/, in my case x86_64-posix-seh). We need just libgfortran-3.dll, which is not present in ghc's mingw. Or you can get it from here: http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.6.0/Dynamic-MINGW/Win64/libgfortran-3.dll (Replace Win64 with Win32 in url if necessary)
  2. Get OpenBLAS binaries from https://sourceforge.net/projects/openblas/files/ (in my case Win64-int32).
  3. Place libopenblas.dll and libgfortran-3.dll in some folder, in my case C:\Programs\lib
  4. cabal install hmatrix --flags=openblas --extra-lib-dirs=C:\Programs\lib

That's all. You also have to pass libs to ghci (all libs must be in PATH, so in my case ghc's mingw\bin and C:\Programs\lib are in PATH):

ghci -llibopenblas -llibgfortran-3 -llibgcc_s_seh-1

where libgcc_s_seh-1.dll is in ghc's mingw (in my case: C:\Programs\ghc\ghc-8.0.1\mingw\bin)

NOTE: tested with ghc-8.0.1
UPDATE: i've found that now it can be done in less steps

  • I'm getting `Missing C library: libopenblas` when running 6. – holdenlee May 20 '16 at 03:12
  • Ensure you have blas headers in your extra-include-dirs In my case: 'd:\Programs\openblas\include' there's `cblas.h`, `f77blas.h` etc. – Alexander VoidEx Ruchkin May 28 '16 at 22:42
  • I do have the blas headers in the directory (for me, `C:/PF/openblas/include`, so I do `cabal install --flags=openblas --extra-lib-dirs=C:/PF/openblas/lib --extra-include-dirs=C:/PF/openblas/include`). I cloned OpenBLAS as in step 2 which has the blas headers in the include directory. – holdenlee May 30 '16 at 02:07
  • I've found some time to retry. Seems, that now it can be done in less steps with no need to build OpenBLAS and install hmatrix from sources. Hope this helps. – Alexander VoidEx Ruchkin Dec 01 '16 at 18:36