Skip to content

Build ColPack without OpenMP by default - #245

Merged
AnHeuermann merged 2 commits into
OpenModelica:masterfrom
AnHeuermann:colpack-no-openmp
Sep 24, 2026
Merged

AnHeuermann merged 2 commits into
OpenModelica:masterfrom
AnHeuermann:colpack-no-openmp

Conversation

@AnHeuermann

Copy link
Copy Markdown
Member

Purpose

Fixes the Alpine sanity check of OpenModelica (seen in OpenModelica/OpenModelica#16864). Every simulation executable failed to link:

ld: .../libSimulationRuntimeC.so: undefined reference to `__kmpc_dispatch_deinit'

Cause

Since b36ca1e, ColPack is built with OpenMP whenever it is found. SimulationRuntimeC links ColPack publicly, so libSimulationRuntimeC.so links the OpenMP runtime, and generated simulation code links against it without -fopenmp. On Alpine 3.24, clang is clang 22, but openmp-dev is libomp 18.1.8. Since LLVM 19, clang emits __kmpc_dispatch_deinit, which libomp 18 does not have.

Approach

OpenMP only parallelises ColPack's SMPGC, which OpenModelica does not use. COLPACK_ENABLE_OPENMP now defaults to OFF. -DCOLPACK_ENABLE_OPENMP=ON still enables it.

Built locally (gcc, Linux) with COLPACK_ENABLE_OPENMP=OFF: libSimulationRuntimeC.so no longer depends on libgomp/libomp and has no undefined omp_*, __kmpc_* or GOMP_* symbols.

Existing build directories keep a cached COLPACK_ENABLE_OPENMP=ON from b36ca1e until it is reset.

🤖 Generated with Claude Code

OpenMP only parallelises SMPGC, which OpenModelica does not use. With
it, libSimulationRuntimeC.so links the compiler's OpenMP runtime, and
simulation executables link against that without -fopenmp. On Alpine
3.24, clang 22 emits __kmpc_dispatch_deinit, which the packaged libomp
18 lacks, so every simulation failed to link.

COLPACK_ENABLE_OPENMP=ON still enables it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With COLPACK_ENABLE_OPENMP=OFF, SMPGC failed to compile on macOS, where
Apple clang has no omp.h.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnHeuermann
AnHeuermann merged commit 0ba7be7 into OpenModelica:master Sep 24, 2026
6 checks passed
@AnHeuermann
AnHeuermann deleted the colpack-no-openmp branch September 24, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant