Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • oanjaoJuly 6, 2009 5:54 PM PDT   
    Unresolved symbol error when running Scipy compiled with icc

    Hi.  I'm trying to compile Python, Numpy, and Scipy on a Linux cluster using icc (ICC) 10.1 20070913.  I can successfully build and run Python and Numpy with Intel tools.  Scipy builds just fine, but I am getting an error when trying to use certain Scipy libraries.  There are various ways to produce this error, but here is a simple one:

    Python 2.5.4 (r254:67916, Jul  6 2009, 19:27:14)
    [GCC Intel(R) C++ gcc 4.1 mode] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from scipy import sparse
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/cfinch/lib/python2.5/site-packages/scipy/sparse/__init__.py", line 6, in <module>
    from csr import *
    File "/home/cfinch/lib/python2.5/site-packages/scipy/sparse/csr.py", line 12, in <module>
    from sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks,
    File "/home/cfinch/lib/python2.5/site-packages/scipy/sparse/sparsetools/__init__.py", line 4, in <module>
    from csr import *
    File "/home/cfinch/lib/python2.5/site-packages/scipy/sparse/sparsetools/csr.py", line 7, in <module>
    import _csr
    ImportError: /home/cfinch/lib/python2.5/site-packages/scipy/sparse/sparsetools/_csr.so: undefined symbol: _ZNSt8ios_base4InitD1Ev

    This symbol is listed as "undefined" in the library _csr.so:
    nm _csr.so | grep ZNSt8
    U _ZNSt8ios_base4InitC1Ev
    U _ZNSt8ios_base4InitD1Ev

    What is this symbol, and where is it supposed to be found?  I have built this combination of Python tools several times on Linux/gcc/ATLAS systems and never had this problem, which is why I suspect it's relatead to icc.  I have searched all the Scipy information I can find, and posted on the scipy-user mailing list, and no one knows what's going on.  Any suggestions would be appreciated.

    Craig




    Om Sachan (Intel)July 7, 2009 12:13 AM PDT
    Rate
     
    Re: Unresolved symbol error when running Scipy compiled with icc


    You may use c++filt to demangle the symbols.

    $ c++filt _ZNSt8ios_base4InitD1Ev
    std::ios_base::Init::~Init()

    You may try adding -lstdc++ to your link command to resolve the issue.



    TimP (Intel)July 7, 2009 7:10 AM PDT
    Rate
     
    Re: Unresolved symbol error when running Scipy compiled with icc


    You may use c++filt to demangle the symbols.

    $ c++filt _ZNSt8ios_base4InitD1Ev
    std::ios_base::Init::~Init()

    You may try adding -lstdc++ to your link command to resolve the issue.

    Which would happen automatically if you use icpc to link a C++ program (as you would use g++ rather than gcc).


    oanjaoJuly 7, 2009 11:30 AM PDT
    Rate
     
    Re: Unresolved symbol error when running Scipy compiled with icc


    You may use c++filt to demangle the symbols.

    $ c++filt _ZNSt8ios_base4InitD1Ev
    std::ios_base::Init::~Init()

    You may try adding -lstdc++ to your link command to resolve the issue.

    Perfect! That's what I needed to know.  I was not familiar with c++filt, and I think it will be a very helpful tool in the future.  Scipy is a Python interface to a large collection of numerical routines, which are written in C, C++, and Fortran.  Because of this mix of languages I have to use icc and ifort to build it.  I tried using "icpc" to force the C++ compiler to build the C libraries, but some of the C code uses outdated programming practices that are no longer allowed in C++.  After adding -lstdc++ to the linker flags, the previous error no longer occurs.  For reasons that I do not understand, it does NOT work if I put -lstdc++ in my LDFLAGS environment variable.  I had to "hard code" it in the file intelccompiler.py under numpy/distutils.  I will bring this up on the Scipy mailing lists to find out why.

    However, there is still a problem when running the Scipy unit tests.  I don't think this is the right forum to discuss that, so I will mark this as "solved."  Many thanks!


Forum jump:  

Intel Software Network Forums Statistics

16,371 users have contributed to 46,345 threads and 163,979 posts to date.

In the past 24 hours, we have 17 new thread(s) 90 new posts(s), and 65 new user(s).

In the past 3 days, the most popular thread for everyone has been Formula for the intersection of straight lines The most posts were made to Take a look at John Burkhard&# The post with the most views is \"-check none\" generates error

Please welcome our newest member theoriginalgunn


For more complete information about compiler optimizations, see our Optimization Notice.