Visual Studio 2013 OpenCL header file not found error [duplicate] - c++

I am currently using Intel's OpenCL SDK platform for heterogeneous parallel programming (OpenCL). I am using Visual Studio 2010 Ultimate for this. My system doesn't have any GPU in it. I have worked on CUDA SDK platform for opencl programming. This the first time I am using Intel's OpenCL SDK for opencl programming.
I have tried some basic platform, device, context identifying/creating/defining codes from 'OpenCL in Action' book. They all worked fine. So we can consider that visual studio is properly configured.
Now, I am trying to build a 'Hello World' program in visual studio which gives me following error:
Error MSB3721: The command ""C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86\ioc32.exe" -cmd=build -input="E:\Menu\Google\programs\1code\feb\10feb2014\OpenCL\OpenCL\hello.cl" -output="Debug\hello.out" -VS -device=CPU -simd=default -bo=" "" exited with code -1073741511. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\IntelOpenCL.targetS
Now my questions are:
What is the significance of this 'Error MSB3721'?
Is this a programming related error or something is wrong with the 'OpenCL + Visual Studio' configuration?
I am trying to be as specific as possible in this question. Let me know if I have not providing enough information and help me out. I really appreciate your concern.

I don't know what it is, but i had the same problem when there was some *.cl file in my project. Just remove it from project (not from disk)! Anyway you will be able to read your source from this *.cl file, but when this file presents in project it causes en error. I don't know why.

I think the cause of the error is Intel codebuilder configuration or infinite loop in .cl file.
Please check if your error can be resolved by below two changes.
If you build your project as the Codebuilder project (e.g. Empty Opencl Project for Windows),
1-1. Right click your project and select properties
1-2. Select OpenCL Code Builder tab
1-3. If your device is configured as Intel(R) CPU (-device=CPU), then change it to your GPU device (e.g. Intel(R) Graphics (-device=GPU) in my case)
If you face the same error, then check if your .cl file contains the infinite loop such as while(1) or for(;;)

I've got the same error. Changing solution platform from x32 to x64 fixed it (I've got x64 machine).

Related

How do I solve the Visual studio 2019 'invalid profile ms_6_5' error when building a solution?

Specs are Window 10 Pro, VS 2019.16.8.3, MS DX12 shader samples.
I installed VS2019 just for this project to migrate my shader efforts into.
1>D3D12MeshletGenerator.cpp
3>dxc failed : Unknown argument: '-Qembed_debug'
2>FXC : error : invalid profile ms_6_5
This:
D3D12_FEATURE_DATA_D3D12_OPTIONS7 comes up undefined in the cpp source file.
What is odd is I was getting file extraction errors in the standard explorer zip extraction but not in 7zip. In both cases this profile error comes and I am not sure how to fix.
I am looking at this in two ways:
Are there problems with the source files or am I missing something in the VS profile area of Visual Studio configuration or usage experience?
I hope I have included everything to make this request clear and enable expeditious recovery.
Thank you in advance.
You need to install the Windows 10 SDK (19041).
D3D12_FEATURE_DATA_D3D12_OPTIONS7 was added to d3d12.h for this release.
The DXIL Compiler (DXC.EXE which unfortunately Visual Studio still calls 'FXC' in the output) was updated to support amplification & mesh shaders,
To install the new SDK you need to run the Visual Studio Installer and then select the optional component Windows 10 SDK (19041).
For reasons I'm not privy to, it only shows up under the UWP workload and in individual components. It's not visible under the "Game Development for C++" or "Desktop development with C++".

How can I solve the directory problem of cplex in eclipse?

