Torch can be installed to your home folder in ~/torch by running these three commands:
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh
The first script installs the basic package dependencies that LuaJIT and Torch require. The second script installs LuaJIT, LuaRocks, and then uses LuaRocks (the lua package manager) to install core packages like torch, nn and paths, as well as a few other packages.
The script adds torch to your PATH variable. You just have to source it once to refresh your env variables. The installation script will detect what is your current shell and modify the path in the correct configuration file.
source ~/.bashrc
source ~/.zshrc
source ~/.profile
If you ever need to uninstall torch, simply run the command:
rm -rf ~/torch
If you want to install torch with Lua 5.2 instead of LuaJIT, simply run:
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch
./clean.sh
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/clean-old.sh | bash
https://github.com/torch/distro : set env to use lua
TORCH_LUA_VERSION=LUA52 ./install.sh
New packages can be installed using Luarocks from the command-line:
$ luarocks install image
$ luarocks list
Once installed you can run torch with the command th from you prompt!
The easiest way to learn and experiment with Torch is by starting an interactive session (also known as the torch read-eval-print loop or TREPL):
$ th
luarocks --from=https://raw.githubusercontent.com/torch/rocks/master/ install nngraph
https://github.com/torch/torch7/wiki/Cheatsheet
sudo apt-get install libpcre3 libpcre3-dev
vim ~/.bashrc
export PATH="$HOME/torch/install/bin:$PATH"