- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am compiling a very simple program using SYCL, which should be able to run on any Windows machine.
Here it is:
#include <CL/sycl.hpp>
#include <iostream>
using namespace sycl;
const std::string secret {
"Ifmmp-!xpsme\"\012J(n!tpssz-!Ebwf/!"
"J(n!bgsbje!J!dbo(u!ep!uibu/!.!IBM\01"
};
const auto sz = secret.size();
int main(int argc, char* argv[]) {
queue Q;
char* result = malloc_shared<char>(sz, Q);
std::memcpy(result, secret.data(), sz);
Q.parallel_for(sz, [=](auto& i) {
result[i] -= 1;
}).wait();
std::cout << result << "\n";
return 0;
}
I work with Visual Studio Code, I have Intel OneAPI installed on my computer and the plug-ins specific to VS Code have been added.
If I compile it from VS Code by typing dpcpp main.cpp -o main.exe in the VS Code terminal, it compiles fine. If I run it from the VS Code terminal, it works fine too.
However, if I run the executable directly from any command prompt, an error tells me that the file "sycl.dll" is missing. If I add the .dll to my executable's folder, it runs... but doesn't show me anything in the terminal.
What should I do to be able to run it anywhere on my computer, but especially to have an executable usable on any Windows machine without having to install anything on it?
In advance, I thank you for your help.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
>>an error tells me that the file "sycl.dll" is missing
You are observing this error because you did not initiate the Intel OneAPI environment, before running that executable. It's mandatory to source the environment in the same session.
Could you please try sourcing the setvars.bat script in the same session where you want to run the executable?
You can find the script fine in the below path:
C:\Program Files (x86)\Intel\oneAPI\setvars.bat
Hope this helps to resolve your issue. If not, please provide the compiler version being used to run the program.
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your answer.
Running the executable inside an Intel oneAPI command prompt will perfectly work, however I cannot run it inside a normal command prompt, even if I run setvars.bat inside the same command prompt before.
This is what is inside my current folder : main.exe, setvars.bat and setvars-vcvarsall.bat.
First, I am running setvars.bat and I obtain the following output:
:: initialising oneAPI environment...
Initializing Visual Studio command-line environment...
Visual Studio version 16.11.11 environment configured.
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\"
Visual Studio command-line environment initialized for: 'x64'
:: oneAPI environment intiialized ::
If I run the main.exe directly after that, it is still telling me that sycl.dll is missing. If I add sycl.dll to the folder, the program will execute (apparently), but won't print the desired output, and won't print any error message either.
My objective by doing this is to obtain a portable executable that will work on another Windows 10 machine where I cannot install anything, but only execute a program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please try to source the setvars.bat file from the below location and then run your executable.
C:\Program Files (x86)\Intel\oneAPI\setvars.bat
Please refer to the below screenshot for more details:
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>>My objective by doing this is to obtain a portable executable...
We are working on this issue. We will get back to you soon.
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
The problem is likely due to dynamic library dependency.
Although you copied sycl.dll to your work directory, sycl.dll may depend on a lot other dynamic libraries which cannot be found.
Can you try to install the compiler runtime to the target computer ?
You can find it in the following page,
https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html
Install the suitable version for your computer from "Runtime Versions".
Please let us know if this can fix the issue.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page