Re: [netcdf-porting] Matlab unable to call netcdf using '!'

NOTE: The netcdf-porting mailing list is no longer active. The list archives are made available for historical reasons.

Hi netCDF users,

This is a follow-up to my earlier question about setting the search path to the 
netcdf libraries. Fortunately, setting DYLD_LIBRARY_PATH in my .tcshrc file to 
my macports libraries allows me to use netcdf in Matlab. Unfortunately however, 
this modification causes X11 to fail upon startup with the following error:

--------------------------
Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: 
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/local/lib/libJPEG.dylib
 in 
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
-------------------------
I get the error with both X11 from Mac OS and the version from XQuartz 2.7.1. I 
added X11 to my search path but still get the same error:
setenv DYLD_LIBRARY_PATH /opt/X11/lib:/opt/local/lib

I am running netcdf 4.2 on Mac OS 10.7.3, installed via macports.

I'm wondering if there's a fix that would allow me to use netcdf from Matlab 
while also being able to run X11 on my computer. Do you have any ideas that 
might allow both to work?

Thanks much,
Andrew



On Apr 16, 2012, at 12:27 PM, Ashish wrote:

> 
> [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)
> 
> 
> Ashish
> 
> PS1: http://www.mathworks.com/help/techdoc/ref/ncdisp.html might be useful 
> too.
> 
> _______________________________________________
> netcdf-porting mailing list
> netcdf-porting@xxxxxxxxxxxxxxxx
> For list information, to unsubscribe, visit: 
> http://www.unidata.ucar.edu/mailing_lists/

> On Sat, 14 Apr 2012 00:04:11 -0400, Andrew Friedman <andfried@xxxxxxxxxxxx> 
> wrote:
> 
>> 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.nc
>> 
>> However, 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/ncdump
>> Reason: Incompatible library version: ncdump requires version 10.0.0 or 
>> later, but libnetcdf.7.dylib provides version 9.0.0 Trace/BPT trap
>> ncdump -h test.nc: Trace/breakpoint trap
>> 
>> I'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 (7.14.0.739).
>> 
>> Thanks for any suggestions,
>> Andrew
>> 
>> 
>> Andrew Friedman
>> Graduate Student, UC Berkeley Geography
>> andfried@xxxxxxxxxxxx
>> 
>> _______________________________________________
>> netcdf-porting mailing list
>> netcdf-porting@xxxxxxxxxxxxxxxx
>> For list information, to unsubscribe, visit: 
>> http://www.unidata.ucar.edu/mailing_lists/
>> 



  • 2012 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-porting archives: