diff options
author | Rui Guo <guorui.xt@gmail.com> | 2016-11-06 08:43:28 +0300 |
---|---|---|
committer | Rui Guo <guorui.xt@gmail.com> | 2016-11-06 08:43:28 +0300 |
commit | 7c614233483dd2e7c55f0a68d9d57661fa7dfa66 (patch) | |
tree | a871a03af487a8ca55fb94c6044fe29b6adcb4fe | |
parent | db3970690e5b727eccfddccba0ae22db4bbb566e (diff) |
fix: conda win-86 -> win-32
-rw-r--r-- | install-deps.bat | 28 | ||||
-rw-r--r-- | install.bat | 4 | ||||
-rw-r--r-- | win-files/README.md | 10 |
3 files changed, 22 insertions, 20 deletions
diff --git a/install-deps.bat b/install-deps.bat index 2b7adcf..ab6f17c 100644 --- a/install-deps.bat +++ b/install-deps.bat @@ -13,7 +13,7 @@ REM set TORCH_LUA_VERSION=LUAJIT21 :: where to install Torch7, default to install\ under distro\ -REM set TORCH_INSTALL_DIR=D:\Torch\ +REM set TORCH_INSTALL_DIR=D:\Torch :: conda environment name for Torch7, default to torch-vcversion REM set TORCH_CONDA_ENV=mytorch7 @@ -77,9 +77,10 @@ if "%PreferredToolArchitecture%" == "x64" ( if "%Platform%" == "" set TORCH_VS_PLATFORM=x86 ) -if "%TORCH_VS_PLATFORM%" == "x86" set TORCH_VS_TOOL=x86 -if not "%TORCH_VS_PLATFORM%" == "%TORCH_VS_PLATFORM:x86_=%" set TORCH_VS_TOOL=x86 -if "%TORCH_VS_TOOL%" == "" set TORCH_VS_TOOL=x64 +if "%TORCH_VS_PLATFORM%" == "x86" set TORCH_VS_TARGET=x86 +if not "%TORCH_VS_PLATFORM%" == "%TORCH_VS_PLATFORM:_x86=%" set TORCH_VS_TARGET=x86 +if not "%TORCH_VS_PLATFORM%" == "%TORCH_VS_PLATFORM:_arm=%" set TORCH_VS_TARGET=arm +if "%TORCH_VS_TARGET%" == "" set TORCH_VS_TARGET=x64 :::: validate lua version :::: @@ -166,12 +167,13 @@ if "%CONDA_CMD%" == "" ( set TORCH_CONDA_INFO=%TORCH_DISTRO%\win-files\check_conda_info_for_torch.txt conda info > %TORCH_CONDA_INFO% -if "%TORCH_VS_TOOL%" == "x64" set TORCH_CONDA_PLATFORM=win-64 -if "%TORCH_VS_TOOL%" == "x86" set TORCH_CONDA_PLATFORM=win-86 +if "%TORCH_VS_TARGET%" == "x64" set TORCH_CONDA_PLATFORM=win-64 +if "%TORCH_VS_TARGET%" == "arm" set TORCH_CONDA_PLATFORM=win-64 +if "%TORCH_VS_TARGET%" == "x86" set TORCH_CONDA_PLATFORM=win-32 findstr "%TORCH_CONDA_PLATFORM%" "%TORCH_CONDA_INFO%" >nul if errorlevel 1 ( - echo %ECHO_PREFIX% %TORCH_VS_TOOL% Torch7 requires %TORCH_CONDA_PLATFORM% conda, installation will continue without conda + echo %ECHO_PREFIX% %TORCH_VS_TARGET% Torch7 requires %TORCH_CONDA_PLATFORM% conda, installation will continue without conda goto :NO_CONDA ) @@ -217,15 +219,15 @@ goto :AFTER_OPENBLAS :CONDA_INSTALL_OPENBLAS echo %ECHO_PREFIX% Installing openblas by conda, since there is no blas library specified -if "%TORCH_VS_TOOL%" == "x64" conda install -n %TORCH_CONDA_ENV% -c ukoethe openblas --yes || goto :Fail -if "%TORCH_VS_TOOL%" == "x86" conda install -n %TORCH_CONDA_ENV% -c omnia openblas --yes || goto :Fail +if not "%TORCH_VS_TARGET%" == "x86" conda install -n %TORCH_CONDA_ENV% -c ukoethe openblas --yes || goto :Fail +if "%TORCH_VS_TARGET%" == "x86" conda install -n %TORCH_CONDA_ENV% -c omnia openblas --yes || goto :Fail :AFTER_OPENBLAS -if "%TORCH_VS_TOOL%" == "x64" ( +if not "%TORCH_VS_TARGET%" == "x86" ( if "%BLAS_LIBRARIES%" == "" set BLAS_LIBRARIES=%TORCH_CONDA_LIBRARY%\\lib\\libopenblas.lib if "%LAPACK_LIBRARIES%" == "" set LAPACK_LIBRARIES=%TORCH_CONDA_LIBRARY%\\lib\\libopenblas.lib ) -if "%TORCH_VS_TOOL%" == "x86" ( +if "%TORCH_VS_TARGET%" == "x86" ( if "%BLAS_LIBRARIES%" == "" set BLAS_LIBRARIES=%TORCH_CONDA_LIBRARY%\\lib\\libopenblaspy.dll.a if "%LAPACK_LIBRARIES%" == "" set LAPACK_LIBRARIES=%TORCH_CONDA_LIBRARY%\\lib\\libopenblaspy.dll.a ) @@ -248,8 +250,8 @@ if not "%TORCH_DEPENDENCIES%" == "" ( ) :NO_CONDA -del /q %TORCH_CONDA_INFO% -del /q %TORCH_CONDA_PKGS% +if exist "%TORCH_CONDA_INFO%" del /q %TORCH_CONDA_INFO% +if exist "%TORCH_CONDA_PKGS%" del /q %TORCH_CONDA_PKGS% :::: git clone luarocks :::: diff --git a/install.bat b/install.bat index 9360e71..c176d00 100644 --- a/install.bat +++ b/install.bat @@ -46,7 +46,7 @@ cd %TORCH_DISTRO%\extra\nngraph && call %LUAROCKS_CMD% make nngraph-scm-1.rocksp cd %TORCH_DISTRO%\pkg\image && call %LUAROCKS_CMD% make image-1.1.alpha-0.rockspec || goto :FAIL cd %TORCH_DISTRO%\pkg\optim && call %LUAROCKS_CMD% make optim-1.0.5-0.rockspec || goto :FAIL -if not "%TORCH_SETUP_HAS_CUDA%" == "" if not "%TORCH_VS_TOOL%" == "x86" ( +if not "%TORCH_SETUP_HAS_CUDA%" == "" if not "%TORCH_VS_TARGET%" == "x86" ( echo %ECHO_PREFIX% Found CUDA on your machine. Installing CUDA packages cd %TORCH_DISTRO%\extra\cutorch && call %LUAROCKS_CMD% make rocks\cutorch-scm-1.rockspec || goto :FAIL cd %TORCH_DISTRO%\extra\cunn && git apply %TORCH_DISTRO%\win-files\patch\cunn.patch --whitespace=fix & ( call %LUAROCKS_CMD% make rocks\cunn-scm-1.rockspec || goto :FAIL ) & git apply %TORCH_DISTRO%\win-files\patch\cunn.patch --reverse --whitespace=fix @@ -61,7 +61,7 @@ cd %TORCH_DISTRO%\pkg\qttorch && call %LUAROCKS_CMD% make rocks\qttorch-scm-1.ro cd %TORCH_DISTRO%\extra\threads && call %LUAROCKS_CMD% make rocks\threads-scm-1.rockspec WIN_DLFCN_INCDIR=%WIN_DLFCN_INCDIR% WIN_DLFCN_LIBDIR=%WIN_DLFCN_LIBDIR% cd %TORCH_DISTRO%\extra\argcheck && call %LUAROCKS_CMD% make rocks\argcheck-scm-1.rockspec -if not "%TORCH_SETUP_HAS_CUDA%" == "" if not "%TORCH_VS_TOOL%" == "x86" ( +if not "%TORCH_SETUP_HAS_CUDA%" == "" if not "%TORCH_VS_TARGET%" == "x86" ( echo %ECHO_PREFIX% Found CUDA on your machine. Installing optional CUDA packages cd %TORCH_DISTRO%\extra\cudnn && git apply %TORCH_DISTRO%\win-files\patch\cudnn.patch --whitespace=fix & call %LUAROCKS_CMD% make cudnn-scm-1.rockspec & git apply %TORCH_DISTRO%\win-files\patch\cudnn.patch --reverse --whitespace=fix ) diff --git a/win-files/README.md b/win-files/README.md index d93bec6..70613c0 100644 --- a/win-files/README.md +++ b/win-files/README.md @@ -20,17 +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), for plotting +- [Gnuplot](https://sourceforge.net/projects/gnuplot/files/latest), required by gnuplot package for plotting - [GraphicsMagick](https://sourceforge.net/projects/graphicsmagick/files/latest), optional for image package ## Install -Open "Windows Command Prompt" or "Visual Studio Native Tools Command Prompt" and run: +Open "Windows 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'. Choose X64 conda for -X64 Torch and X86 conda for X86 Torch. X86 Torch will not contain cuda packages and has 2G memory limitation. +By default x64 Torch will be installed under install\ with LuaJIT 2.1 and openlblas from conda environment 'torch-vcversion'. +Run install.bat in a specific "VS\* \* Tools Command Prompt" to compile for a different target. Please choose x64 conda +for x64 Torch and x86 conda for x86 Torch. X86 Torch does 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 |