Help with UsingTheRightCompiler

Christopher Jones jonesc at hep.phy.cam.ac.uk
Fri Jul 24 19:55:17 UTC 2020


You should be setting CXX, not CC, to define the c++ compiler to use…

Chris

> On 24 Jul 2020, at 7:47 pm, Frank Schima <mf2k at macports.org> wrote:
> 
> Hi Ken,
> 
>> On Jul 23, 2020, at 10:38 PM, Ken Cunningham <ken.cunningham.webuse at gmail.com <mailto:ken.cunningham.webuse at gmail.com>> wrote:
>> 
>>> You have to use clang++ if you are calling in c++ includes.
>>> 
>>> Then it will work.
>> 
>> Having read over the other comments, and in case that wan’t clear — if you use /usr/bin/clang++ your build will automatically find the c++ includes, and you don’t need to do any of those suggestions with -isysroot or SDKROOT or xcrun etc.
>> It is presently failing because /usr/bin/clang does not automatically add the search path for the c++ includes, and <algorithm> is only in the c++ includes, not in the c includes.
> 
> Thanks for the advice. I’m having  problems implementing it though. 
> 
> I tried setting CC like so:
> 
> build.args          CC="${configure.cpp} [get_canonical_archflags cc]"
> 
> But it still does not work. Here is the resulting compiler used:
> 
> /usr/bin/cpp -arch x86_64 -Wall -g -O2 -I/opt/X11/include -DPNG -DPNG15 -Wno-write-strings -Wno-overflow -c ascii.c
> 
> Also, I don’t see clang++ in the compilers listed in https://trac.macports.org/wiki/UsingTheRightCompiler <https://trac.macports.org/wiki/UsingTheRightCompiler>. 
> 
> So I hacked it by using:
> 
> build.args          CC="/usr/bin/clang++"
> 
> And it builds! But that does not seem to be the Macports way. How can I set the compiler with Macports?
> 
> Thoughts?
> 
> 
> Cheers!
> Frank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20200724/db18967c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1930 bytes
Desc: not available
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20200724/db18967c/attachment.bin>


More information about the macports-dev mailing list