Hi
I am trying to run the Opencl version of kmeans but getting some linking errors while running.
kmeans_clustering.o: In function kmeans_clustering': kmeans_clustering.c:(.text+0x7d2): undefined reference to
clCreateBuffer’
kmeans_clustering.c:(.text+0x814): undefined reference to clCreateBuffer' kmeans_clustering.c:(.text+0x85a): undefined reference to
clCreateBuffer’
kmeans_clustering.c:(.text+0x88f): undefined reference to clSetKernelArg' kmeans_clustering.c:(.text+0x8b0): undefined reference to
clSetKernelArg’
kmeans_clustering.c:(.text+0x8d1): undefined reference to clSetKernelArg' kmeans_clustering.c:(.text+0x8f1): undefined reference to
clSetKernelArg’
kmeans_clustering.c:(.text+0x911): undefined reference to clSetKernelArg' kmeans_clustering.o:kmeans_clustering.c:(.text+0x931): more undefined references to
clSetKernelArg’ follow
kmeans_clustering.o: In function kmeans_clustering': kmeans_clustering.c:(.text+0xbb6): undefined reference to
clEnqueueNDRangeKernel
This is my Makefile
OPENCL_OPTS = -I ~/NVIDIA_GPU_Computing_SDK/OpenCL/common/inc/ -L ~/NVIDIA_GPU_Computing_SDK/OpenCL/common/lib/ -l OpenCL
DFLAGS = -D_USE_ATOMIC_PRAGMA_
DFLAGS =
OPTFLAGS = -O2
INCFLAGS =
CFLAGS = $(OPENCL_OPTS) $(OPTFLAGS) $(DFLAGS) $(INCFLAGS) -pg
LDFLAGS = -lm -pg
CC = cc -g -non_shared -taso -DANSI -D__STDC__
CC = gcc
CC = icc -openmp
H_FILES = fuzzy_kmeans.h
SRC = fuzzy_kmeans.c
cluster.c
kmeans_clustering.c
example.c
OBJ = $(SRC:%.c=%.o)
.c.o:
$(CC) $(CFLAGS) -c $<
all: example
example: $(OBJ) $(H_FILES)
$(CC) $(OPTFLAGS) -o example $(OBJ) $(LDFLAGS)
Please someone help me…