Skip to content

Add Linux/clang build support and GitHub Actions CI - #3

Merged
suisarbre merged 1 commit into
mainfrom
feat/linux-clang-ci
Sep 2, 2026
Merged

suisarbre merged 1 commit into
mainfrom
feat/linux-clang-ci

Conversation

@suisarbre

Copy link
Copy Markdown
Owner

setup.py hardcoded MSVC flags (/O2 /std:c++17 /openmp), so the extension could not build with clang or gcc. Flags are now chosen in a build_ext subclass from compiler.compiler_type, giving MSVC and GCC/Clang each their own set. CPP_ENGINE_NO_OPENMP=1 builds a single-threaded engine for toolchains without OpenMP, e.g. Apple clang without libomp.

optimizer.cpp included <omp.h> unconditionally and called omp_get_thread_num() to seed per-thread RNGs, which broke any non-OpenMP build. Guarded with _OPENMP and a fallback returning 0.

CI builds and tests on ubuntu-latest with clang plus libomp-dev, and on windows-latest with MSVC. test_supertrend_calculation is deselected as a known pre-existing failure; test_execute_optimization_logic_cpp passes because the extension is built first.

Verified: clang 19 in a python:3.12-slim container builds the module and runs 82 passed, 1 skipped, 31 subtests passed. MSVC rebuild on Windows imports and passes both parity suites.

setup.py hardcoded MSVC flags (/O2 /std:c++17 /openmp), so the extension
could not build with clang or gcc. Flags are now chosen in a build_ext
subclass from compiler.compiler_type, giving MSVC and GCC/Clang each their
own set. CPP_ENGINE_NO_OPENMP=1 builds a single-threaded engine for
toolchains without OpenMP, e.g. Apple clang without libomp.

optimizer.cpp included <omp.h> unconditionally and called
omp_get_thread_num() to seed per-thread RNGs, which broke any non-OpenMP
build. Guarded with _OPENMP and a fallback returning 0.

CI builds and tests on ubuntu-latest with clang plus libomp-dev, and on
windows-latest with MSVC. test_supertrend_calculation is deselected as a
known pre-existing failure; test_execute_optimization_logic_cpp passes
because the extension is built first.

Verified: clang 19 in a python:3.12-slim container builds the module and
runs 82 passed, 1 skipped, 31 subtests passed. MSVC rebuild on Windows
imports and passes both parity suites.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@suisarbre
suisarbre merged commit adf494b into main Sep 2, 2026
2 checks passed
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