[SciPy-user] F2PY stopped working with new scipy

Neilen Marais nmarais at sun.ac.za
Fri Apr 7 04:34:38 CDT 2006


Hi

I'm using F2PY with the intel fortran compiler under Ubunty Breezy (05.10)
AMD64 to wrap some F90 code. If I use the old scipy (package version
0.3.2-2ubuntu1) with:

F2PY Version:2.46.243_2020
scipy.distutils Version: 0.3.2

the following test command works as expected:

$ f2py --fcompiler=intel -m testmod -c test_data.f90 test_prog.f90

Before I install new scipy, I removed all the f2py files , since it is now
included with scipy. I also removed the ubuntu scipy package.

After installing numpy-0.9.6 and scipy-0.4.8, trying to generate the wrappers
results in the following output:

$ f2py --fcompiler=intel -m testmod -c test_data.f90 test_prog.f90
running build
running config_fc
running build_src
building extension "testmod" sources
f2py options: []
f2py:> /tmp/tmp_cZX2X/src/testmodmodule.c
creating /tmp/tmp_cZX2X
creating /tmp/tmp_cZX2X/src
Reading fortran codes...
        Reading file 'test_data.f90' (format:free)
        Reading file 'test_prog.f90' (format:free)
Post-processing...
        Block: testmod
                        Block: data
                        Block: prog
                                Block: init_data
                                Block: process_data
Post-processing (stage 2)...
        Block: testmod
                Block: unknown_interface
                        Block: data
                        Block: prog
                                Block: init_data
                                Block: process_data
Building modules...
        Building module "testmod"...
                Constructing F90 module support for "data"...
                  Variables: test_arr
                Constructing F90 module support for "prog"...
                        Constructing wrapper function "prog.init_data"...
                          init_data()
                        Constructing wrapper function "prog.process_data"...
                          process_data(factors,[n])
        Wrote C/API module "testmod" to file
        "/tmp/tmp_cZX2X/src/testmodmodule.c"
        Fortran 90 wrappers are saved to
        "/tmp/tmp_cZX2X/src/testmod-f2pywrappers2.f90"
  adding '/tmp/tmp_cZX2X/src/fortranobject.c' to sources.
  adding '/tmp/tmp_cZX2X/src' to include_dirs.  copying
  /usr/lib/python2.4/site-packages/numpy/f2py/src/fortranobject.c ->
  /tmp/tmp_cZX2X/src copying
  /usr/lib/python2.4/site-packages/numpy/f2py/src/fortranobject.h ->
  /tmp/tmp_cZX2X/src
  adding '/tmp/tmp_cZX2X/src/testmod-f2pywrappers2.f90' to sources.  running
  build_ext customize UnixCCompiler customize UnixCCompiler using build_ext
  Could not locate executable efort Could not locate executable efc warning:
  build_ext: fcompiler=intel is not available.  building 'testmod' extension
  compiling C sources gcc options: '-pthread -fno-strict-aliasing -DNDEBUG -g
  -O3 -Wall -Wstrict-prototypes -fPIC' creating /tmp/tmp_cZX2X/tmp creating
  /tmp/tmp_cZX2X/tmp/tmp_cZX2X creating /tmp/tmp_cZX2X/tmp/tmp_cZX2X/src
  compile options: '-I/tmp/tmp_cZX2X/src
  -I/usr/lib/python2.4/site-packages/numpy/core/include
  -I/usr/include/python2.4 -c' gcc: /tmp/tmp_cZX2X/src/fortranobject.c gcc:
  /tmp/tmp_cZX2X/src/testmodmodule.c Traceback (most recent call last):
  File "/usr/bin/f2py", line 6, in ?
    f2py.main()
  File "/usr/lib/python2.4/site-packages/numpy/f2py/f2py2e.py", line 546, in
  main
    run_compile()
  File "/usr/lib/python2.4/site-packages/numpy/f2py/f2py2e.py", line 533, in
  run_compile
    setup(ext_modules = [ext])
  File "/usr/lib/python2.4/site-packages/numpy/distutils/core.py", line 85, in
  setup
    return old_setup(**new_attr)
  File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.4/distutils/command/build.py", line 112, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.4/site-packages/numpy/distutils/command/build_ext.py",
  line 109, in run
    self.build_extensions()
  File "/usr/lib/python2.4/distutils/command/build_ext.py", line 405, in
  build_extensions
    self.build_extension(ext)
  File "/usr/lib/python2.4/site-packages/numpy/distutils/command/build_ext.py",
  line 220, in build_extension
    if self.fcompiler.module_dir_switch is None:
AttributeError: 'NoneType' object has no attribute 'module_dir_switch'

Is there something wrong with my setup, or what is causing this behaviour?

Thanks
Neilen


-- 
you know its kind of tragic 
we live in the new world
but we've lost the magic

-- Battery 9 (www.battery9.co.za)



More information about the SciPy-user mailing list