Criterion icon indicating copy to clipboard operation
Criterion copied to clipboard

Won't build on MacOS 12.2 - wrong SDK

Open dhait opened this issue 3 years ago • 3 comments

Criterion won't build on MacOS 12.2. I am getting the following error:

../src/core/theories.c:27:10: fatal error: 'ffi.h' file not found
#include <ffi.h>

I've traced this to this line in build when I run ninja -C build :

...
-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ffi
...

I don't have this old SDK installed on my machine. The current SDK's are for MacOSX11 and MacOSX12. I cannot figure out where this is being set.

How do we point the build to the newer MacOS SDKs?

dhait avatar Feb 20 '22 16:02 dhait

I think the SDK version is determined by the toolchain that is installed in your environment (Xcode), MacOSX10.15.sdk is not hardcoded by Criterion, it was auto-detected somehow on your system.

The easiest way to install Criterion on macOS is using Homebrew: https://github.com/Snaipe/Criterion#packages

I've tested the build with the brew-packaged version of libffi, it works out of the box.

MrAnno avatar Feb 20 '22 16:02 MrAnno

Well, I've gone through all the xcode and xcrun recommendations; and none of these tools show MacOS10.15. That xcode toolchain is definitely not installed. Do you have any advice how to find where this is getting pulled from?

dhait avatar Feb 20 '22 16:02 dhait

We can verify those auto-detected paths by checking the build logs. Could you share the meson-logs directory?

Or in case you're trying to build the previous release (v2.3.3), CMakeOutput.log and CMakeError.log are the files we are looking for.

MrAnno avatar Feb 20 '22 17:02 MrAnno

I'm closing this issue due to inactivity. Feel free to reopen once you shared your Meson/CMake logs.

MrAnno avatar Jan 04 '23 15:01 MrAnno