oneapi-src / oneMKL

oneAPI Math Kernel Library (oneMKL) Interfaces
Apache License 2.0
620 stars 158 forks source link

Wrong compiler lib directory inferred in VS16 toolset v142 intergration .props/.targets files #70

Closed kkm000 closed 3 years ago

kkm000 commented 3 years ago

Summary

Part of directory path (relative) for compiler libraries hardcoded into MSBuild\Microsoft\VC\v160\Platforms\x64\PlatformToolsets\v142\ImportAfter\Intel.Libs.oneMKL.v142.props does not match actual installation directory of the compiler libraries.

Version

w_onemkl_p_2021.1.1.52_offline.exe

Environment

VS16.8.3 Building x64 target

More details

Right out of the box, after installing oneMKL package end enabling MKL in project options, the file Intel.Libs.oneMKL.v142.targets:42 issues an error about being unable to locate compiler library directory during a build attempt:

    <ICMessage Code="WRN001" Type="Warning" Arguments="oneMKLOmpLibDir;oneMKL" Condition="'$(oneMKLOmpLibDir)'==''" />

Is this the right repo to report the issue with toolchain glue files? There is an obvious typo in the .props file, easy to fix. But I cannot find the VS .props/.targets files anywhere in the open. Should I report the issue here? But since I'm already doing that, the original resolved directory is compiler/latest/windows/compiler/lib/intel64_win, the actual directory the compiler DLLs are installed is compiler/latest/windows/lib/x64.

The machine has never had any Intel MKL or related performance library product installed--maybe that's the reason? Also, I did not install any other packages except mentioned above.

Here's the fix to match the correct directory:

$ diff -U2 Intel.Libs.oneMKL.v142.props.orig Intel.Libs.oneMKL.v142.props
--- Intel.Libs.oneMKL.v142.props.orig   2021-01-06 23:40:58.705937900 -0800
+++ Intel.Libs.oneMKL.v142.props   2021-01-07 12:32:41.599610400 -0800
@@ -45,5 +45,5 @@
     <oneMKLIncludeDir>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Intel\PerfLibSuites\$(_oneMKLSubKey)\oneMKL\$(ICPlatform)', 'IncludeDir', null, RegistryView.Registry32))</oneMKLIncludeDir>
     <oneMKLLibDir>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Intel\PerfLibSuites\$(_oneMKLSubKey)\oneMKL\$(ICPlatform)', 'LibDir', null, RegistryView.Registry32))</oneMKLLibDir>
-    <_oneMKLOmpLibDir>$([System.IO.Path]::Combine($(oneMKLProductDir), ..\..\compiler\latest\windows\compiler\lib\$(IntelPlatform)_win))</_oneMKLOmpLibDir>
+    <_oneMKLOmpLibDir>$([System.IO.Path]::Combine($(oneMKLProductDir), ..\..\compiler\latest\windows\lib\$(PlatformTarget)))</_oneMKLOmpLibDir>
     <_oneMKLOmpLibDir>$([System.IO.Path]::GetFullPath($(_oneMKLOmpLibDir)))</_oneMKLOmpLibDir>
     <oneMKLOmpLibDir Condition="Exists('$(_oneMKLOmpLibDir)')">$(_oneMKLOmpLibDir)</oneMKLOmpLibDir>

I suspect it's not the right place to report the issue, but hope you might forward this internally--this VS integration script does not seem to be part of the OSS project. Thanks..

jasukhar commented 3 years ago

Hi @kkm000 ! Thanks for bringing the issue. However as you mentioned this issue is not related to open source product and more appropriate place for Intel oneMKL binary product will be a forum. While I'm closing this issue as not related to this project, I will forward it internally to responsible team.

kkm000 commented 3 years ago

Thanks for the pointer @jasukhar!