Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
419 Discussions

Cannot compile any sample or autogenerated project with VS 2022

famastefano
Beginner
2,350 Views

Hello,

I've installed the oneAPI base toolkit (2022.1), with the extensions for VS 2022.

But after trying to compile a sample project, or even the autogenerated one via New Project -> DPC++ -> Console Project, it fails to link:

 

2> Target "Link" in file "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Platforms\x64\PlatformToolsets\Intel(R) oneAPI DPC++ Compiler 2022\Toolset.targets":
2>  Task "SYCLLink"
2>    C:\Program Files (x86)\Intel\oneAPI\compiler\2022.1.0\windows\bin\dpcpp-cl.exe /Fe"C:\Users\fama\source\repos\Base_Vector_Add\x64\Debug\vector-add-usm.exe" "x64\Debug\vector-add-usm.obj" /Zi /WX- /MDd /nologo
2>    dpcpp: : error : unable to execute command: program not executable
2>    dpcpp: : error : linker command failed with exit code 1 (use -v to see invocation)
2>  Done executing task "SYCLLink" -- FAILED.

 

How can I fix this problem?

 

Labels (2)
0 Kudos
13 Replies
SeshaP_Intel
Moderator
2,302 Views

Hi,

 

Thank you for posting in Intel Communities.

 

Could you please provide the following details so that we can reproduce the issue at our end?

1. The sub version of Visual Studio you are using? Example: VS 2022 17.0.0

2. The Operating system & its version you are using?

3. Could you please run the below commands to check the DPC++ compiler version and provide us with the screenshot of the output

 

"C:\Program Files (x86)\intel\oneAPI\setvars.bat"

dpcpp --version

4. Also, could you please confirm if you have followed the same steps to run the application as mentioned in the below link?

 

https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-hpc-linux/top/run-a-sample-project-with-vscode.html

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
famastefano
Beginner
2,246 Views

Hello!

Here's the informations you've requested:

  1. Microsoft Visual Studio Professional 2022 (64-bit) - LTSC 17.2 Version 17.2.8
  2. Windows 10 Pro 21H2 19044.2006
  3. Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.1.0.20220316)
    Target: x86_64-pc-windows-msvc
    Thread model: posix
    InstalledDir: C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm
  4. Regarding your link, that's VS Code on Linux, I'm using VS 2022 on Windows
    The procedure I've followed is:
    1. Open VS 2022
    2. On the menubar, Extensions -> Intel -> Browse oneAPI code samples...
    3. Select 'Base Vector Add'
    4. Build solution

Maybe I should repair the oneAPI installation?

0 Kudos
famastefano
Beginner
2,247 Views

Hello!

Here's the information you've asked:

  1. Microsoft Visual Studio Professional 2022 (64-bit) - LTSC 17.2 Version 17.2.8
  2. Windows 10 Pro 21H2 19044.2006
  3. Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.1.0.20220316)
    Target: x86_64-pc-windows-msvc
    Thread model: posix
    InstalledDir: C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm
  4. Your link is for VSCode on Linux, I use VS 2022 on Windows
    The steps I've done are:
    1. New Project -> DPC++ Console Application
    2. Inside the project properties I've enabled TBB
    3. Try to compile this single program:

      #include <oneapi/tbb.h>

      int main()
      {

      }

For the samples, I've used the extension provided by Intel for VS 2022 to generate a sample project "Base Vector Add", but didn't work either.

I've also repaired the installation, but it didn't solve the issue.

0 Kudos
famastefano
Beginner
2,246 Views

Hello!

Here's the information you've asked:

  1. Microsoft Visual Studio Professional 2022 (64-bit) - LTSC 17.2 Version 17.2.8
  2. Windows 10 Pro 21H2 19044.2006
  3. Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.1.0.20220316)
    Target: x86_64-pc-windows-msvc
    Thread model: posix
    InstalledDir: C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm
  4. Your link is for VSCode on Linux, I use VS 2022 on Windows
    1. The steps I've done are:
    2. New Project -> DPC++ Console Application
    3. Inside the project properties I've enabled TBB
    4. Try to compile this single program:
      #include <oneapi/tbb.h>

      int main()
      {

      }


