libc++/libstdc++ compatibility?

Hello HDF5 --

I'm testing my project on a fresh OSX 10.9 install. Some of the tools don't build with clang yet, so I'm using gcc for now. However, by default, hdf5 picks clang (OSX 10.9 / xcode 5) for compilation. This appears to be resulting in a binary incompatibility:

My code is looking for this symbol:
H5::CommonFG::openDataSet(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
HDF5 libraries have this symbol:
H5::CommonFG::openDataSet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const

Is there a way that HDF5 can be compiled to have ABI compatibility with both libc++ and libstdc++? I can imagine there are a lot of systems where someone would want to install HDF5 in a standard location, but where some users might to use gcc while others would want clang. Maybe people should compile both? For example, in my package, some tools that I use can be compiled with clang while others can't be (yet).

Thanks!
Amos.

I doubt it. The libc++ webpage even talks about how breaking ABI with libstdc++ was necessary.

On 10.9 the default is libc++, as you say, but libstdc++ is still available, why not just use it? -stdlib=libstdc++

Cheers,

···

On Fri, 22 Nov 2013 12:25:47 -0800, Amos Anderson said:

I'm testing my project on a fresh OSX 10.9 install. Some of the tools
don't build with clang yet, so I'm using gcc for now. However, by
default, hdf5 picks clang (OSX 10.9 / xcode 5) for compilation. This
appears to be resulting in a binary incompatibility:

My code is looking for this symbol:
H5::CommonFG::openDataSet(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&) const
HDF5 libraries have this symbol:
H5::CommonFG::openDataSet(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) const

Is there a way that HDF5 can be compiled to have ABI compatibility with
both libc++ and libstdc++?

--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada

Hi Amos,

I don't have access to an OSX 10.9 yet. Let me see if I can help.

Apple has its own version of gcc.
Are you using the Apple gcc/g++ or the Gnu gcc/g++?
What configure options did you use?

Could you send a copy of src/libhdf5.settings? It will
help me what versions the compilers are.
Thanks.

-Albert Cheng
THG staff

···

On Nov 22, 2013, at 2:25 PM, Amos Anderson <amos.anderson@protabit.com> wrote:

Hello HDF5 --

I'm testing my project on a fresh OSX 10.9 install. Some of the tools don't build with clang yet, so I'm using gcc for now. However, by default, hdf5 picks clang (OSX 10.9 / xcode 5) for compilation. This appears to be resulting in a binary incompatibility:

My code is looking for this symbol:
H5::CommonFG::openDataSet(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
HDF5 libraries have this symbol:
H5::CommonFG::openDataSet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const

Is there a way that HDF5 can be compiled to have ABI compatibility with both libc++ and libstdc++? I can imagine there are a lot of systems where someone would want to install HDF5 in a standard location, but where some users might to use gcc while others would want clang. Maybe people should compile both? For example, in my package, some tools that I use can be compiled with clang while others can't be (yet).

Thanks!
Amos.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org