在Win7上安装Torch7; cmake和PATH问题

时间:2015-07-15 01:17:26

标签: windows lua torch luarocks

我正在尝试在我的Win7系统上安装Torch 7来运行RNN,这太疯狂了。我在Ubuntu VM上轻松安装了它,但是无法访问我的GPU进行CUDA加速,因此我尝试使用实验性的PCI passthrough软件,或者尝试在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,请告诉我(或者说,甚至是在虚拟机中启用GPU加速的方法。还有什么可以摆脱这种困境)。

1 个答案:

答案 0 :(得分: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中的讨论,了解您可能需要应用的一项更改。
  5. 该故障单还提供了可以从命令行运行以编译的特定命令。