本记录只暂时只记录一些错误。
编译错误,opencv3.2与anaconda3下的libtiff不兼容,冲突。
问题查找(查找所有的TIFF库与编译错误提示匹配/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0‘,可以确定是anaconda3//pkgs目录下的libtiff与opencv3.2冲突):
1 wmz@wmz-ThinkPad-T420s:~$ locate libtiff.so 2 /home/wmz/anaconda3/lib/libtiff.so 3 /home/wmz/anaconda3/lib/libtiff.so.5 4 /home/wmz/anaconda3/lib/libtiff.so.5.2.4 5 /home/wmz/anaconda3/pkgs/libtiff-4.0.6-2/lib/libtiff.so 6 /home/wmz/anaconda3/pkgs/libtiff-4.0.6-2/lib/libtiff.so.5 7 /home/wmz/anaconda3/pkgs/libtiff-4.0.6-2/lib/libtiff.so.5.2.4 8 /snap/code/25/usr/lib/x86_64-linux-gnu/libtiff.so.5 9 /snap/code/25/usr/lib/x86_64-linux-gnu/libtiff.so.5.2.4 10 /snap/gnome-3-28-1804/116/usr/lib/x86_64-linux-gnu/libtiff.so.5 11 /snap/gnome-3-28-1804/116/usr/lib/x86_64-linux-gnu/libtiff.so.5.3.0 12 /snap/gnome-3-28-1804/67/usr/lib/x86_64-linux-gnu/libtiff.so.5 13 /snap/gnome-3-28-1804/67/usr/lib/x86_64-linux-gnu/libtiff.so.5.3.0 14 /usr/lib/x86_64-linux-gnu/libtiff.so 15 /usr/lib/x86_64-linux-gnu/libtiff.so.5 16 /usr/lib/x86_64-linux-gnu/libtiff.so.5.3.0
解决办法,卸载冲突的libtiff库,先确定库名字:
使用命令:
conda list
执行结果:
1 wmz@wmz-ThinkPad-T420s:~$ conda list 2 # packages in environment at /home/wmz/anaconda3: 3 # 4 _license 1.1 py35_1 5 _nb_ext_conf 0.3.0 py35_0 6 alabaster 0.7.9 py35_0 7 anaconda 4.2.0 np111py35_0 8 anaconda-clean 1.0.0 py35_0 9 anaconda-client 1.5.1 py35_0 10 anaconda-navigator 1.3.1 py35_0 11 argcomplete 1.0.0 py35_1 12 astroid 1.4.7 py35_0 13 astropy 1.2.1 np111py35_0 14 babel 2.3.4 py35_0 15 backports 1.0 py35_0 16 beautifulsoup4 4.5.1 py35_0 17 bitarray 0.8.1 py35_0 18 blaze 0.10.1 py35_0 19 bokeh 0.12.2 py35_0 20 boto 2.42.0 py35_0 21 bottleneck 1.1.0 np111py35_0 22 cairo 1.12.18 6 23 cffi 1.7.0 py35_0 24 chest 0.2.3 py35_0 25 click 6.6 py35_0 26 cloudpickle 0.2.1 py35_0 27 clyent 1.2.2 py35_0 28 colorama 0.3.7 py35_0 29 conda 4.2.9 py35_0 30 conda-build 2.0.2 py35_0 31 configobj 5.0.6 py35_0 32 contextlib2 0.5.3 py35_0 33 cryptography 1.5 py35_0 34 curl 7.49.0 1 35 cycler 0.10.0 py35_0 36 cython 0.24.1 py35_0 37 cytoolz 0.8.0 py35_0 38 dask 0.11.0 py35_0 39 datashape 0.5.2 py35_0 40 dbus 1.10.10 0 41 decorator 4.0.10 py35_0 42 dill 0.2.5 py35_0 43 docutils 0.12 py35_2 44 dynd-python 0.7.2 py35_0 45 entrypoints 0.2.2 py35_0 46 et_xmlfile 1.0.1 py35_0 47 expat 2.1.0 0 48 fastcache 1.0.2 py35_1 49 filelock 2.0.6 py35_0 50 flask 0.11.1 py35_0 51 flask-cors 2.1.2 py35_0 52 fontconfig 2.11.1 6 53 freetype 2.5.5 1 54 get_terminal_size 1.0.0 py35_0 55 gevent 1.1.2 py35_0 56 glib 2.43.0 1 57 greenlet 0.4.10 py35_0 58 gst-plugins-base 1.8.0 0 59 gstreamer 1.8.0 0 60 h5py 2.6.0 np111py35_2 61 harfbuzz 0.9.39 1 62 hdf5 1.8.17 1 63 heapdict 1.0.0 py35_1 64 icu 54.1 0 65 idna 2.1 py35_0 66 imagesize 0.7.1 py35_0 67 ipykernel 4.5.0 py35_0 68 ipython 5.1.0 py35_0 69 ipython_genutils 0.1.0 py35_0 70 ipywidgets 5.2.2 py35_0 71 itsdangerous 0.24 py35_0 72 jbig 2.1 0 73 jdcal 1.2 py35_1 74 jedi 0.9.0 py35_1 75 jinja2 2.8 py35_1 76 jpeg 8d 2 77 jsonschema 2.5.1 py35_0 78 jupyter 1.0.0 py35_3 79 jupyter_client 4.4.0 py35_0 80 jupyter_console 5.0.0 py35_0 81 jupyter_core 4.2.0 py35_0 82 lazy-object-proxy 1.2.1 py35_0 83 leveldb 0.201 <pip> 84 libdynd 0.7.2 0 85 libffi 3.2.1 0 86 libgcc 4.8.5 2 87 libgfortran 3.0.0 1 88 libpng 1.6.22 0 89 libsodium 1.0.10 0 90 libtiff 4.0.6 2 91 libxcb 1.12 0 92 libxml2 2.9.2 0 93 libxslt 1.1.28 0 94 llvmlite 0.13.0 py35_0 95 locket 0.2.0 py35_1 96 lxml 3.6.4 py35_0 97 markupsafe 0.23 py35_2 98 matplotlib 1.5.3 np111py35_0 99 mistune 0.7.3 py35_0 100 mkl 11.3.3 0 101 mkl-service 1.1.2 py35_2 102 mpmath 0.19 py35_1 103 multipledispatch 0.4.8 py35_0 104 nb_anacondacloud 1.2.0 py35_0 105 nb_conda 2.0.0 py35_0 106 nb_conda_kernels 2.0.0 py35_0 107 nbconvert 4.2.0 py35_0 108 nbformat 4.1.0 py35_0 109 nbpresent 3.0.2 py35_0 110 networkx 1.11 py35_0 111 nltk 3.2.1 py35_0 112 nose 1.3.7 py35_1 113 notebook 4.2.3 py35_0 114 numba 0.28.1 np111py35_0 115 numexpr 2.6.1 np111py35_0 116 numpy 1.11.1 py35_0 117 odo 0.5.0 py35_1 118 openpyxl 2.3.2 py35_0 119 openssl 1.0.2j 0 120 pandas 0.18.1 np111py35_0 121 partd 0.3.6 py35_0 122 patchelf 0.9 0 123 path.py 8.2.1 py35_0 124 pathlib2 2.1.0 py35_0 125 patsy 0.4.1 py35_0 126 pep8 1.7.0 py35_0 127 pexpect 4.0.1 py35_0 128 pickleshare 0.7.4 py35_0 129 pillow 3.3.1 py35_0 130 pip 8.1.2 py35_0 131 pixman 0.32.6 0 132 pkginfo 1.3.2 py35_0 133 ply 3.9 py35_0 134 prompt_toolkit 1.0.3 py35_0 135 protobuf 3.11.3 <pip> 136 psutil 4.3.1 py35_0 137 ptyprocess 0.5.1 py35_0 138 py 1.4.31 py35_0 139 pyasn1 0.1.9 py35_0 140 pycosat 0.6.1 py35_1 141 pycparser 2.14 py35_1 142 pycrypto 2.6.1 py35_4 143 pycurl 7.43.0 py35_0 144 pyflakes 1.3.0 py35_0 145 pygments 2.1.3 py35_0 146 pylint 1.5.4 py35_1 147 pyopenssl 16.0.0 py35_0 148 pyparsing 2.1.4 py35_0 149 pyqt 5.6.0 py35_0 150 pytables 3.2.3.1 np111py35_0 151 pytest 2.9.2 py35_0 152 python 3.5.2 0 153 python-dateutil 2.8.1 <pip> 154 python-dateutil 2.5.3 py35_0 155 python-gflags 3.1.2 <pip> 156 pytz 2016.6.1 py35_0 157 pyyaml 3.12 py35_0 158 pyzmq 15.4.0 py35_0 159 qt 5.6.0 0 160 qtawesome 0.3.3 py35_0 161 qtconsole 4.2.1 py35_1 162 qtpy 1.1.2 py35_0 163 readline 6.2 2 164 redis 3.2.0 0 165 redis-py 2.10.5 py35_0 166 requests 2.11.1 py35_0 167 rope 0.9.4 py35_1 168 ruamel_yaml 0.11.14 py35_0 169 scikit-image 0.12.3 np111py35_1 170 scikit-learn 0.17.1 np111py35_2 171 scipy 0.18.1 np111py35_0 172 setuptools 27.2.0 py35_0 173 simplegeneric 0.8.1 py35_1 174 singledispatch 3.4.0.3 py35_0 175 sip 4.18 py35_0 176 six 1.10.0 py35_0 177 snowballstemmer 1.2.1 py35_0 178 sockjs-tornado 1.0.3 py35_0 179 sphinx 1.4.6 py35_0 180 spyder 3.0.0 py35_0 181 sqlalchemy 1.0.13 py35_0 182 sqlite 3.13.0 0 183 statsmodels 0.6.1 np111py35_1 184 sympy 1.0 py35_0 185 terminado 0.6 py35_0 186 tk 8.5.18 0 187 toolz 0.8.0 py35_0 188 tornado 4.4.1 py35_0 189 traitlets 4.3.0 py35_0 190 unicodecsv 0.14.1 py35_0 191 wcwidth 0.1.7 py35_0 192 werkzeug 0.11.11 py35_0 193 wheel 0.29.0 py35_0 194 widgetsnbextension 1.2.6 py35_0 195 wrapt 1.10.6 py35_0 196 xlrd 1.0.0 py35_0 197 xlsxwriter 0.9.3 py35_0 198 xlwt 1.1.2 py35_0 199 xz 5.2.2 0 200 yaml 0.1.6 0 201 zeromq 4.1.4 0 202 zlib 1.2.8 3
从中可以找到库名字就是libtiff,版本号不需要使用,卸载该库:
使用命令:
conda uninstall libtiff
执行结果:
1 wmz@wmz-ThinkPad-T420s:~$ conda uninstall libtiff 2 Fetching package metadata ....... 3 Solving package specifications: . 4 Package plan for package removal in environment /home/wmz/anaconda3: 5 6 The following packages will be REMOVED: 7 8 libtiff: 4.0.6-2 9 10 Proceed ([y]/n)? y 11 12 Unlinking packages ... 13 [ COMPLETE ]|###################################################| 100%
再次编译遇到错误:
1 [ 88%] Linking CXX executable caffe 2 //usr/lib/libgdal.so.20: undefined reference to `sqlite3_column_origin_name‘ 3 //usr/lib/libgdal.so.20: undefined reference to `sqlite3_column_table_name‘ 4 collect2: error: ld returned 1 exit status 5 tools/CMakeFiles/caffe.bin.dir/build.make:134: recipe for target ‘tools/caffe‘ failed 6 make[2]: *** [tools/caffe] Error 1 7 CMakeFiles/Makefile2:533: recipe for target ‘tools/CMakeFiles/caffe.bin.dir/all‘ failed 8 make[1]: *** [tools/CMakeFiles/caffe.bin.dir/all] Error 2 9 Makefile:129: recipe for target ‘all‘ failed 10 make: *** [all] Error 2
显示是sqlite3_colum_origin_name 未定义引用,就是找不到,在anaconda下查找有sqlite,可能是版本不匹配,执行更新命令:
conda update sqlite
ubuntu18 + caffe+cpu+anaconda3
原文:https://www.cnblogs.com/juluwangshier/p/12359330.html