Skip to content

Build SMPGC only with COLPACK_ENABLE_OPENMP - #14

Merged
AnHeuermann merged 1 commit into
OpenModelica:masterfrom
AnHeuermann:smpgc-requires-openmp
Sep 24, 2026
Merged

AnHeuermann merged 1 commit into
OpenModelica:masterfrom
AnHeuermann:smpgc-requires-openmp

Conversation

@AnHeuermann

Copy link
Copy Markdown
Member

Purpose

COLPACK_ENABLE_OPENMP=OFF does not build where the compiler has no OpenMP headers, for example Apple clang without Homebrew's libomp:

src/SMPGC/SMPGCColoring.h:9:10: fatal error: 'omp.h' file not found

Needed for OpenModelica/OMCompiler-3rdParty#245, which turns ColPack's OpenMP off by default in OpenModelica.

Approach

SMPGC is the OpenMP-parallel coloring and includes <omp.h> unconditionally. The rest of ColPack only uses OpenMP under _OPENMP. SMPGC's sources, headers and include directory are now only added with COLPACK_ENABLE_OPENMP.

Tested on Linux (gcc) with COLPACK_ENABLE_TESTS=ON and COLPACK_BUILD_SHARED=ON:

  • OFF, with an omp.h that is an #error put first on the include path: builds, 5/5 tests pass.
  • ON: SMPGC is built as before, 5/5 tests pass.

🤖 Generated with Claude Code

SMPGC includes <omp.h> unconditionally, so COLPACK_ENABLE_OPENMP=OFF
failed to compile wherever the compiler has no OpenMP headers, such as
Apple clang without Homebrew's libomp. The rest of ColPack only uses
OpenMP under _OPENMP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnHeuermann AnHeuermann self-assigned this Sep 24, 2026
@AnHeuermann
AnHeuermann merged commit 9aae695 into OpenModelica:master Sep 24, 2026
15 checks passed
@AnHeuermann
AnHeuermann deleted the smpgc-requires-openmp branch September 24, 2026 13:52
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