trouble installing PyNIO/PyNGL with binaries and source build with Intel

From: Andre R. Erler <aerler_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 09 2012 - 21:50:05 MST

I'm new to PyNGL and the whole NCAR software collection.
I'm trying to install PyNIO and PyNGL; I tried both, the binaries and to build
from source. Both were unsuccessful.
I have already installed NCL and NCAR Graphics successfully from source, using
the Intel Compiler Suite (after some tweaking).
I'm installing all this on a (k)ubuntu 11.04 64bit system.

1) Binaries distributions: I've installed them to /usr/local:

$ ls /usr/local/lib/python2.7/site-packages/
Ngl.pth Nio.pth PyNGL PyNGL-1.4.0-py2.7.egg-info PyNIO PyNIO-1.4.1-

Apparently the *.pth files have no effect at all. The packages can be imported
by path names (eg. PyNGL), but seem to be empty. Here is an example with
resulting error:

$ epd
Enthought Python Distribution --
Version: 7.1-1 (64-bit)

Python 2.7.2 |EPD 7.1-1 (64-bit)| (default, Jul 3 2011, 15:17:51)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "packages", "demo" or "enthought" for more information.
>>> import Ngl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Ngl
>>> import PyNGL
>>> x = [10., 20.00, 30., 40.0, 50.000, 60.00, 70., 80.00, 90.000]
>>> y = [ 0., 0.71, 1., 0.7, 0.002, -0.71, -1., -0.71, -0.003]
>>> wks_type = "ps"
>>> wks = PyNGL.open_wks(wks_type,"ngl01p") # Open a workstation.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'open_wks'

I'm using the Enthought Python distribution here, but the same thing happens
with the regular Python distro.
The environment variable PYNGL_NCARG is set to /usr/local/lib/python2.7/site-

The binary version of PyNIO has the same problem.

2) Now source builds: I'm using the Intel compilers and the Enthought Python
Distro, again. PyNIO compiles alright, but when I try to import the package, I
get this error:

>>> import nio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /opt/EPD/epd-7.1-1-rh5-x86_64/lib/python2.7/site-
packages/PyNIO/ undefined symbol: for_cpystr

The symbol 'for_cpystr' is actually defined in a Fortran library related to
the Intel compiler suite:

$ nm /opt/intel/composerxe-2011.4.191/compiler/lib/intel64/ | grep
00000000000cfc60 T for_cpystr

The library is in my LD_LIBRARY_PATH and adding it to /etc/
doesn't help either. The source install resides in /opt/EPD/epd-7.1-1-rh5-
x86_64/lib/python2.7/site-packages/ and
$ ldd /opt/EPD/epd-7.1-1-rh5-x86_64/lib/python2.7/site-packages/PyNIO/ |
grep ''
turns up nothing, so it seems these libraries are not correctly linked in.
Which leads me to suspect that the F2CLIBS and F2CLIBS_PREFIX environment
variables are not properly read by the script.
I have defined them in the following way:

export F2CLIBS='m ifcore irc ifport'
export F2CLIBS_PREFIX=/opt/intel/composerxe-2011.4.191/compiler/lib/intel64/

With this combination (although different syntax) I was able to successfully
build NCL. From my limited understanding of what the script does,
this should produce a list of the required libraries required by f2py. But
obviously it does not work that way.
In fact none of the above libraries are actually linked in to '', except
'' which points to the standard GNU/Linux version.

The script for PyNGL crashes in the linking stage with the following

gcc -pthread -shared -g -L/usr/local/lib -O2 -I/usr/local/include
build/temp.linux-x86_64-2.7/Helper.o build/temp.linux-x86_64-2.7/hlu_wrap.o
build/temp.linux-x86_64-2.7/gsun.o -L/usr/local/ncarg/lib -
L/opt/intel/composerxe-2011.4.191/compiler/lib/intel64/ -L/opt/EPD/epd-7.1-1-
rh5-x86_64/lib -lnfpfort -lhlu -lncarg -lncarg_gks -lncarg_c -lngmath -lX11 -
lm -lifcore -lirc -lifport -lpython2.7 -o build/lib.linux-
/usr/bin/ld: /usr/local/ncarg/lib/libnfpfort.a(dmapgci.o): relocation
R_X86_64_32 against `.rodata.str1.4' can not be used when making a shared
object; recompile with -fPIC
/usr/local/ncarg/lib/libnfpfort.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

(I don't know why gcc is used for linking... otherwise the Intel compilers are
used.) NCL is installed in /usr/local/ncarg/ and this package were compiled
with '-fPIC'. I don't know what the meaning of this is.

Sorry for this lengthy post, but I wanted to provide as much information as
possible. I'm really stuck now. Any help would be greatly appreciated!


pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Mon Jan 9 21:50:13 2012

This archive was generated by hypermail 2.1.8 : Mon Feb 06 2012 - 14:54:47 MST