Re: PyNGL install

From: Hiroyuki Kurokawa <kurokawa_at_nyahnyahspammersnyahnyah>
Date: Tue Sep 20 2011 - 01:21:41 MDT

Hello Mary,

These are outputs.

---------------------
KuroCrz-MBA:~ kurokawahiroyuki$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
KuroCrz-MBA:~ kurokawahiroyuki$ file 'which python'
which python: cannot open `which python' (No such file or directory)
KuroCrz-MBA:~ kurokawahiroyuki$ python ngl01p.py
Traceback (most recent call last):
  File "ngl01p.py", line 53, in <module>
    import Ngl
  File "/usr/local/lib/python2.7/site-packages/PyNGL/Ngl.py", line 39, in <module>
    import fplib
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/PyNGL/fplib.so, 2): no suitable image found. Did find:
        /usr/local/lib/python2.7/site-packages/PyNGL/fplib.so: mach-o, but wrong architecture
KuroCrz-MBA:~ kurokawahiroyuki$ arch -arch i386 python ngl01p.py
---------------------

Figures could be shown after I type the command "arch -arch i386 python ngl01p.py".
(Sorry I don't know how to copy it here)
Is it working without problems?

Thanks a lot,
Hiro

On 2011/09/19, at 19:11, Mary Haley wrote:

> Hi Hiro,
>
> To clarify that PyNGL is working on your system, can you type the following and send me the output:
>
> which python
> file `which python`
>
> Then,<ngl01p.py> try the attached PyNGL script and let me know if it works:
>
> python ngl01p.py
>
> This should pop up an X11 window, and you'll need to click on this window with your left mouse button to advance to the next frame.
>
> There are five different frames, each with a different XY plot.
>
> Thanks,
>
> --Mary
>
> On Sep 19, 2011, at 6:32 AM, Hiroyuki Kurokawa wrote:
>
>> Thank you for many suggestions and informations.
>> And I'm sorry to late for reply.
>> Maybe I successfully install PyNGL thanks for your advices.
>>
>>>>> 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
>> On my Mac,
>> The out put against "which python" is only about the direcotry in where python is. like,
>> /Library/Frameworks/Python.framework/Versions/2.7/bin/python
>> (Maybe because I installed by using binary file?)
>> I installed python with "Python 2.7.2 Mac OS X 64-bit/32-bit x86-64/i386 Installer" on python website (http://www.python.org/download/releases/2.7.2/).
>> I'm not sure but it might be dual version as you said.
>>
>>>> I would like to add something to Mary's detailed instructions below. If you get the same output from file `which python` as that in Mary's email, then you can most likely solve your problems encountered when using the 32 bit PyNGL libraries by trying to execute python as follows:
>>>>
>>>> arch -arch i386 python
>>>>
>>>> This will override the OS's default executable selection hierarchy (which is 64 bit, 32 bit and then ppc) and select the 32 bit executable in the universal binary. Then, I am hopeful that you should be able to import the Nio and Ngl libraries without any problems. If this works, then you don't have to recompile the libraries for 64 bit.
>> I tried this command and tested "import Ngl".
>> It does not show any error.
>> So my python would be the universal 32&64 bit version.
>>
>> Thanks again.
>> Hiro
>>
>> On 2011/09/16, at 21:47, Mary Haley wrote:
>>
>>> Hi Deepak,
>>>
>>> Thanks so much for this great suggestion! I will write a little page about these Mac issues and put it on the pyngl/pynio web page.
>>>
>>> --Mary
>>>
>>> On Sep 16, 2011, at 11:47 AM, Deepak Chandan wrote:
>>>
>>>> Hi Hiro,
>>>> I would like to add something to Mary's detailed instructions below. If you get the same output from file `which python` as that in Mary's email, then you can most likely solve your problems encountered when using the 32 bit PyNGL libraries by trying to execute python as follows:
>>>>
>>>> arch -arch i386 python
>>>>
>>>> This will override the OS's default executable selection hierarchy (which is 64 bit, 32 bit and then ppc) and select the 32 bit executable in the universal binary. Then, I am hopeful that you should be able to import the Nio and Ngl libraries without any problems. If this works, then you don't have to recompile the libraries for 64 bit.
>>>>
>>>> Sincerely,
>>>> Deepak Chandan
>>>>
>>>> PhD Candidate
>>>> Department of Physics, University of Toronto
>>>> 60 St. George Street
>>>> Toronto, ON, M5S1A7, Canada
>>>> Office: MP 619A
>>>> dchandan@atmosp.physics.utoronto.ca
>>>>
>>>>
>>>>
>>>> On 2011-09-16, at 1:37 PM, Mary Haley wrote:
>>>>
>>>>> [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 Tue Sep 20 01:19:32 2011

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