Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install pytorch #18

Open
sivagnanamn opened this issue Oct 3, 2016 · 4 comments
Open

Unable to install pytorch #18

sivagnanamn opened this issue Oct 3, 2016 · 4 comments

Comments

@sivagnanamn
Copy link

sivagnanamn commented Oct 3, 2016

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
@lebedov
Copy link

lebedov commented Oct 5, 2016

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.

@sivagnanamn
Copy link
Author

sivagnanamn commented Nov 3, 2016

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

@sagarwaghmare69
Copy link

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

@rylm
Copy link

rylm commented Jan 5, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants