I installed OneAPI on my Windows 10 machine and tried to build a new simple pstl project from
it compiled ok, but the linker seems to not be setup properly in VisualStudio 2019 (16.9.5 - the latest).
1>------ Rebuild All started: Project: DPCPPConsoleApplication1, Configuration: Release x64 ------
1>LINK : : error LNK1104: cannot open file 'tbb12.lib'
1>dpcpp: : error : linker command failed with exit code 1104 (use -v to see invocation)
1>Done building project "DPCPPConsoleApplication1.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Could you possibly add instructions on how to setup VisualStudio 2019 to use with with DPCPP and TBB?
I figured out the issue. When using the Intel Compiler, under Configuration Properties, under Intel Libraries for OneAPI, Use OneTBB setting needs to be set to Yes. Then in VisualStudio Run, the application runs successfully, and compiles successfully.
Setup of VisualStudio projects seems to work well when its a new Intel DPC++ project, where everything is setup properly. However, a previously setup VisualStudio project that was not setup as a new DPC++ project, doesn't seem to be setup to link with TBB properly, even when TBB property is set to true. It seems that headers #include <oneapi/dpl/execution> can't be found.
Thanks for reaching out to us.
>> I figured out the issue, Use OneTBB setting needs to be set to Yes
Exactly, before compiling any project that includes TBB libraries in visual studio please make sure that Intel oneAPI Threading Building Blocks is enabled in your Visual studio setup in order to get rid of the tbb linking errors which you have mentioned previously and glad to know that you have figured it out.
>> It seems that headers #include <oneapi/dpl/execution> can't be found.
If you are using Intel OneAPI DPC++ Compiler then you will not get any issues regarding the dpl headers.
But if we use Intel Compiler 19.2 or Intel compiler 2021 then we need to provide the path of the header files explicitly in Visual Studio setup under
>> configuration properties -> VC++ Directories -> Include Directories
to avoid such kind of errors.
Please do let us know if you face any issues.
We are closing this thread assuming your issue has been resolved.
We will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread.
Any further interaction in this thread will be considered community only.