clCaffe install-error : Linking CXX executable caffe-fp16.bin

25 views
Skip to first unread message

Poplar Giant

unread,
Apr 22, 2019, 11:19:48 PM4/22/19
to Caffe Users
I met a link error when installing clCaffe, follow https://github.com/01org/caffe/wiki/clCaffe
here is the detail information
===============================================================================================
lib paths
===============================================================================================
a@a-Z170-D3H:build$ ls /home/a/PerfTool/clCaffe/dep_libs/include/
clBLAS-complex.h  clBLAS.h  clBLAS.version.h  isaac  viennacl

a@a-Z170-D3H:build$ ls /home/a/PerfTool/clCaffe/dep_libs/lib/
cmake  libisaac.so

a@a-Z170-D3H:build$ ls /home/a/code/viennacl-dev/build/libviennacl/
CMakeFiles  cmake_install.cmake  libviennacl.so  Makefile

a@a-Z170-D3H:build$ echo $LD_LIBRARY_PATH
/usr/loca/lib/:/home/a/PerfTool/clCaffe/opencv/lib:/home/a/code/viennacl-dev/build/libviennacl/:


===============================================================================================
Makefile.config
===============================================================================================
a@a-Z170-D3H:build$ cat ../Makefile.config
# Contributions simplifying and improving our build system are welcome!

# 32 bit / 64 bit indexing
# USE_INDEX_64 := 1

# GreenTea (ViennaCL/OpenCL) backend switch

# Enable the CUDA backend
# USE_CUDA := 1

# Enable the OpenCL/Greentea backend
USE_GREENTEA := 1
DISABLE_DEVICE_HOST_UNIFIED_MEMORY := 0
# Enable the Greentea-LibDNN convolution backend
# USE_LIBDNN := 1

# Enable the Intel spatial convolutions
USE_INTEL_SPATIAL := 1

# Folder of the ViennaCL header-only library
VIENNACL_DIR := /home/a/PerfTool/clCaffe/dep_libs/include/viennacl

# Override BLAS, use CLBlast instead of ViennacLBLAS.
# USE_CLBLAST := 1
# Custom CLBlast lib and include directories.
# CLBLAST_INCLUDE := /path/to/clblast/include
# CLBLAST_LIB     := /path/to/clblast/lib

# Override BLAS, use clBLAS insead of ViennaclBLAS.
# USE_CLBLAS := 1
# Custom clBLAS lib and include directories.
# CLBLAS_INCLUDE := /path/to/clblas/include
# CLBLAS_LIB     := /path/to/clblas/lib

# Override BLAS, use ISAAC instead of ViennaclBLAS.
USE_ISAAC := 1

# Uncomment for FFT
# USE_FFT := 1

# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1

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

# CPU OpenMP switch. Do not use OpenMP on dual socket systems!
USE_OPENMP := 1

# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# USE_HDF5 := 0

# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
# You should not set this flag if you will be reading LMDBs with any
# possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1

# Uncomment if you're using OpenCV 3
# OPENCV_VERSION := 3

# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++

# 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

# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
-gencode arch=compute_60,code=sm_60 \
-gencode arch=compute_61,code=sm_61 \
-gencode arch=compute_61,code=compute_61

# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
# BLAS := atlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas

# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib

# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
# ANACONDA_HOME := $(HOME)/anaconda
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
# $(ANACONDA_HOME)/include/python2.7 \
# $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include

# Uncomment to use Python 3 (default is Python 2)
# PYTHON_LIBRARIES := boost_python3 python3.5m
# PYTHON_INCLUDE := /usr/include/python3.5m \
#                 /usr/lib/python3.5/dist-packages/numpy/core/include

# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib

# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib

# Uncomment to support layers written in Python (will link against Python libs)
# WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE)  /home/a/PerfTool/OpenCL-Headers  /usr/local/include /home/a/PerfTool/clCaffe/dep_libs/include

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /home/a/PerfTool/clCaffe/opencv/lib /home/a/code/viennacl-dev/build/libviennacl


# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib

# NCCL acceleration switch (uncomment to build with NCCL)
# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
# USE_NCCL := 1

# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1

# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute

# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# VIENNACL_DEBUG := 0

# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0

# enable pretty build (comment to see full commands)
Q ?= @


===============================================================================================
Makefile add one line at 345
===============================================================================================
ifeq ($(DISABLE_DEVICE_HOST_UNIFIED_MEMORY),1)
        COMMON_FLAGS += -DDISABLE_DEVICE_HOST_UNIFIED_MEMORY
endif

LIBRARIES += viennacl //line 345

