-std=c++11 for gnuplot +qt5 (was Re: building from source with libc++)

Andrew L. Moore slewsys at gmail.com
Thu Apr 20 21:12:25 UTC 2017


Sorry to land in the middle this discussion with some dumb questions...

  I'm on macOS 10.12.4 (Sierra)/Xcode 8.3.2, but was reviewing LibcxxOnOlderSystems <https://trac.macports.org/wiki/LibcxxOnOlderSystems>
after having to add `configure.cxxflags-append -std=c++11’  in gnuplot Portfile for variant qt5.

Is my understanding correct that, on Sierra, Apple clang++ isn’t using c++11 by default?
Is there, or should there be, a LibcxxOnNewerSystems page that advises making
`-std=c++11' the default?

From cxx11-1.x.tcl, it would seem that  there are hurdles to this on newer systems?
And yet, to link against qt5, it’s required?

Again, looking at qt5-1.0.tcl, I don’t see `-std=c++11’ used at.  So is what I’m doing working
for the wrong reason, perhaps?

Lots more head-scratching along these lines…  Any pointers would be appreciated!
-AM


> On Apr 19, 2017, at 9:13 AM, Mojca Miklavec <mojca at macports.org> wrote:
> 
> Posting this to the developer list, it probably got too off-topic for
> the user list.
> 
> On 19 April 2017 at 02:29, Ken Cunningham wrote:
>> 
>> After coming across this issue one too many times for my own liking, and
>> changing several dozen ports as you have done, I finally just patched clang
>> to make it default to add -stdlib=lilbc++ by default on all systems, which
>> solves this issue once and forever.
>> 
>> I do find this helps a lot with the stdlib hiccups on older systems, and i
>> plan to continue to use it, but I understand concerns about changing default
>> behaviour of compilers.  Jeremy has previously indicated privately to me
>> that he wasn't too keen on the idea due to possible unexpected consequences
>> of changing default behaviour, and this is a respectable point coming from
>> the honcho himself.
>> 
>> As a counter argument, changing one compiler default to what is the current
>> expected behaviour seems a lot easier than updating an uncertain number out
>> of 21,000 ports, some of which (WxWidgets, for example) turn out to be
>> rather messy to fix properly.
> 
> Something else just crossed my mind (though this is something for the
> developer mailing list rather than for the user list).
> 
> I just had some back-and-forth conversation about problems related to
> config.guess [1] (link is not too relevant). They sent me this link
> which might be more relevant: [2], arguing that one should probably
> use:
>    CC="clang -arch i386"
> rather than
>    CC=clang
>    CFLAGS="-arch i386"
>    LDFLAGS="-arch i386"
> 
> And some conversation with xwWidgets developers [3] which also
> suggested me to use:
>    CXX="clang -stdlib=libc++"
> rather than fighting with:
>    CXXFLAGS="-stdlib=libc++"
>    LDFLAGS="-stdlib=libc++"
> 
> The thing is that a lot of these failures happen when developers don't
> put too much attention into consistently respecting all flags. Some
> don't respect the compiler, but that's easier to spot, easier to argue
> about and much easier to test on any given 10.12 box. Testing for
> correct stdlib flags is left to weirdos still running the ancient
> boxes and includes a lot of effort in making sure that upstream fixes
> the problems. But no matter how much effort goes into this, there will
> still be a huge number of packages forgetting to add all the CXXFLAGS
> to their autoconf setup or to their manually crafted makefiles.
> 
> Changing this would be a very very very serious change, one that might
> break a number of packages, but maybe MacPorts should actually set
>    CXX="{compiler} -stdlib={stdlib}"
> in the environmental variables. Then it would most likely work better
> in many ports that currently fail.
> 
> (We might be able to afford making this change just for
> libc++-pre-10.9 setups. Still, it might get tricky.)
> 
> Mojca
> 
> 
> [1] http://lists.gnu.org/archive/html/config-patches/2017-04/msg00012.html
> http://lists.gnu.org/archive/html/config-patches/2017-04/msg00003.html
> 
> [2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Preset-Output-Variables.html
> 
> [3] https://groups.google.com/d/msg/wx-dev/fIYBMsEKIqo/TtfiEOimCAAJ

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20170420/ca7a2a6f/attachment.html>


More information about the macports-dev mailing list