1

I'm trying to install Torch 7 on my Win7 system to run an RNN, and it's insane. I installed it easily on my Ubuntu VM, but that can't access my GPU for CUDA acceleration, so either I try experimental PCI passthrough software, or I try to get Torch on Windows. I've managed to install Lua and LuaRocks so far (but I can't run it from anywhere but the C:\Program Files (x86)\LuaRocks\2.2 path). I've installed mingw and cmake. I tried installing Torch using the following command:

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

(source: Installing Torch7 with Luarocks on Windows with mingw build error)

but I get:

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.

I don't know where the cl compiler is, or even if I have it on my system. Regarding my PATH variable, it's apparently a user variable, not a system one (I don't have a system PATH variable). I don't know if that's a problem. It currently looks like this:

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

I have no clue if that's correct, but if it's meant to let me run lua or luarocks from outside their respective bin directories, it fails at that. If anyone has an easier way of installing Torch on Windows, please let me know (or heck, even a way of enabling GPU acceleration in a VM. Anything to get out of this stuck situation).

Community
  • 1
  • 1
IronWaffleMan
  • 2,513
  • 5
  • 30
  • 59

1 Answers1

1

cl is command line compiler from Visual Studio. CMake is looking for it as its default settings use it. To use mingw that you have, you need to provide an additional option (as I described here), but I'm not sure how to pass it to luarocks as I usually do it from the command line directly.

You may try to follow the steps in the answer I linked; there are details in the torch7 ticket referenced. In short, the steps will involve:

  1. Clone, compile and install torch/paths;
  2. Clone, compile and install torch/cwrap;
  3. Clone, compile and install torch/torch; make sure you grab the latest code as it includes the changes I submitted for mingw compilation.
  4. Clone, compile and install torch/nn. See the discussion in this ticket for one change you may need to apply.

The ticket also provides specific commands you can run to compile from the command line.

Community
  • 1
  • 1
Paul Kulchenko
  • 25,884
  • 3
  • 38
  • 56
  • If you mean follow the instructions here: https://github.com/torch/DEPRECEATED-torch7-distro, I tried that and got stuck with cmake 'not recognised as an internal or external command' after I'd cd'ed into the torch build folder. I tried fixing the paths to make it work but couldn't manage. – IronWaffleMan Jul 15 '15 at 05:07
  • No, I mean the update to the answer to use the current torch repository. – Paul Kulchenko Jul 15 '15 at 05:52
  • Ah, I think you mean https://github.com/torch/torch7/pull/287. I'm really not sure how to go about starting to install those specific packages... if I start over, from scratch, is there a specific order I should be doing things in? – IronWaffleMan Jul 15 '15 at 06:15