For the samples, I've used the extension provided by Intel for VS 2022 to generate a sample project "Base Vector Add", but didn't work either.

I've also repaired the installation, but it didn't solve the issue.

 

P.S.

That's the 3rd time I've posted this reply, as the forum displays my reply but after a refresh it's gone...

0 Kudos
SeshaP_Intel
Moderator
2,204 Views

Hi,


Thanks for providing the information.


Could you please try the below steps and let us know if you are able to run sample programs successfully using the command line?

1. Open "Intel oneAPI command prompt for Intel 64 for Visual Studio 2022" and execute the below command:

oneapi-cli


2. And please follow the steps provided in the below link.

https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-hpc-linux/top/run-a-sample-project-using-the-command-line.html


Please let us know if it works.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
famastefano
Beginner
2,191 Views

Hello,

thanks for your reply.

 

Unfortunately, it didn't work.

The sample project is created successfully, the program compiles but still fails during the linking phase.

The "getting started" link you've provided is for Linux users, I am not. I use Windows 10 and Visual Studio.

 

I wanted to add that on my personal workstation that I have at home, I had no issues with TBB, and I also didn't need to do anything else after installing the components via Intel oneAPI Online Installer.

I'll try to reinstall all the components and check if the problem persists.

0 Kudos
SeshaP_Intel
Moderator
2,146 Views

Hi,


Sorry for the inconvenience. For windows, you can refer to the below link for building and running a sample project using the command line:

https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-hpc-windows/top/run-a-sample-project-using-the-command-line.html


Could you please try the steps mentioned in the link above and let us know if it works?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
famastefano
Beginner
2,125 Views

Hello,

if I follow the steps of that link, it works.

Sadly, this doesn't solve my problem as I can't compile it inside Visual Studio.

I don't understand what kind of problem it has, maybe the environment doesn't initialize properly when creating a DPC++ project?

The real strange thing is that I can't reproduce this problem at home because on my PC I can compile everything without problems, but on my company's workstation, I can't.

0 Kudos
SeshaP_Intel
Moderator
2,073 Views

Hi,


It seems to be an Integration issue between Visual studio & Intel oneAPI toolkits.

So, could you please try uninstalling the Visual Studio and Intel oneAPI toolkits and re-install them?


Note: You need to install Visual Studio before installing Intel oneAPI Toolkits.

Please refer to the below links for more details.


https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html#gs.duokvg

https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit.html#gs.duors3


Thanks and Regards,

Pendyala Sesha Srinivas



0 Kudos
famastefano
Beginner
2,046 Views

Sadly, reinstalling Intel oneAPI didn't work.

 

I'm sorry but reinstalling Visual Studio is not a solution for me, I can't lose hours because your tool simply doesn't work.

I'll see if it will be possible to use it via CMake, otherwise I'll simply use another library.

I don't understand why on my PC works flawylessly while at work doesn't, even after reinstalling it.

I even have the same extensions installed in both, the only difference is that at work I have VS 2017/2019/2022, while at home I only have VS 2022, but I'm not going to reinstall them to see if it's an issue or not.

0 Kudos
SeshaP_Intel
Moderator
2,004 Views

Hi,


We understand there is a problem with VS integration. 

Could you please try with below steps and let us know what you have found so that we can investigate more your issue?


1. Press win+R on your keyboard.

2. Type cmd in the run application and press enter.

3. Run the following command in the command prompt to initilialize the oneAPI environment

"C:\Program Files (x86)\Intel\oneAPI\setvars.bat"

4. Check the dpcpp version using the following command and let us know the output you have got.

dpcpp --version

5. Run the following command in the command prompt 

oneapi-cli

6. Click on enter for the following commands

Create a project

cpp

Base: Vector Add

7. At the project destination, click on Create and Quit

8. Run the following commands in the command prompt

cd vector-add\src

dpcpp vector-add-buffers.cpp /EHsc

vector-add-buffers.exe


Please try the above steps and let us know where you have faced the problem with a complete error log or a screenshot of the output.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
1,880 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
1,604 Views

Hi,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Reply