First thing you need to do is run clinfo and see if you agree with its output.
Second thing is to go to /opt/AMDAPPSDK-3.0/samples/opencl and cmake everything under there. All the code is c++. This is to verify your installation.
I decided to uninstall everything and reinstall again.
Installed in the path "/opt/AMDAPPSDK-2.9-1/"
When i go to "/opt/AMDAPPSDK-2.9-1/samples/opencl", i run the command cmake -G "Unix Makefiles"
sudo cmake -G "Unix Makefiles"
[sudo] password for alexandrefreitas:
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
linked by target "AtomicCounters" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/AtomicCounters
linked by target "BasicDebug" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BasicDebug
linked by target "BinarySearch" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BinarySearch
linked by target "BinomialOption" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BinomialOption
linked by target "BinomialOptionMultiGPU" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BinomialOptionMultiGPU
linked by target "BitonicSort" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BitonicSort
linked by target "BlackScholes" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BlackScholes
linked by target "BlackScholesDP" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BlackScholesDP
linked by target "BoxFilter" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BoxFilter
linked by target "BoxFilterGL" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BoxFilterGL
linked by target "BufferBandwidth" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BufferBandwidth
linked by target "BufferImageInterop" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/BufferImageInterop
linked by target "DCT" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/DCT
linked by target "DeviceFission" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/DeviceFission
linked by target "DeviceFission11Ext" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/DeviceFission11Ext
linked by target "DwtHaar1D" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/DwtHaar1D
linked by target "VectorAddition" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/DynamicOpenCLDetection
linked by target "FastWalshTransform" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/FastWalshTransform
linked by target "FloydWarshall" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/FloydWarshall
linked by target "FluidSimulation2D" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/FluidSimulation2D
linked by target "GaussianNoiseGL" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/GaussianNoiseGL
linked by target "HelloWorld" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/HelloWorld
linked by target "Histogram" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/Histogram
linked by target "ImageBandwidth" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/ImageBandwidth
linked by target "ImageOverlap" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/ImageOverlap
linked by target "KernelLaunch" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/KernelLaunch
linked by target "KmeansAutoclustering" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/KmeansAutoclustering
linked by target "LUDecomposition" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/LUDecomposition
linked by target "Mandelbrot" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/Mandelbrot
linked by target "MatrixMulImage" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/MatrixMulImage
linked by target "MatrixMultiplication" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/MatrixMultiplication
linked by target "MatrixTranspose" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/MatrixTranspose
linked by target "MemoryModel" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/MemoryModel
linked by target "MonteCarloAsian" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/MonteCarloAsian
linked by target "MonteCarloAsianDP" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/MonteCarloAsianDP
linked by target "MonteCarloAsianMultiGPU" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/MonteCarloAsianMultiGPU
linked by target "NBody" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/NBody
linked by target "PrefixSum" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/PrefixSum
linked by target "QuasiRandomSequence" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/QuasiRandomSequence
linked by target "RadixSort" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/RadixSort
linked by target "RecursiveGaussian" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/RecursiveGaussian
linked by target "Reduction" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/Reduction
linked by target "ScanLargeArrays" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/ScanLargeArrays
linked by target "SimpleConvolution" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/SimpleConvolution
linked by target "SimpleGL" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/SimpleGL
linked by target "SimpleImage" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/SimpleImage
linked by target "SimpleMultiDevice" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/SimpleMultiDevice
linked by target "SobelFilter" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/SobelFilter
linked by target "StringSearch" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/StringSearch
linked by target "Template" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/Template
linked by target "TransferOverlap" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/TransferOverlap
linked by target "URNG" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cl/URNG
linked by target "AsyncDataTransfer" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/AsyncDataTransfer
linked by target "ConcurrentKernel" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/ConcurrentKernel
linked by target "CplusplusWrapper" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/CplusplusWrapper
linked by target "DwtHaar1DCPPKernel" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/DwtHaar1DCPPKernel
linked by target "EigenValue" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/EigenValue
linked by target "FFT" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/FFT
linked by target "GaussianNoise" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/GaussianNoise
linked by target "HDRToneMapping" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/HDRToneMapping
linked by target "HistogramAtomics" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/HistogramAtomics
linked by target "IntroStaticCPPKernel" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/IntroStaticCPPKernel
linked by target "MatrixMulDouble" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/MatrixMulDouble
linked by target "MatrixMultiplicationCPPKernel" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/MatrixMultiplicationCPPKernel
linked by target "MersenneTwister" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/MersenneTwister
linked by target "SoAversusAoS" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/SoAversusAoS
linked by target "SobelFilterImage" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/SobelFilterImage
linked by target "TransferOverlapCPP" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/TransferOverlapCPP
linked by target "UnsharpMask" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/UnsharpMask
linked by target "URNGNoiseGL" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/cpp_cl/URNGNoiseGL
linked by target "ConstantBandwidth" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/benchmark/ConstantBandwidth
linked by target "GlobalMemoryBandwidth" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/benchmark/GlobalMemoryBandwidth
linked by target "LDSBandwidth" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/benchmark/LDSBandwidth
linked by target "MemoryOptimizations" in directory /opt/AMDAPPSDK-2.9-1/samples/opencl/benchmark/MemoryOptimizations
-- Configuring incomplete, errors occurred!
See also "/opt/AMDAPPSDK-2.9-1/samples/opencl/CMakeFiles/CMakeOutput.log".
Interesting. What is the value of OPENCL_LIBRARIES in your CMakeCache.txt?
Should be: /opt/AMDAPPSDK-2.9.1/lib/x86_64/libOpenCL.so
You will probably need to reinstall your SDK. This time uninstall from AMD_APP_SDK_Installation_Notes2.pdf and download a fresh copy of the sDK.
Inside the folder "/ opt / AMD APP SDK-2.9.1 / lib / x86_64 /" there is only libOpenCL.so.1 and not libOpenCl.so, is there any difference?
When I open the CmakeCAche.txt file, OPENCL_LIBRARIES parameter is "NOT FOUND", so I tried to assign value to this libOpenCL.so.1, but he does not accept and continues as "NOT FOUND".
This is how did the first time, I remember now.
At that point, I created a symbolic link:
sudo ln -s /opt/AMDAPPSDK-2.9-1/lib/x86_64/libOpenCL.so.1 libOpenCL.so
And so I can assign a value to the parameter OPENCL_LIBRARIES, the build works now, and the codes in C as well.
But the codes in C ++ still want to not work, displays that same initial problem
Well, that link should be there from installation. Try reinstalling a fresh SDK after unistalling the old one from Installation notes.
You should try removing -DUNIX and -DDEBUG from your Cflags.
All the samples also include <CL/cl.hpp> and build OK. You can check their sources.
Thank you nibal, now work.
The solution was created that link, and looked at the examples in C ++. Now it works great.