Repository: pytorch
Issue: Ubuntu 16.04 setup.py error - undefined reference to elfLink_Get_FatBinary_From_Object' /usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to elf32_section_header'
Labels: module: build,triaged,module: undefined reference

**Editorial note:** Hi! Are you on this issue because of an 'undefined reference' error? Please do the following steps before replying "me too":

1.  Check that your missing symbol actually is the same as the one here. If it is, please add your environment configuration to this ticket.
2. Check if your missing symbol shows up on the list here https://github.com/pytorch/pytorch/labels/topic%3A%20undefined%20reference ; if so, please file a relevant bug
3. If it is not, please file a new bug for your issue.

The most common me too's on this issue are:

* Build error: Undefined symbols for architecture x86_64: "_MPI_Comm_rank" on OS X (please go to #7065)
* Cannot build libtorch: SLEEF does not allow in-source builds #17181

----

Hello, I have been trying to install pytorch for roughly a week now, and I created a dual boot just for that purpose. The setup.py tool runs until it gets to 100% and then I get the following error. If anybody has any recommendations, I would be appreciate a ton!

```
$ python setup.py install

...

[100%] Linking CXX executable ../../bin/test_api
/usr/bin/ld: warning: libnvidia-fatbinaryloader.so.396.44, needed by /usr/lib/x86_64-linux-gnu/libcuda.so, not found (try using -rpath or -rpath-link)
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Get_FatBinary_From_Object'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_section_header'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `gpuInfoRunsOn'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf_end'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_shnum'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_symbol_shndx'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Free_Fatbinary'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_string_at_offset'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_symbol_shndx'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl_Compile'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_file_header'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl_PickCandidate'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_string_at_offset'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Start'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_typed_section_header'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Finish'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `gpucompSetLogLine'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Next_Library_Member'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_section_name'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf_is_64bit'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf_size'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl_Delete'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_symbol_name'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_shnum'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Add_Cubin'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_section_contents'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_section_header'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_named_section_header'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Delete'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Finish_Reading_Library'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_typed_section_header'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `gpucompRestoreLogLine'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_file_header'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Load_Host_Object'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Start_Reading_Library'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Free_Host_Object'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_named_section_header'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_symbol_name'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_section_name'
/usr/lib/x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl_Create'
collect2: error: ld returned 1 exit status
caffe2/torch/CMakeFiles/test_api.dir/build.make:345: recipe for target 'bin/test_api' failed
make[2]: *** [bin/test_api] Error 1
CMakeFiles/Makefile2:3810: recipe for target 'caffe2/torch/CMakeFiles/test_api.dir/all' failed
make[1]: *** [caffe2/torch/CMakeFiles/test_api.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Failed to run 'bash ../tools/build_pytorch_libs.sh --use-cuda --use-nnpack --use-mkldnn nccl caffe2 libshm gloo THD c10d'
```