Closed makaimann closed 4 years ago
Maybe related: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=82366
I only have gcc-8.3.0
and I can confirm the issue. It seems to be an ABI related problem with string since they upgrade the it aftergcc-7
. Due to the manylinux
python wheel requirement, if the compiler is newer than gcc4.8
, the binaries have to be statically linked with glic
/glic++
.
Here is a hot fix:
(env) keyi@batman:~/workspace/pycoreir/coreir-cpp$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c8adef2..d05bc077 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,8 @@ endif()
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -fPIC -Werror ${STATIC_FLAGS}")
+add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
+
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
set(INCLUDE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/include)
@makaimann if it's very important for you to use, I can try to verify the new ABI change won't break the manylinux
wheel. If so, I can send a PR to CoreIR.
Thanks @Kuree! It's not a priority for me, clang is fine.
I'm wondering now if it actually is a g++ 7+ issue or not though. This build for CoSA failed with CXX=g++-4.9: https://travis-ci.org/cristian-mattarei/CoSA/builds/524180955
And if I revert that change as so: https://github.com/cristian-mattarei/CoSA/commit/ed2cdff46e3676b3cfa7146151fcb7d62ad0541a then it's fine.
Has anyone else observed this? I just looked at the Travis logs for pycoreir and it looks like it's using g++-4.9, so I'm not sure what the difference is.
Resolved upstream in coreir
It looks like there's an issue compiling with
g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
. Usingclang++ 6.0.0-1
instead works fine. I'm able to compilecoreir
withg++-7
and run the binary with no problems. But, if I installpycoreir
withpip install -e .
from the repository usingg++-7
then run it withgdb
I get the following: