caffe icon indicating copy to clipboard operation
caffe copied to clipboard

caffe Mattest error

Open bcd33bcd opened this issue 8 years ago • 34 comments

when I make mattest, some error happened:


`cd matlab; /usr/local/MATLAB/R2014a/bin/matlab -nodisplay -r 'caffe.run_tests(), exit()'`

                            < M A T L A B (R) >
                  Copyright 1984-2014 The MathWorks, Inc.
                    R2014a (8.3.0.532) 64-bit (glnxa64)
                             February 11, 2014


To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
Invalid MEX-file
'/home/xw/caffeBuild/caffe-master/matlab/+caffe/private/caffe_.mexa64':
/home/xw/caffeBuild/caffe-master/matlab/+caffe/private/caffe_.mexa64: undefined
symbol:
_ZN2cv8imencodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERSt6vectorIhSaIhEERKSB_IiSaIiEE

Error in caffe.set_mode_cpu (line 5)
caffe_('set_mode_cpu');

Error in caffe.run_tests (line 6)
caffe.set_mode_cpu();

And when I copy caffe_mexa64 to other path and run code "caffe('get_init_key')" ,it also show the same error ,except

Error in caffe.set_mode_cpu (line 5)
caffe_('set_mode_cpu');

Error in caffe.run_tests (line 6)
caffe.set_mode_cpu();

And my OS is Ubuntu 15.10, so the version of g++ and gcc is 5.2.1. what should I do? Thanks~

bcd33bcd avatar Apr 03 '16 01:04 bcd33bcd

I am also facing the same problem. My Matlab version is 2015b. I tried to put default version of gcc as gcc-4.7 since Maltab mex support that and explicitly give gcc version gcc-5 in Makefile configuration for Caffe.

Anyone able to fix this issue?

shekharRavi avatar Apr 15 '16 13:04 shekharRavi

The problem here seems to be that caffe is compiled against the system version of opencv, but linking to the matlab version when running matcaffe. I was able to fix the problem by replacing the symbolic links for libopencv_[imgproc,core,highgui].so.2.4 in MATLAB/R2015a/bin/glnxa64 with a link for the versions in /usr/lib, as those were the three used by caffe. This fix probably breaks all the other opencv library files that were not replaced, so you might want to be careful or just replace them all.

kevjshih avatar Apr 19 '16 19:04 kevjshih

@kevjshih

Followed your instruction, I changed some symbolic link in /bin/glnxa64 and matcaffe works well. ^_^

libopencv_core.so.2.4 -> /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.9
libopencv_highgui.so.2.4 -> /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9
libopencv_imgproc.so.2.4 -> /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4.9

root@test222:/matlab/r2016a/bin/glnxa64# mv libopencv_imgproc.so.2.4 libopencv_imgproc.so.2.4.bak
root@test222:/matlab/r2016a/bin/glnxa64# mv libopencv_highgui.so.2.4 libopencv_highgui.so.2.4.bak
root@test222:/matlab/r2016a/bin/glnxa64# mv libopencv_core.so.2.4 libopencv_core.so.2.4.bak

root@test222:/matlab/r2016a/bin/glnxa64# ln /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.9 libopencv_core.so.2.4
root@test222:/matlab/r2016a/bin/glnxa64# ln /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9 libopencv_highgui.so.2.4
root@test222:/matlab/r2016a/bin/glnxa64# ln /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4.9 libopencv_imgproc.so.2.4

duchengyao avatar Aug 30 '16 03:08 duchengyao

@duchengyao I'm new to linux and I'm facing the same problem. How did you change the symbolic links? Could you please add some details? Much thanks.

lld533 avatar Aug 31 '16 04:08 lld533

You can see the links when you run ls -alh. If file B is a symlink of some file A elsewhere, you'll see B -> A in the output. To create a symlink that creates a proxy for A at location B, run ln -s A B.

kevjshih avatar Aug 31 '16 05:08 kevjshih

@kevjshih Much thanks for your help. I made it.:)

lld533 avatar Aug 31 '16 05:08 lld533

@kevjshih I changed the three above mentioned symbolic links. The error remained same. There are many links to MATLAB provided libraries. Which of them to change. Is there any way to know? @duchengyao Is there any reason you changed only those three links?

Achilles-96 avatar Sep 27 '16 12:09 Achilles-96

I think I determined those three libraries by reading the stack trace (it's been a while so I don't quite recall).

kevjshih avatar Sep 27 '16 20:09 kevjshih

Thank you so much,it helps me a lot @kevjshih It is very kind of U

DouSong avatar Dec 29 '16 18:12 DouSong

Thanks a lot @kevjshih But how can you figure out this issues caused by opencv? I mean how can you figure out this (The problem here seems to be that caffe is compiled against the system version of opencv, but linking to the matlab version when running matcaffe.). Hope your reply. Thanks again.

xmyqsh avatar Jan 03 '17 00:01 xmyqsh

Well the function name (imencode in this case) is in the stacktrace so you can pretty much throw it into a web query and see which library comes up.

