hughperkins / pytorch

Python wrappers for torch and lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to install pytorch

sivagnanamn opened this issue · comments

I'm getting the error below while trying to run "./build.sh". I'm having Lua5.1 and all dependencies installed.

creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/TH -Ithirdparty/lua-5.1.5/src -I/usr/local/include -I/usr/include/python2.7 -c src/lua.cpp -o build/temp.linux-x86_64-2.7/src/lua.o -std=c++0x -Wno-unused-function -Wno-unreachable-code -Wno-strict-prototypes
cc1plus: warning: command line option ‘-Wno-strict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
src/lua.cpp:248:22: fatal error: THRandom.h: No such file or directory
 #include "THRandom.h"
                      ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

If you are using the latest code from GitHub, you need to set the TORCH_INSTALL environmental variable to the root directory of your Torch installation.

I tried setting the environment variable. Still I'm not able to install Pytorch. Here is the output that I get after executing

$./build.sh

Cannot uninstall requirement PyTorch, not installed
Storing debug log for failure in /home/siva/.pip/pip.log
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Torch7 in /home/siva/torch/install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/siva/Documents/PyTorch/pytorch/cbuild
Scanning dependencies of target PyTorchNative
[100%] [100%] Building CXX object CMakeFiles/PyTorchNative.dir/src/LuaHelper.cpp.o
Building CXX object CMakeFiles/PyTorchNative.dir/src/nnWrapper.cpp.o
Linking CXX shared library libPyTorchNative.so
[100%] Built target PyTorchNative
Install the project...
-- Install configuration: "Debug"
-- Installing: /home/siva/torch/install/lib/libPyTorchNative.so
-- Set runtime path of "/home/siva/torch/install/lib/libPyTorchNative.so" to "$ORIGIN/../lib:/home/siva/torch/install/lib"
torch_install: /home/siva/torch-cl/install
os family Linux
/usr/local/lib/python2.7/dist-packages/setuptools/dist.py:340: UserWarning: The version specified ('4.1.1-SNAPSHOT') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
running install
running bdist_egg
running egg_info
creating src/PyTorch.egg-info
writing requirements to src/PyTorch.egg-info/requires.txt
writing src/PyTorch.egg-info/PKG-INFO
writing top-level names to src/PyTorch.egg-info/top_level.txt
writing dependency_links to src/PyTorch.egg-info/dependency_links.txt
writing manifest file 'src/PyTorch.egg-info/SOURCES.txt'
reading manifest file 'src/PyTorch.egg-info/SOURCES.txt'
writing manifest file 'src/PyTorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying src/floattensor.py -> build/lib.linux-x86_64-2.7
copying src/PyTorchAug.py -> build/lib.linux-x86_64-2.7
copying src/PyTorchHelpers.py -> build/lib.linux-x86_64-2.7
copying src/PyTorchLua.py -> build/lib.linux-x86_64-2.7
running build_ext
building 'lua' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/siva/torch-cl/install/include/TH -Ithirdparty/lua-5.1.5/src -I/home/siva/torch-cl/install/include -I/usr/include/python2.7 -c src/lua.cpp -o build/temp.linux-x86_64-2.7/src/lua.o -std=c++0x -Wno-unused-function -Wno-unreachable-code -Wno-strict-prototypes
cc1plus: warning: command line option ‘-Wno-strict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/lua.o -L/home/siva/torch-cl/install/lib -Wl,-R/home/siva/torch-cl/install/lib -lPyTorchNative -o build/lib.linux-x86_64-2.7/lua.so
/usr/bin/ld: cannot find -lPyTorchNative
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1

Then I manually tried installing using

$python setup.py install --user

torch_install: /home/siva/torch
os family Linux
/usr/local/lib/python2.7/dist-packages/setuptools/dist.py:340: UserWarning: The version specified ('4.1.1-SNAPSHOT') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
running install
running bdist_egg
running egg_info
writing requirements to src/PyTorch.egg-info/requires.txt
writing src/PyTorch.egg-info/PKG-INFO
writing top-level names to src/PyTorch.egg-info/top_level.txt
writing dependency_links to src/PyTorch.egg-info/dependency_links.txt
reading manifest file 'src/PyTorch.egg-info/SOURCES.txt'
writing manifest file 'src/PyTorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'lua' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/siva/torch/include/TH -Ithirdparty/lua-5.1.5/src -I/home/siva/torch/include -I/usr/include/python2.7 -c src/lua.cpp -o build/temp.linux-x86_64-2.7/src/lua.o -std=c++0x -Wno-unused-function -Wno-unreachable-code -Wno-strict-prototypes
cc1plus: warning: command line option ‘-Wno-strict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
src/lua.cpp:248:22: fatal error: THRandom.h: No such file or directory
 #include "THRandom.h"
                      ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I am having similar issue. Was anybody able to resolve this ?

I have this issue to, but on installing step, not on the building. Please help!