-
Notifications
You must be signed in to change notification settings - Fork 190
Following instructions to install gives compiler errors when building python on Ubuntu #48
Comments
We're exploring the use of a new combined PyTorch-Caffe2 package that should hopefully alleviate some installation/compilation difficulties (see #43 (comment)). We'll also try to look into what PyTorch/Caffe2/ONNX/fairseq are doing with their make files to see if we can pull some best practices/version checking from them - thanks for the suggestion! |
@HaraldKorneliussen , would you be able to retry the instructions now? They have been updated to use the PyTorch-Caffe2 package @theweiho mentions. |
@HaraldKorneliussen, feel free to reopen if you still have issues with install. |
Hello, sorry I didn't see this before. I followed the new instructions, it fails at the cmake step with the following error message:
by the way, yes, it's cuda 9.1 installed here, I hope the minor version number doesn't change things. If I add the line they suggest, building works until the final linking step, when it fails with
and then a long list of missing symbols. Again I try the suggestion of passing -rpath or -rpath-link (via make LDFLAGS="-rpath-links ..."), but this doesn't help. This file is available many places in my system
but it seems the linker can't find any of these (maybe the compiler version matters?) Update: I also tried specifying gcc-4.8 as the cuda host compiler to cmake, but this gives the same error |
Summary: Per pytorch#48 Differential Revision: D7995296 fbshipit-source-id: 2281b4d278985262ea046b237aa2d2d50431fe51
Does pre-pending the correct lib dir to the LD_LIBRARY_PATH shell variable help? Like
Otherwise, consider searching online for other linker tips/tricks. Also, given that your default GCC version is >= 7, what's the fallback version you're using per the error message? GCC 4.8.5 would be too old to work for us - I think we'd need at least 4.9.2. |
Summary: Per pytorch#48 Differential Revision: D7995296 fbshipit-source-id: bbfed34fb9acc7a9f26ad2fac65e0d3b021859e0
I finally got this to work with gcc-6. Specifying -DCUDA_HOST_COMPILER=/usr/bin/gcc-6 was not enough, I needed to set gcc 6 as the default compiler too with run update-alternatives --config gcc. |
Hello,
I tried to follow the instructions in the readme to install. First, I used my existing anaconda environment. However, it failed during the build of pytorch, the linker complaining about missing -pthreads among other things. I did some searching and found that maybe the anaconda compilers weren't installed, so I tried to install them with
conda install gcc_linux-64 gxx_linux-64 gfortran_linux-64
However, this was apparently the wrong compilers, since the build immediately failed with two unrecognized command line options: -fstack-protector-strong and -fno-plt
After that I thought I'd try using a fresh miniconda environment rather than my existing anaconda environment, so I did it over with following the miniconda installation steps in the README too. This time, it fails with linker being unable to find -lgcc_s, which again sounds a lot like a missing compiler install. Trying to install them with the same command line as above gives the same error.
Installing FAIR's tools - which are fantastic once I get them to work, thank you! - appear to be extremely sensitive to C++ compiler versions. The same with nvidia's tools... I stranded on this problem last time I tried to install pytorch from source, however then the new nightly build distributions of pytorch saved me then.
If you could provide similar bleeding edge binaries for ONNX and Caffe2, that'd be terrific! If not, if the build files could make sure the right compiler was used (and give sensible error messages if not) that would be a big improvement too.
The text was updated successfully, but these errors were encountered: