Problems with shared libraries in Python packages.

Problems with shared libraries in Python packages.

I'm not sure if this is the right forum to post, but I have no better idea, and I can't imagine I'm the only one with this problem.
The general problem is that I get 'undefined symbol' errors whenever I try to import a Python package into my Python code, which includes shared libraries compiled with the Intel Fortran compiler (ifort, v12.0.4). These undefiend symbols are usually defined in libraries supplied by Intel in the Compiler Suite, but are not linked correctly to the shared library used in python.
This happened with various software packages.
Here is an example:

I'm using the Intel compilers (composerxe-2011.4.191) and the Enthought Python Distro (v7.1-1) on (k)ubuntu 11.04, 64bit. the package is PyNIO from NCAR (
It compiles and installs alright ( install), but when I try to import the package, I get this error:

>>> import nio
Traceback (most recent call last):
File "", line 1, in
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 'for_cpystr'
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.

I'm kinda stuck here, but I really want to figure this out!
I've attached a script with the compiler flags I'm using.
Any help would be highly appreciated!

Downloadtext/x-sh installPyNIO.sh1.49 KB
1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.