code-saturne / code-saturne/code_saturne

macOS requires setting of RPATH in executable solver

Open
#142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
307
Forks
102
PR merge metrics
No merged PRs in 30d

Description

On macOS, and I suppose other BSD systems, one has to specify the `RPATH` for any third-party library used during the building of the solver because these libraries may be installed in various non-standard locations e.g. when using the Spack package manager to build the third-party libraries for `code_saturne`. In order to make this work I modified file `python/code_saturne/base/cs_case_domain.py` so that after the building of the solver is completed the code calls the `install_name_tool `utility that macOS has to add the required RPATHs to the executable.

The modification is changing the code starting from line 1007 checking if the platform is macOS and then calling this utility for each library path needed (only unique values should be used).

The modified file is attached to this issue report and it works properly on my system.

[cs_case_domain.py.zip](https://github.com/user-attachments/files/18508964/cs_case_domain.py.zip)

Contributor guide

Open the contributing guide

Research direction

Start in python/code_saturne/base/cs_case_domain.py around line 1007, where solver building completes. Review the attached modification and the macOS install_name_tool utility, including how the required library paths are collected and deduplicated. Done means the built solver has the required RPATHs for third-party libraries installed in non-standard locations on macOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.