【发布时间】:2018-01-30 06:53:14
【问题描述】:
我一直在尝试在我的 Windows 机器上安装 tensorflow/haskell 包。
但是,在使用 stack 和 cabal 安装时,我一直遇到这个错误:
Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe: Missing dependency on a foreign
library:
* Missing C library: tensorflow
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.
根据 Tensorflow 网站:https://www.tensorflow.org/install/install_c ,Tensorflow 的 C 包只能在 Unix 机器上运行。我不确定这是死胡同还是有一些解决方法。
我在链接库或 cabal 方面没有经验,希望能得到一些帮助。
使用 Cabal,我在我的目录中包含了以下 .cabal 文件:
cabal-version: >= 1.2
Executable hax
Includes: c_api.h
Extra-libraries: tensorflow
但我仍然收到错误:cabal.exe: Missing dependency on a foreign library: * Missing C library: tensorflow The exception was: user error (Using 'build-type: Custom' but there is no Setup.hs or Setup.lhs script.)
【问题讨论】:
-
我在这里找到了应该是 C 库的东西:stackoverflow.com/questions/44682845/…,但我不知道该告诉 cabal 如何处理它
-
您可以将标志
--extra-lib-dirs=<..>传递给cabal(堆栈有一个相应的字段可以放在配置文件中)。我不知道这是否足够;您可能需要.lib文件和.dll文件(我不太了解 GHC 如何链接事物以了解它是否真的如此)。 -
随时尝试编辑您的问题 - 没有任何人可以单独处理单行错误消息。
-
使用 Cabal,我在我的目录中包含了以下 .cabal 文件:
cabal-version: >= 1.2 Executable hax Includes: c_api.h Extra-libraries: tensorflow但我仍然收到错误:cabal.exe:缺少对外部库的依赖:* 缺少 C 库: tensorflow异常是:用户错误(使用'build-type:Custom'但没有Setup.hs或Setup.lhs脚本。)