...I should add that these commands work fine when issued straight from the terminal, but they form part of an intermediate processing chain which is why it'd be great if the "system" command performed as expected! J
External Library version error
2 次查看(过去 30 天)
显示 更早的评论
Hello, I am having some issues with external libraries in Matlab 8.2.0.701 (R2013b) on an iMac OSX 10.9.2 (Mavericks).
I am creating some NetCDF files using the native Matlab interface, which is successful. However, for the last step I use the "system" command to access the NCO (NetCDF Operators) tool "ncatted" to quickly tweak some metadata (add a missing value for all variables) but this fails with the following error:
>> system(['ncatted -O -a missing_value,,c,f,-1.0e34 ',filename])
dyld: Library not loaded: /opt/local/lib/libnetcdf.7.dylib
Referenced from: /opt/local/bin/ncatted
Reason: Incompatible library version: ncatted requires version 10.0.0 or later, but libnetcdf.7.dylib provides version 9.0.0
ncatted -O -a missing_value,,c,f,-1.0e34 psi_data.nc: Trace/breakpoint trap
This is really curious because when I check the versions of the libraries with "ldd" I get:
>> system('ldd /opt/local/bin/ncatted')
/opt/local/bin/ncatted:
/opt/local/lib/libexpat.1.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
** /opt/local/lib/libnetcdf.7.dylib (compatibility version 10.0.0, current version 10.0.0)
/opt/local/lib/libcurl.4.dylib (compatibility version 8.0.0, current version 8.0.0)
/opt/local/lib/libgsl.0.dylib (compatibility version 18.0.0, current version 18.0.0)
/opt/local/lib/libgslcblas.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libudunits2.0.dylib (compatibility version 2.0.0, current version 2.0.0)
As you can see, libnetcdf.7.dylib () is indeed version 10.0.0. I also get the same problem with other installed commands, e.g.
>> system(['ncdump -h ',filename])
dyld: Library not loaded: /opt/local/lib/libnetcdf.7.dylib
Referenced from: /opt/local/bin/ncdump
Reason: Incompatible library version: ncdump requires version 10.0.0 or later, but libnetcdf.7.dylib provides version 9.0.0
ncdump -h psi_data.nc: Trace/breakpoint trap
I originally thought that the problem was with the libraries in $MATLAB_ROOT/bin/maci64 but as the error message shows, it's not these libraries that are inspected...I even tried linking the /opt/local/ libraries into Matlab but that makes things worse!
Is there some sort of path that is confusing Matlab into testing against a version 9 library? Any ideas would be greatly appreciated. Jonathan
2 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NetCDF 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!