ComputeCpp not building in Visual Studio 2017

Hi,

I am new to ComputeCpp and Sycl.
I am trying to get it up and running in my Windows 10 PC using Visual Studio 2017, but facing problems.
Can you please help?

Basically I did the following:

  1. Downloaded the community edition of ComputeCpp and installed it
  2. Installed CMake.
  3. Installed the OpenCL sdk from Intel

Next,
I created a new project in Visual Studio 2017 using the ComputeCpp Sycl C++ project template.
In the Property Pages, I set the following:
General / Windows SDK Version = 10.0.17134.0 (it was 8.1 by default)
General / Platform Toolset = Visual Studio 2017 (v141) (I do not have Visual Studio 2015)

When I build using the Visual Studio IDE, I get this error:
Severity Code Description Project File Line Suppression State
Error MSB4019 The imported project ā€œC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\BuildCustomizations\ComputeCpp.propsā€ was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Please tell me if I am doing anything wrong.
How can I get it to build and run properly?

thanks,
Raj

Hi @raj,

Iā€™ve not really used Visual Studio for a while but searching for that error code does find some hits, Iā€™m not sure if theyā€™re useful or not. To make sure that everything is working as we expect, would you be able to try to use CMake to set up a project?

If you download one of our GitHub projects and try to configure that, that should let us know if everything is working correctly. There are instructions in that repo but in short:

cmake -G "Visual Studio 15 2017" -A x64

should configure things correctly. Iā€™m not sure what this would look like if youā€™re using the CMake GUI. If you try this, hopefully that will give us some more information.

Best regards,
Duncan.

Hi Duncan,
Thanks for helping.

I did in fact download the computecpp-sdk-master project from https://github.com/codeplaysoftware/computecpp-sdk

I am not familiar with CMake at all, nevertheless, I followed the steps provided in https://developer.codeplay.com/products/computecpp/ce/guides/getting-started and was in fact able to build the ā€œsamplesā€.
My steps were:

  1. Downloaded computecpp-sdk-master
  2. In command prompt, moved to the ā€˜computecpp-sdk-masterā€™ directory
  3. Created a new directory called ā€˜buildā€™ here and moved to the ā€˜buildā€™ directory
  4. Executed the command
    cmake ā€¦ -G ā€œVisual Studio 15 2017 Win64ā€ -T v141 -DComputeCpp_DIR=ā€œC:\Program Files\Codeplay\ComputeCppā€
    This created a Visual Studio solution ā€˜ComputeCpp-SDK.slnā€™
    I did not type ā€˜makeā€™ in the command prompt. Instead, opened the ā€˜ComputeCpp-SDK.slnā€™ in Visual Studion 2017. I was able to build and run ā€˜simple-vector-addā€™ project from within Visual Studio.

Hope the above gave you some clues as to why creating a new project using ComputeCpp Sycl C++ project template fails to build for me.

Hi Raj,

Thatā€™s good, that means that your Visual Studio install is working normally and can work with ComputeCpp. Iā€™m afraid I donā€™t really have any pointers for the issue that youā€™re experiencing currently, itā€™s definitely possible that itā€™s an issue in our templates however.

That being said, an upcoming release of ComputeCpp will support Visual Studio 2019, and my colleagues have made a couple of changes to the templates with that in mind. Would you be able to try that when itā€™s released? The announcement should mention 2019 support.

Until then, I would always recommend our CMake support, as it is capable of producing build files for many systems, and we know it works and can maintain it much more easily. The file FindComputeCpp.cmake can be used to enable ComputeCpp in CMake projects. I can understand if thatā€™s not an option, however, if youā€™re not already acquainted.

Best regards,
Duncan.

Dear Duncan,

Yes, I will wait for the ComputeCpp support on Visual Studio 2019.

And in the meantime, I will try to learn and use CMake in my current environment.

Thanks a lot.

best regards

Raj

1 Like

Hi,
I was able to use CMake to create and build a simple vector addition project from scratch.

The command I used was:
\build>cmake ā€¦ -G ā€œVisual Studio 15 2017 Win64ā€ -T v141 -DComputeCpp_DIR=ā€œC:\Program Files\Codeplay\ComputeCppā€
\build>cmake build ā€¦

Thanks a lot for your help.

But now, I have one more question:
How can I use cmake to create a Visual Studio 2019 solution?

best regards
Raj

Did the command

cmake ā€¦ -G ā€œVisual Studio 15 2017 Win64ā€ -T v141 -DComputeCpp_DIR=ā€œC:\Program Files\Codeplay\ComputeCppā€

Not result in the VS solution file being generated in that directory?

VS2019 support will come with the next release which will be made available on Monday or Tuesday next week.

Hi,

Sorry if I was unclear.

The command

cmake ā€¦ -G ā€œVisual Studio 15 2017 Win64ā€ -T v141 -DComputeCpp_DIR=ā€œC:\Program Files\Codeplay\ComputeCppā€

successfully created a VS solution file.

I just wanted to know the command string for VS2019.

Best regards
Raj

Hi @raj,

This generator should work: Visual Studio 16 2019 Win64

Hi @raj, Weā€™ve now released the latest ComputeCpp that now provides support and templates for VS2019.
You can get it on our developer website.

Thank you very much!