Repository navigation
Add Linux/clang build support and GitHub Actions CI - #3
Merged
Merged
Conversation
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>
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.
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.