Torch compilation requires a number of standard packages described below:
Concerning the compiler, if you do not have already Visual Studio, then install the freely available Microsoft Visual Studio 2008 (Express Edition). You need the C++ compiler.
Download the CMake Win32 installer and install CMake.
Install Tortoise SVN.
If you want graphics, you should install QT 4.4. Torch will compile if you do not, but you will not be able to produce plots or handle widgets. Trolltech produces QT binaries for Windows, but unfortunately they are not compiled with the Microsoft Visual Studio compiler. You will have to follow simple instructions to compile and install it.
B. Getting Torch sources
However, we recommend to use the subversion repository to keep bleeding edge sources. Start
for that purpose: right-click in the explorer at the place you want to checkout Torch repository. Choose
TortoiseSVN -> Export .... Then enter as URL
https://torch5.svn.sourceforge.net/svnroot/torch5/trunkChoose the directory you want for Torch sources, and click
C. Configuring Torch
CMake for configuring
Torch. Start CMake application. Set the
source path to the directory where you downloaded Torch. Set as a build
path another directory you like. This eases cleaning up built objects,
but also allow you to build Torch with various configurations
(e.g. Release and Debug in two different build directories).
Visual Studio 9 2008 if you downloaded the last
version of Visual Studio (if not, select the compiler version you have).
Make sure you chose the
Release and not
Debug version (well, except if
you want the Debug version!) to compile (Variable
Also, if you do not have the administrator rights, you might not be able to
install Torch in the directory set in variable
is by default
C:/Program Files/Torch. Change the variable to the install
path you would like.
Generate is clickable. Click
D. Compiling and installing
If CMake configuration went fine, a Visual Studio project should have been generated in your
build directory. Double-click the project. Build the solution. If everything went fine, you
can then install it by building the target
D. Running Torch
Now Torch should be installed. If you did not changed
CMAKE_INSTALL_PREFIX, it should be in
C:/Program Files/Torch. Lua
qlua) are found in the
bin sub-directory of these
installation directories. Start
lua by double-clicking it, and try it
Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio > require 'torch' > = torch.Tensor(5):zero() 0 0 0 0 0 [torch.Tensor of dimension 5] >The executable
luais a simple Lua interpreter (as provided on Lua website), while
qluahas enhanced interactivity (like completion) and is able to handle graphics and QT widgets.