Intel OpenCL SDK - where are the header files? - c++

I'm trying to use OpenCL on my ultrabook with Iris graphics, therefore I've installed the Intel OpenCL SDK 2013 (the one from here: http://software.intel.com/en-us/vcsource/tools/opencl-sdk).
Trying to do something with it, however I fail to find the directory where the header file (CL/cl.h) is stored... there's no include subdirectory in the install location, and also no headers in the Visual Studio / SDK folders... a search for cl.h on my C: drive also didn't give any results.
What am I doing wrong? Do I have to install anything else to get the headers?
I've only used the AMD OpenCL SDK before, there the headers are neatly located in an include subdirectory of the installation folder...

Turns out the installer didn't run through properly. The last page looked inconspicous and had a nice Finish button, but only the Runtime got installed, but not the Application SDK. The Installer says something like "Installation ended prematurely because of an error" (no more specific information as to what error it was that had occured).
The reason is that the Installer doesn't seem to like my Visual C++ 2010 Express Edition.
Deactivating the "Visual Studio (2010) integration" made the installation be successful, and made the includes turn up.

For me, it's under:
C:\Program Files (x86)\Intel\OpenCL SDK\<version>\include\CL\cl.h
Are you sure the installation was completed successfully? Do you have a bin folder under the OpenCL SDK folder?

For the current version of the SDK, it is at:
C:\Program Files (x86)\IntelSWTools\system_studio_2020\OpenCL\sdk\include
As installed by intel_sdk_for_opencl_applications_2020.3.494.zip downloaded from https://software.intel.com/content/www/us/en/develop/tools/opencl-sdk.html

Related

Visual Studio: copy installation folder and setup it up to be auto-detected by Qt Creator

I wiped out an old Windows 10 and replaced it with a new Windows 10 by ISO image.
Before wiping out, I copied the folder of Microsoft Visual Studio 2017 Community Edition on old Windows to an external hard disk:
xcopy /E "C:\Program Files (x86)\Microsoft Visual Studio" D:\
Now after reinstalling Windows 10, I copied the VS 2017 folder from external the hard disk to the C:\Program Files (x86)\ folder of new operating system.
I did so to avoid having to download VS 2017 again on new OS.
The problem is other software, like Qt Creator, cannot auto-detect the VS C/C++ compilers. I guess that's because the VS 2017 isn't added to path.
The questions are:
What path should I add to system path in order to VS 2017 to be auto-detected by other software like Qt Creator?
Is there any script which I can run to automatically integrate the VS 2017 to the rest of the operating system.
To answer the questions in your issue:
Copying the content of C:\Program Files (x86)\Microsoft Visual Studio folder is not a recommended way to install VS.
(The complete installation will not only set the Environment variables but also set the related registry keys and values. A simple copy may break this process)
So we always suggest that users install the VS by vs-installer or offline installation package. (Same like what Zlatomir suggests.)
To your actual requirements:
It seems you're just trying to use VC++ compiler in QT Creator instead of developing QT projects in Visual Studio. So build tools for VS package is enough for you.
See this related issue, if we download Build Tools for VS package with corresponding C++ workload, then we can get the compiler the QT needs. There's no need to install the VS IDE for this situation.
And if we need C++ compiler from VS2017, download the Build Tools for VS2017, if we need C++ compiler from VS2015, download the Build Tools for VS2015 Update3. Link of old version about VS Tools see here.
Update:
From the the link older downloads we can see:
Choose the download button according to which version we need. We can find both VS2017 build tools package and VS2015's there.
Usually programs on Windows don't work after you just copy the installation folder.
So right now there is little you can do to fix it, even if you partially fix, you have no way to know if something else will be broken in the future.
So the recommended solution is to download the installer again and create an offline installer for the next time this happens, you can do that by running the online installer with the following parameters: vs_community.exe --layout c:\vslayout --lang en-US (replace vs_community.exe with the actual name of the online installer file, or rename it), for more options, that might require a smaller download (example if you only need native and don't need .net) check the documentation here for the full set of options you have.

Visual Studio 2017 with CUDA cannot open include file 'cuda.h'

I am working on the Nvidia SDK with Visual Studio and I have been running into the error of this whenever I am trying to compile the sample from Nvidia:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'cuda.h': No such file or
directory AppDecPerf
c:\users\administrator\desktop\video_codec_sdk_8.1.24\samples\appdecode\appdecperf\appdecperf.cpp 12
I do have CUDA installed on my computer and it looks like I have to link it with the IDE somehow but I just cannot find 'cuda.h' file anywhere.
Any help is appreciated. Thanks!
Install cuda library( static or dynamic) for Windows in vc++ 2017 using vcpkg.exe. Use .\vcpkg integrate install to automatically link the project to your solution.
Use .\vcpkg install cuda:x64-windows-static to install.
Right click your project, choose Build Dependencies then Build Customizations. From here you can choose the version of the CUDA Toolkit that you'd like to work with (amongst other things it will add the $(CudaToolkitDir) variable, and a new CUDA C/C++ tab to the project properties). The samples from NVIDIA should already be configured this way, but I've noticed that they can break when upgrading the SDK.
Further details are available here:
https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#build-customizations-for-existing-projects

How to set the default Windows kit (SDK) version?

I used to use Windows 8.1 SDK for my C++ application, and everything's working fine. Today I installed the Windows 10 SDK and I can't find a way to make it the default one.
I can hard-code the new SDK path in the Visual Studio project settings, but that is highly undesirable. I want the new kit to be used by default for every new project.
There's no environment variable for the SDK, and I can't find anything in the registry, either.
More precisely, there are Windows SDK entries in the registry, but what I need - the C++ includes and libraries - is called the Windows Kit (located in C:\Program Files (x86)\Windows Kits).
Ok, it seems not a lot of people face thist problem, but i'll still post a workaround to set default sdk version. It worked with Visual Studio 2017 Communtity.
Consider the following situation:
You've got a solution with projects you must not retarget
You had older VS installed earlier on your PC
When you open the solution, VS sets SDK version as 8.1 for some reason, while you use Windows SDK 10
When you try to build you have the following:
Error MSB8036 The Windows SDK version 8.1 was not found. Install the
required version of Windows SDK or change the SDK version in the
project property pages or by right-clicking the solution and selecting
"Retarget solution".
because SDK 8.1 is not installed properly on your PC, and reinstalling it somewhy does not solve the problem.
Others on your team don't have such a problem as the projects don't have Windows SDK version explicitly defined inside *.vcxproj files.
So, obviusly, MS build system with multiple SDKs installed has some kind of confusion, and the worst part is that it results in defining corruptly installed SDK as your default.
I used the following workaround to set default windows SDK explicitly:
Go to [VS installment path]\Common7\IDE\VC\VCTargets
,example:
C:\Program Files (x86)\Microsoft Visual
Studio\2017\WDExpress\Common7\IDE\VC\VCTargets\Microsoft.Cpp.WindowsSDK.props)
Open file Microsoft.Cpp.WindowsSDK.props as an administrator
Find line
<DefaultWindowsSDKVersion Condition="'$(DefaultWindowsSDKVersion)' == ''
and '$(AppContainerApplication)' != 'true'">8.1</DefaultWindowsSDKVersion>
change 8.1 to the SDK version you're sure you have properly installed, then save the file.
In my case it was 10.0.17763.0, so the final line was
<DefaultWindowsSDKVersion Condition="'$(DefaultWindowsSDKVersion)' == ''
and '$(AppContainerApplication)' != 'true'">10.0.17763.0</DefaultWindowsSDKVersion>
Now reopen your solution and try to build it. Should work fine.
My first troubleshooting tips would be to uninstall all the Visual Studio stuff you have, then reboot. Then install the latest version of Visual Studio. Then install any other SDKs that you need via the Visual Studio installer wizard. If you require to have Visual Studio 2015 and 2019 installed, go ahead and install 2015 before you install 2019.
If you want to change the project templates, you can in fact do that. The folder for the default templates is here:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\ProjectTemplates\VC\WindowsDesktop\
Let's say you want to modify the ConsoleApplication template. Create a new project, in this new project edit the Project Property "SDK version" to be 8.1. Save the project and then go to Project->Export Template. Export the template. It will be a zip file in Documents\Visual Studio 2019\My Exported Templates. Unzip it.
You will notice the .vstemplate file in this folder which is similar to the found in the directory above. You will see in the node it will reference a .vcxproj file. In this .vcxproj file you will find the property:
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
Therefore in order to modify the default templates to match the template you just exported you will need to add the necessary files and lines XML from the My Exported Templates files and overwrite the defaults in Program Files. These will probably be overwritten each time you update VS tho.
Alternatively just extract the zip file of template you exported to the folder:
ProjectTemplates\VC\WindowsDesktop\
And you will find it in your templates after you reload visual studio

Where to find cuda.rule files for cuda 4.1

I am a beginner in CUDA,I am trying to run the examples given in GPU Computing SDK but it is giving me following error.
File: C:\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\C\src\vectorAdd\vectorAdd_vs2008.vcproj
Line: 22
Column: 4
Error Message:
Custom build rules file 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\NvCudaRuntimeApi.rules' was not found or failed to load.
The file 'C:\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.1\C\src\vectorAdd\vectorAdd_vs2008.vcproj' has failed to load.
Can anybody please tell what m i missing and where can I get this rules file as I am not able to find it in SDK.
Thanks,Any suggestion will be very helpful.
Have you installed the CUDA Toolkit? The "SDK" is basically a set of examples, you will need the Toolkit as well since it includes the compiler itself.
When you install the CUDA Toolkit (available here) it will install the NvCudaRuntimeApi.rules into the Visual Studio directory. If for any reason it cannot find Visual Studio (you install VS after CUDA, for instance), you can find the rules file in \extras\visual_studio_integration\rules.
Once you've installed the Toolkit and got the SDK samples working, check out this post for how to get started with your own project (or this post for VS2010).

'dxerr9.h': No such file or directory

I am trying to compile a program I took off a cd from a book that uses directx to render 3d objects. when i press compile I get the following error
C1083: Cannot open include file: 'dxerr9.h': No such file or directory
I am using VC++ 2008 Express Edition and i am running off of Vista. I went to the following folder
[edit]
C:\Program Files (x86)\Microsoft DirectX SDK (February 2010)\Include
I was able to find dxerr.h in the folder and the path is also being included in the VC++ Directories tab in the options window. dont know whats going on.
It seems your program was written using older version of DirectX SDK. The 'dxerr9.h' is present at least in "Microsoft DirectX 9.0 SDK (December 2004)", but is absent at least in "Microsoft DirectX SDK (August 2009)".
I think VitalyVal was right. about the following:
It seems your program was written using an older version of DirectX SDK. The 'dxerr9.h' is present at least in "Microsoft DirectX 9.0 SDK (December 2004)", but is absent at least in "Microsoft DirectX SDK (August 2009)".
I think the files now go by dxerr.h. I removed the 9 to the header and lib files and it worked.
That header was precisely duped in Aug2009 SDK, though that shouldn't surprise since it was already two years older DX versions had been deprecated, thus allowing for just a single library for everything.
By the way, people might be interested to check this post for a kind of more updated version.