Make all error "undefined reference to"

264 views
Skip to first unread message

Yufei Wang

unread,
Jun 28, 2016, 5:05:05 PM6/28/16
to Caffe Users
I'v encounter make all error I am unable to resolve

:~/caffe$ make all
CXX/LD -o .build_release/tools/convert_imageset.bin
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_scal<double>(int, double, double*)'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_asum<float>(int, float const*, float*)'
.build_release/lib/libcaffe.so: undefined reference to `cudaEventDestroy'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_dot<double>(int, double const*, double const*, double*)'
.build_release/lib/libcaffe.so: undefined reference to `cudaMemcpy'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_asum<double>(int, double const*, double*)'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_axpy<double>(int, double, double const*, double*)'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_dot<float>(int, float const*, float const*, float*)'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_axpy<float>(int, float, float const*, float*)'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_set<double>(int, double, double*)'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_scal<float>(int, float, float*)'
.build_release/lib/libcaffe.so: undefined reference to `cudaEventElapsedTime'
.build_release/lib/libcaffe.so: undefined reference to `cudaGetErrorString'
.build_release/lib/libcaffe.so: undefined reference to `cudaEventSynchronize'
.build_release/lib/libcaffe.so: undefined reference to `cudaEventCreate'
.build_release/lib/libcaffe.so: undefined reference to `void caffe::caffe_gpu_set<float>(int, float, float*)'
.build_release/lib/libcaffe.so: undefined reference to `cudaEventRecord'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_imageset.bin] Error 1

Only 2 things I changed in Makefile.config are:

# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1

and

# CUDA directory contains bin/ and lib/ directories that we need.
#CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
CUDA_DIR := /usr

Yufei Wang

unread,
Jun 29, 2016, 4:39:40 PM6/29/16
to Caffe Users
Solved by Delete Caffe and re clone and build it. 
Reply all
Reply to author
Forward
0 new messages