forked from torch/distro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix && improvement: rc1 for official master
- Loading branch information
Showing
14 changed files
with
239 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ build/ | |
install/ | ||
*/*/build | ||
extra/luafilesystem/lfs.so | ||
win-files/3rd/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,55 @@ | ||
Self-contained Torch installation for windows | ||
============ | ||
|
||
## Prerequisites | ||
|
||
#### Must have | ||
- MSVC, anyone of the following choices is sufficient | ||
- [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) | ||
- [Visual Studio Express](https://www.visualstudio.com/vs/visual-studio-express/) | ||
- [Visual Studio Community](https://www.visualstudio.com/vs/community/) | ||
- [Git](https://git-scm.com/download/win) | ||
- [CMake](https://cmake.org/download/#latest) | ||
- [Conda](http://conda.pydata.org/docs/download.html), manage dependencies like openblas, jpeg, qt, etc | ||
|
||
#### If use CUDA | ||
[](https://travis-ci.org/torch/distro) | ||
|
||
- [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) | ||
- [CUDNN](https://developer.nvidia.com/cudnn), if use dnn | ||
Self-contained Torch installation | ||
============ | ||
|
||
#### Optional | ||
#### Please refer to the [Torch installation guide](http://torch.ch/docs/getting-started.html#_) for details on how to make a fresh install of Torch on Linux or MacOS. | ||
#### If on windows with msvc, please refer to this [guide](win-files/README.md) for details on installation and usage. | ||
|
||
- [MKL](https://software.intel.com/intel-mkl), better performance blas/lapack library | ||
- [Gnuplot](https://sourceforge.net/projects/gnuplot/files/latest) | ||
- [GraphicsMagick](https://sourceforge.net/projects/graphicsmagick/files/latest), optional for image package | ||
|
||
## Install | ||
Open "Visual Studio Native Tools Command Prompt" and run: | ||
```bat | ||
install.bat | ||
## Repo content | ||
#### Dependencies | ||
Globally installed dependencies can be installed via: | ||
```bash | ||
bash install-deps | ||
``` | ||
By default Torch will be installed under install\ with LuaJIT 2.1 and openlblas from conda environment 'torch'. | ||
There are a few customizable environment variables listed on top of install-deps.bat. There is no need to run | ||
install-deps.bat before run install.bat, it sets variables in global and it will be called directly by install.bat. | ||
*Do not* use lua instead of luajit since lua version Torch will use luaffifb for ffi which has bugs on windows | ||
and has poor performance. | ||
|
||
## Use | ||
In order to use Torch in a Self-contained way, a few helper cmd will be installed under the installation directory: | ||
- torchenv.cmd: setup Torch environment including PATH, LUA\_PATH, LUA\_CPATH, CUDNN\_PATH | ||
- luajit.cmd: a wrapper of luajit.exe with Torch environment | ||
- luarocks.cmd: a wrapper of luarocks.bat with Torch environment | ||
- cmake.cmd: a wrapper of cmake.exe which helps package installation with MSVC | ||
|
||
#### Use luajit.cmd and luarocks.cmd directly | ||
```bat | ||
path_to_Torch\luajit -ltorch -e "torch.test()" | ||
#### Lua and Torch | ||
The self-contained Lua and Torch installations are performed via: | ||
```bash | ||
./install.sh | ||
``` | ||
luarocks install should be run in "Visual Studio Native Tools Command Prompt" or consoles with MSVC setup | ||
```bat | ||
path_to_Torch\luarocks install dpnn | ||
``` | ||
Torch manages a repo for all packages' rockspecs, however the rockspecs may be not up-to-date. dpnn is one of that | ||
case when I tried. Main problem is that luarocks on windows does not support commands in multiple lines. Instead, | ||
the latest source of [dpnn](https://github.com/Element-Research/dpnn) should be git cloned, cd dpnn and run: | ||
```bat | ||
path_to_Torch\luarocks make rocks\dpnn-scm-1.rockspec | ||
|
||
By default Torch will install LuaJIT 2.1. If you want other options, you can use the command: | ||
```bash | ||
# If a different version was installed, used ./clean.sh to clean it | ||
TORCH_LUA_VERSION=LUA51 ./install.sh | ||
TORCH_LUA_VERSION=LUA52 ./install.sh | ||
``` | ||
It will automatically install not installed dependencies. | ||
|
||
#### Run torchenv.cmd, then use availabe Torch executables | ||
```bat | ||
path_to_Torch\torchenv.cmd | ||
th | ||
## Update | ||
To update your already installed distro to the latest `master` branch of `torch/distro` simply run: | ||
```bash | ||
./update.sh | ||
``` | ||
Trepl on windows should work similarly as on linux or macos. | ||
|
||
## Clean or Uninstall | ||
To remove all the temporary compilation files: | ||
```bat | ||
clean.bat | ||
## Cleaning | ||
To remove all the temporary compilation files you can run: | ||
```bash | ||
./clean.sh | ||
``` | ||
This will run "git checkout -f" for all packages, so *do not* do modifications in those packages directory, leave them as | ||
synced with github. Do modifications in another cloned folder, and run luarocks.cmd for seperate installation. | ||
|
||
To remove the installation: | ||
```bat | ||
uninstall.bat | ||
To remove the installation run: | ||
```bash | ||
# Warning: this will remove your current installation | ||
rm -rf ./install | ||
``` | ||
This will remove the install\ directory in addition to clean.bat. Since it has no knowledge where Torch is installed, it | ||
is up to the user to remove the installation directory if Torch is installed in a different place. | ||
You may also want to remove the `torch-activate` entry from your shell start-up script (`~/.bashrc` or `~/.profile`). | ||
|
||
## Test | ||
You can test that all libraries are installed properly by running: | ||
```bat | ||
test.bat | ||
```bash | ||
./test.sh | ||
``` | ||
|
||
Tested on Windows 10, Visual Studio Community 2015, Anaconda4, Cuda8.0, MKL2017 | ||
Tested on Ubuntu 14.04, CentOS/RHEL 6.3 and OSX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.