Closed 183amir closed 7 years ago
I compiled boost on defaults. I never use the docker image, I always use 'real' CentOS 5.11.
Are you suggesting that I try this on a real CentOS 5.11? I am following the instructions on https://github.com/ContinuumIO/anaconda-recipes to compile packages that are not available in the defaults
channel. Since I want to build packages on the CI, I am stuck with docker images.
The main question is why does this segfaults and how can I avoid it?
I am confused as you answered the question already yourself.
You need to use the gcc
andlibgcc
packages as requirements/build
and requirements/run
respectively as the boost
recipe does rather than linking both your system's (be that the Arch or the docker image one) libstdc++ and the one from libgcc
into the same executable.
@mingwandroid if the boost
package from defaults is supposed to work only with libgcc
from defaults, isn't better to list it as a dependency?
Ah no, you are right, seems I used CentOS 5.11's native GCC. The boost devs do a good job of supporting really old libstdc++ it seems!
You are probably running into a C++ ABI issue then. GCCs > 5.2 are usually built with with the new C++11 ABI (mainly to do with Small String Optimization). You can read more about it here: https://developers.redhat.com/blog/2015/02/05/gcc5-and-the-c11-abi/
Can you try passing -D_GLIBCXX_USE_CXX11_ABI=0 on your g++ command line and see if that works? I'd be interested to know.
There was an attempt at maintaining support for 'dual ABI' support, but from what I've read from Clang developers, it was broken for a long time.
Sticking below GCC 5.2 avoids the C++11 ABI which is probably why using gcc and libgcc works.
Passing -D_GLIBCXX_USE_CXX11_ABI=0
makes it work. Thank you.
I was exporting export CXXFLAGS="${CXXFLAGS} -Wabi=2"
and export CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0"
but I was not paying attention that this is not inherited in conda build.
Great. FYI, I am working on updating all of our compilers and switching to C++11 ABI. At that point, we will be recommending everyone to use the compilers for all packages (on Linux initially, then macOS later in the year).
Once we adopt the C++11 ABI people will not be able to link to conda libraries when they use older compilers.
I am using the
continuumio/conda_builder_linux:latest
image and start the image with thebuild64/start_cpp98.sh
script that is provided but I fail to compile a simple program with boost and conda-build.The test cpp code is this:
The recipe to build it with conda-build is this:
And these are the commands that I run:
It segfaults. This is easily reproducible through this test code that I have provided here. It segfaults on ArchLinux's gcc too:
but it compiles fine when I use the
gcc
andlibgcc
packages from the defaults channel:Isn't
boost
in thedefaults
channel compiled with the same image? Is this a boost bug or a gcc problem?ping @msarahan @ccordoba12