Repository navigation
[cmake] fixes static build for macos with OpenMP enabled (fixes #6601) - #6600
Conversation
|
@microsoft-github-policy-service agree |
jameslamb
left a comment
There was a problem hiding this comment.
Thanks very much for this, and sorry for breaking builds of the static library on macOS. We probably need to add some CI coverage of that.
Could you please instead skip this entire block, by adding a NOT BUILD_STATIC_LIB into this condition?
All of this logic, like modifying RPATH entries, should be unnecessary for the static library.
|
Thanks James. Done. |
jameslamb
left a comment
There was a problem hiding this comment.
Thanks for the fix!
I pulled your branch onto my M2 mac and tested like this:
git remote add mottl git@github.com:Mottl/LightGBM.git
git fetch mottl macos_openmp_cmake_fix
cmake \
-B build \
-S . \
-DBUILD_STATIC_LIB=ON \
-DUSE_OPENMP=ON
cmake --build build --target all -j4Saw everything build successfully, with 0 warnings or errors.
[ 89%] Built target lightgbm_objs
[ 97%] Linking CXX static library /Users/jlamb/repos/LightGBM/lib_lightgbm.a
[ 97%] Building CXX object CMakeFiles/lightgbm.dir/src/application/application.cpp.o
[ 97%] Building CXX object CMakeFiles/lightgbm.dir/src/main.cpp.o
[ 97%] Built target _lightgbm
[100%] Linking CXX executable /Users/jlamb/repos/LightGBM/lightgbm
[100%] Built target lightgbm
Also inspected the library a bit and everything looked correct.
ar -t ./lib_lightgbm.a
nm ./lib_lightgbm.a|
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
Fixes #6601 with
-DBUILD_STATIC_LIB=ONon macos withUSE_OPENMPenabled