apt: add clang + llvm-dev to the full image for OpenModelica LLVM builds#52
Merged
Merged
Conversation
Adds the LLVM toolchain (clang meta-package, llvm meta-package, and
llvm-dev headers/libs/LLVMConfig.cmake) to the base image so downstream
OpenModelica builds that pass -DOM_OMC_ENABLE_LLVM=ON can find LLVM
without further provisioning.
Distro version note:
The llvm/llvm-dev/clang meta-packages resolve to the distro-default
major:
ubuntu 26.04 -> llvm-20 (>= 16, supported)
ubuntu 24.04 -> llvm-18 (>= 16, supported)
ubuntu 22.04 -> llvm-14 (< 16, OM_OMC_ENABLE_LLVM will refuse
per OMCompiler/Compiler/runtime/CMakeLists.txt:154)
debian 13 -> llvm-19 (>= 16, supported)
debian 12 -> llvm-14 (< 16, OM_OMC_ENABLE_LLVM will refuse)
The default OpenModelica build (LLVM off) is unaffected. When LLVM is
enabled and the distro-default is too old, CMake exits with a clear
'needs LLVM >= 16' message, which is the right failure mode; older
distros are not silently degraded.
Co-Authored-By: JKRT_CLAUDE <247156613+SVAGEN26@users.noreply.github.com>
AnHeuermann
requested changes
Jul 1, 2026
AnHeuermann
left a comment
Member
There was a problem hiding this comment.
clang is already part of build-deps from OpenModelica.
Do we need llvm and llvm-dev for all builds of OpenModelica or should it be an add-on like debug in https://github.com/OpenModelica/build-deps/blob/main/apt/Dockerfile#L270-L287?
Otherwise looks fine. We can merge it as soon as the build and publish step is fixed in our CI.
AnHeuermann
approved these changes
Jul 2, 2026
AnHeuermann
reviewed
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
clang,llvm, andllvm-devtoCOMMON_PKGSinapt/Dockerfileso the publishedbuild-deps:*-fullimages ship the LLVM toolchain out of the box.Motivation
The OpenModelica
revive-llvm-jitPR (#15890) and downstream LLVM work want-DOM_OMC_ENABLE_LLVM=ONto be reachable from CI without further provisioning. Today thefullimage has neitherclangnorllvm-dev, so CMake'sfind_package(LLVM 18 CONFIG …)fails on the base image and any LLVM-enabled build has to install these itself.What CMake actually needs
OMCompiler/Compiler/runtime/CMakeLists.txt:147-171requires:LLVMConfig.cmake(provided byllvm-N-dev)core orcjit mcjit executionengine transformutils ipo support irreader bitwriter native nativecodegenclang+llvm-linkreachable viaLLVM_TOOLS_BINARY_DIR(used byEXT_LLVM.compileModelToBitcodeat simulate time to lower model C to bitcode)The
llvm,llvm-dev,clangmeta-packages pull in the distro-default LLVM major with all of the above.Distro coverage
The meta-packages resolve to whatever ships natively; no third-party apt repo is added. Consequences per image in
.ci/matrix.yml:OM_OMC_ENABLE_LLVM=ONusable?The default OpenModelica build (LLVM off) is unaffected. On the two older distros, an LLVM-on build fails with a clear "needs LLVM >= 16" message rather than being silently degraded, which is the right behavior. If a follow-up wants LLVM ≥ 16 on Jammy or Bookworm, adding
apt.llvm.orgin a separate conditionalRUNis the natural next step; that is out of scope for this PR.Image size impact
llvm-N-devand the LLVM shared libs are large (~500 MB on Ubuntu 24.04). Thefullimage already carries Qt6, TeX Live, and the OpenCL stack; the delta is meaningful but not disproportionate for a base image whose purpose is "everything needed to build OpenModelica."Test plan
docker build --target full --build-arg DISTRO=ubuntu --build-arg VERSION=24.04 --tag build-deps:ubuntu-24.04 aptsucceeds.dpkg -l | grep -E 'llvm-|clang'showsllvm-18-devandclang-18(or the distro-default equivalent).apt list --installed 2>/dev/null | grep -q llvm-18-dev.revive-llvm-jitand configuring with-DOM_OMC_ENABLE_LLVM=ON -DOM_OMC_ENABLE_LLVM_JIT=ONfinds LLVM ≥ 16.docker build --target full --build-arg DISTRO=ubuntu --build-arg VERSION=22.04 --tag build-deps:ubuntu-22.04 aptstill succeeds (older LLVM installed; no build regression on the default image, onlyOM_OMC_ENABLE_LLVM=ONwould refuse there).Refs OpenModelica/OpenModelica#15890