Re: PyNGL install

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 16 2011 - 11:37:08 MDT

[Hi Ray, thanks for helping to respond to this.]

Hiro,

Ray is correct, that it has to do with 32-bit and 64-bit architectures.

You can check which type of python you have with:

file `which python`

On my Mac, this reports:

/usr/bin/python: Mach-O universal binary with 3 architectures
/usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture i386): Mach-O executable i386
/usr/bin/python (for architecture ppc7400): Mach-O executable ppc

This indicates that my default python is a "universal" one, which means it was built for
both 32-bit and 64-bit architectures.

Unfortunately, you can't use our precompiled PyNGL or PyNIO binaries with a universal
Python, because it will fail due to incompatibilities. Our binaries are built for one
archictecture only.

So, if your python reports that you have a universal binary as well, then you will need to
build your own version of python for the architecture you want, and then you can build
PyNGL from scratch or use a precompiled binary.

I know this is a pain, and I wish we didn't have to require it. But, the internal code that PyNGL
and PyNIO is dependent on doesn't build in universal mode (yet, maybe someday).

If you want to go down the route of building your own Python, I'll be happy to help.

Here are the settings I used to build Python 2.7.1 on my Mac system:

setenv CC gcc
setenv CXX g++
setenv FC gfortran
setenv F77 gfortran
setenv CFLAGS '-m64 -fPIC'
setenv FFLAGS '-m64 -fPIC'
setenv F90FLAGS '-m64 -fPIC'
setenv CXXFLAGS '-m64 -fPIC'
setenv MACOSX_DEPLOYMENT_TARGET 10.6

--Mary

On Sep 16, 2011, at 8:52 AM, Raymond P. wrote:

> You use the command line command otool on the object you want
> information on. Type "man otool" to get the options. You
> can run it on any library file (*.so) Ngl uses, to see what version
> you have.
>
>
> On Sep 16, 2011, at 8:51 AM, Hiroyuki Kurokawa wrote:
>
>> Thank you for information.
>> I have used 32 bit version of PyNGL.
>> In this case, I would be using 64 bit version of python?
>> Where can I check the version?
>>
>> Sorry for stupid question..
>>
>> Thanks,
>> Hiro
>>
>> On 2011/09/16, at 13:52, Raymond P. wrote:
>>
>>> I believe this means that you have installed a 32 bit PyNGL, but
>>> are using a 64-bit version of Python. It is very confusing, since even
>>> when you are running a 32 bit version of the operating system, you
>>> can install and run 64 bit applications. You get the same error message
>>> if you are using a 32 bit Python but have erroneously installed a 64 bit
>>> PyNGL. You can find out what kind of PyNGL you installed by running
>>> otool on fplib.so .
>>>
>>> --Ray Pierrehumbert
>>>
>>>
>>> Life will be much better when things settle down enough that everything
>>> is 64-bit.
>>> On Sep 16, 2011, at 6:36 AM, Hiroyuki Kurokawa wrote:
>>>
>>>> Hello,
>>>>
>>>> Now I'm trying to install PyNGL from binary file.
>>>> My PC is Mac OS X 10.6.8, 32bit system.
>>>> When I check whether it is installed successfully by type "import Ngl" on Python,
>>>> There are error messages shown below.
>>>>
>>>>>>> import Ngl
>>>> Traceback (most recent call last):
>>>> File "<stdin>", line 1, in <module>
>>>> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyNGL/Ngl.py", line 39, in <module>
>>>> import fplib
>>>> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyNGL/fplib.so, 2): no suitable image found. Did find:
>>>> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyNGL/fplib.so: mach-o, but wrong architecture
>>>>
>>>> I could not understand this error.
>>>> Is this error to install PyNGL?
>>>> Or should I check python or some other settings?
>>>>
>>>> Thanks,
>>>>
>>>> Hiroyuki Kurokawa
>>>>
>>>> ----------------------------------------------------------------------------------------
>>>> Hiroyuki Kurokawa
>>>> Tokyo Institute of Technology & Max-Planck Institute for Astronomy
>>>> PhD student
>>>> email:kurokawa@geo.titech.ac.jp
>>>> ----------------------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> pyngl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>>
>>
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Fri Sep 16 11:37:13 2011

This archive was generated by hypermail 2.1.8 : Mon Oct 10 2011 - 14:31:01 MDT