I have installed computecpp on windows 10 using VS 2017,and included the AMD’s opencl path to the Iinclude files and the linker but Visual studio shows the following errors
Severity Code Description Project File Line Suppression State
Error MSB3721 The command ““C:\Program Files\Codeplay\ComputeCpp\bin\compute++.exe” -D_SIZE_T_DEFINED -Wno-ignored-attributes -fdiagnostics-format=msvc -sycl -O2 -nobuiltininc -I"c:\program files (x86)\Microsoft Visual Studio 12.0\VC\include” -I"c:\program files (x86)\Microsoft Visual Studio 12.0\atlmfc\include" -I"C:\Program Files\Codeplay\ComputeCpp\include" -I"C:\Program Files\Codeplay\ComputeCpp\include\image_library" -I"C:\Users\PontiacGTX\source\repos\ComputeCpp SYCL C++1\ComputeCpp SYCL C++1\" -I"C:\Program Files (x86)\AMD APP SDK\3.0/include" -I"…/…/…/…/…/include/SDKUtil" -I"…/…/…/…/…/include" -I"C:\Program Files\Codeplay\ComputeCpp\include" -I"C:\Program Files\Codeplay\ComputeCpp\include\image_library" -I"C:\Users\PontiacGTX\source\repos\ComputeCpp SYCL C++1\ComputeCpp SYCL C++1\" -o"C:\Users\PontiacGTX\source\repos\ComputeCpp SYCL C++1\ComputeCpp SYCL C++1\main.sycl" -c main.cpp " exited with code 1. ComputeCpp SYCL C++1 C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\ComputeCpp.targets 60
Hi PontiacGTX,
I would suggest trying the following guide which explains how to properly setup ComputeCpp on Windows environment. Make sure you retarget the Visual Studio (2017) Solution to VS15 by changing the Platform Toolset from v141
to v140
. Here is a How To on StackOverflow.
If you don’t have Platform Toolset - v140
as an option, you have to open the vs_installer
and modify the installation of your Visual Studio 2017 to include it.
Could you share with us if this works for you?
Regards,
Georgi
Tried using the same toolset but it doesnt work
i believe has to do how the include path-directory and libraries directory should be set on your project
But i tried adding it but only get the error in the first post
Hi,
Are you sure you are setting the correct path to the AMD-APP-SDK
OpenCL include directory (the one with the CL/
folder inside? Then make sure you add the library directory path, and then link the actual OpenCL library.
If you are completely sure you have done that, maybe try to clone the computecpp-sdk and try and build it using CMake
.
Build guide:
In the root create a build/
folder and in that folder call the following depending on your Visual Studio version. At the moment you need to have the VS2015 Platform Toolset installed. Tested with VS15 and VS17.
If using Visual Studio 15:
cmake .. -G "Visual Studio 14 Win64" -DComputeCpp_DIR="C:\Program Files\Codeplay\ComputeCpp"
And for your case, using Visual Studio 17:
cmake .. -G "Visual Studio 15 2017 Win64" -T v140 -DComputeCpp_DIR="C:\Program Files\Codeplay\ComputeCpp"
This should work and build the sample code in the SDK. Following the approach used in the SDK, which uses CMake
, you can get started with creating your personal projects.
Best,
Georgi
well I added again just the directory for AMD APP SDK and now the error that remains is possibly that looks for a Visual studio 2015 folder
pats hould be
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include
or
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\atlmfc\include
edit now the program compiles
I have added to the include directory
C:\Program Files (x86)\AMD APP SDK\3.0\include
and opened ComputeCpp SYCL C++2.vcxproj with notepad and wrote the correct directory for VS2017
<DeviceAdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include;$(COMPUTECPP_ROOT_DIR)\include;$(COMPUTECPP_ROOT_DIR)\include\image_library;$(ProjectDir)</DeviceAdditionalIncludeDirectories>
<DeviceAdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include;$(COMPUTECPP_ROOT_DIR)\include;$(COMPUTECPP_ROOT_DIR)\include\image_library;$(ProjectDir)</DeviceAdditionalIncludeDirectories>