Re: PyNGL/PyNIO on Mac OSX libc++ error?

From: Madeline Miller <madelinem_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 23 2013 - 22:54:37 MDT

Hi Mary,

I have several versions of gcc installed on my system. Some are the Apple
defaults and the others are versions installed by Macports.

The current default is:

$which gcc
/opt/local/bin/gcc

This is a softlink to
/opt/local/bin/gcc-mp-4.5

which is gcc 4.5 installed by macports.

$gcc --version:
gcc (MacPorts gcc45 4.5.4_6) 4.5.4

$ ls /usr/local/lib/libgcc_*
/usr/local/lib/libgcc_ext.10.4.dylib /usr/local/lib/libgcc_s.10.5.dylib
/usr/local/lib/libgcc_ext.10.5.dylib
/usr/local/lib/libgcc_s_ppc64.1.dylib
/usr/local/lib/libgcc_s.1.dylib
/usr/local/lib/libgcc_s_x86_64.1.dylib
/usr/local/lib/libgcc_s.10.4.dylib

The nm command reports nothing:

$ nm /usr/local/lib/libgcc_s.1.dylib | grep ___emutls_get_address
$

Madeline

On Tue, Apr 23, 2013 at 8:45 PM, Mary Haley <haley@ucar.edu> wrote:

