Help with UsingTheRightCompiler

Ryan Schmidt ryandesign at macports.org
Thu Jul 23 16:38:05 UTC 2020



> On Jul 23, 2020, at 11:27, Frank Schima <mf2k at macports.org> wrote:
> 
> Hi Ryan,
> 
>> On Jul 23, 2020, at 9:52 AM, Ryan Schmidt <ryandesign at macports.org> wrote:
>> 
>> On Jul 23, 2020, at 10:18, Frank Schima wrote:
>> 
>>> I’m trying to get the new Portfile ncplot to UseTheRightCompiler. It uses a primitive Makefile but not a configure file. So I added the makefile 1.0 portgroup. However, I get a build error when I do. Can anyone help?
>>> 
>>> Error is:
>>> 
>>> :info:build In file included from init.c:22:
>>> :info:build ./define.h:14:10: fatal error: 'algorithm' file not found
>>> :info:build #include <algorithm>
>>> :info:build          ^~~~~~~~~~~
>>> :info:build 1 error generated.
>> 
>> What was the clang compile line that generated that error?
>> 
>> What OS version are you using?
> 
> Catalina 10.15.6. Xcode 11.6.
> 
> /usr/bin/clang -Wall -g -O2 -I/opt/X11/include -DPNG -DPNG15 -Wno-write-strings -Wno-overflow -c ascii.c

Ah, right.

Mojave 10.14 and later doesn't provide /usr/include anymore. System headers like <algorithm> are only in the SDK now. Note the -isystem flag with the path to the SDK isn't in that compile line. MacPorts put that flag into CFLAGS, CXXFLAGS, CPPFLAGS, and a comparable one into LDFLAGS for you, so this shows you that your build system isn't respecting those variables yet. Read the makefile portgroup to see if any of the options it provides can help you. Read your project's Makefile to see how it expects those values to be supplied. The Makefile may not provide a way. If not, you'll have to patch it to make it possible.


More information about the macports-dev mailing list