-1

我正在尝试根据此处的脚本通过 MATLAB 与SUMO进行交互。

在第 43 行,MATLAB 命令是

system(['sumo-gui -c ' '"' scenarioPath '"' ' --remote-port 8873 --start&']);

由于我正在使用Ubuntu 16.04.1 LTS,我修复了scenarioPath. 现在,这条线等于

system('sumo-gui -c "/path/to/SUMO/docs/tutorial/traci_tls/data/cross.sumocfg" --remote-port 8873 --start&');

当我运行它时,什么都没有发生(ans=0),而当我在 bash 命令行中测试命令时,sumo-gui应用程序启动。

我相信问题更进一步。当我尝试其他应用程序时:

 system('firefox &')
 system('nautilus &')
 system('totem &')

什么都没有发生。虽然它们都在 Linux 命令行下运行。当我在没有分号的情况下运行它们时,;我会收到ans=0. 没有任何消息。

&如果我在它们的末尾删除,我会收到以下消息。我究竟做错了什么?

system('firefox')

/usr/lib/firefox/firefox: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/firefox/firefox)

ans =

     1

或者

system('nautilus')

nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libexempi.so.3)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicui18n.so.55)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)
nautilus: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)

ans =

     1

或者

system('sumo-gui')

sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by sumo-gui)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by sumo-gui)
sumo-gui: /usr/local/MATLAB/R2016a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libFOX-1.6.so.0)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libgdal.so.1)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/libgdal.so.1)
sumo-gui: /usr/local/MATLAB/R2016a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
sumo-gui: /usr/local/MATLAB/R2016a/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)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlbase.so.1)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmldom.so.1)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libkmlengine.so.1)
sumo-gui: /usr/local/MATLAB/R2016a/bin/glnxa64/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
sumo-gui: /usr/local/MATLAB/R2016a/bin/glnxa64/libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdapclient.so.6)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libdap.so.17)
sumo-gui: /usr/local/MATLAB/R2016a/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)
sumo-gui: /usr/local/MATLAB/R2016a/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)
sumo-gui: /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55)

ans =

     1

使用

export LD_LIBRARY_PATH=/usr/local/lib

也无济于事。

4

1 回答 1

2

当您使用位于 matlab 安装的 bin 目录中的标准 matlab 脚本时,Matlab 会弄乱 LD_LIBRARY_PATH。尝试直接启动 bin/<arch>/MATLAB(在我的例子中是 bin/glnxa64/MATLAB)。

于 2016-10-30T16:47:51.383 回答