Skip to content

Conversation

@talregev
Copy link
Contributor

@talregev talregev commented Jan 3, 2026

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@talregev
Copy link
Contributor Author

talregev commented Jan 3, 2026

I manage to fix it for windows and add all the dll. For linux create the MKL_LINK to static by default.

But it still don't find the mkl on linux:

-- MKL_VERSION: 2025.2.0
-- MKL_ROOT: /usr/local/share/vcpkg/installed/x64-linux-release
-- MKL_ARCH: intel64
-- MKL_LINK: None, set to ` static` by default
-- MKL_INTERFACE_FULL: None, set to ` intel_ilp64` by default
-- MKL_THREADING: None, set to ` intel_thread` by default
-- MKL_MPI: None, set to ` intelmpi` by default
-- Found /usr/local/share/vcpkg/installed/x64-linux-release/lib/libmkl_scalapack_ilp64.a
-- Found /usr/local/share/vcpkg/installed/x64-linux-release/lib/libmkl_cdft_core.a
-- Found /usr/local/share/vcpkg/installed/x64-linux-release/lib/libmkl_intel_ilp64.a
-- Found /usr/local/share/vcpkg/installed/x64-linux-release/lib/libmkl_intel_thread.a
-- Found /usr/local/share/vcpkg/installed/x64-linux-release/lib/libmkl_core.a
-- Found /usr/local/share/vcpkg/installed/x64-linux-release/lib/libmkl_blacs_intelmpi_ilp64.a
CMake Warning at /usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake:908 (_find_package):
  Found package configuration file:

    /usr/local/share/vcpkg/installed/x64-linux-release/share/mkl/MKLConfig.cmake

  but it set MKL_FOUND to FALSE so package "MKL" is considered to be NOT
  FOUND.  Reason given by package:

  The required variable OMP_LIBRARY has an invalid value
  "OMP_LIBRARY-NOTFOUND".

Call Stack (most recent call first):
  cmake/FindMKL.cmake:26 (find_package)
  /usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake:908 (_find_package)
  cmake/HandleMKL.cmake:3 (find_package)
  CMakeLists.txt:125 (include)

@talregev talregev changed the title Fix intel-mkl for dynamic [intel-mkl] Fix for dynamic Jan 3, 2026
@talregev talregev force-pushed the TalR/fix/intel-mkl branch from 4f7a5fd to 91976d2 Compare January 4, 2026 12:03
@talregev
Copy link
Contributor Author

talregev commented Jan 4, 2026

I manage to fix the error "OMP_LIBRARY-NOTFOUND" on static (linux) as well.

@talregev talregev changed the title [intel-mkl] Fix for dynamic [intel-mkl] Fix for dynamic and static Jan 4, 2026
Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this needs more attention on how to actually deal with VCPKG_LIBRARY_LINKAGE.

Comment on lines +131 to +133
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${mkl_dir}/${runtime_dir}/" DESTINATION "${CURRENT_PACKAGES_DIR}/bin/")
endif()
Copy link
Contributor

@dg0yt dg0yt Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC the port now offers DLL in addition to static libs for MSVC.
And it probably always offered shared objects in addition to static libs for non-Windows.
IOW installed binaries do not follow VCPKG_LIBRARY_LINKAGE.

Copy link
Contributor Author

@talregev talregev Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC the port now offers DLL in addition to static libs for MSVC.

Only of msvc dynamic.

Currently for non windows:
In static it offer only static libs without shared object.
In dynamic it offer only shared object without static libs.

Comment on lines -174 to 183
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/mkl/MKLConfig.cmake" "redist/\${MKL_ARCH}" "bin")
if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/mkl/MKLConfig.cmake" "define_param(MKL_LINK DEFAULT_MKL_LINK MKL_LINK_LIST)"
[[define_param(MKL_LINK DEFAULT_MKL_LINK MKL_LINK_LIST)
set(MKL_LINK "static")
]])
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/mkl/MKLConfig.cmake" "set(DEFAULT_MKL_LINK dynamic)" "set(DEFAULT_MKL_LINK static)")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/mkl/MKLConfig.cmake" "set(LIB_EXT \".so\")" "set(LIB_EXT \".a\")")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC the port used to implement VCPKG_LIBRARY_LINKAGE by forcing MKL_LINK.
After this change, it only changes the DEFAULT_MKL_LINK instead, but it overwrites LIB_EXT.
IMO the original variant was more vcpkg-ish.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous change didn't change link to static, and this change is cleaner.
You are welcome to offer practical changes that are working.

@talregev
Copy link
Contributor Author

talregev commented Jan 6, 2026

@dg0yt Are you interesting to continue this work and change as you see fit?

@talregev
Copy link
Contributor Author

talregev commented Jan 7, 2026

@vicroms @BillyONeal
Currently before my PR, the intel-mkl port is not usable.
My fix make it usable for windows and linux.
It can later take my work and continue it on other PR if needed.

@vicroms vicroms merged commit 029035b into microsoft:master Jan 7, 2026
17 checks passed
@talregev talregev deleted the TalR/fix/intel-mkl branch January 7, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants