CppExtension error when import _C

After write cpp extension code. The build process(setup.py) is correct. However, when I import the _C file, there is an error as following:

_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at5ErrorC1ENS_14SourceLocationERKSs


thank you.


Are you using mac? If so use clang as a compiler by setting CXX=clang.
If not, which OS / compiler do you use?

thank you for your reply @albanD .

I use Ubuntu, and the default compiler is gcc-4.9.4 ( extra_compile_args = {"cxx": []})

I use pytorch 1.0.0a0+e25b886, is this possible due to this “old version”?

I am not sure :confused: It should not.
The missing symbol is at::Error:SourceLocation. So maybe it’s actually missing from your install.