-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake build failure on macOS: __libcheck.c:4:10: fatal error: 'err.h' file not found #4956
Comments
It seems that |
Running both commands with |
Thank you! Confirming that this works: > cmake -DCMAKE_C_COMPILER=/usr/bin/clang ... You're right about the search path. I don't know why the /Library clang is being invoked, it's not on my > which clang
/usr/bin/clang
> which clang++
/usr/bin/clang++ Is the fix here to hardcode the |
Maybe from your CMake logs you can figure out how it came to pick that path? |
The logs aren't that helpful, they mention what compiler was used but don't really give a clue to why. I'm now wondering if CMake was upgraded together with my command-line tools? My CMakeVersion is 3.15.0, perhaps a new version of CMake introduced a bug where it looks in the wrong place?
|
Closing this, as I haven't made progress and it may well be a unique problem with my machine. |
I have the same issue on MacOS 10.14.5 with CMake 3.15.1. I have the "err.h" file in the exact same location as mentioned here. |
Confirming that this error exhibits on a brand-new machine running macOS 10.14.6. I still don't understand why. The workaround is still to build using > cmake -DCMAKE_C_COMPILER=/usr/bin/clang ... at some point, I'll try to change the CMake files to hardcode this path to clang if the OS version is >= 10.14.5. Unless somebody figures out what the actual problem is, but I'm pretty flummoxed. I'm also not ruling out that it's a recent CMake bug rather than a macOS Clang bug; I haven't yet bisected cmake or clang, so I'll get round to that at some stage. (if it's a CMake or upstream Clang problem, then I could at least theoretically fix it. Whereas if it's a problem with how Apple are building the Clang that they ship, then it's hopeless anyway. Whether I get time to fix this is a different matter...) |
I haven't had time to look into this, but I'll point out that I've been ramping up new CBMC users over the past few months, and they've all experienced this issue |
@chrisr-diffblue this is the macOS build issue that I mentioned. |
Thanks @karkhaz - yes, this is the same behaviour I've found. I've not entirely figured out what happens here, but I believe it is an issue with Apple's developer tools, possibly when you have a combination of CommandLineTools and XCode installed, and how Apple handle their system frameworks. I use a similar workaround ( |
I'm told that on macOS 10.14 the following command will resolve the issue: |
I am told that something like |
Yuck :-) I really don't think adding symlinks should be the way to go :-) |
Or maybe |
This commit adds a note to COMPILING.md, explaining that the full path to the compiler needs to be given to CMake in order to build on macOS. This is a workaround for the issue in diffblue#4956
This commit adds a note to COMPILING.md, explaining that the full path to the compiler needs to be given to CMake in order to build on macOS. This is a workaround for the issue in diffblue#4956
Thanks for adding the information to the documentation. I don’t believe there is much we can or should be doing this outside of documenting this behaviour though, as this is an issue with how CMake detects compilers and frameworks and as far as I can tell isn’t directly related to cbmc. @karkhaz would you be OK with closing this on those grounds? |
Tracking this internally as ADA-565 – currently not planning to do anything about it as it appears to be an issue with CMake itself, not with anything in CBMC. |
Closing this for now – this is an environmental issue that we can’t really do anything about on our end, and it’s been documented. |
[Edit] Current status: the workaround to this bug is to set the absolute path to the compiler when configuring CBMC, like this:
> cmake -DCMAKE_C_COMPILER=/usr/bin/clang ...
original bug report follows
CBMC fails to build with CMake on macOS. For some reason, building using the Makefile in the src directory works.
I've been unable to find a commit that broke this, and I also recently updated my system (both macOS itself and also the command-line tools). So I'm wondering if that was to blame. I haven't been able to find any information online about moved headers, though.
err.h
still exists:> find /Library/Developer -name err.h /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/err.h
but I don't have an older system to compare against.
Command:
My command-line tools:
> pkgutil --pkg-info=com.apple.pkg.CLTools_Executables package-id: com.apple.pkg.CLTools_Executables version: 10.3.0.0.1.1562985497 volume: / location: / install-time: 1564051272 groups: com.apple.FindSystemFiles.pkg-group
Operating system is macOS 10.14.6. Commit is
306697d6
, but I've tried starting a bisect waaaaay in the past (d201bad22
) and this still shows up even then, so I'm guessing it's an OS issue.The text was updated successfully, but these errors were encountered: