Cabal:缺少对外国C库的依赖 [英] Cabal: missing dependency on foreign C library

查看:62
本文介绍了Cabal:缺少对外国C库的依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在Windows机器上安装tensorflow/haskell软件包.

但是,在同时使用stack和cabal进行安装时,我始终遇到此错误:

  Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe:缺少对外部文件的依赖图书馆:*缺少的C库:张量流通常可以通过安装以下系统软件包来解决此问题:提供此库(您可能需要"-dev"版本).如果图书馆是已经安装但在非标准位置,则可以使用标志--extra-include-dirs =和--extra-lib-dirs =指定其位置. 

根据Tensorflow网站: https://www.tensorflow.org/install/install_c,用于Tensorflow的C软件包仅在Unix计算机上运行.我不确定这是死路一条,还是有一些解决方法.

我没有链接库或cabal的经验,希望能获得一些帮助.

使用Cabal,我在目录中包含以下.cabal文件:

  cabal-version:> = 1.2可执行的hax包括:c_api.h额外的图书馆:张量流 

但是我仍然收到错误: cabal.exe:缺少对外部库的依赖:*缺少C库:tensorflow异常是:用户错误(使用"build-type:Custom",但没有安装程序).hs或Setup.lhs脚本.)

您编写根据Tensorflow网站:

的确,如果您的计算机上没有安装 tensorflow C程序包-因为它不会在其上运行,那么您将找不到它绑定到它.

没有解决办法.

I have been trying to install the tensorflow/haskell package on my Windows machine.

However, both while installing with stack and cabal, I keep running into this error:

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.

According to the Tensorflow website: https://www.tensorflow.org/install/install_c , the C package for Tensorflow only runs on Unix machines. I am not sure if this is a dead end or if there is some workaround.

I am not experienced with linking libraries or with cabal, and would appreciate some assistance.

Using Cabal, I've included the following .cabal file in my directory:

cabal-version: >= 1.2 
Executable hax 
Includes: c_api.h 
Extra-libraries: tensorflow 

but I still receive the errors: 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.)

解决方案

You write "According to the Tensorflow website: https://www.tensorflow.org/install/install_c , the C package for Tensorflow only runs on Unix machines. I am not sure if this is a dead end or if there is some workaround."

Indeed, if you don't have the tensorflow C package installed on your machine -- because it won't run on it, then you can't find it to bind to it.

There is no work around for that.

这篇关于Cabal:缺少对外国C库的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