【问题标题】:Installing Torch7 on Win7; cmake and PATH problems在 Win7 上安装 Torch7; cmake 和 PATH 问题
【发布时间】:2015-10-03 21:00:05
【问题描述】:

我试图在我的 Win7 系统上安装 Torch 7 来运行 RNN,这太疯狂了。我在我的 Ubuntu VM 上轻松安装了它,但它无法访问我的 GPU 以进行 CUDA 加速,所以我要么尝试实验性 PCI 直通软件,要么尝试在 Windows 上安装 Torch。到目前为止,我已经成功安装了 Lua 和 LuaRocks(但除了 C:\Program Files (x86)\LuaRocks\2.2 路径之外,我无法从任何地方运行它)。我已经安装了mingw和cmake。我尝试使用以下命令安装 Torch:

luarocks --server=https://raw.githubusercontent.com/torch/rocks/master install torch

(来源:Installing Torch7 with Luarocks on Windows with mingw build error

但我明白了:

Missing dependencies for torch:
paths >= 1.0

Using https://raw.githubusercontent.com/torch/rocks/master/paths-scm-1.rocksp
Cloning into 'paths'...
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 0), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (10/10), 12.81 KiB | 0 bytes/s, done.
Checking connectivity... done.
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Rele
gram Files (x86)/lua/5.3/include/" -DLUA_LIBDIR="C:/Program Files (x86)/lua/5
uaRocks\systree/lib/luarocks/rocks/paths/scm-1/lua" -DLIBDIR="C:\Program File
/paths/scm-1/lib" -DCMAKE_INSTALL_PREFIX="C:\Program Files (x86)\LuaRocks\sys
gw32-make

-- Building for: NMake Makefiles
CMake Warning in :
  To use the NMake generator, cmake must be run from a shell that can use the
  compiler cl from the command line.  This environment does not contain
  INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
  work.


-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in :
  The CMAKE_C_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error in :
  The CMAKE_CXX_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

我不知道 cl 编译器在哪里,或者即使我的系统上有它。关于我的 PATH 变量,它显然是一个用户变量,而不是系统变量(我没有系统 PATH 变量)。我不知道这是否有问题。目前看起来是这样的:

C:\Users\USERNAME\AppData\Roaming\npm;C:\MinGW\bin;C:\Program Files (x86)\lua\5.3\bin;C\Program Files (x86)\LuaRocks\2.2;C:\Users\USERNAME\AppData\Roaming\LuaRocks\bin;C:\Program Files (x86)\LuaRocks\systree\bin

我不知道这是否正确,但如果它是为了让我从它们各自的 bin 目录之外运行 lua 或 luarocks,它就会失败。 如果有人有在 Windows 上安装 Torch 的更简单方法,请告诉我(或者,甚至是在 VM 中启用 GPU 加速的方法。任何可以摆脱这种卡住情况的方法)。

【问题讨论】:

  • 您的输出似乎缺少部分命令:-DCMAKE_BUILD_TYPE=Rele...gram Files (x86)/lua/5.3/include/"
  • 糟糕,是的,那是由于我在 cmd 中所做的“标记”,它只捕获了一个足够宽的矩形区域来容纳后面的文本。

标签: windows lua torch luarocks


【解决方案1】:

cl 是 Visual Studio 的命令行编译器。 CMake 正在寻找它,因为它的默认设置使用它。要使用您拥有的 mingw,您需要提供一个附加选项 (as I described here),但我不确定如何将它传递给 luarocks,因为我通常直接从命令行执行。

您可以尝试按照我链接的答案中的步骤进行操作;参考的torch7票中有详细信息。简而言之,这些步骤将涉及:

  1. 克隆、编译并安装torch/paths
  2. 克隆、编译并安装torch/cwrap
  3. 克隆、编译并安装torch/torch;确保获取最新的代码,因为它包含我为 mingw 编译提交的更改。
  4. 克隆、编译并安装torch/nn。请参阅this ticket 中的讨论,了解您可能需要应用的一项更改。

票证还提供了您可以运行以从命令行编译的特定命令。

【讨论】:

  • 如果您的意思是按照此处的说明进行操作:github.com/torch/DEPRECEATED-torch7-distro,我试过了,但在我 cd 到 torch 构建文件夹后,我遇到了 cmake '不被识别为内部或外部命令' .我尝试修复路径以使其正常工作,但无法管理。
  • 不,我的意思是更新使用当前火炬存储库的答案。
  • 啊,我想你的意思是github.com/torch/torch7/pull/287。我真的不知道如何开始安装这些特定的软件包......如果我从头开始,我应该按照特定的顺序做事吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-15
  • 1970-01-01
  • 2018-10-30
  • 1970-01-01
  • 2011-06-22
相关资源
最近更新 更多