Saturday, 7 September 2013

Cuda - Undefined symbols for architecture x86_64 OS X

Cuda - Undefined symbols for architecture x86_64 OS X

Here is my make file output:
nvcc -c -arch=sm_35 src/kmeans_cuda.cu
nvcc -c -arch=sm_35 src/sequence.c
nvcc -c -arch=sm_35 src/io.c
nvcc -c -arch=sm_35 src/main.c
nvcc -g -o cuda-means kmeans_cuda.o sequence.o io.o main.o
Undefined symbols for architecture x86_64:
"_kmeans", referenced from:
_main in main.o
(maybe you meant: cudaError (anonymous
namespace)::cudaLaunch<char>(char*))
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [all] Error 1
On my main function i call kmeans();, kmeans, is a C function defined in
kmeans_cuda.cu
void kmeans() {
long i,h,j,k; //counters
long delta; //Number of objects has diverged in current iteration
long nearest; //Nearest centroid
unsigned int distance,min_distance; //distance calculated by relation
point-cluster
int *count,*recv_count;
int *send_label;
double begin,end,trans_init,trans_end;
// should call kernel, but is not calling yet, because it's not
implemented ...
I already try to added __host__ on kmeans() declaration, but dind't fixed
the problem. I have now idea why i'm getting this error, because i'm
linking the object with the function.

No comments:

Post a Comment