RuntimeError connected with compileAutoLib

Help
2014-05-15
2014-05-15
  • Maurizio De Pitta'

    Dear everyone,
    I am completely new to PyDSTool (and aside, rather new to Python).
    My apologies in advance for cross-posting in case, but I could not find any solution on the web.
    I am trying to run some bifurcation analysis of some system, for example let's say the Moris-Lecar neuron as in PyCont_MorrisLecar_TypeII.py. EC-C curves are computed fine, but when I try to compute LC-C branches then I get:

    File "<ipython-input-4-efcf4e403c51>", line 1, in <module>
    runfile('/opt/PyDSTool/tests/PyCont_MorrisLecar_TypeII.py', wdir='/opt/PyDSTool/tests')

    File "/Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
    execfile(filename, namespace)

    File "/opt/PyDSTool/tests/PyCont_MorrisLecar_TypeII.py", line 71, in <module>
    PyCont.newCurve(PCargs)

    File "/opt/PyDSTool/PyCont/ContClass.py", line 221, in newCurve
    self.loadAutoMod()

    File "/opt/PyDSTool/PyCont/ContClass.py", line 432, in loadAutoMod
    self.compileAutoLib()

    File "/opt/PyDSTool/PyCont/ContClass.py", line 717, in compileAutoLib
    raise RuntimeError

    RuntimeError

    If I get it correctly, the problem shall be that AUTO libs are not compiled correctly.
    I think so because it seems that LC-C computations produce always the same error, regardless of the system (I tried also on some system of mine, and I keep getting the same RuntimeError).

    I am working on MAC OSX Mavericks, using python by Anaconda. Xcode works fine.

    Any help would be sincerely appreciated.

    Best,

    Maurizio

     
  • Rob Clewley

    Rob Clewley - 2014-05-15

    It's most likely that you don't have the proper dependencies for compiling C code automatically. I'm not familiar with getting this to work on Mavericks, but you need to carefully follow the instructions for ensuring that swig, gcc and gfortran are accessible on your PATH, etc. Check the "Getting Started" page and look at the section about C-based integrators (AUTO is included here implicitly). You shouldn't have to install anything if Anaconda comes with swig too (you should check), just maybe configure a couple of things. Did you also put the PyDSTool.pth file in site-packages?

     
  • Maurizio De Pitta'

    Dear Rob,
    thanks for the prompt reply.
    So, I actually followed the Getting Started suggestions, and installed SWIG, dropped the flag -m32 in the compiler of ContClass, and added the pth file.

    The problem is still there.
    Before further debugging: I must admit that I am not sure whether I wrote a correct PyDSTool.pth file. On my MAC, PyDSTool is in /opt/PyDSTool, so I write the file as:

    /opt
    /opt/PyDSTool

    Does this make sense? Or do I need to keep the <somthing>/src/ path as online?

    Thanks for your patience.

    M

     
    Last edit: Maurizio De Pitta' 2014-05-15
  • Rob Clewley

    Rob Clewley - 2014-05-15

    That should be fine, although I have always put the trailing / at the end of each line (it may not matter). I really need to see the actual error traceback from gcc and Python's distutils, which you'll only see if you start at the terminal prompt at run

    python PyCont_MorrisLecar_TypeII.py
    

    and send me the full info (should include the gcc call before the Python RuntimeError). But you should also tell me whether this works and what its error output is if it fails:

    python dopri_event_test.py
    
     
  • Maurizio De Pitta'

    Hi Rob,
    no, both of them don't work:

    I'll post here the output of PyCont_MorrisLecar_TypeII.py. While for dopri_event_test.py I'll post it right after.

    runfile('/opt/PyDSTool/tests/PyCont_MorrisLecar_TypeII.py', wdir=r'/opt/PyDSTool/tests')
    Computing curve...
    Maximum test function iterations reached.

    Checking...
    |q| = 1.000000
    |<p,q> - 1| = 2.22044604925e-16
    |Aq - iwq| = 0.000008
    |A*p + iwp| = 0.001173

    H Point found

    0 :
    Iapp = 93.8606995046
    w = 0.139681761316
    v = -25.2690349617

    Eigenvalues =

     (0.000008,0.079779)
     (0.000008,-0.079779)
    

    w = 0.079778788658630376
    l1 = 0.00052809665641795225

    Maximum test function iterations reached.

    Checking...
    |q| = 1.000000
    |<p,q> - 1| = 2.77555756156e-17
    |Aq - iwq| = 0.000005
    |A*p + iwp| = 0.000611

    H Point found

    0 :
    Iapp = 212.021298931
    w = 0.595494299163
    v = 7.80088978423

    Eigenvalues =

     (-0.000005,0.148604)
     (-0.000005,-0.148604)
    

    w = 0.14860350049863846
    l1 = 0.00055089487899438695

    done in 1.546 seconds!
    /opt/PyDSTool/PyCont/auto/module/automod.c:59:5: error: non-void function 'PackOut' should return a value [-Wreturn-type]
    import_libnumarray();
    ^

    /Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/numpy/numarray/include/numpy/libnumarray.h:78:172: note: expanded from macro 'import_libnumarray'

    define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; }

                                                                                                                                                                           ^
    

    1 error generated.
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
    execfile(filename, namespace)
    File "/opt/PyDSTool/tests/PyCont_MorrisLecar_TypeII.py", line 71, in <module>
    PyCont.newCurve(PCargs)
    File "/opt/PyDSTool/PyCont/ContClass.py", line 221, in newCurve
    self.loadAutoMod()
    File "/opt/PyDSTool/PyCont/ContClass.py", line 432, in loadAutoMod
    self.compileAutoLib()
    File "/opt/PyDSTool/PyCont/ContClass.py", line 719, in compileAutoLib
    raise RuntimeError
    RuntimeError

     
    Last edit: Maurizio De Pitta' 2014-05-15
    • Vladimir Zakharov

      16.05.2014 0:59 "Maurizio De Pitta'" mauriziodepitta@users.sf.net wrote:

      /opt/PyDSTool/PyCont/auto/module/automod.c:59:5: error: non-void function
      'PackOut' should return a value [-Wreturn-type]
      import_libnumarray();
      ^

      /Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/numpy/numarray/include/numpy/libnumarray.h:78:172:
      note: expanded from macro 'import_libnumarray'

      define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred())
      { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi
      failed to import.\n"); return; }

      ^

      1 error generated.

      It seems, your system compiler is Clang. Which is not yet supported by
      PyDSTool C generators. Show us output of the 'cc -v' command.

       
  • Maurizio De Pitta'

    Here is instead the output of dopri_event_test.py:

    runfile('/opt/PyDSTool/tests/dopri_event_test.py', wdir=r'/opt/PyDSTool/tests')
    /opt/PyDSTool/integrator/interface.c:22:3: error: non-void function 'Vfield' should return a value [-Wreturn-type]
    import_libnumarray();
    ^
    /Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/numpy/numarray/include/numpy/libnumarray.h:78:172: note: expanded from macro 'import_libnumarray'

    define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; }

                                                                                                                                                                           ^
    

    /opt/PyDSTool/integrator/interface.c:68:3: error: non-void function 'Jacobian' should return a value [-Wreturn-type]
    import_libnumarray();
    ^
    /Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/numpy/numarray/include/numpy/libnumarray.h:78:172: note: expanded from macro 'import_libnumarray'

    define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; }

                                                                                                                                                                           ^
    

    /opt/PyDSTool/integrator/interface.c:128:3: error: non-void function 'JacobianP' should return a value [-Wreturn-type]
    import_libnumarray();
    ^
    /Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/numpy/numarray/include/numpy/libnumarray.h:78:172: note: expanded from macro 'import_libnumarray'

    define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; }

                                                                                                                                                                           ^
    

    /opt/PyDSTool/integrator/interface.c:187:3: error: non-void function 'AuxFunc' should return a value [-Wreturn-type]
    import_libnumarray();
    ^
    /Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/numpy/numarray/include/numpy/libnumarray.h:78:172: note: expanded from macro 'import_libnumarray'

    define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; }

                                                                                                                                                                           ^
    

    /opt/PyDSTool/integrator/interface.c:233:3: error: non-void function 'MassMatrix' should return a value [-Wreturn-type]
    import_libnumarray();
    ^
    /Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/numpy/numarray/include/numpy/libnumarray.h:78:172: note: expanded from macro 'import_libnumarray'

    define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; }

                                                                                                                                                                           ^
    

    /opt/PyDSTool/integrator/interface.c:627:3: error: non-void function 'PackOut' should return a value [-Wreturn-type]
    import_libnumarray();
    ^
    /Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/numpy/numarray/include/numpy/libnumarray.h:78:172: note: expanded from macro 'import_libnumarray'

    define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; }

                                                                                                                                                                           ^
    

    6 errors generated.
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/Users/mauriziodepitta/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
    execfile(filename, namespace)
    File "/opt/PyDSTool/tests/dopri_event_test.py", line 58, in <module>
    testODE = Dopri_ODEsystem(DSargs)
    File "/opt/PyDSTool/Generator/Dopri_ODEsystem.py", line 421, in init
    self.compileLib()
    File "/opt/PyDSTool/Generator/Dopri_ODEsystem.py", line 795, in compileLib
    raise RuntimeError
    RuntimeError

     
  • Maurizio De Pitta'

    Uhm, sorry for the bad-formatting...

     
  • Rob Clewley

    Rob Clewley - 2014-05-15

    I'm not familiar with using Anaconda, but it looks like you have a serious issue with the compatibility of the underlying legacy API for numarray (through numpy). I don't know enough about that API to understand why it's a problem on your system - it is not a problem I commonly see. I think you should post a question to the Anaconda support group, and explain that PyDSTool is trying to use distutils to build a DLL extension that uses libnumarray, and that it has generally worked in that past for other people using this software. Is it possible that your version of Anaconda is too new and does not even contain the libnumarray legacy API?

     
  • Maurizio De Pitta'

    Hi Rob,
    I have no clue on that. I will follow though your advice.
    And also, (by tomorrow now, since it is 2am down here), I will try to run everything from native python (without the spider-by-anaconda interface). And update accordingly if I will have any progress.

    Thanks for now.

    M

     

Log in to post a comment.