[enter image description here][1]I'm developing a c++ code on eclipse and i need cplex.
#include "ilcplex/ilocplex.h".
I have made this passages:
- project\properties\C/C++ built\Settings\GCC C++ compiler\Includes:
"C:\Program Files\IBM\ILOG\CPLEX_Studio126\cplex\include"
-project\properties\C/C++ built\Settings\MinGW C++ Linker\libraries:
"C:\Program Files\IBM\ILOG\CPLEX_Studio126\cplex\include\ilcplex"
and the library seems to be ok, since if i use f3 it works.
Despite this, it continues to give me this message:
fatal error: ilcplex/ilocplex.h no such file or directory.
I have tried to follow the instructions of the other similar posts, but nothing changed.
Can you please help me?
Even if you fix the error you are getting now, using CPLEX with gcc on Windows is not something that is supported, and it's likely you'll just run into another error. If you look at the detailed system requirements for CPLEX on Windows, you will see that Visual Studio 2015 or Visual Studio 2017 is required. You should take a look at the c_cpp.html file that gets installed with CPLEX for instructions on how to set up the Visual Studio environment when working with C/C++ projects.

Unable to debug c++ code in Visual Studio Code

I've just installed Visual Studio Code v1.7.1 to write my c++ code in for my degree. My programming level is pretty basic, but I like what I've seen of VS Code so far, save for the fact that I've no idea how to debug or build my code.
I've looked at a few questions on the topic, such as: How do I set up VSCode to compile C++ code?
and have tried implementing some of these into the tasks.json file, including the make command and the g++ command, but when I try and execute it I get the error:
'make' is not recognized as an internal or external command,
operable program or batch file.
or something similar. When I try running the debugger, it tells me to set up the launch.json file, so I entered the path of my file where it says 'program' as the instructions imply, I get the error
Unknown Error: 0x800700c1
I'm just looking for the simplest option that will allow me to write and debug code in vs code, in a manner similar to using the full version of visual studio, but without the heavy project filing system or the 10 minute loading times. Any help would be greatly appreciated.
What I deduce from your question and the comments is that you have no actual C++ compiler/buildchain installed. There are multiple compilers available (like minGW, GCC).
However, what Microsoft recommends is the following:
Installing C/C++ build tools
To obtain your set of C/C++ compilers on Windows you can grab the Visual C++ build tools SKU. By default these tools are installed at ‘C:\Program Files (x86)\Microsoft Visual C++ Build Tools’.
I have not tested, nor ever worked with the Visual C++ compiler, but it's probably the easiest way to get started right away.

When compiling makefile project in Visual Studio Express 2012, the .exe does not work in Windows Server 2003

As an extension on one of my earlier projects that required printing PDF files from command line, I now need to print them duplex.
Therefore I have found an open source piece of software called SumatraPDF and added a patch using Visual Studio Express 2012 that enables duplex settings in command line and compiled. This software works completely on Windows 7 64bit however on Windows Server 2003 64bit it returns an error message:
C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe is not a valid Win32 application.
I have found examples on the internet of others having this issue when compiling applications using VSE2012 and have tried to follow the advice given. This being to change the project platform to Windows XP (v110_xp) after installing VS Service Pack 3, however to do this I would have to change the project configuration type from Makefile to Application (.exe) and after testing this causes errors during compilation.
I have now also implemented #Hans advice with the same result.
If anyone can help I would be most appreciative.
Thanks.
NB - I have looked at other questions regarding this subject and did not feel any supplied me with a solution, apologies if I have overlooked it.

How do I start a CUDA app in Visual Studio 2010?

