我想從MATLAB shell運行一個名爲mf2k的應用程序。在Bash shell中,這個命令讀取:matlab更改了我的linux應用程序的環境變量
$ ldd mf2k.mac linux-vdso.so.1 (0x00007fff807d6000)
libc.so.6 => /lib64/libc.so.6 (0x00007f4e3c32d000)
libgfortran.so.3 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libgfortran.so.3 (0x00007f4e3c017000)
libm.so.6 => /lib64/libm.so.6 (0x00007f4e3bd16000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libgcc_s.so.1 (0x00007f4e3bb00000)
libquadmath.so.0 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libquadmath.so.0 (0x00007f4e3b8ca000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4e3c6d4000)
但是,一旦我在MATLAB外殼執行相同的命令,它會返回
>> !ldd mf2k.mac
./mf2k.mac: /home/chenming/SLhome/chenming/apps/Matlab2012b/sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by ./mf2k.mac)
linux-vdso.so.1 (0x00007fffd637f000)
libc.so.6 => /lib64/libc.so.6 (0x00007f2e226aa000)
libgfortran.so.3 => /home/chenming/SLhome/chenming/apps/Matlab2012b/sys/os/glnxa64/libgfortran.so.3 (0x00007f2e223bf000)
libm.so.6 => /lib64/libm.so.6 (0x00007f2e220be000)
libgcc_s.so.1 => /home/chenming/SLhome/chenming/apps/Matlab2012b/sys/os/glnxa64/libgcc_s.so.1 (0x00007f2e21ea8000)
libquadmath.so.0 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libquadmath.so.0 (0x00007f2e21c72000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2e22a51000)
注意,對於libgfortran.so.3和libgcc_s.so路徑.1已被更改。
如何在MATLAB schell中設置環境變量?我發現這個問題與question有關,但是他們的解決方案在這裏不適用。
----------------------- update ---------------------- -----------
這裏是$ echo $ LD_LIBRARY_PATH運行在bash shell和matlab shell中。
在bash shell中:
$ echo $LD_LIBRARY_PATH
/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64:/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64:/opt/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64:/opt/intel/composer_xe_2011_sp1.9.293/debugger/lib/intel64:/opt/intel/composer_xe_2011_sp1.9.293/mpirt/lib/intel64
在Matlab中殼:
>> ! echo $LD_LIBRARY_PATH
/home/chenming/SLhome/chenming/apps/Matlab2012b/sys/os/glnxa64:/home/chenming/SLhome/chenming/apps/Matlab2012b/bin/glnxa64:/home/chenming/SLhome/chenming/apps/Matlab2012b/extern/lib/glnxa64:/home/chenming/SLhome/chenming/apps/Matlab2012b/runtime/glnxa64:/home/chenming/SLhome/chenming/apps/Matlab2012b/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/home/chenming/SLhome/chenming/apps/Matlab2012b/sys/java/jre/glnxa64/jre/lib/amd64/server:/home/chenming/SLhome/chenming/apps/Matlab2012b/sys/java/jre/glnxa64/jre/lib/amd64:/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64:/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64:/opt/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64:/opt/intel/composer_xe_2011_sp1.9.293/debugger/lib/intel64:/opt/intel/composer_xe_2011_sp1.9.293/mpirt/lib/intel64
我在問題中添加了更新。 – 2014-10-03 12:34:24