Re: _GDattach error on import

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 14 2012 - 16:57:32 MST

It looks to me as if there is an architectural mismatch in your build. You are compiling with the -arch i386 option set for gcc and -m32 for gfortran (meaning 32 bit mode), but I suspect the libraries in /usr/local/lib are all compiled as x86_64. That is the meaning of the multiple warnings:

ld: warning: in /usr/local/lib/libjpeg.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /usr/local/lib/libpng.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /usr/local/lib/libz.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /usr/local/lib/libnetcdf.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /usr/local/lib/libmfhdf.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /usr/local/lib/libdf.a, file was built for unsupported file format which is not the architecture being linked (i386)
etc.

I do not use Enthought Python myself, but I just looked at the Enthought Python web site, and it looks as if the default distribution is 32 bit. That may be the real problem. It appears there is a 64-bit version (see http://www.enthought.com/products/epdgetstart.php?platform=mac#64bit) that is described as the "computational" version. I think you need either to recompile all the required libraries in 32 bit mode or you need to install the 64 bit version of EPD.

One rather frustrating aspect of the shared object installation is that you only get a single error message when the object cannot be imported, even though there may be a whole set of problems.
I still don't quite understand about the GDattach message, but I am sure the architectural issue needs to be resolved. Once that is taken care of, the other issue may magically disappear.

Hope this helps. Let me know if I am way off base here.
 -dave

On Nov 14, 2012, at 3:29 PM, John Nielsen-Gammon wrote:

> Dave -
> Attached is the output from the build command.
> - John
> <build.out>
>
> On Nov 14, 2012, at 4:00 PM, David Brown wrote:
>
>> Hi John,
>> I wonder if you could remove the build directory and try capturing the output when doing
>>
>> python setup.py build
>>
>> Using bash I do it with this command:
>>
>> python setup.py build | tee build.out
>>
>> From the symptoms it sounds like the file libsrc/NclHDFEOS.c is getting compiled (it does contain a reference to GDattach) although that should not happen with HAS_HDFEOS set to 0.
>> I would like to look at the build output.
>> -dave
>>
>>
>> On Nov 14, 2012, at 9:52 AM, John Nielsen-Gammon wrote:
>>
>>> Howdy! I'm new to the list.
>>> I just installed PyNIO from source onto my Mac (OS X 10.6.8) with only one departure from instructions (I needed to use the config_fc command for setup.py). I'm using the Enthought Python Distribution free version 7.3-2.
>>> When I type "import Nio", I get the following error:
>>>
>>> >>> import nio
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in <module>
>>> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/PyNIO/nio.so, 2): Symbol not found: _GDattach
>>> Referenced from: /Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/PyNIO/nio.so
>>> Expected in: flat namespace
>>> in /Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/PyNIO/nio.so
>>>
>>> Some googling implies that GDattach is associated with the HDF-EOS2 package. But I didn't install HDF-EOS2 and the value of HAS_HDFEOS in my user environment is 0. Furthermore, the recommended version of HDF-EOS2 is not available at ftp://edhs1.gsfc.nasa.gov/pub/, which is where the installation instructions say I should obtain
>>> Any ideas?
>>> - John
>>>
>>> ________________________________________________
>>> John W. Nielsen-Gammon
>>> Regents Professor and Texas State Climatologist
>>> Dept. of Atmospheric Sciences, Texas A&M University (O&M Rm 1210F)
>>> 3150 TAMUS, College Station, TX 77843-3150
>>> Ph 979-862-2248 Fax 979-862-4466
>>>
>>> _______________________________________________
>>> pyngl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>
>
> ________________________________________________
> John W. Nielsen-Gammon
> Regents Professor and Texas State Climatologist
> Dept. of Atmospheric Sciences, Texas A&M University (O&M Rm 1210F)
> 3150 TAMUS, College Station, TX 77843-3150
> Ph 979-862-2248 Fax 979-862-4466
>
Received on Wed Nov 14 16:57:37 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 21 2012 - 10:43:45 MST