Skip to content

Commit

Permalink
fix: add cycle linking for mkl_core(bazel) (#2967)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr-Solovev authored Nov 5, 2024
1 parent d4cb5f4 commit d99f184
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
15 changes: 6 additions & 9 deletions .ci/pipeline/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -534,15 +534,12 @@ jobs:
--test_thread_mode=par
displayName: 'cpp-examples-thread-release-static'
# The issue that bazel doesnt link MKL libs via -Wl, --start-group..
# oneDAL make build pass this test
# TODO: add cycle linking in bazel
# - script: |
# export DALROOT=`pwd`/bazel-bin/release/daal/latest
# bazel test //examples/oneapi/cpp:all \
# --test_link_mode=release_dynamic \
# --test_thread_mode=par
# displayName: 'cpp-examples-thread-release-dynamic'
- script: |
export DALROOT=`pwd`/bazel-bin/release/daal/latest
bazel test //examples/oneapi/cpp:all \
--test_link_mode=release_dynamic \
--test_thread_mode=par
displayName: 'cpp-examples-thread-release-dynamic'
- script: |
bazel test //cpp/daal:tests
Expand Down
13 changes: 12 additions & 1 deletion dev/bazel/deps/mkl.tpl.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,22 @@ cc_library(
"lib/libmkl_tbb_thread.a",
],
linkopts = [
# The source libraries have circular symbol dependencies. To successfully build this cc_library,
# oneMKL requires wrapping the libraries with -Wl,--start-group and -Wl,--end-group.
"-Wl,--start-group",
"$(location lib/libmkl_core.a)",
"$(location lib/libmkl_intel_ilp64.a)",
"$(location lib/libmkl_tbb_thread.a)",
"-Wl,--end-group",
"-lpthread",
"-lm",
"-ldl",
],
deps = [
":headers",
]
],
alwayslink = 1,
linkstatic = 1,
)

cc_library(
Expand Down

0 comments on commit d99f184

Please sign in to comment.