Direct Question: How do I create a simple hello world CUDA project within visual studio 2010?
Background: I've written CUDA kernels. I'm intimately familiar with the .vcproj files from Visual Studio 2005 -- tweaked several by hand. In VS 2005, if I want to build a CUDA kernel, I add a custom build rule and then explicitly define the nvcc call to build the files.
I have migrated to Win 7, and VS 2010 because I really want to try out nSight. I have nSight 1.5 installed. But this is where I'm totally lost. If I proceed as before, nvcc reports that it only supports msvc 8.0 & 9.0. But the website clearly states that it supports VS 2010.
I read somewhere else that I need to have VS 2008 (msvc 9.0) also installed -- my word. Doing so now.
But I'm guessing that at least part of my problems stem from the homegrown custom build tool specifications. Several websites talk about adding a *.rules file to the build, but I've gathered that this is only applicable to VS 2008. Under "Build Customizations" I see CUDA 3.1 and 3.2, but when I add kernels to the project they aren't built. Another website proclaims that the key is three files: Cuda.props Cuda.xml Cuda.targets, but it doesn't say how or where to add these files -- or rather I'll gamble that I just don't understand the notes referenced in the website.
So does anyone know how to create a simple project in VS 2010 which builds a CUDA kernel -- using either the nSight 1.5 setup or the NvCudaRuntimeApi.v3.2.rules file which ships with the CUDA 3.2 RC?
Thanks in advance! I'd offer a bounty, but I only have 65 points total.
CUDA TOOLKIT 4.0 and later
The build customisations file (installed into the Program Files\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations directory) "teaches" Visual Studio how to compile and link any .cu files in your project into your application. If you chose to skip installing the customisations, or if you installed VS2010 after CUDA, you can add them later by following the instructions in Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\extras\visual_studio_integration.
Create a new project using the standard MS wizards (e.g. an empty console project)
Implement your host (serial) code in .c or .cpp files
Add the NVIDIA build customisation (right click on the project, Build customizations, tick the relevant CUDA box)
See note 1 if using CUDA 4.0
Implement your wrappers and kernels in .cu files
If you added .cu files before the build customisations, then you'll need to set the type of the .cu files to CUDA C/C++ (right-click on the file, Properties, set Item Type)
Add the CUDA runtime library (right click on the project and choose Properties, then in Linker -> Input add cudart.lib to the Additional Dependencies)
Then just build your project and the .cu files will be compiled to .obj and added to the link automatically
Incidentally I would advocate avoiding cutil if possible, instead roll your own checking. Cutil is not supported by NVIDIA, it's just used to try to keep the examples in the SDK focussed on the actual program and algorithm design and avoid repeating the same things in every example (e.g. command line parsing). If you write your own then you will have much better control and will know what is happening. For example, the cutilSafeCall wrapper calls exit() if the function fails - a real application (as opposed to a sample) should probably handle the failure more elegantly!
NOTE
For CUDA 4.0 only you may need to apply this fix to the build customisations. This patch fixes the following message:
The result "" of evaluating the value "$(CudaBuildTasksPath)" of the "AssemblyFile" attribute in the element is not valid
This answer applies to CUDA 3.2, from 4.0 onwards CUDA supports the VC 10 compiler directly, see other answers for more information
You need either VS 2008 or the 6.1 Windows SDK installed. That's because NSight 1.5 RC or the CUDA 3.2 SDK use the VC 9 compiler under the hood. I've got this working successfully with 2008 installed and am told it should work with the SDK but haven't tried.
With NSight 1.5 and/or the CUDA 3.2 SDK you shouldn't need to muck with any custom build rules. I've been there and it's painful. With the latest builds all that goes away:
Create your VC++ project.
Add a .CU file to it.
Select the project file in the Solution Explorer.
Open Project | Build Customizations...
Check the "CUDA 3.2 (.targets,
.props)" customization.
Select a .CU file in your project and hit Alt-Enter to show it's properties.
Make sure it's Item Type is set to "CUDA C/C++"
It should just build. Let me know if this helps and if you run into problems as this is from memory.
The good news it getting CUDA working with VS 2010 just got much easier.
Ade
BTW: I'll update my blog post.
Another Good tutorial here:
http://www.stevenmarkford.com/installing-nvidia-cuda-with-visual-studio-2010/
if you get an error about '<' note this step (from a previous answer):
If you added .cu files before the build customisations, then you'll need to set the type of the .cu files to CUDA C/C++ (right-click on the file, Properties, set Item Type)
But if you follow their steps, it should work!