One example program that I am trying to run has the compiling option as following from makefile.
ATISTREAMSDKROOT=/home/david/src/ati-stream-sdk-v2.0-lnx64
CC=gcc
CCFLAGS=-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall \
-I$(ATISTREAMSDKROOT)/include -L$(ATISTREAMSDKROOT)/lib/x86_64 -lglut -lOpenCL
But I’m using Nvidia’s OpenCL implementation, so I’m going to change the option to like this.
CC=gcc
CCFLAGS=-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall \
-I ~/NVIDIA_GPU_Computing_SDK/OpenCL/common/inc/ -lglut -lOpenCL
Could you tell me whether it is right or not? BTW, I could not find the correct path for the “-L” option for NVIDIA which corresponds with ATI’s.
Somewhat confusingly, NVIDIA’s GPU computing SDK isn’t really an SDK at all, it is just a collection of example programs written in CUDA and OpenCL. It doesn’t contain the necessary headers and libraries required to build and run OpenCL programs (the same applies to CUDA).
You will find what you are looking for in the NVIDIA GPU computing toolkit, whose release versions contain their OpenCL headers. Your compilation command should probably be something like:
PATH_TO_NVIDIA_TOOLKITwill be /usr/local/cuda if you accept the toolkit installer defaults. The NVIDIA OpenCL libraries ship in their driver package,libOpenCL.soshould end up in a default search path and won’t need an explicit search path for the linker to find it.