runtimeverification / runtimeverification/llvm-backend

CMake fix for Mac building

Open
#1,181 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
43
Forks
22
PR merge metrics
No merged PRs in 30d

Description

When I try to build the LLVM backend on my M1 Mac I keep running into issues due to how CMake handles the versioning of LLVM.
In particular, the issue is with the lines below:
https://github.com/runtimeverification/llvm-backend/blob/b16e56c905b7dc4db70ac7c0ec00abc18831500d/cmake/FindLLVM.cmake#L1-L14
I have LLVM version 15.0.7 installed but for some reason this is not found by find_package(LLVM 15 QUIET CONFIG). I also tried to change it to find_package(LLVM 15...<16 QUIET CONFIG) but this also failed.
If I simply replace all of these lines by find_package(LLVM REQUIRED CONFIG) then everything works fine, so I would propose doing this change (I would have opened a PR but I don't seem to have permission to do so). Lines 15-18 will still make sure that an appropriate llvm version was selected so it feels like trying out all of these higher versions in hopes of finding the right one seems redundant. I figured this might be in place to make sure that the highest version gets selected in multiple are installed, but as far as I could tell reading online, if no version is specified the highest one will be selected by default anyway.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cmake/FindLLVM.cmake, especially lines 1-18, and review how the current find_package calls handle the installed LLVM version. Build the LLVM backend on an M1 Mac with LLVM 15.0.7 and verify that configuration succeeds and the selected LLVM version remains appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.