[f2py] Difficulties getting f90-files to work
innkeyp-ooo at yahoo.com
innkeyp-ooo at yahoo.com
Fri Nov 4 04:12:45 EET 2005
Hi,
I have been trying for quite some time now to get f2py
to work, but I can't seem to get it to work with with
anything except the GNU compiler, which seems only to
accept f77-files. I am new to Fortran and am more of a
Python programmer, but need some code to run faster
than it can with Python, so I needed to learn a new
language. I chose Fortran, because it doesn't seem as
mind-bending as C.
I write my files in f95-format and usully use gFortran
to compile. The files compile and run fine, but I
can't get f2py to do its magic on them, because f2py
doesn't seem to acknowledge gFortran as a viable
compiler. It this correct?
I have also downloaded and installed Intel's Fortran
compiler, and although it is recognized by f2py(it
shows up on the list of available compilers when I do
the f2py -c --help-fcompiler command), I get the LONG
error mesage seen below. It's quite difficult to
grasp, but I assume I need the executables called
'efort' and 'efc', but I don't any files in my system
with those names, and googling for them does not
reveal anything..
I really am clueless now, so any help is extremely
appreciated.
kind regards Terri P
output:
***************************************************
numpy_info:
FOUND:
define_macros = [('NUMERIC_VERSION',
'"\\"23.8\\""')]
include_dirs = ['/usr/include/python2.4']
running build
running config_fc
running build_src
building extension "untitled" sources
f2py:> /tmp/tmpd1lcgf/src/untitledmodule.c
creating /tmp/tmpd1lcgf
creating /tmp/tmpd1lcgf/src
Reading fortran codes...
Reading file 'int_sin.f90'
Line #33 in int_sin.f90:"real(DP), parameter ::
interval_end = 2.0_DP * pi"
updatevars: no name pattern found for entity='*'.
Skipping.
Post-processing...
Block: untitled
Block: int_sin
{'interval_begin': '0.0_dp'}
In: :untitled:int_sin.f90:int_sin
get_parameters: got "unexpected EOF while parsing
(line 1)" on '0.0_dp'
{'interval_end': '2.0_dp', 'interval_begin': '0.0_dp'}
In: :untitled:int_sin.f90:int_sin
get_parameters: got "unexpected EOF while parsing
(line 1)" on '2.0_dp'
{'interval_end': '2.0_dp', 'interval_begin': '0.0_dp',
'pi': '3.141592653589793238_dp'}
In: :untitled:int_sin.f90:int_sin
get_parameters: got "unexpected EOF while parsing
(line 1)" on '3.141592653589793238_dp'
Block: integ_func
Post-processing (stage 2)...
Building modules...
Building module "untitled"...
Wrote C/API module "untitled" to file
"/tmp/tmpd1lcgf/src/untitledmodule.c"
adding '/tmp/tmpd1lcgf/src/fortranobject.c' to
sources.
adding '/tmp/tmpd1lcgf/src' to include_dirs.
copying
/usr/lib/python2.4/site-packages/f2py2e/src/fortranobject.c
-> /tmp/tmpd1lcgf/src
copying
/usr/lib/python2.4/site-packages/f2py2e/src/fortranobject.h
-> /tmp/tmpd1lcgf/src
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
Could not locate executable efort
Could not locate executable efc
customize IntelFCompiler
customize IntelFCompiler using build_ext
building 'untitled' extension
compiling C sources
gcc options: '-pthread -fno-strict-aliasing -DNDEBUG
-g -O3 -Wall -Wstrict-prototypes -fPIC'
creating /tmp/tmpd1lcgf/tmp
creating /tmp/tmpd1lcgf/tmp/tmpd1lcgf
creating /tmp/tmpd1lcgf/tmp/tmpd1lcgf/src
compile options: '-I/usr/include/python2.4
-I/tmp/tmpd1lcgf/src -I/usr/include/python2.4 -c'
gcc: /tmp/tmpd1lcgf/src/fortranobject.c
gcc: /tmp/tmpd1lcgf/src/untitledmodule.c
compiling Fortran sources
ifort(f77) options: '-72 -w90 -w95 -KPIC -cm -O3
-unroll'
ifort(f90) options: '-FR -KPIC -cm -O3 -unroll'
ifort(fix) options: '-FI -KPIC -cm -O3 -unroll'
compile options: '-I/usr/include/python2.4
-I/tmp/tmpd1lcgf/src -I/usr/include/python2.4 -c'
ifort:f90: int_sin.f90
/opt/intel/fc/9.0/bin/ifort -shared -nofor_main
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
/tmp/tmpd1lcgf/int_sin.o -o ./untitled.so
IPO Error: unresolved : PyArg_ParseTuple
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : Py_BuildValue
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : PyErr_SetString
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyErr_Occurred
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : Py_InitModule4
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : PyType_Type
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : PyImport_ImportModule
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : PyModule_GetDict
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : PyDict_GetItemString
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyCObject_Type
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : Py_FatalError
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : PyString_FromString
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyDict_SetItemString
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyErr_NewException
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : PyErr_Print
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : PyCObject_AsVoidPtr
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/untitledmodule.o
IPO Error: unresolved : _PyObject_New
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyDict_New
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyObject_Free
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : _Py_NoneStruct
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : Py_FindMethod
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyString_ConcatAndDel
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyExc_TypeError
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyErr_Format
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyExc_RuntimeError
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyDict_DelItemString
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
IPO Error: unresolved : PyExc_AttributeError
Referenced in
/tmp/tmpd1lcgf/tmp/tmpd1lcgf/src/fortranobject.o
Removing build directory /tmp/tmpd1lcgf
More information about the f2py-users
mailing list