Intel® oneAPI Base Toolkit
Support for core tools and libraries to build and deploy high-performance data-centric applications
273 Discussions

OneAPI pstl linker error in VisualStudio 2019

VictorD
Novice
699 Views

I installed OneAPI on my Windows 10 machine and tried to build a new simple pstl project from

https://docs.oneapi.com/versions/latest/onedpl/pstl/dpcpp_policies_usage.html

 

it compiled ok, but the linker seems to not be setup properly in VisualStudio 2019 (16.9.5 - the latest).

Rebuild started...
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 ==========

 

VictorD_0-1621342931211.png

Could you possibly add instructions on how to setup VisualStudio 2019 to use with with DPCPP and TBB?

Thank you

5 Replies
VictorD
Novice
685 Views

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.

VictorD
Novice
682 Views

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.

VidyalathaB_Intel
Moderator
668 Views

Hi Victor,

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.

Regards,

Vidya

 

 

VidyalathaB_Intel
Moderator
640 Views

Hi Victor,

Reminder:

Could you please confirm us whether your issue is resolved ? so that we can close this thread from our end.

Regards,

Vidya.


VidyalathaB_Intel
Moderator
608 Views

Hi,

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.

Regards,

Vidya.


Reply