Opened 6 years ago

Closed 6 years ago

#57704 closed defect (fixed)

zmq, zmq-devel: Fix C++11 detection issues

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: michaelld (Michael Dickens)
Port: zmq, zmq-devel

Description

zmq doesn't quite correctly deal with C++11. It apparently wants to optionally use C++11 if it detects that the compiler supports it.

On 10.6, whose g++ 4.2 compiler does not support C++11 at all, it correctly detects that and builds successfully. But on 10.7 and 10.8, whose clang compiler does accept the -std=gnu++11 flag but whose default C++ standard library libstdc++ does not support C++11, it fails to build.

There is already a patchfile in the port that adds an --enable-cxx11 / --disable-cxx11 flag to the configure script, and the port is requesting that C++11 be disabled, but this appears to be having no effect. Maybe the patch needs to be updated.

I see the port has special handling that enables C++11 support for PowerPC systems only. I don't know why it does that. Seems like a weird choice. If there is some benefit to building zmq with C++11 support, then why not unconditionally include the cxx11 1.1 portgroup and just always build with C++11 support? And if there is no benefit, then why not always disable it? Or base the decision of whether to add C++11 support on whether or not the selected C++ standard library supports it?

Change History (4)

comment:1 in reply to:  description Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

However, you do want to be careful not to impose a C++11 requirement on every port that uses zmq, if that can be avoided.

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Cc: stromnov removed
Owner: changed from merijn to stromnov

comment:3 Changed 6 years ago by michaelld (Michael Dickens)

You are correct: the ZMQ folks added in a check for C++11; actually gnu++11. Which seems to override my patch's flag to disable it. Let me see what I can do here ...

comment:4 Changed 6 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

In e068f443fcb5a2581091d5f517c3986072a2cb36/macports-ports (master):

zmq[-devel]: fix use of c++11 and c11

Closes: #57704

Note: See TracTickets for help on using tickets.