Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.

vscode remote compiler dpc++ projects failed

liu_wei67
Beginner
454 Views

Hi:

I'm using vscode to remotely compile and debug the example project array-transform code and I'm getting errors, if I don't compile it through vscode, I can compile it myself in the background and then debug it without problems. Now I want to compile it automatically before debug.
Now I have created a .vscode directory in the current directory, under which I have created both launch.json and tasks.json files. When I run it, I see that the reason for the error is that the associated static file or something is not found... But I did load oneapi's setvars.sh environment .... Also I'm curious why I have this problem of missing static files in vscode when I compile directly with cmake in the background with no problem...

Thanks

0 Kudos
6 Replies
NoorjahanSk_Intel
Moderator
424 Views

Hi,

 

Thanks for reaching out to us.

 

 

>>I'm using vscode to remotely compile and debug 

 

Could you please elaborate on the above statement?

Could you please provide the steps you have followed so that we can try it from our end?

 

Also please provide the OS details(both remote and local machine) and compiler version being used

 

Thanks & Regards,

Noorjahan.

 

NoorjahanSk_Intel
Moderator
405 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue along with the above-requested details?


Thanks & Regards,

Noorjahan.


liu_wei67
Beginner
377 Views

hi:

Sorry, I've been busy these days and forgot to reply.
This problem is solved for now, still a bit confused. You can find the steps you need to follow on the website.

 

General question.
I wanted it to compile automatically before debugging, so I added the tasks.json and launch.json files.
launch.json is debugged with gdb-oneapi, plus a hook preLaunchTask, so I wrote tasks.json.
The problem is the tasks.json file.
When I write `"command": "mkdir build && cd build && cmake . .  && make"`, I get an error when I run the debug.
If I first run it in the background via xshell.

>>> source /opt/intel/oneapi/setvars.sh
>>> mkdir build && cd build && cmake ..
Then the tasks.json file writes `"command": "cd build && make"` and runs the debug and it has no problems.

 

Intel website: https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top/ss...

 

Thanks

liu_wei67
Beginner
360 Views

hi:

local: win10

remote:  centos8.2

tools: vscode (remote ssh linux)

inteloneapi  compiler version: 2022.0.2

inteloneapi debugger version: 2021.5.0 

 

thanks

NoorjahanSk_Intel
Moderator
319 Views

Hi,

 

Thanks for providing the details.

We are working on your issue and we will get back to you soon.

 

Thanks & Regards,

Noorjahan.

 

 

Klaus-Dieter_O_Intel
243 Views

For using VS Code remotely with oneAPI it is essential that the oneAPI environment is loaded also for non-interactive shells, see https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top/ss...

You may check this outside of VS code by executing "which icx". You should see the icx path below (this shows the latest version):

 

> ssh my_remote_system which icx

/opt/intel/oneapi/compiler/2022.1.0/linux/bin/icx

 

If this does not work, please add the following to your $HOME/.bashrc script (see link above):

[ "$BASH_DATE" ] || BASH_DATE=$(date +%y%m%d.%H%M%S)

if [ -z "$SSH_TTY" ] && [ -n "$SSH_CLIENT" ]; then

  . /opt/intel/oneapi/setvars.sh --force > $HOME/log_setvars_$(hostname -s)_${BASH_DATE}.txt

  which dpcpp >> $HOME/log_setvars_$(hostname -s)_${BASH_DATE}.txt

fi

 

Using $HOME/log_setvars_$(hostname -s)_${BASH_DATE}.txt is my trick to check the execution. Alternatively you might want to redirect the output to /dev/null as shown at the link above.

 

Please find attached the JSON files I used with minor modifications. For example, my version of VS Code reported that '"comments":' is not supported. I replaced it by "//"

 

Reply