# \[SOLVED\] Is there any dependency between cpp-extension and gcc version

**URL:** <https://discuss.pytorch.org/t/solved-is-there-any-dependency-between-cpp-extension-and-gcc-version/26795>\
**Category:** Uncategorized\
**Created:** [October 8, 2018, 7:19pm UTC](https://discuss.pytorch.org/t/solved-is-there-any-dependency-between-cpp-extension-and-gcc-version/26795 "2018-10-08T19:19:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![InnovArul](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/innovarul/32/5282_2.png) [@InnovArul](https://discuss.pytorch.org/u/InnovArul)\
**Post date:** [October 8, 2018, 7:19pm UTC](https://discuss.pytorch.org/t/solved-is-there-any-dependency-between-cpp-extension-and-gcc-version/26795/1 "2018-10-08T19:19:52Z")

</div>

I would like to know if there is a dependency between gcc-version and cpp-extension compilation.

I have tried compiling the standard cpp-extension (LLTM from [here](http://pytorch.org/tutorials/advanced/cpp_extension.html)) example under two gcc version (5.2.0, 6.1.0 with conda), both of them are unable to compile the extension.

The details are given below:

Ubuntu : `14.04`  
Python version: `3.6.5`  
Pytorch installation: `conda install pytorch-nightly -c pytorch` (version 1.0.0.dev20181008)  
gcc installation: `conda install -c omgarcia gcc-6` or `conda install -c cqwz gcc-5`

Error in gcc 5.2.0:

```auto
g++: error: -fuse-linker-plugin is not supported in this configuration

```

Error in gcc 6.1.0:

```auto
creating build/lib.linux-x86_64-3.6
g++ -pthread -shared -L/home/arul/anaconda3/envs/pytorch-nightly/lib -Wl,-rpath=/home/arul/anaconda3/envs/pytorch-nightly/lib,--no-as-needed -L/home/arul/anaconda3/envs/pytorch-nightly/lib -Wl,-rpath=/home/arul/anaconda3/envs/pytorch-nightly/lib,--no-as-needed build/temp.linux-x86_64-3.6/lltm.o -L/home/arul/anaconda3/envs/pytorch-nightly/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/lltm_cpp.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: /home/arul/anaconda3/envs/pytorch-nightly/bin/../lib/gcc/x86_64-pc-linux-gnu/6.1.0/crtbeginS.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

```

---

<div class="post-metadata">

**Author:** ![InnovArul](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/innovarul/32/5282_2.png) [@InnovArul](https://discuss.pytorch.org/u/InnovArul)\
**Post date:** [October 8, 2018, 8:55pm UTC](https://discuss.pytorch.org/t/solved-is-there-any-dependency-between-cpp-extension-and-gcc-version/26795/2 "2018-10-08T20:55:18Z")

</div>

It seems the `gcc` installed using `conda` is not compatible with the other libraries native in the OS (Ubuntu). After updating the system `gcc` to 6.4.0 (by following [this](https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91)), the compilation works.
