oneDAL icon indicating copy to clipboard operation
oneDAL copied to clipboard

Makefile build against official MKL and TBB possible?

Open emmenlau opened this issue 2 years ago • 1 comments

Describe the bug I'd like to build DAAL for the standard CPU (no FPGA or GPU needed). I already have the Intel oneAPI Base Toolkit in my build and would like to build DAAL against that for MKL and TBB. When I try to build, it will not use the MKL from the oneAPI Base Toolkit. Would it be possible to support that, instead of the daal-specific MKL that is a binary download from Dependencies?

Environment:

  • OS: Ubuntu 20.04 x86_64, Windows VS2019, macOS 11.6
  • Compiler: Linux Clang 14.0.1, Visual Studio 2019 with ClangCl, Apple Clang from XCode 12

emmenlau avatar Apr 08 '22 17:04 emmenlau

I have managed to change the makefile so that it will find TBB from my oneAPI installation. However this does not lead to a successful build, due to problems with linking TBB. It seems that oneDAL tries to link the static TBB when building a oneDAL DLL:

link  -nologo -map -dll  -DYNAMICBASE -NXCOMPAT tmp_build_files/work/threading_dynamic/threading_tbb.obj tmp_build_files/work/threading_dynamic/service_thread_pinner_tbb.obj __deps/mklfpk/win/lib/intel64/daal_mkl_thread.lib __deps/mklfpk/win/lib/intel64/daal_vmlipp_core.lib tmp_build_files/work/threading_dynamic/dll_tbb.res -DEF:tmp_build_files/work/threading_dynamic/onedal_thread.1_link.def -LIBPATH:tmp_build_files/release/tbb/latest/lib/intel64/vc_mt tbb12.lib tbbmalloc.lib msvcrt.lib msvcprt.lib /nodefaultlib:libucrt.lib ucrt.lib -IMPLIB:tmp_build_files/work/daal/lib/onedal_thread.1_dll.lib -out:tmp_build_files/work/daal/lib/onedal_thread.1.dll && printf '\n%s\n' 'tmp_build_files/work/daal/lib/onedal_thread.1.dll.mkdeps += makefile dev/make/cmplr.vc.mk dev/make/cmplr.dpcpp.mk dev/make/common.mk dev/make/deps.mk makefile.ver' '$(tmp_build_files/work/daal/lib/onedal_thread.1.dll.mkdeps):' 'tmp_build_files/work/daal/lib/onedal_thread.1.dll: $(tmp_build_files/work/daal/lib/onedal_thread.1.dll.mkdeps)' 'tmp_build_files/work/daal/lib/onedal_thread.1.dll.trigger = md5:4c98782cfeb420f7c7955ed2578fafe8' >> tmp_build_files/work/daal/lib/onedal_thread.1.dll.d.tmp && mv -f tmp_build_files/work/daal/lib/onedal_thread.1.dll.d.tmp tmp_build_files/work/daal/lib/onedal_thread.1.dll.d ;
cp -fp tmp_build_files/work/daal/lib/onedal_sequential.1.dll tmp_build_files/release/daal/latest/redist/intel64/onedal_sequential.1.dll
   Creating library tmp_build_files/work/daal/lib/onedal_thread.1_dll.lib and object tmp_build_files/work/daal/lib/onedal_thread.1_dll.exp
daal_mkl_thread.lib(dgeqrf_tbb_avx2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in threading_tbb.obj
daal_mkl_thread.lib(dgetrf_tbb_avx2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in threading_tbb.obj
daal_mkl_thread.lib(dorgqr_tbb_avx2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in threading_tbb.obj
daal_mkl_thread.lib(dormqr_tbb_avx2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in threading_tbb.obj
daal_mkl_thread.lib(dormrq_tbb_avx2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in threading_tbb.obj
daal_mkl_thread.lib(dpotrf_tbb_avx2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in threading_tbb.obj
daal_mkl_thread.lib(sgeqrf_tbb_avx2.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in threading_tbb.obj
[...]

emmenlau avatar Apr 20 '22 08:04 emmenlau

Anyone?

emmenlau avatar Dec 04 '22 13:12 emmenlau

In general there are no plans to support build against MKL at the moment. In theory this would be possible - our fpk lib is subset of mkl functions with added prefix, so having some tool that would extract required functions and adding prefix would create similar fpk lib. Although there is also non mkl functions in fpk lib

napetrov avatar Dec 04 '22 17:12 napetrov