Skip to content

Fix/open mp#79

Merged
chemiskyy merged 10 commits intomasterfrom
fix/openMP
Mar 14, 2026
Merged

Fix/open mp#79
chemiskyy merged 10 commits intomasterfrom
fix/openMP

Conversation

@chemiskyy
Copy link
Member

This pull request introduces changes to improve compatibility and reliability of the build process on macOS, specifically around handling shared libraries and dynamic linking for wheel and conda builds. The most important changes are:

macOS wheel build improvements:

  • Updated the repair-wheel-command in pyproject.toml to exclude libomp.dylib from bundled shared libraries, preventing potential conflicts with system or conda-provided versions.

Dynamic library search path enhancements:

  • Expanded the INSTALL_RPATH for the _core target in simcoon-python-builder/CMakeLists.txt on Apple platforms to include multiple locations where libomp.dylib might be found, such as conda, Homebrew, and system directories, increasing the robustness of dynamic linking.

Prevent delocate from bundling libomp.dylib by adding --exclude libomp.dylib to the repair-wheel-command in pyproject.toml. Update simcoon-python-builder/CMakeLists.txt to set INSTALL_RPATH for the _core target on macOS to @loader_path, @loader_path/../../.., /usr/local/lib and /opt/homebrew/opt/libomp/lib so the wheel can find libsimcoon and system/conda/Homebrew libomp at runtime (keep BUILD_WITH_INSTALL_RPATH ON). This avoids shipping libomp in wheels and improves compatibility across CI, conda, and Homebrew environments.
Introduce a GitHub Actions workflow (fedoo-integration.yml) to run integration tests across multiple fedoo versions (0.7.0, 0.6.1, 0.6.0) and OS runners (Linux, macOS). The workflow installs system deps, builds and installs the simcoon wheel, installs fedoo, and runs tests; it also includes a macOS check to ensure libomp is not bundled. Add comprehensive pytest integration file tests/test_fedoo_integration.py exercising EPICP and Neo-Hookean behaviors, non-linear geometry, OpenMP-parallelized umat calls (including a threads parametrized test), and tangent/plasticity checks.
Add batch (Gauss-point) support to Rotation: introduce _is_batch and _voigt_* helpers, disallow converting batches to single _CppRotation, and vectorize mechanics methods (apply_stress/strain/stiffness/compliance/tensor and voigt rotation accessors) using NumPy einsum. Add unit tests covering batch operations and invariants in test_rotation.py. Integrate fedoo integration test steps into existing GitHub workflows (build.yml and ci.yml) for non-Windows runners and remove the dedicated fedoo-integration.yml workflow. Minor cleanups and docstring clarifications in tests/test_fedoo_integration.py.
Update CI workflows to install fedoo directly from the GitHub main branch instead of pinning to v0.8.0. build.yml: replace the pinned install with a git+https install and add a commented suggestion to use >=0.8.0 when released. ci.yml: add scikit-build-core, pybind11 and numpy to the install step, keep local package install, and install fedoo from the GitHub repo (with a commented line for >=0.8.0); both workflows continue to run the fedoo integration tests.
Update CI and build workflows to install fedoo from the repository's master branch instead of main. The pip install URLs in .github/workflows/build.yml and .github/workflows/ci.yml were changed from @main to @master so integration tests pull the correct branch.
@chemiskyy chemiskyy requested a review from kmarchais March 12, 2026 20:48
Copy link
Member

@kmarchais kmarchais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, when this will be merged, the main priority seems to release simcoon 1.11 so that fedoo 0.8 can be released too. Then it will be important to modify build.yml to test against the PyPI package of fedoo 0.8 and ci.yml to test against the conda package of fedoo 0.8

@chemiskyy
Copy link
Member Author

LGTM, when this will be merged, the main priority seems to release simcoon 1.11 so that fedoo 0.8 can be released too. Then it will be important to modify build.yml to test against the PyPI package of fedoo 0.8 and ci.yml to test against the conda package of fedoo 0.8

Yes, the temporary test on the fedoo pre-release branch will be updated

@chemiskyy chemiskyy merged commit 349c02a into master Mar 14, 2026
7 checks passed
@chemiskyy chemiskyy deleted the fix/openMP branch March 14, 2026 17:42
@github-project-automation github-project-automation bot moved this from Backlog to Done in simcoon 2.0 Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants