-D_GLIBCXX_USE_CXX11_ABI=0 cflags?
See original GitHub issueHi, I wonder how to set -D_GLIBCXX_USE_CXX11_ABI=1
when building apex. I got this error when using syncbn:
Warning: using Python fallback for SyncBatchNorm, possibly because apex was installed without --cuda_ext. The exception raised when attempting t
o import the cuda backend was: /usr/lib/python3.7/site-packages/syncbn.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14So
urceLocationERKSs
and then I got:
$ c++filt _ZN3c105ErrorC1ENS_14SourceLocationERKSs
c10::Error::Error(c10::SourceLocation, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
It is said related to -D_GLIBCXX_USE_CXX11_ABI
according to this post.
Also, I check ABI by:
$ strings /usr/lib/python3.7/site-packages/torch/lib/libtorch.so|grep ABI
CXXABI_1.3.8
CXXABI_1.3.5
CXXABI_1.3.7
CXXABI_1.3.3
CXXABI_1.3
$ strings /usr/lib/python3.7/site-packages/syncbn.cpython-37m-x86_64-linux-gnu.so|grep ABI
CXXABI_1.3
CXXABI_1.3.3
CXXABI_1.3.5
A solution to this is compile apex with -D_GLIBCXX_USE_CXX11_ABI=1
. So, how could I do that?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
c++ - _GLIBCXX_USE_CXX11_ABI, GCC 4.8 and ABI ...
It's possible to use the C++11 ABI with gcc 4.8.2, but it's a dangerous hack; you would be far better off if at...
Read more >Dual ABI - GCC, the GNU Compiler Collection
The _GLIBCXX_USE_CXX11_ABI macro (see Macros) controls whether the declarations in the library headers use the old or new ABI. So the decision of...
Read more >Build errors - might be boost version? · Issue #1260 - GitHub
Building this from scratch in Ubuntu 18.04 with CFLAGS=-O3 CXXFLAGS=-O3 BUILD_CFG=Release python build-all.py It says it finds the boost ...
Read more >How to manage the GCC >= 5 ABI - Conan Docs
However, if you are using GCC >= 5 your compiler is likely to be using the new CXX11 ABI by default (libstdc++11). This...
Read more >Clang Compiler User's Manual
This document describes important notes about using Clang as a compiler for an ... clang -fsave-optimization-record=bitstream in.c -o out will generate.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/pytorch/pytorch/commit/e0c593eae7679fbf9e08d933f695ba9781b24da2
So the problem is that pytorch is compiled from source but the version string is set binary-formatted manually in the PKGBUILD. This issue is resolved in the commit above (3 days ago) but not in the pytorch v1.0.1.
I compiled pytorch master from source with cuda/intel-mkl and compiled apex with it. I can verify the problem does not exist for pytorch master.
@mcarilli So in order for apex to build and function I first need to build pytorch with D_GLIBCXX_USE_CXX11_ABI=1 instead of the 0 in the spots you mentioned?