kevjshih avatar Jan 03 '17 00:01 kevjshih

got it :+1: @kevjshih

xmyqsh avatar Jan 03 '17 13:01 xmyqsh

@kevjshih based on the error information, i change some symbol links one by one, but i still get stuck in libopencv_features2d.so.2.4 even though i have already changed its symbol links. Looking forward for your help

7LFB avatar Apr 08 '17 06:04 7LFB

@7LFB I'm not sure how much I can help. The general idea here is that you simply need to make sure the .so file being read while in MATLAB is the same as the one you originally compiled Caffe against. If it's not working, then maybe that's not the version of opencv you used? I suppose one thing you can check is whether you have opencv 3.0 install as well, and might've compiled Caffe against that instead.

kevjshih avatar Apr 08 '17 06:04 kevjshih

thank u a lot for your words and i have already fixed it ! @kevjshih

7LFB avatar Apr 08 '17 09:04 7LFB

@7LFB Facing the same problem. Which all links did you change?

Shaswat27 avatar May 12 '17 07:05 Shaswat27

@Shaswat27 About 5-6 symbol links. I just follow the error information it present like this,"libopencv_features2d.so.2.4, undefined symbol". and then i modified its links one by one.

7LFB avatar May 13 '17 03:05 7LFB

I am also getting the same error: libcaffe.so.1.0.0: undefined symbol: _ZN2cv8imencodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERSt6vectorIhSaIhEERKSB_IiSaIiEE

I am trying to run .m code to generate lmdb process as suggested in Deep Metric Learning using Lifted Structured Embedding which mexa.64 but it stops and pops the error.

I also made symbolic links between the libcaffe.so.1.0.0-rc3 and libcaffe.so and libcaffe.so.1.0.0 but it didn't work out.

Can anyone suggest any solution to this?

Ashutosh1995 avatar Jul 27 '17 09:07 Ashutosh1995

I had the same error try using Opencv 2.4.9 for your project also do this in terminal before opening matlab: export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6

wahabaftab avatar Aug 29 '17 08:08 wahabaftab

I am getting the below error when i issue the make mattest command

I am using the following version of softwares ubuntu : 16.04 Matlab 2016a gcc and g++ 4.9 OpenCV 3.2 Invalid MEX-file '/home/hp/caffe/matlab/+caffe/private/caffe_.mexa64': /usr/lib/libgdal.so.1: undefined symbol: ZN11xercesc_3_111InputSource11setEncodingEPKt Error in caffe.set_mode_cpu (line 5) caffe('set_mode_cpu'); Error in caffe.run_tests (line 6) caffe.set_mode_cpu();

How to solve this issue?

binialias avatar Oct 16 '17 07:10 binialias

@binialias did you tried run export LD_PRELOAD=/usr/lib/libgdal.so.1 before running make mattest as @wahabaftab metioned?

variantf avatar Nov 20 '17 14:11 variantf

It took me several days to solve this issue. I tried all the above methods, but they didn't work. Finally I replaced the opencv version from 3.3.0 to 3.2.0 and it works.

carterbao avatar Nov 22 '17 16:11 carterbao

yes i have tried that also

On Wed, Nov 22, 2017 at 10:26 PM, Carter Bao [email protected] wrote:

It took me several days to solve this issue. I tried all the above methods, but they didn't work. Finally I replaced the opencv version from 3.3.0 to 3.2.0 and it works.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/3934#issuecomment-346410666, or mute the thread https://github.com/notifications/unsubscribe-auth/AXzBOPO2KQtlMpdx9aMOHwX5KHVYyo-dks5s5FIpgaJpZM4H-cJY .

-- Thanks & Regards,

Bini Alias.

binialias avatar Dec 19 '17 13:12 binialias

Hi @variantf @wahabaftab @binialias ,

My system specs

Ubuntu 16.04
CUDA 9.0
Matlab R2015a
gcc/g++ 4.9 for matlab and 5.4.1 for caffe

I also have the same problem, so followed the steps of others in

here https://github.com/BVLC/caffe/issues/3934#issuecomment-243321669 and here http://caffe.berkeleyvision.org/tutorial/interfaces.html

Here are the results I get before and after I apply your suggestion

Errors I get before export LD_PRELOAD=/usr/lib/libgdal.so.1

~/caffe$ make mattest
cd matlab; /usr/local/MATLAB/R2015a/bin/matlab -nodisplay -r 'caffe.run_tests(), exit()'

                                                                                     < M A T L A B (R) >
                                                                           Copyright 1984-2015 The MathWorks, Inc.
                                                                           R2015a (8.5.0.197613) 64-bit (glnxa64)
                                                                                      February 12, 2015

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
 
Invalid MEX-file '/home/bedir/caffe/matlab/+caffe/private/caffe_.mexa64': /usr/lib/libgdal.so.1: undefined symbol: _ZN11xercesc_3_111InputSource11setEncodingEPKt

Error in caffe.set_mode_cpu (line 5)
caffe_('set_mode_cpu');

