Ken Cunningham ken.cunningham.webuse at
Sun Jun 28 23:13:52 UTC 2020

> libffi
> Curtis Matz curtis at  <>
> Sun Jun 28 19:37:49 UTC 2020
> Previous message (by thread): faust-devel <>
> Next message (by thread): Noah port (and alternatives?) <>
> Messages sorted by: [ date ] <> [ thread ] <> [ subject ] <> [ author ] <>
> I’ve installed libffi but I’m trying to compile and it says it can’t find ffi.h.  How do I tell my compiler which happens to be gcc9 to look in /opt/local for the header file?
> > port installed | grep libffi
>   libffi @3.2.1_0 (active)
> src/rtlib/thread_call.c:33:10: fatal error: ffi.h: No such file or directory
>    33 | #include <ffi.h>
>       |          ^~~~~~~
> compilation terminated.
> make: *** [src/rtlib/obj/darwin-x86_64/thread_call.o] Error 1

I take it you are trying to build your own software using stuff from MacPorts and it doesn’t work.

Homebrew always “just worked” but MacPorts does not. Sadly, you are the second person so far in as many weeks to ask how the heck to actually use macports :>

For better or worse, richer or poorer, MacPorts has tucked all it’s software away in a hidden directly that no software ever looks in without being told to. That is __better__. That is __harder__. Sometimes __much_harder__. That’s because MacPorts was designed 20 years ago by software engineers who knew what they were doing, and knew how to do it right. It is safer/more secure/just better to do it this way.

It’s also 1000x harder for users, which is why the competition has done so frighteningly well with an mostly vastly inferior product (that everyone can use).

You need to set up your bulld to use MacPorts. The easiest way to see how is to try to configure any good port using “sudo port -d configure XYZ”, and see what MacPorts does for you behind the scenes


DEBUG: Environment: 
CFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64'
CPPFLAGS='-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk'
CXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64'
F90FLAGS='-pipe -Os -m64'
FCFLAGS='-pipe -Os -m64'
FFLAGS='-pipe -Os -m64'
INSTALL='/usr/bin/install -c'
LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64'
OBJCFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64'
OBJCXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64'


Most of that, except the PERL and POD2MAN probably, is what you need to put into your environment with individual commands, a shell script, etc.

And if you’re trying to do that with Xcode — well please tell us all how. That’s really hard.

But better!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list