Hello All,
I am facing error while building caffe from source code .
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
I have described steps below.
Any suggestions or pointers will be helpful.
Best Regards,
Archana Deshmukh
I am following
https://www.qengineering.eu/install-caffe-on-ubuntu-20.04-with-opencv-4.4.html to install caffe.
I am able to build openCV and install it.
The commands to build OpenCV is
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=/home/archana/caffe/opencv_contrib/modules \
-D BUILD_TIFF=ON \
-D WITH_FFMPEG=ON \
-D WITH_GSTREAMER=ON \
-D WITH_TBB=ON \
-D BUILD_TBB=ON \
-D WITH_EIGEN=ON \
-D WITH_V4L=ON \
-D WITH_LIBV4L=ON \
-D WITH_VTK=OFF \
-D WITH_QT=OFF \
-D WITH_OPENGL=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_DNN_CUDA=OFF \
-D BUILD_TESTS=OFF \
-D WITH_LAPACK=OFF \
-D BUILD_EXAMPLES=OFF ..
The Makefile.config file is
# 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)/anaconda2
# 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_python310 python3.10
PYTHON_INCLUDE := /usr/include/python3.10 \
/usr/lib/python3/dist-packages/numpy/core/include \
/usr/lib/python3/dist-packages/numpy/core/include/numpy
# We need to be able to find
libpythonX.X.so or .dylib.
#PYTHON_LIB := /usr/local/lib
PYTHON_LIB := /usr/local/lib /usr/lib/x86_64-linux-gnu
# 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) /usr/local/include /usr/local/include/opencv4 /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial
# 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
# 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
# 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 ?= @
When I build caffe, I get following error
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
collect2: error: ld returned 1 exit status
make: *** [Makefile:630: .build_release/tools/convert_imageset.bin] Error 1
make: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make: *** [Makefile:630: .build_release/tools/extract_features.bin] Error 1
collect2: error: ld returned 1 exit status
make: *** [Makefile:630: .build_release/tools/upgrade_net_proto_binary.bin] Error 1
collect2: error: ld returned 1 exit status
make: *** [Makefile:630: .build_release/tools/create_label_map.bin] Error 1
collect2: error: ld returned 1 exit status
make: *** [Makefile:630: .build_release/tools/convert_annoset.bin] Error 1
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make: *** [Makefile:630: .build_release/tools/upgrade_net_proto_text.bin] Error 1
make: *** [Makefile:630: .build_release/tools/upgrade_solver_proto_text.bin] Error 1
/usr/bin/ld: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_log_set_debug_enabled'
collect2: error: ld returned 1 exit status
make: *** [Makefile:630: .build_release/tools/compute_image_mean.bin] Error 1
The information rekated to libgio
(env4) (base) archana@DESKTOP-55973JC:~/caffe/opencv/build$ find /usr/ -name '*libgio-2.0*'
/usr/lib/x86_64-linux-gnu/libgio-2.0.a
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7200.4
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
/usr/lib/x86_64-linux-gnu/
libgio-2.0.so/lib/x86_64-linux-gnu/libgio-2.0.so.0
(env4) (base) archana@DESKTOP-55973JC:~/caffe/opencv/build$ ls -al /lib/x86_64-linux-gnu/libgio-2.0.so.0
lrwxrwxrwx 1 root root 22 Oct 13 00:29 /lib/x86_64-linux-gnu/libgio-2.0.so.0 -> libgio-2.0.so.0.7200.4
(env4) (base) archana@DESKTOP-55973JC:~/caffe/opencv/build$ ldd /lib/x86_64-linux-gnu/libgio-2.0.so.0
linux-vdso.so.1 (0x00007ffd8633e000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2db9f88000)
libgobject-2.0.so.0 => /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f2db9f28000)
libgmodule-2.0.so.0 => /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f2db9f21000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2db9f05000)
libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f2db9ec1000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f2db9e93000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2db9c6b000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f2db9bf5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2db9b0e000)
libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007f2db9b01000)
libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f2db9aca000)
libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f2db9a31000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2dba2b7000)