ifeq ($(USE_GREENTEA),1)
        # Find a valid OpenCL library
        # TODO: Validate and complete this based on different SDKs
        ifdef OPENCL_INC
                CLLINC = '$(OPENCL_INC)'


===============================================================================================
cmake command for clCaffe build
===============================================================================================
export ISAAC_HOME=/home/a/PerfTool/clCaffe/dep_libs/include
cmake .. -DUSE_GREENTEA=ON -DUSE_CUDA=OFF -DUSE_INTEL_SPATIAL=ON -DBUILD_docs=0 -DUSE_ISAAC=ON -DViennaCL_INCLUDE_DIR=/home/a/PerfTool/clCaffe/dep_libs/include -DBLAS=open -DOPENCL_LIBRARY=/opt/intel_ocl_runtime_cpu/opencl/linux/compiler/lib/intel64_lin/libOpenCL.so -DOPENCL_INCLUDE_DIRS=/home/a/PerfTool/OpenCL-Headers/


==============================================================================================
make VERBOSE=1
==============================================================================================
a@a-Z170-D3H:build$ make VERBOSE=1
/usr/bin/cmake -H/home/a/code/clCaffe -B/home/a/code/clCaffe/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/a/code/clCaffe/build/CMakeFiles /home/a/code/clCaffe/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/a/code/clCaffe/build'
make -f src/caffe/CMakeFiles/proto.dir/build.make src/caffe/CMakeFiles/proto.dir/depend
make[2]: Entering directory '/home/a/code/clCaffe/build'
cd /home/a/code/clCaffe/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/a/code/clCaffe /home/a/code/clCaffe/src/caffe /home/a/code/clCaffe/build /home/a/code/clCaffe/build/src/caffe /home/a/code/clCaffe/build/src/caffe/CMakeFiles/proto.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/a/code/clCaffe/build'
make -f src/caffe/CMakeFiles/proto.dir/build.make src/caffe/CMakeFiles/proto.dir/build
make[2]: Entering directory '/home/a/code/clCaffe/build'
make[2]: Nothing to be done for 'src/caffe/CMakeFiles/proto.dir/build'.
make[2]: Leaving directory '/home/a/code/clCaffe/build'
[  1%] Built target proto
make -f src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/build.make src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/depend
make[2]: Entering directory '/home/a/code/clCaffe/build'
cd /home/a/code/clCaffe/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/a/code/clCaffe /home/a/code/clCaffe/src/caffe/opencl/vendors/intel/tools /home/a/code/clCaffe/build /home/a/code/clCaffe/build/src/caffe/opencl/vendors/intel/tools /home/a/code/clCaffe/build/src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/a/code/clCaffe/build'
make -f src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/build.make src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/build
make[2]: Entering directory '/home/a/code/clCaffe/build'
make[2]: Nothing to be done for 'src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/build'.
make[2]: Leaving directory '/home/a/code/clCaffe/build'
[  1%] Built target pretune_convert
make -f src/caffe/CMakeFiles/caffe.dir/build.make src/caffe/CMakeFiles/caffe.dir/depend
make[2]: Entering directory '/home/a/code/clCaffe/build'
cd /home/a/code/clCaffe/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/a/code/clCaffe /home/a/code/clCaffe/src/caffe /home/a/code/clCaffe/build /home/a/code/clCaffe/build/src/caffe /home/a/code/clCaffe/build/src/caffe/CMakeFiles/caffe.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/a/code/clCaffe/build'
make -f src/caffe/CMakeFiles/caffe.dir/build.make src/caffe/CMakeFiles/caffe.dir/build
make[2]: Entering directory '/home/a/code/clCaffe/build'
make[2]: Nothing to be done for 'src/caffe/CMakeFiles/caffe.dir/build'.
make[2]: Leaving directory '/home/a/code/clCaffe/build'
[ 80%] Built target caffe
make -f tools/CMakeFiles/net_speed_benchmark.dir/build.make tools/CMakeFiles/net_speed_benchmark.dir/depend
make[2]: Entering directory '/home/a/code/clCaffe/build'
cd /home/a/code/clCaffe/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/a/code/clCaffe /home/a/code/clCaffe/tools /home/a/code/clCaffe/build /home/a/code/clCaffe/build/tools /home/a/code/clCaffe/build/tools/CMakeFiles/net_speed_benchmark.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/a/code/clCaffe/build'
make -f tools/CMakeFiles/net_speed_benchmark.dir/build.make tools/CMakeFiles/net_speed_benchmark.dir/build
make[2]: Entering directory '/home/a/code/clCaffe/build'
make[2]: Nothing to be done for 'tools/CMakeFiles/net_speed_benchmark.dir/build'.
make[2]: Leaving directory '/home/a/code/clCaffe/build'
[ 81%] Built target net_speed_benchmark
make -f tools/CMakeFiles/caffe-fp16.bin.dir/build.make tools/CMakeFiles/caffe-fp16.bin.dir/depend
make[2]: Entering directory '/home/a/code/clCaffe/build'
cd /home/a/code/clCaffe/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/a/code/clCaffe /home/a/code/clCaffe/tools /home/a/code/clCaffe/build /home/a/code/clCaffe/build/tools /home/a/code/clCaffe/build/tools/CMakeFiles/caffe-fp16.bin.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/a/code/clCaffe/build'
make -f tools/CMakeFiles/caffe-fp16.bin.dir/build.make tools/CMakeFiles/caffe-fp16.bin.dir/build
make[2]: Entering directory '/home/a/code/clCaffe/build'
[ 81%] Linking CXX executable caffe-fp16.bin
cd /home/a/code/clCaffe/build/tools && /usr/bin/cmake -E cmake_link_script CMakeFiles/caffe-fp16.bin.dir/link.txt --verbose=1
/usr/bin/c++    -fPIC -Wall -std=c++17 -DCMAKE_BUILD -Wno-sign-compare -Wno-uninitialized -O3 -DNDEBUG  -pie CMakeFiles/caffe-fp16.bin.dir/caffe-fp16.cpp.o  -o caffe-fp16.bin  -L/home/a/code/clCaffe/PUBLIC  -L/usr/lib/x86_64-linux-gnu/libboost_system.so  -L/usr/lib/x86_64-linux-gnu/libboost_thread.so  -L/usr/lib/x86_64-linux-gnu/libboost_filesystem.so  -L/usr/lib/x86_64-linux-gnu/libboost_regex.so  -L/usr/lib/x86_64-linux-gnu/libboost_chrono.so  -L/usr/lib/x86_64-linux-gnu/libboost_date_time.so  -L/usr/lib/x86_64-linux-gnu/libboost_atomic.so  -L/usr/lib/x86_64-linux-gnu/libpthread.so  -L/home/a/code/clCaffe/PRIVATE  -L/home/a/code/clCaffe/-lpthread  -L/usr/lib/x86_64-linux-gnu/libglog.so  -L/usr/lib/x86_64-linux-gnu/libgflags.so  -L/home/a/code/clCaffe/optimized  -L/usr/lib/x86_64-linux-gnu/libprotobuf.so  -L/home/a/code/clCaffe/debug  -L/home/a/anaconda3/lib/libhdf5_hl.so  -L/home/a/anaconda3/lib/libhdf5.so  -L/usr/lib/x86_64-linux-gnu/librt.so  -L/home/a/anaconda3/lib/libz.so  -L/usr/lib/x86_64-linux-gnu/libdl.so  -L/usr/lib/x86_64-linux-gnu/libm.so  -L/usr/lib/x86_64-linux-gnu/liblmdb.so  -L/usr/lib/x86_64-linux-gnu/libleveldb.so  -L/usr/lib/x86_64-linux-gnu/libsnappy.so  -L/opt/intel_ocl_runtime_cpu/opencl/linux/compiler/lib/intel64_lin/libOpenCL.so  -L/home/a/code/isaac/build/lib/libisaac.so  -L/home/a/code/clCaffe/opencv_core  -L/home/a/code/clCaffe/opencv_highgui  -L/home/a/code/clCaffe/opencv_imgproc  -L/usr/lib/libopenblas.so  -L/usr/lib/x86_64-linux-gnu/libpython2.7.so  -L/usr/lib/x86_64-linux-gnu/libboost_python.so -rdynamic ../lib/libcaffe.so.1.0.0-rc5 ../lib/libproto.a -lpython2.7 -lboost_system -lboost_thread -lboost_filesystem -lboost_regex -lboost_chrono -lboost_date_time -lboost_atomic -lpthread -lglog -lgflags -lprotobuf -lpthread /home/a/anaconda3/lib/libhdf5_hl.so /home/a/anaconda3/lib/libhdf5.so -lrt /home/a/anaconda3/lib/libz.so -ldl -lm -lpthread -lglog -lgflags -lprotobuf -lpthread /home/a/anaconda3/lib/libhdf5_hl.so /home/a/anaconda3/lib/libhdf5.so -lrt /home/a/anaconda3/lib/libz.so -ldl -lm -llmdb -lleveldb /opt/intel_ocl_runtime_cpu/opencl/linux/compiler/lib/intel64_lin/libOpenCL.so /home/a/code/isaac/build/lib/libisaac.so /home/a/PerfTool/clCaffe/opencv/lib/libopencv_highgui.so.2.4.13 /home/a/PerfTool/clCaffe/opencv/lib/libopencv_imgproc.so.2.4.13 /home/a/PerfTool/clCaffe/opencv/lib/libopencv_core.so.2.4.13 -lopenblas -lboost_python -Wl,-rpath,/home/a/code/clCaffe/PUBLIC:/usr/lib/x86_64-linux-gnu/libboost_system.so:/usr/lib/x86_64-linux-gnu/libboost_thread.so:/usr/lib/x86_64-linux-gnu/libboost_filesystem.so:/usr/lib/x86_64-linux-gnu/libboost_regex.so:/usr/lib/x86_64-linux-gnu/libboost_chrono.so:/usr/lib/x86_64-linux-gnu/libboost_date_time.so:/usr/lib/x86_64-linux-gnu/libboost_atomic.so:/usr/lib/x86_64-linux-gnu/libpthread.so:/home/a/code/clCaffe/PRIVATE:/home/a/code/clCaffe/-lpthread:/usr/lib/x86_64-linux-gnu/libglog.so:/usr/lib/x86_64-linux-gnu/libgflags.so:/home/a/code/clCaffe/optimized:/usr/lib/x86_64-linux-gnu/libprotobuf.so:/home/a/code/clCaffe/debug:/home/a/anaconda3/lib/libhdf5_hl.so:/home/a/anaconda3/lib/libhdf5.so:/usr/lib/x86_64-linux-gnu/librt.so:/home/a/anaconda3/lib/libz.so:/usr/lib/x86_64-linux-gnu/libdl.so:/usr/lib/x86_64-linux-gnu/libm.so:/usr/lib/x86_64-linux-gnu/liblmdb.so:/usr/lib/x86_64-linux-gnu/libleveldb.so:/usr/lib/x86_64-linux-gnu/libsnappy.so:/opt/intel_ocl_runtime_cpu/opencl/linux/compiler/lib/intel64_lin/libOpenCL.so:/home/a/code/isaac/build/lib/libisaac.so:/home/a/code/clCaffe/opencv_core:/home/a/code/clCaffe/opencv_highgui:/home/a/code/clCaffe/opencv_imgproc:/usr/lib/libopenblas.so:/usr/lib/x86_64-linux-gnu/libpython2.7.so:/usr/lib/x86_64-linux-gnu/libboost_python.so:/home/a/code/clCaffe/build/lib:/home/a/anaconda3/lib:/opt/intel_ocl_runtime_cpu/opencl/linux/compiler/lib/intel64_lin:/home/a/code/isaac/build/lib:/home/a/PerfTool/clCaffe/opencv/lib: 
../lib/libcaffe.so.1.0.0-rc5:对‘viennacl::ocl::program& caffe::RegisterKernels<float>(viennacl::ocl::context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)’未定义的引用
../lib/libcaffe.so.1.0.0-rc5:对‘viennacl::ocl::program& caffe::RegisterKernels<half_float::half>(viennacl::ocl::context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)’未定义的引用
../lib/libcaffe.so.1.0.0-rc5:对‘viennacl::ocl::program& caffe::RegisterKernels<double>(viennacl::ocl::context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)’未定义的引用
../lib/libcaffe.so.1.0.0-rc5:对‘caffe::RegisterCommonKernels(viennacl::ocl::context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)’未定义的引用
../lib/libcaffe.so.1.0.0-rc5:对‘viennacl::ocl::program& caffe::submit_conv_spatial_program<half_float::half>(viennacl::ocl::context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)’未定义的引用
../lib/libcaffe.so.1.0.0-rc5:对‘viennacl::ocl::program& caffe::submit_conv_spatial_program<double>(viennacl::ocl::context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)’未定义的引用
../lib/libcaffe.so.1.0.0-rc5:对‘viennacl::ocl::program& caffe::submit_conv_spatial_program<float>(viennacl::ocl::context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)’未定义的引用
collect2: error: ld returned 1 exit status
tools/CMakeFiles/caffe-fp16.bin.dir/build.make:133: recipe for target 'tools/caffe-fp16.bin' failed
make[2]: *** [tools/caffe-fp16.bin] Error 1
make[2]: Leaving directory '/home/a/code/clCaffe/build'
CMakeFiles/Makefile2:540: recipe for target 'tools/CMakeFiles/caffe-fp16.bin.dir/all' failed
make[1]: *** [tools/CMakeFiles/caffe-fp16.bin.dir/all] Error 2
make[1]: Leaving directory '/home/a/code/clCaffe/build'
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2



Reply all
Reply to author
Forward
0 new messages