> Hi Madeline,
>
> Unfortunately I'm not certain of which version I used to build PyNIO,
> although 4.2.1 seems about right.
>
> The issue may be that you don't have gcc installed on your system, or it's
> out-of-date.
>
> What does the following report:
>
> which gcc
> gcc --version
> ls /usr/local/lib/libgcc_*
>
> If you have a file called "/usr/local/lib/libgcc_s.1.dylib", then what
> does the following report:
>
> nm /usr/local/lib/libgcc_s.1.dylib | grep ___emutls_get_address
>
> --Mary
>
> On Apr 23, 2013, at 7:16 PM, Madeline Miller wrote:
>
> Hi Daryl,
>
> Thanks for this clarification; as you can tell I'm new to python. Now it
> seems the basic PyNGL examples are working so I just need to sort out
> PyNIO.
>
> Madeline
>
>
> On Tue, Apr 23, 2013 at 4:49 PM, daryl herzmann <akrherz@iastate.edu>wrote:
>
>> Madeline,
>>
>> pynglex is a python script itself and can be run without invoking python
>> first. You should be able to do simply this from the command line
>>
>> pynglex -l
>>
>> That assumes pynglex is in your $PATH variable and is set executable.
>>
>> The python triple prompt is for running python code interactively and not
>> necessarily whole python scripts. Typically whole python scripts are run
>> by:
>>
>> python myscript.py
>>
>> So you could try running pynglex like
>>
>> python pynglex -l
>>
>> daryl
>>
>>
>> On Tue, 23 Apr 2013, Madeline Miller wrote:
>>
>> Oh, I had already switched the #!, but python still is not recognizing
>>> pynglex as a command. I am running python interactively and type the
>>> command "pynglex -l" at the prompt. It returns:
>>>
>>>> pynglex -l
>>>>>>
>>>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in <module>
>>> NameError: name 'pynglex' is not defined
>>>
>>> I tried doing this in the folder where pynglex resides, but that doesn't
>>> change the result.
>>>
>>>
>>> On Tue, Apr 23, 2013 at 3:13 PM, Mary Haley <haley@ucar.edu> wrote:
>>>
>>>
>>>> Let me check on the version of gcc when I get home.
>>>>
>>>> I had a typo in my pynglex correction.
>>>>
>>>> It should be:
>>>>
>>>> #!/usr/bin/env python
>>>>
>>>>
>>>> --Mary
>>>>
>>>> On Apr 23, 2013, at 4:08 PM, Madeline Miller wrote:
>>>>
>>>> Hi Mary,
>>>>>
>>>>> Is there a way to modify a path variable in one of the PyNGL/PyNIO
>>>>> files
>>>>>
>>>> to point to another installed gcc version to run those functions, or
>>>> does
>>>> my version of Python need to be re-compiled with the newer gcc to make
>>>> this
>>>> work?
>>>>
>>>>>
>>>>> Modifying that line in the pynglex file did not fix the problem; could
>>>>>
>>>> this be related to the gcc issue as well?
>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Madeline
>>>>>
>>>>>
>>>>> On Tue, Apr 23, 2013 at 2:00 PM, Mary Haley <haley@ucar.edu> wrote:
>>>>> Hi Madeline,
>>>>>
>>>>> I believe this issue has to do with the version of gcc that PyNGL was
>>>>>
>>>> compiled with.
>>>>
>>>>>
>>>>> This was on my home Mac, so I can't verify which gcc this was built
>>>>>
>>>> with. I *think* it was 4.5.0,
>>>>
>>>>> which will certainly be an issue trying to link against your 4.2.1
>>>>>
>>>> version.
>>>>
>>>>>
>>>>> Do you have any other versions of gcc that you can point to on your
>>>>>
>>>> system?
>>>>
>>>>>
>>>>> The pynglex problem is a bug on my part.
>>>>>
>>>>> You should be able to edit this file directly and change the top line
>>>>> to
>>>>>
>>>> read:
>>>>
>>>>>
>>>>> !#/usr/bin/env python
>>>>>
>>>>>
>>>>> --Mary
>>>>>
>>>>> On Apr 23, 2013, at 10:46 AM, Madeline Miller wrote:
>>>>>
>>>>> Hi,
>>>>>>
>>>>>> I am having some issues getting PyNGL and PyNIO installed.
>>>>>> I am using the most recent pre-compiled binaries for Mac OS X, Python
>>>>>>
>>>>> 2.7 and NumPy 1.6.
>>>>
>>>>>
>>>>>> PyNIO-1.4.1.macos-10.6-x86_64-**py271-numpy160-nodap.tar.gz
>>>>>> PyNGL-1.4.0.macos-10.6-x86_64-**py271-numpy160.tar.gz
>>>>>>
>>>>>>
>>>>>> These are the details of my operating system/other installations:
>>>>>>
>>>>>> Mac OSX 10.6.8 (Snow Leopard)
>>>>>>
>>>>>> Python 2.7.3 installed with MacPorts, using GCC 4.2.1
>>>>>>
>>>>>> file `which python` returns:
>>>>>> /opt/local/bin/python: Mach-O 64-bit executable x86_64
>>>>>>
>>>>>> After installing PyNIO and PyNGL in the python directories, I start
>>>>>>
>>>>> python and try to import Nio and Ngl:
>>>>
>>>>>
>>>>>>
>>>>>> import Nio
>>>>>>>>>
>>>>>>>> Traceback (most recent call last):
>>>>>> File "<stdin>", line 1, in <module>
>>>>>> File
>>>>>>
>>>>> "/opt/local/Library/**Frameworks/Python.framework/**
>>>> Versions/2.7/lib/python2.7/**site-packages/PyNIO/Nio.py",
>>>> line 63, in <module>
>>>>
>>>>> from nio import *
>>>>>> ImportError:
>>>>>>
>>>>> dlopen(/opt/local/Library/**Frameworks/Python.framework/**
>>>> Versions/2.7/lib/python2.7/**site-packages/PyNIO/nio.so,
>>>> 2): Symbol not found: ___emutls_get_address
>>>>
>>>>> Referenced from: /usr/local/lib/libstdc++.6.**dylib
>>>>>> Expected in: /usr/local/lib/libgcc_s.1.**dylib
>>>>>> in /usr/local/lib/libstdc++.6.**dylib
>>>>>>
>>>>>> Does anyone know what might be the issue or how to fix this?
>>>>>>
>>>>>>
>>>>>> There are no errors for import Ngl, but
>>>>>>
>>>>>> pynglex -l
>>>>>>>>>
>>>>>>>> Traceback (most recent call last):
>>>>>> File "<stdin>", line 1, in <module>
>>>>>> NameError: name 'pynglex' is not defined
>>>>>>
>>>>>> I put the binaries pynglex and pynglex 2.7 in the folder:
>>>>>> $PYTHONPREFIX/bin
>>>>>>
>>>>>> Should they go somewhere else?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Madeline
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ______________________________**_________________
>>>>>> pyngl-talk mailing list
>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>> http://mailman.ucar.edu/**mailman/listinfo/pyngl-talk<http://mailman.ucar.edu/mailman/listinfo/pyngl-talk>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>> --
>> /**
>> * Daryl Herzmann
>> * Assistant Scientist -- Iowa Environmental Mesonet
>> * http://mesonet.agron.iastate.**edu <http://mesonet.agron.iastate.edu/>
>> */
>>
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
>
>
Received on Tue Apr 23 22:55:06 2013

This archive was generated by hypermail 2.1.8 : Fri May 03 2013 - 07:37:28 MDT