Reputation: 1745
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.
Upvotes: 2
Views: 462
Reputation: 72348
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:
CCFLAGS=-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall \
-I PATH_TO_NVIDIA_TOOLKIT/include/CL -lglut -lOpenCL
PATH_TO_NVIDIA_TOOLKIT
will be /usr/local/cuda if you accept the toolkit installer defaults. The NVIDIA OpenCL libraries ship in their driver package, libOpenCL.so
should end up in a default search path and won't need an explicit search path for the linker to find it.
Upvotes: 1