Conversation
|
For reference, these are the libs I see on my Linux machine: LibraryProduct("libmkl_avx2", :libmkl_avx2),
LibraryProduct("libmkl_avx512_mic", :libmkl_avx512_mic),
LibraryProduct("libmkl_avx512", :libmkl_avx512),
LibraryProduct("libmkl_avx", :libmkl_avx),
LibraryProduct("libmkl_blacs_intelmpi_ilp64", :libmkl_blacs_intelmpi_ilp64),
LibraryProduct("libmkl_blacs_intelmpi_lp64", :libmkl_blacs_intelmpi_lp64),
LibraryProduct("libmkl_blacs_openmpi_ilp64", :libmkl_blacs_openmpi_ilp64),
LibraryProduct("libmkl_blacs_openmpi_lp64", :libmkl_blacs_openmpi_lp64),
LibraryProduct("libmkl_blacs_sgimpt_ilp64", :libmkl_blacs_sgimpt_ilp64),
LibraryProduct("libmkl_blacs_sgimpt_lp64", :libmkl_blacs_sgimpt_lp64),
LibraryProduct("libmkl_cdft_core", :libmkl_cdft_core),
LibraryProduct("libmkl_core", :libmkl_core),
LibraryProduct("libmkl_def", :libmkl_def),
LibraryProduct("libmkl_gf_ilp64", :libmkl_gf_ilp64),
LibraryProduct("libmkl_gf_lp64", :libmkl_gf_lp64),
LibraryProduct("libmkl_gnu_thread", :libmkl_gnu_thread),
LibraryProduct("libmkl_intel_ilp64", :libmkl_intel_ilp64),
LibraryProduct("libmkl_intel_lp64", :libmkl_intel_lp64),
LibraryProduct("libmkl_intel_thread", :libmkl_intel_thread),
LibraryProduct("libmkl_mc3", :libmkl_mc3),
LibraryProduct("libmkl_mc", :libmkl_mc),
LibraryProduct("libmkl_pgi_thread", :libmkl_pgi_thread),
LibraryProduct("libmkl_rt", :libmkl_rt),
LibraryProduct("libmkl_scalapack_ilp64", :libmkl_scalapack_ilp64),
LibraryProduct("libmkl_scalapack_lp64", :libmkl_scalapack_lp64),
LibraryProduct("libmkl_sequential", :libmkl_sequential),
LibraryProduct("libmkl_tbb_thread", :libmkl_tbb_thread),
LibraryProduct("libmkl_vml_avx2", :libmkl_vml_avx2),
LibraryProduct("libmkl_vml_avx512_mic", :libmkl_vml_avx512_mic),
LibraryProduct("libmkl_vml_avx512", :libmkl_vml_avx512),
LibraryProduct("libmkl_vml_avx", :libmkl_vml_avx),
LibraryProduct("libmkl_vml_cmpt", :libmkl_vml_cmpt),
LibraryProduct("libmkl_vml_def", :libmkl_vml_def),
LibraryProduct("libmkl_vml_mc2", :libmkl_vml_mc2),
LibraryProduct("libmkl_vml_mc3", :libmkl_vml_mc3),
LibraryProduct("libmkl_vml_mc", :libmkl_vml_mc), |
|
Yeah, I'm doing the same. Apart from the |
|
How do I define a list of products that depends on the platform? |
|
Pass different |
It's not that aren't there, they can't be dlopened. For example: https://dev.azure.com/JuliaPackaging/Yggdrasil/_build/results?buildId=3800&view=logs&j=efce48f3-28a1-5321-70aa-c183c50cb11b&t=744a09f2-d2b5-5d6c-521a-0384a7fbb802&l=401 Looping over all the libraries shows that this symbol is defined in some of the mkl libraries but |
| if should_build_platform(triplet(Windows(:i686))) | ||
| products = products_win32 | ||
| elseif should_build_platform(triplet(Windows(:x86_64))) | ||
| products = products_win64 | ||
| elseif should_build_platform(triplet(Linux(:x86_64))) | ||
| products = products_linux | ||
| else | ||
| products = products_macos | ||
| end |
There was a problem hiding this comment.
I think this works only if building for one platform at the time (which happens to be the case with our CI system now), not if building for all them together. If the products are different for all platforms, you literally need separate calls to build_tarballs
|
I think this is not going to work anyway for Linux because |
|
I'm trying to think how to go about this. My idea was to only add Honestly, I don't know which one we should pick up. Given the names of these libraries this looks like something that should be determined dynamically at runtime. Just for the sake of trying it, I did but this still failed to dlopen: julia> using Libdl; dlopen("./libmkl_gnu_thread.so")
ERROR: could not load library "./libmkl_gnu_thread.so"
./libmkl_gnu_thread.so: undefined symbol: mkl_blas_dgemm_blk_info_bdzso I looked for the missing symbol and patched In this way I've been able to dlopen julia> using Libdl; dlopen("./libmkl_core.so")
Ptr{Nothing} @0x0000000004b08ba0
julia> using Libdl; dlopen("./libmkl_gnu_thread.so")
Ptr{Nothing} @0x000000000423b250
julia> using Libdl; dlopen("./libmkl_intel_lp64.so")
Ptr{Nothing} @0x0000000002788f40Again, I don't know which of the libraries we should use for |
|
My interpretation is that those symbols are missing intentionally and the libraries are not linked together intentionally because the user is expected to pick the right combination for their architecture and application. I wonder if we should create "combined" shared libs for the various combinations, e.g., I worry that patching the libraries will break certain combinations. |
Yes, that's my feeling too |
|
Is this necessary? I thought most libraries will link to |
|
In an ideal world we shouldn't do this, but MKL is a mess |
|
We are increasingly seeing issues with openblas performance (mostly with its multi-threading), hence I am paying more attention to making it easy to use MKL ecosystem wide. |
|
But at least OpenBLAS comes with a single library, you load that and you're done. MKL has some dozens of libraries, different on each operating system, and you can't even load all of them because some will freak out in some cases. But then third-party libraries will need some of the not-yet-loaded MKL libraries, so what to do? 🤷 Without further intelligence in the library wrappers we are out of luck, or the users will need to sort out loading of the library themselves, good luck with that |
|
I'd love to get this to work but I'm not sure how. Some packages want to link against a bunch of the MKL libs, e.g., https://github.com/JuliaPackaging/Yggdrasil/pull/2144/files#diff-4601b0a333dde98a8dcb9e4897622fa2fe292d3940e4454e51f3653f89c22347R21. I thought one way would be to create a "super-library" for each platform, that simply links to a consistent subset of the MKL, and export that. |
|
With LBT coming to base, we will have a clean way to use MKL (hopefully). |
|
What's LBT? |
Created in a bit of a haste. Not sure it's necessary to export all libs.