简体   繁体   English

如何在Windows下使用BLAS和LAPACK构建hmatrix?

[英]How to build hmatrix with BLAS and LAPACK under Windows?

Windows 10 x64 Cabal 1.22 Windows 10 x64 Cabal 1.22

I'm following steps in Windows section https://github.com/AlbertoRuiz/hmatrix/blob/master/INSTALL.md 我正在按照Windows部分https://github.com/AlbertoRuiz/hmatrix/blob/master/INSTALL.md中的步骤进行操作

I downloaded hmatrix sources and gsl-lapack-windows.zip. 我下载了hmatrix源代码和gsl-lapack-windows.zip。 When I try to install hmatrix with: 当我尝试安装hmatrix时:

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\\ 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). 配置hmatrix-0.16.1.5 ...无法安装hmatrix-0.16.1.5构建日志(D:\\ Projects \\ workspace \\ hmatrix-0.16.1.5.cabal-sandbox \\ logs \\ hmatrix-0.16.1.5.log):配置hmatrix -0.16.1.5 ... setup-Simple-Cabal-1.22.4.0-x86_64-windows-ghc-7.10.2.exe:缺少对外部库的依赖:*缺少C库:blas,lapack,blas,lapack这个问题可以通常可以通过安装提供这些库的系统包来解决(您可能需要“-dev”版本)。 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. 如果库已经安装但是在非标准位置,那么您可以使用标志--extra-include-dirs =和--extra-lib-dirs =来指定它们的位置。 cabal: Error: some packages failed to install: hmatrix-0.16.1.5 failed during the configure step. cabal:错误:某些软件包无法安装:hmatrix-0.16.1.5在配置步骤中失败。 The exception was: ExitFailure 1 例外是:ExitFailure 1

"-dev versions" I think is only for *nix based OSes. “-dev版本”我认为仅适用于基于* nix的操作系统。 In folders I give to cabal there are blas.dll and lapack.dll. 在我给cabal的文件夹中有blas.dll和lapack.dll。

What could be the problem? 可能是什么问题呢?

Try this: 尝试这个:

  1. Install mingw from https://sourceforge.net/projects/mingw-w64/files/ , in my case x86_64-posix-seh ). https://sourceforge.net/projects/mingw-w64/files/安装mingw,在我的情况下是x86_64-posix-seh )。 We need just libgfortran-3.dll , which is not present in ghc's mingw. 我们只需要libgfortran-3.dll ,这在ghc的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) 或者你可以从这里得到它: http//icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.6.0/Dynamic-MINGW/Win64/libgfortran-3.dll (用Win32替换Win64)在必要时在网址中)
  2. Get OpenBLAS binaries from https://sourceforge.net/projects/openblas/files/ (in my case Win64-int32 ). https://sourceforge.net/projects/openblas/files/获取OpenBLAS二进制文件(在我的案例中为Win64-int32 )。
  3. Place libopenblas.dll and libgfortran-3.dll in some folder, in my case C:\\Programs\\lib libopenblas.dlllibgfortran-3.dll放在某个文件夹中,在我的例子中是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): 你还必须将libs传递给ghci (所有的libs必须在PATH中,所以在我的情况下ghc的mingw\\binC:\\Programs\\lib在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 ) 其中libgcc_s_seh-1.dll在ghc的mingw中(在我的例子中: C:\\Programs\\ghc\\ghc-8.0.1\\mingw\\bin

NOTE: tested with ghc-8.0.1 注意:使用ghc-8.0.1进行测试
UPDATE: i've found that now it can be done in less steps 更新:我发现现在可以用更少的步骤完成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM