netcdf-porting mailing list is no longer active. The list archives are made available for historical reasons.
Hi everyone,This is my first time posting to a netcdf listserve - please let me know if another list would be more suitable for my question.I am running netcdf 4.2 on Mac OS 10.7.3, installed via macports.When I am in the shell (tcsh) on my Mac, I am able to use netcdf libraries. For example:ncdump -h testfile.ncHowever, in Matlab, the same command preceded by the '!' (which is supposed to directly invoke the shell) generates an error:!ncdump -h test.nc dyld: Library not loaded: /opt/local/lib/libnetcdf.7.dylib Referenced from: /opt/local/bin/ncdumpReason: Incompatible library version: ncdump requires version 10.0.0 or later, but libnetcdf.7.dylib provides version 9.0.0 Trace/BPT trapncdump -h test.nc: Trace/breakpoint trapI'm unable to figure out why the command preceded by '!' in Matlab does not invoke the same netcdf libraries. I have many matlab scripts that invoke netcdf from the command line, so this is an important issue for me. I changed my Matlab search path to include the MacPorts directories, but that doesn't help.Any ideas? I'm running Matlab R2012a (188.8.131.529). Thanks for any suggestions, Andrew Andrew Friedman Graduate Student, UC Berkeley Geography andfried@xxxxxxxxxxxx _______________________________________________ netcdf-porting mailing list netcdf-porting@xxxxxxxxxxxxxxxxFor list information, to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/
[Replying to the group] Andrew,MATLAB ships with a version of the netcdf library, it appears that a !ncdump is trying to use MATLAB's version of the library.
You mentioned you changed the 'Matlab search' path. This only effects what files the MATLAB interpreter can see. When you use a ! or the system command MATLAB passes the command on to the OS, where the MATLAB search path has no bearing. In Linux (I assume Mac's are similar), the shell environment variables like $PATH (for executables) and $LD_LIBRARY_PATH (for corresponding shared libraries) call the shots.
I guess setting the environment LD_LIBRARY_PATH equivalent for the Mac (DYLD_PATH?) to point to your local install might help. (http://www.mathworks.com/help/techdoc/matlab_env/f0-12994.html#f0-38522)
AshishPS1: http://www.mathworks.com/help/techdoc/ref/ncdisp.html might be useful too.