Skip to content
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

Document specifying compiler path when using CMake #5339

Merged

Conversation

karkhaz
Copy link
Collaborator

@karkhaz karkhaz commented May 13, 2020

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 #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
Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better than nothing, but can we have cmake make a configure-time check and emit a helpful error if it notices we're on OSX and err.h isn't found?

@karkhaz
Copy link
Collaborator Author

karkhaz commented May 13, 2020

I did try this back when I reported the bug, but it didn't work reliably. The problem isn't that err.h doesn't exist, it's that the clang that CMake uses (sometimes) doesn't have err.h in the include path. So you would either need to run clang on a test program at configure-time (I didn't try doing that, not sure whether it's possible or idiomatic), or you would need to detect the macOS minor version number.

I was focusing on trying to fix the bug (e.g. if the minor version is >14, then override CMAKE_C_COMPILER), but that's also bad if the user wants to set a different compiler entirely. You seem to be suggesting to let it fail but to emit a warning, which could work...as long as we can reliably detect when the build would actually fail.

So in summary: I'm not sure what the fix is, it isn't as obvious as it might seem. But I'd like to document the workaround meanwhile. I can't count the number of times that I've had to point people to #4956 when they've tried to compile CBMC by following the instructions, we can remove this from the documentation when it's actually fixed.

@karkhaz karkhaz merged commit 90afd47 into diffblue:develop May 14, 2020
@karkhaz karkhaz deleted the kk-document-explicit-compiler-path branch May 22, 2020 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants