F2PY problems
Siegfried Gonzi
siegfried.gonzi at kfunigraz.ac.at
Thu May 2 06:47:00 EDT 2002
Is there a good soul out there, who can help with my problem?
I want to use F2PY, but after following the examples:
C:\Wissenschaft\F2PY\tmp> f2py -c -m example foo3.py
I get the error message:
...
scipy_distutils.command.build_flib.nag_fortran_compiler
scipy_distutils.command.build_flib.compaq_fortran_compiler
scipy_distutils.command.build_flib.vast_fortran_compiler
scipy_distutils.command.build_flib.gnu_fortran_compiler
using Gnu 2.95.3-5 Fortran compiler
building 'example' library
...
"C:\Wissenschaft\Python2.2\Lib\site-packages\scipy_distutils\command\build_ext.py",
line 16, in build_extension
save_linker_so = self.compiler.linker_so
AttributeError: MSVCCompiler instance has no attribute 'linker_so'
The compilation starts with gnu but the Microsoft Visual C++ compiler
interferes somewhat the compilation.
I got the advice to add the following to the f2pye.py file:
# force g77 for now
from scipy_distutils.command import build_flib
build_flib.all_compilers = [build_flib.gnu_fortran_compiler]
if sys.platform == 'win32':
from scipy_distutils.mingw32_support import *
But honestly speaking I do not know where exactly to put the above
statements.
A few weeks ago I used SWIG and set up "vcvars32.bat" and maybe this is
the reason why MVC++ interferes. Is there a way to set Mingw as a
default environment (please, if possible an explanation for a dummy) and
to set "vcvars32.bat" back (if needed?). But I use the Fortran 90/95 F
compiler in companion with Mingw in order to compile Fortran 90/95
programs; F relies on Mingw and therefore Mingw should work.
Has anybody experience with F2PY on Windows and Python2.2?
Thanks,
S. Gonzi
More information about the Python-list
mailing list