【问题标题】:How to build hmatrix with BLAS and LAPACK under Windows?如何在 Windows 下使用 BLAS 和 LAPACK 构建 hmatrix?
【发布时间】:2015-09-06 11:49:46
【问题描述】:

Windows 10 x64 阴谋集团 1.22

我正在遵循 Windows 部分中的步骤https://github.com/AlbertoRuiz/hmatrix/blob/master/INSTALL.md

我下载了 hmatrix 源代码和 gsl-lapack-windows.zip。 当我尝试安装 hmatrix 时:

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

我收到了一条我仍然无法解决的消息:

正在配置 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”版本)。如果图书馆是 已经安装但在非标准位置,那么您可以使用 标志 --extra-include-dirs= 和 --extra-lib-dirs= 指定在哪里 他们是。 cabal:错误:某些软件包无法安装: hmatrix-0.16.1.5 在配置步骤中失败。例外是: 退出失败 1

“-dev 版本”我认为仅适用于基于 *nix 的操作系统。在我给 cabal 的文件夹中有 blas.dll 和 lapack.dll。

可能是什么问题?

【问题讨论】:

标签: windows haskell lapack blas hmatrix


【解决方案1】:

试试这个:

  1. https://sourceforge.net/projects/mingw-w64/files/ 安装mingw,在我的情况下是x86_64-posix-seh)。我们只需要libgfortran-3.dll,它不存在于ghc 的mingw 中。或者你可以从这里获取它:http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.6.0/Dynamic-MINGW/Win64/libgfortran-3.dll(如果需要,将 url 中的 Win64 替换为 Win32)
  2. https://sourceforge.net/projects/openblas/files/(在我的情况下为Win64-int32)获取OpenBLAS 二进制文件。
  3. libopenblas.dlllibgfortran-3.dll 放在某个文件夹中,在我的情况下为C:\Programs\lib
  4. cabal install hmatrix --flags=openblas --extra-lib-dirs=C:\Programs\lib

就是这样。您还必须将库传递给 ghci(所有库都必须在 PATH 中,所以在我的情况下,ghc 的 mingw\binC:\Programs\lib 在 PATH 中):

ghci -llibopenblas -llibgfortran-3 -llibgcc_s_seh-1

libgcc_s_seh-1.dll 在 ghc 的 mingw 中(在我的例子中:C:\Programs\ghc\ghc-8.0.1\mingw\bin

注意:使用 ghc-8.0.1 测试
更新:我发现现在可以用更少的步骤完成

【讨论】:

  • 我在运行 6 时收到 Missing C library: libopenblas
  • 确保你的额外包含目录中有 blas 标头在我的情况下:'d:\Programs\openblas\include' 有 cblas.hf77blas.h 等。
  • 我确实在目录中有 blas 标头(对我来说,C:/PF/openblas/include,所以我做cabal install --flags=openblas --extra-lib-dirs=C:/PF/openblas/lib --extra-include-dirs=C:/PF/openblas/include)。我在第 2 步中克隆了 OpenBLAS,其中包含目录中的 blas 标头。
  • 我找到了一些时间重试。似乎,现在它可以用更少的步骤完成,而无需构建 OpenBLAS 并从源代码安装 hmatrix。希望这会有所帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-03
  • 1970-01-01
相关资源
最近更新 更多