diff options
author | Rui Guo <guorui.xt@gmail.com> | 2016-11-03 18:17:18 +0300 |
---|---|---|
committer | Rui Guo <guorui.xt@gmail.com> | 2016-11-03 18:17:18 +0300 |
commit | bac29c2675dc0efaa84757094b0df9f98a478912 (patch) | |
tree | 77dcc0d13f5a3e6de2da7a689f6b3511181d09c7 /win-files | |
parent | df811cf48c8cc8281f1513aad5e567dcb30311bb (diff) |
fix && improvement: rc2 for official master
Diffstat (limited to 'win-files')
-rw-r--r-- | win-files/README.md | 9 | ||||
-rw-r--r-- | win-files/patch/cudnn.patch | 22 | ||||
-rw-r--r-- | win-files/patch/torch.patch | 13 | ||||
-rw-r--r-- | win-files/patch/trepl.x86.patch | 13 |
4 files changed, 37 insertions, 20 deletions
diff --git a/win-files/README.md b/win-files/README.md index ea7b64b..d93bec6 100644 --- a/win-files/README.md +++ b/win-files/README.md @@ -20,16 +20,17 @@ Self-contained Torch installation for windows #### Optional - [MKL](https://software.intel.com/intel-mkl), better performance blas/lapack library -- [Gnuplot](https://sourceforge.net/projects/gnuplot/files/latest) +- [Gnuplot](https://sourceforge.net/projects/gnuplot/files/latest), for plotting - [GraphicsMagick](https://sourceforge.net/projects/graphicsmagick/files/latest), optional for image package ## Install -Open "Windows Command Prompt" or a "Visual Studio Native Tools Command Prompt" and run: +Open "Windows Command Prompt" or "Visual Studio Native Tools Command Prompt" and run: ```bat install.bat ``` X64 Torch will be installed by default if using "Windows Command Prompt" without MSVC setup. By default Torch will be -installed under install\ with LuaJIT 2.1 and openlblas from conda environment 'torch-vcversion'. +installed under install\ with LuaJIT 2.1 and openlblas from conda environment 'torch-vcversion'. Choose X64 conda for +X64 Torch and X86 conda for X86 Torch. X86 Torch will not contain cuda packages and has 2G memory limitation. 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 because currently lua version Torch will use luaffifb for ffi which has bugs on windows @@ -69,6 +70,8 @@ qlua ``` Trepl on windows should work similarly as on linux or macos. qlua should be used to run qt related lua codes. +#### Packages + ## Clean or Uninstall To remove all the temporary compilation files: ```bat diff --git a/win-files/patch/cudnn.patch b/win-files/patch/cudnn.patch index 0be6625..3edd760 100644 --- a/win-files/patch/cudnn.patch +++ b/win-files/patch/cudnn.patch @@ -1,33 +1,21 @@ diff --git a/init.lua b/init.lua -index b5270e3..5abb5db 100644 +index b5270e3..7fb9f2b 100644 --- a/init.lua +++ b/init.lua @@ -4,6 +4,7 @@ cudnn = require 'cudnn.env' require('cudnn.ffi') local C = cudnn.C local ffi = require 'ffi' -+local ffiC = ffi.os == 'Windows' and ffi.load('THC') or ffi.C ++local THC = ffi.os == 'Windows' and ffi.load('THC') or ffi.C cudnn.benchmark = false cudnn.fastest = false -@@ -108,7 +109,7 @@ function cudnn.getHandle() - local status = C['cudnnCreate'](cudnn.handle - + (((device-1) * maxStreamsPerDevice) - + stream)) -- if status ~= ffi.C.CUDNN_STATUS_SUCCESS then -+ if status ~= ffiC.CUDNN_STATUS_SUCCESS then - local str = ffi.string(C.cudnnGetErrorString(status)) - error('Error in CuDNN: ' .. str) - end -@@ -119,9 +120,9 @@ end +@@ -119,7 +120,7 @@ end local errcheck = function(f, ...) C.cudnnSetStream(cudnn.getHandle(), - ffi.C.THCState_getCurrentStream(cutorch.getState())) -+ ffiC.THCState_getCurrentStream(cutorch.getState())) ++ THC.THCState_getCurrentStream(cutorch.getState())) local status = C[f](...) -- if status ~= ffi.C.CUDNN_STATUS_SUCCESS then -+ if status ~= ffiC.CUDNN_STATUS_SUCCESS then + if status ~= ffi.C.CUDNN_STATUS_SUCCESS then local str = ffi.string(C.cudnnGetErrorString(status)) - error('Error in CuDNN: ' .. str .. ' ('..f..')') - end diff --git a/win-files/patch/torch.patch b/win-files/patch/torch.patch index 63e7868..c22d907 100644 --- a/win-files/patch/torch.patch +++ b/win-files/patch/torch.patch @@ -1,3 +1,16 @@ +diff --git a/lib/TH/THDiskFile.c b/lib/TH/THDiskFile.c +index 2ded7bd..ad81b2e 100644 +--- a/lib/TH/THDiskFile.c ++++ b/lib/TH/THDiskFile.c +@@ -2,7 +2,7 @@ + #include "THDiskFile.h" + #include "THFilePrivate.h" + +-#ifdef _WIN64 ++#ifdef _MSC_VER + #include <stdint.h> + #endif + diff --git a/lib/luaT/luaT.c b/lib/luaT/luaT.c index 95166ed..2dc307a 100644 --- a/lib/luaT/luaT.c diff --git a/win-files/patch/trepl.x86.patch b/win-files/patch/trepl.x86.patch new file mode 100644 index 0000000..ffd6a8c --- /dev/null +++ b/win-files/patch/trepl.x86.patch @@ -0,0 +1,13 @@ +diff --git a/trepl-scm-1.rockspec b/trepl-scm-1.rockspec +index 62d6812..68860dc 100644 +--- a/trepl-scm-1.rockspec ++++ b/trepl-scm-1.rockspec +@@ -42,7 +42,7 @@ build = { + libraries = {'readline'}, + defines = {"WinEditLine"}, + incdirs = {"..\\..\\win-files\\3rd\\wineditline-2.101\\include"}, +- libdirs = {"..\\..\\win-files\\3rd\\wineditline-2.101\\lib64"}, ++ libdirs = {"..\\..\\win-files\\3rd\\wineditline-2.101\\lib32"}, + libraries = {'edit_static', 'user32'} + } + } |