[Numpy-discussion] [f2py] Troubles building a module

Fabrice Silva silva@lma.cnrs-mrs...
Sat Feb 9 01:52:54 CST 2008


Reading the tutorial
http://scipy.org/Cookbook/Theoretical_Ecology/Hastings_and_Powell
I've tried to run the provided code.

But compiling the fortran module with the line command given in the
tuto, I've got the following traceback (you can see it with syntax
highlighting at http://paste.debian.net/48759 ):
        
        fab@Portable-s2m:/tmp$ f2py -c -m hastings hastings.f90
        running build
        running config_cc
        unifing config_cc, config, build_clib, build_ext, build commands --compiler options
        running config_fc
        unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
        running build_src
        building extension "hastings" sources
        f2py options: []
        f2py:> /tmp/tmptfNK80/src.linux-i686-2.4/hastingsmodule.c
        creating /tmp/tmptfNK80
        creating /tmp/tmptfNK80/src.linux-i686-2.4
        Reading fortran codes...
        	Reading file 'hastings.f90' (format:free)
        Post-processing...
        	Block: hastings
        			Block: model
        				Block: fweb
        Post-processing (stage 2)...
        	Block: hastings
        		Block: unknown_interface
        			Block: model
        				Block: fweb
        Building modules...
        	Building module "hastings"...
        		Constructing F90 module support for "model"...
        		  Variables: a1 a2 b1 b2 d2 d1
        			Constructing wrapper function "model.fweb"...
        			  yprime = fweb(y,t)
        	Wrote C/API module "hastings" to file "/tmp/tmptfNK80/src.linux-i686-2.4/hastingsmodule.c"
        Traceback (most recent call last):
          File "/usr/bin/f2py", line 26, in ?
            main()
          File "/var/lib/python-support/python2.4/numpy/f2py/f2py2e.py", line 558, in main
            run_compile()
          File "/var/lib/python-support/python2.4/numpy/f2py/f2py2e.py", line 545, in run_compile
            setup(ext_modules = [ext])
          File "/var/lib/python-support/python2.4/numpy/distutils/core.py", line 176, 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 113, 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 "/var/lib/python-support/python2.4/numpy/distutils/command/build_src.py", line 130, in run
            self.build_sources()
          File "/var/lib/python-support/python2.4/numpy/distutils/command/build_src.py", line 147, in build_sources
            self.build_extension_sources(ext)
          File "/var/lib/python-support/python2.4/numpy/distutils/command/build_src.py", line 256, in build_extension_sources
            sources = self.f2py_sources(sources, ext)
          File "/var/lib/python-support/python2.4/numpy/distutils/command/build_src.py", line 511, in f2py_sources
            numpy.f2py.run_main(f2py_options + ['--lower',
          File "/var/lib/python-support/python2.4/numpy/f2py/f2py2e.py", line 367, in run_main
            ret=buildmodules(postlist)
          File "/var/lib/python-support/python2.4/numpy/f2py/f2py2e.py", line 319, in buildmodules
            dict_append(ret[mnames[i]],rules.buildmodule(modules[i],um))
          File "/var/lib/python-support/python2.4/numpy/f2py/rules.py", line 1222, in buildmodule
            for l in '\n\n'.join(funcwrappers2)+'\n'.split('\n'):
        TypeError: cannot concatenate 'str' and 'list' objects
        



More information about the Numpy-discussion mailing list