-
Notifications
You must be signed in to change notification settings - Fork 218
Fix make & cmake build errors on Arch Linux
#308
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
base: master
Are you sure you want to change the base?
Fix make & cmake build errors on Arch Linux
#308
Conversation
analyzer/CMakeLists.txt
Outdated
| include_directories(${FRONTEND_LLVM_INCLUDE_DIR}) | ||
|
|
||
| find_package(LLVM 14.0.0...<15.0.0 REQUIRED HINTS '/usr/lib/llvm14/lib/cmake/llvm') | ||
| find_package(LLVM 14.0.0...<15.0.0 REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it seems like version ranges in find_package are only available since CMake 3.19:
https://cmake.org/cmake/help/latest/command/find_package.html#basic-signature
We currently support cmake 3.4.3 and above, as specified by cmake_minimum_required:
https://github.com/NASA-SW-VnV/ikos/blob/master/analyzer/CMakeLists.txt#L41
We could potentially increase that, although there might be people depending on lower versions.
We could also have two versions of the find_package call depending on the cmake version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed version ranges in 5ab5b3a.
It looks like they were redundant, as FindLLVM.cmake returns the first LLVM version it finds, and it always begins it's search by looking for llvm-config-14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it seems like version ranges in
find_packageare only available since CMake 3.19: https://cmake.org/cmake/help/latest/command/find_package.html#basic-signatureWe currently support cmake 3.4.3 and above, as specified by
cmake_minimum_required: https://github.com/NASA-SW-VnV/ikos/blob/master/analyzer/CMakeLists.txt#L41We could potentially increase that, although there might be people depending on lower versions. We could also have two versions of the
find_packagecall depending on the cmake version.
Hello!
I'm personally having issues with the cmake 3.4.3 requirement.
Modern CMake versions will output an error if the project being built is below a minimum requirement of CMake 3.5; this specifically is causing an issue when trying to install Ikos over brew in a GitHub runner.
For example by running this commands:
cmake --version
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin" >> $GITHUB_PATH
echo >> /home/runner/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/runner/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install nasa-sw-vnv/core/ikos
mkdir ikscan && pushd ikscan
ikos-scan cmake .. -DCMAKE_POLICY_VERSION_MINIMUM=3.4.3 # <- Attempt at making it work anyway, I've tried both 3.4.3 and 3.5
ikos-scan cmake build . --config Release
popd
you end up with
# brew install
CMake Error at CMakeLists.txt:41 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
-- Configuring incomplete, errors occurred!
If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
https://github.com/nasa-sw-vnv/homebrew-core/issues
These open issues may also help:
Getting error while installing IKOS https://github.com/NASA-SW-VnV/homebrew-core/issues/19
Error: Process completed with exit code 1.
And the CMake Version in the runner is cmake version 3.31.6.
I've tried building IKOS and changing the minimum version to 3.5 and scan some test files... seems like everything is in order.
If upgrading to at least cmake_minimum_required(VERSION 3.5 FATAL_ERROR) could be considered it would be awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be ok with moving to at least 3.5, and I'd like to know what systems won't support 3.19.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that I understand what systems you are referring to specifically, however if there is any checks I could that would be useful do let me know.
Purely out of curiosity I've bumped the CMake versions to 3.19 on all the CMake files and built everything from scratch; it worked just fine on my generic and up to date Debian VM.
|
Is this ready to merge? Are any other changes needed? |
|
Hey, I apologize for abandoning this PR, I quite honestly forgot about it. It's not ready to be merged yet, there were 2 separate issues: build error in Regarding the I'm still figuring out how to determine if we should use the output generated by I'll try to push a fix for this tomorrow, or when I find it |
|
Alternatively, I think we could also use: but I think that requires the
|
|
Excuse the spam, wanted to attach a closing note: Replacing all instances of does fix all remaining issues that I have when building IKOS, but I'm quite sure this fix isn't universal to all user setups, and will likely break the |
Fixes #307
Currently still being worked on.
cmakemake