Setting up and using F2PY
For a research project we wished to wrap an Old-Ironsides-eqsue FORTRAN90 program into a slick and modern python module that could be imported and used in conjuction with pytables. This proved to be a rather monsterous task as the F2PY parser has a hard time figuring out quite what to do with the code unless it's either very obvious or specifically told by directives sprinkled throughout the fortran source in the form of specialized comments.In order to even get started, we have to install a handful of packages. Assuming python is already happily installed, this boils down to the following set of rather suspect packages, installed as such:
[ Show crazy output / Woah! Hide that noise! ]
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:181: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:182: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘npy_uintp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:284: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:285: error: expected ‘)’ before ‘*’ token /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:287: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:287: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:288: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:298: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:298: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:300: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:300: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:301: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:303: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:308: error: expected ‘)’ before ‘*’ token /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:313: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:315: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:316: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:316: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:318: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:322: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:324: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:325: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:326: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:327: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:327: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:328: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:328: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:332: error: expected specifier-qualifier-list before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:345: error: expected specifier-qualifier-list before ‘PyArray_GetItemFunc’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:446: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:478: error: expected specifier-qualifier-list before ‘PyObject’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:488: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:513: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:521: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:528: error: expected declaration specifiers or ‘...’ before ‘PyObject’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:670: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:817: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:871: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:1084: error: expected specifier-qualifier-list before ‘npy_intp’ In file included from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:1099, from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14, from /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:13, from /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:17: /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h: In function ‘_import_array’: /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: ‘PyObject’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: (Each undeclared identifier is reported only once /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: for each function it appears in.) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: ‘numpy’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: warning: implicit declaration of function ‘PyImport_ImportModule’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:972: error: ‘c_api’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:972: error: ‘NULL’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:974: warning: implicit declaration of function ‘PyObject_GetAttrString’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:975: warning: implicit declaration of function ‘Py_DECREF’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:976: warning: implicit declaration of function ‘PyCObject_Check’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:977: warning: implicit declaration of function ‘PyCObject_AsVoidPtr’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:984: warning: implicit declaration of function ‘PyErr_Format’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:984: error: ‘PyExc_RuntimeError’ undeclared (first use in this function) In file included from /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:17: /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h: At top level: /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:61: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:63: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:73: error: expected specifier-qualifier-list before ‘npy_intp’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:85: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:94: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyFortran_Type’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:95: error: expected ‘)’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:96: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:97: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:111: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:114: error: expected declaration specifiers or ‘...’ before ‘PyObject’ /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:100: error: ‘NULL’ undeclared here (not in a function) /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:103: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f2py_module_methods’ /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:108: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inittiny_program’ /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:16:20: error: Python.h: No such file or directory In file included from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:61, from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14, from /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:13, from /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:17: /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/npy_common.h:71:2: error: #error Must use Python with unicode enabled. In file included from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14, from /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:13, from /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:17: /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:181: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:182: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘npy_uintp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:284: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:285: error: expected ‘)’ before ‘*’ token /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:287: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:287: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:288: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:298: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:298: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:300: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:300: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:301: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:303: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:308: error: expected ‘)’ before ‘*’ token /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:313: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:315: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:316: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:316: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:318: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:322: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:324: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:325: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:326: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:327: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:327: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:328: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:328: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:332: error: expected specifier-qualifier-list before ‘npy_intp’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:345: error: expected specifier-qualifier-list before ‘PyArray_GetItemFunc’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:446: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:478: error: expected specifier-qualifier-list before ‘PyObject’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:488: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:513: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:521: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:528: error: expected declaration specifiers or ‘...’ before ‘PyObject’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:670: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:817: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:871: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:1084: error: expected specifier-qualifier-list before ‘npy_intp’ In file included from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:1099, from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14, from /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:13, from /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:17: /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h: In function ‘_import_array’: /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: ‘PyObject’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: (Each undeclared identifier is reported only once /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: for each function it appears in.) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: ‘numpy’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: warning: implicit declaration of function ‘PyImport_ImportModule’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:972: error: ‘c_api’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:972: error: ‘NULL’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:974: warning: implicit declaration of function ‘PyObject_GetAttrString’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:975: warning: implicit declaration of function ‘Py_DECREF’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:976: warning: implicit declaration of function ‘PyCObject_Check’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:977: warning: implicit declaration of function ‘PyCObject_AsVoidPtr’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:984: warning: implicit declaration of function ‘PyErr_Format’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:984: error: ‘PyExc_RuntimeError’ undeclared (first use in this function) In file included from /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:17: /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h: At top level: /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:61: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:63: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:73: error: expected specifier-qualifier-list before ‘npy_intp’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:85: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:94: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyFortran_Type’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:95: error: expected ‘)’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:96: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:97: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:111: error: expected declaration specifiers or ‘...’ before ‘npy_intp’ /tmp/tmpWxV0ti/src.linux-i686-2.6/fortranobject.h:114: error: expected declaration specifiers or ‘...’ before ‘PyObject’ /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:100: error: ‘NULL’ undeclared here (not in a function) /tmp/tmpWxV0ti/src.linux-i686-2.6/tiny_programmodule.c:103: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f2py_module_method
[ Show crazy output / Woah! Hide that noise! ]
alejandero@jalopy:~$gfortran shortest_example.f90 -o output /usr/lib/gcc/i486-linux-gnu/4.4.3/libgfortranbegin.a(fmain.o): In function `main': (.text+0x27): undefined reference to `MAIN__' collect2: ld returned 1 exit status
[ Show crazy output / Woah! Hide that noise! ]
In [1]: from mymod import *
In [2]: arraystuff.increment(3,[1,2,3])
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/alejandero/