Error in caffe.run_tests (line 6)
caffe.set_mode_cpu();
 
>> 

Errors I get before export LD_PRELOAD=/usr/lib/libgdal.so.1 after export LD_PRELOAD=/usr/lib/libgdal.so.1

~/caffe$ export LD_PRELOAD=/usr/lib/libgdal.so.1
~/caffe$ make mattest
cd matlab; /usr/local/MATLAB/R2015a/bin/matlab -nodisplay -r 'caffe.run_tests(), exit()'
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libgdal.so.1)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/libgdal.so.1)
uname: /usr/local/MATLAB/R2015a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos_c.so.1)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
uname: /usr/local/MATLAB/R2015a/bin/glnxa64/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
uname: /usr/local/MATLAB/R2015a/bin/glnxa64/libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
uname: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libgdal.so.1)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/libgdal.so.1)
sed: /usr/local/MATLAB/R2015a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos_c.so.1)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
sed: /usr/local/MATLAB/R2015a/bin/glnxa64/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
sed: /usr/local/MATLAB/R2015a/bin/glnxa64/libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
sed: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libgdal.so.1)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/libgdal.so.1)
getconf: /usr/local/MATLAB/R2015a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos_c.so.1)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
getconf: /usr/local/MATLAB/R2015a/bin/glnxa64/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libgdal.so.1)
getconfawk: : /usr/local/MATLAB/R2015a/bin/glnxa64/libssl.so.1.0.0/usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: : version `GLIBCXX_3.4.20' not found (required by /usr/lib/libgdal.so.1)no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)

getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
getconf: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
awk: /usr/local/MATLAB/R2015a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos_c.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)getconf
: awk/usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: : /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so): 
version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)getconf
: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
awk: /usr/local/MATLAB/R2015a/bin/glnxa64/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
awk: /usr/local/MATLAB/R2015a/bin/glnxa64/libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
getconfawk: : /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6/usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: : version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55)version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)

awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libgdal.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/libgdal.so.1)
awk: /usr/local/MATLAB/R2015a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos_c.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
awk: /usr/local/MATLAB/R2015a/bin/glnxa64/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
awk: /usr/local/MATLAB/R2015a/bin/glnxa64/libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libgeos-3.5.0.so)
awk: /usr/local/MATLAB/R2015a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55)
/usr/local/MATLAB/R2015a/bin/glnxa64/MATLAB: /usr/local/MATLAB/R2015a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
/usr/local/MATLAB/R2015a/bin/glnxa64/MATLAB: /usr/local/MATLAB/R2015a/bin/glnxa64/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
/usr/local/MATLAB/R2015a/bin/glnxa64/MATLAB: /usr/local/MATLAB/R2015a/bin/glnxa64/libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
/usr/local/MATLAB/R2015a/bin/glnxa64/MATLAB: symbol lookup error: /usr/lib/libgdal.so.1: undefined symbol: _ZN11xercesc_3_111InputSource11setEncodingEPKt
Makefile:539: recipe for target 'mattest' failed

~/caffe$ 

I also tried to change my environment variables in /etc/environment accordingly but it did not work. I would definitely want to try to switch to opencv3.2 as well, but since there are others in opencv 3.2 that facing the same problem, I see no point.

BedirYilmaz avatar Dec 24 '17 10:12 BedirYilmaz

My system specs

Ubuntu 16.04
CUDA 8.0
Matlab R2014b
gcc/g++  5.4.0
OpenCV3.2

I have the same problem, so followed the steps of others in

Invalid MEX-file '/home/cuishi/caffe/matlab/+caffe/private/caffe_.mexa64': /usr/lib/libgdal.so.1:
undefined symbol: _ZN11xercesc_3_111InputSource11setEncodingEPKt

Any solutions?

jwz-ecust avatar Jan 12 '18 07:01 jwz-ecust

@Ashutosh1995 Have you solved this problem?

ksnzh avatar Jan 23 '18 10:01 ksnzh

@duchengyao after following yours, i got this: Invalid MEX-file '/home/akhil/caffe/matlab/+caffe/private/caffe_.mexa64': /usr/local/MATLAB/MATLAB_Production_Server/R2015a/bin/glnxa64/libopencv_core.so.2.4: file too short

Error in caffe.set_mode_cpu (line 5) caffe_('set_mode_cpu');

Error in classification_demo (line 71) caffe.set_mode_cpu();

artish3 avatar Jan 25 '18 21:01 artish3

try exporting this: export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 and this: export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libprotobuf.so.9 and try to use matlab 2015a or lower , bcoz matcaffe usually gives error on latest versions(opencv 2.4.9)

Also check this link if my solution isn't working (its in another language so translate it) http://blog.csdn.net/rt5rte54654/article/details/54742981

wahabaftab avatar Jan 31 '18 15:01 wahabaftab

Can you please send me your mex file

soulslicer avatar Mar 09 '18 17:03 soulslicer

Is anyone able to upload for me a matlab caffe mex file. I am simply unable to build it

soulslicer avatar Mar 09 '18 18:03 soulslicer