尝试使用 hmatrix 构建时,堆栈找不到 libgfortran-3.dll

Stack can't find libgfortran-3.dll when trying to build with hmatrix

我正在尝试在我的 Windows 10 机器上使用 GHC 8.0.2 设置 hmatrix。 我一直在关注 here 的答案,但是当我尝试构建它时它说找不到 libgfortran-3.dll 尽管我确定我已将它添加到 BLAS 目录中的 bin 文件夹中。 我的代码在 here 我 运行 stack build 这就是我得到的:

hmatrix-0.18.0.0: configure
Progress: 1/2
--  While building package hmatrix-0.18.0.0 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe --builddir=.stack-work\dist\ca59d0ab configure "--with-ghc=C:\Program Files\Haskell Platform\8.0.2\bin\ghc.EXE" "--with-ghc-pkg=C:\Program Files\Haskell Platform\8.0.2\bin\ghc-pkg.EXE" --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b201cfe6\pkgdb --package-db=D:\Haskell\networks\.stack-work\install995373\pkgdb --libdir=D:\Haskell\networks\.stack-work\install995373\lib --bindir=D:\Haskell\networks\.stack-work\install995373\bin --datadir=D:\Haskell\networks\.stack-work\install995373\share --libexecdir=D:\Haskell\networks\.stack-work\install995373\libexec --sysconfdir=D:\Haskell\networks\.stack-work\install995373\etc --docdir=D:\Haskell\networks\.stack-work\install995373\doc\hmatrix-0.18.0.0 --htmldir=D:\Haskell\networks\.stack-work\install995373\doc\hmatrix-0.18.0.0 --haddockdir=D:\Haskell\networks\.stack-work\install995373\doc\hmatrix-0.18.0.0 --dependency=array=array-0.5.1.1 --dependency=base=base-4.9.1.0 --dependency=binary=binary-0.8.3.0 --dependency=bytestring=bytestring-0.10.8.1 --dependency=deepseq=deepseq-1.4.2.0 --dependency=random=random-1.1-9tceXaeYIMZ4JrKq20Egog --dependency=split=split-0.2.3.1-FWyXC6nhV0H3AfM8IzrEFk --dependency=storable-complex=storable-complex-0.2.2-G9QzpmZTKvgKKVagrcRWdL --dependency=vector=vector-0.11.0.0-HhutbadagxHIONIkSRJEug -fopenblas --extra-include-dirs=C:\OpenBLAS-v0.2.19-Win64-int32\include --extra-include-dirs=C:\Users\Yotam\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\OpenBLAS-v0.2.19-Win64-int32\bin --extra-lib-dirs=C:\Users\Yotam\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
    Process exited with code: ExitFailure 1
    Logs have been written to: D:\Haskell\networks\.stack-work\logs\hmatrix-0.18.0.0.log

    Configuring hmatrix-0.18.0.0...
    Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe: Missing dependency on a foreign
    library:
    * Missing C library: libgfortran-3
    This problem can usually be solved by installing the system package that
    provides this library (you may need the "-dev" version). If the library is
    already installed but in a non-standard location then you can use the flags
    --extra-include-dirs= and --extra-lib-dirs= to specify where it is.

D:\OpenBLAS-v0.2.19-Win64-int32\bin 包括 libopenblas.dlllibgfortran-3.dll 并且 blas 目录取自 url

感谢您的帮助

我已经成功安装如下。

yourpath\to\stack\x86_64-windows\msys2-20150512 中,双击 msys2_shell.bat 打开 msys2 shell。

在 shell 中输入:

pacman -S mingw-w64-x86_64-toolchain

然后在stack.yaml中添加这些"extra":

extra-include-dirs:
- yourpath\to\OpenBLAS\include
extra-lib-dirs:
- yourpath\to\OpenBLAS\lib
- yourpath\to\stack\x86_64-windows\msys2-20150512\usr\lib\gcc\x86_64-pc-msys.3.0
- yourpath\to\stack\x86_64-windows\msys2-20150512\mingw64\bin