[MacPorts] #55641: zmq @4.2.3 fails to build on 10.7 and 10.8 due to C++11
MacPorts
noreply at macports.org
Thu Jan 4 12:34:09 UTC 2018
#55641: zmq @4.2.3 fails to build on 10.7 and 10.8 due to C++11
--------------------------------+----------------------------
Reporter: ryandesign | Owner: merijn
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.4.2
Keywords: lion, mountainlion | Port: zmq, zmq-devel
--------------------------------+----------------------------
zmq @4.2.3 builds fine on Mac OS X 10.5 and 10.6, and on OS X 10.9 and
later, but fails to build on OS X 10.7 and 10.8.
On 10.8 this is the error I see:
{{{
CXX src/src_libzmq_la-ctx.lo
src/ctx.cpp:466:37: error: no member named 'emplace' in
'std::map<std::basic_string<char>, zmq::endpoint_t,
std::less<std::basic_string<char> >, std::allocator<std::pair<const
std::basic_string<char>, zmq::endpoint_t> > >'
const bool inserted = endpoints.ZMQ_MAP_INSERT_OR_EMPLACE (addr_,
~~~~~~~~~ ^
./src/blob.hpp:39:41: note: expanded from macro
'ZMQ_MAP_INSERT_OR_EMPLACE'
#define ZMQ_MAP_INSERT_OR_EMPLACE(k, v) emplace (k,v)
^
src/ctx.cpp:540:29: error: no member named 'emplace' in
'std::multimap<std::basic_string<char>, zmq::ctx_t::pending_connection_t,
std::less<std::basic_string<char> >, std::allocator<std::pair<const
std::basic_string<char>, zmq::ctx_t::pending_connection_t> > >'
pending_connections.ZMQ_MAP_INSERT_OR_EMPLACE (addr_,
pending_connection);
~~~~~~~~~~~~~~~~~~~ ^
./src/blob.hpp:39:41: note: expanded from macro
'ZMQ_MAP_INSERT_OR_EMPLACE'
#define ZMQ_MAP_INSERT_OR_EMPLACE(k, v) emplace (k,v)
^
2 errors generated.
}}}
I assume this is a C++11 feature. The configure script earlier checked for
C++11 features and found them:
{{{
checking whether /usr/bin/clang++ supports C++11 features by default... no
checking whether /usr/bin/clang++ supports C++11 features with
-std=gnu++11... yes
}}}
Of course, as we know, even though the clang compiler on 10.7 and 10.8
supports C++11 if using libc++, the default C++ stdlib on those systems is
libstdc++ which does not support C++11. And changing the C++ stdlib to
libc++ for individual ports is generally not advised.
If there were a straightforward way to instruct the configure system not
to use C++11, I might suggest modifying the portfile to do so when
`{${configure.cxx_stdlib} ne "libc++"}`. But I didn't see a way to do
that.
So instead, I suggest including `PortGroup cxx11 1.1` when `[string match
*clang* ${configure.compiler}]`. This should fix the build failure on 10.7
and 10.8 without having any effect for 10.9 and later. Since 10.6 and
earlier were happy to build without C++11 support (since they were using
gcc-4.2.1 which does not support C++11 at all), I'm inclined to leave them
that way.
The zmq-devel subport is of course affected as well. I don't believe the
zmq3 or zmq22 subports are affected, given that our buildbot did
successfully produce binaries of those subports for all versions of macOS.
My proposed fix ''almost'' works for me on 10.8. Everything compiles, but
the dylib fails to link because for some reason /usr/bin/clang++ is being
used to link instead of the compiler MacPorts specified. I don't yet
understand why that's happening.
--
Ticket URL: <https://trac.macports.org/ticket/55641>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list