this package uses openmp, clang needs -fopenmp to link this#4139
this package uses openmp, clang needs -fopenmp to link this#4139pinkenburg merged 1 commit intosPHENIX-Collaboration:masterfrom
Conversation
📝 WalkthroughWalkthroughBuild configuration updates for TPC dEdx calibrations module: include path changed from standard (-I) to system include (-isystem) flag; compiler flags expanded to add OpenMP support and supplementary warnings (-Wshadow, -Wextra). Changes
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
jenkins is acting up - merging this PR to get the clang build back to work |
4a20dee
into
sPHENIX-Collaboration:master
|
@pinkenburg I looked at the code, and I don't think it actually uses any open MP functionality |
|
@hupereir sure - please go ahead. It is annoying that whatever links against libtrack_reco needs to be compiled with this flag under clang (libtrack_reco really should build this dependency into the library). The best solution is to remove a non existing dependency on libtrack_reco (I didn't check for this) |
This allows to remove openmp configuration flag, introduced in sPHENIX-Collaboration#4139
This allows to remove openmp configuration flag, introduced in sPHENIX-Collaboration#4139
Types of changes
What kind of change does this PR introduce? (Bug fix, feature, ...)
clang needs an explicit -fopenmp if linking libraries which use OpenMP. jenlins does not pass clang compilation errors on, so this problem managed to get past us.
TODOs (if applicable)
Links to other PRs in macros and calibration repositories (if applicable)
Summary
Motivation & Context
This PR addresses a linking issue when building the TPC dEdx calibration package with the clang compiler. The package uses OpenMP, which requires explicit -fopenmp linking support. While gcc handles this implicitly, clang requires the flag to be explicitly specified during compilation and linking. The issue was previously masked in Jenkins builds.
Key Changes
configure.ac:
Makefile.am:
Potential Risk Areas
ac_cv_prog_gxx = yes(detecting g++ specifically). If clang is being used as the C++ compiler, this condition may not trigger properly, potentially leaving the clang build without the required -fopenmp flag. This should be verified on actual clang builds.Possible Future Improvements
Note: AI analysis may contain errors; the implementation of the compiler condition should be carefully verified to ensure clang builds actually receive the -fopenmp flag as intended.