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

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 30 2013 - 08:24:17 MDT

Madeline,

I think part of the problem is that the gcc/gfortran in /opt/local is newer than the one that PyNIO was built with.

I don't want to tell you to downgrade your version of gcc/gfortran, so you may need to consider building PyNIO from source code.

I can help with this if needed. Here's a link to help you get started:

http://www.pyngl.ucar.edu/Download/build_pynio_from_src.shtml

At a minimum, you will need to install NetCDF (4.1 or 4.2) before you build PyNIO. If you further want support for NetCDF-4, you will need to install HDF5 and szip. The instructions are all on this page.

--Mary

On Apr 23, 2013, at 10:54 PM, Madeline Miller wrote:

> 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
>>
>>
>>
>>
>>
>>
>> --
>> /**
>> * Daryl Herzmann
>> * Assistant Scientist -- Iowa Environmental Mesonet
>> * http://mesonet.agron.iastate.edu
>> */
>>
>> _______________________________________________
>> 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 Apr 30 08:24:26 2013

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