Hi,

> On 8 Sep 2018, at 4:46 pm, Werner LEMBERG <[email protected]> wrote:
> 
> 
>> What exactly did you do to set it as the ‘default’ gcc compiler ?
>> port select ?
> 
> Yep.
> 
>> This setting has no bearing on what ports use to build, its only
>> there as a convenience for you, to define what you get as ‘gcc’ at
>> the command line.
> 
> OK, thanks.
> 
>> Also note that the gcc compilers do not use libc++ as their c++
>> runtime, but gcc default libstdc++.  Mixing both runtimes is a very
>> bad idea, so in fact using gcc is a bad choice.  No ports in
>> MacPorts will use it to build C++ sources.
> 
> OK.  BTW, I see on
> 
>  https://libcxx.llvm.org/docs/UsingLibcxx.html#using-libc-with-gcc
> 
> that gcc on MacOS actually *can* use libc++…

Oh yes. But MacPorts is not setup at all to do that, as frankly there is little 
need. clang is the default compiler on macOS since quite a while, and thus the 
focus is on using this rather than gcc.

>> No. Only one is needed for poppler.  The others are likely required
>> for the dependencies needed first, before you can instance poppler.
> 
> Indeed.  Building clang-5.0 needs three previous versions!  This is
> bad…


Not really. Each port in MacPorts is free to define which compiler it wants to 
use. Most work fine with the defaults on a given system, but sometimes they 
need to change this and for this they use the compilers blacklists and 
fallbacks options.

its perfectly fine for a mixture of compilers to be used by various ports, as 
they feel fit. The only things that matters, for c++ sources, is they all share 
the same c++ runtime.

For most users this is a non issue, as they get pre-built binaries made by the 
MacPorts builbots. Building from source is in fact rare. In your case though 
you are forcing this for everything, so you are going to just have to except 
the consequences, which is a number of different compilers will be required.

> 
> BTW, looking at
> 
>  http://llvm.org/docs/GettingStarted.html#requirements
> 
> I see that llvm can be built with gcc > 4.8 – for this I can
> definitely use my already installed gcc8, right?  It's funny that the
> native Lion compiler can build gcc8 (since it only needs a C++98
> compiler) but not the older clang-5.0…

the clang sources have always used more up to date C++ features than gcc, so 
this is not really so surprising.

> 
> So: What is the right option to enforce gcc8 for building clang-5.0?

There isn’t one. Sorry, but using gcc to build c++ sources is really not a 
focus for MacPorts.

> And what about installing clang-7.0 instead of 5.0?  Will `port'
> accept that for C++11 stuff as a default?

clang-7.0 is very very new, and as such MacPorts will not (yet) considered it 
as a fallback compiler. clang 6.0 is the newest used for that.

Chris

> 
> I can also imagine to follow this route in general (at least on Lion):
> First, you build a recent gcc version with the native Apple compiler,
> then you use it to build a recent clang version.  This would avoid the
> compilation of three intermediate clang versions that probably nobody
> needs later on.
> 
> 
>    Werner

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to