[f2py] Re: Bug with string concatenation
Thomas Robitaille <[email protected]>
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
Apologies, I cut out too much of the code. Here is the code that
produces the problem:
SUBROUTINE TEST ()
CHARACTER WORD*20
PARAMETER (WORD = 'HELLO' // 'WORLD' )
END
If I try and compile it with f2py, I get the traceback I sent
previously. If I compile e.g. with gfortran -c there is no problem.
Is this a bug?
Thanks,
Thomas
On Apr 1, 2009, at 10:14 AM, Thomas Robitaille wrote:
> Hi,
>
> I am getting an error when running f2py on the following code (I
> have simplified the code to the buggy part)
>
> SUBROUTINE TEST ()
> PARAMETER (WORD = 'HELLO' // 'WORLD' )
> END
>
> The full traceback is below. Is this a bug with f2py?
>
> Thanks,
>
> Thomas
>
> $ f2py -c temp.f -m temp
> 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 "temp" sources
> f2py options: []
> f2py:> /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/tmpFj8g8F/
> src.macosx-10.3-i386-2.6/tempmodule.c
> creating /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/tmpFj8g8F
> creating /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/tmpFj8g8F/
> src.macosx-10.3-i386-2.6
> Reading fortran codes...
> Reading file 'temp.f' (format:fix,strict)
> Traceback (most recent call last):
> File "/Library/Frameworks/Python.framework/Versions/Current/bin/
> f2py", line 5, in <module>
> pkg_resources.run_script('numpy==1.3.0rc1', 'f2py')
> File "build/bdist.macosx-10.3-i386/egg/pkg_resources.py", line 448,
> in run_script
> File "build/bdist.macosx-10.3-i386/egg/pkg_resources.py", line
> 1166, in run_script
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/EGG-
> INFO/scripts/f2py", line 24, in <module>
> main()
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/f2py/f2py2e.py", line 557, in main
> run_compile()
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/f2py/f2py2e.py", line 543, in run_compile
> setup(ext_modules = [ext])
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/distutils/core.py", line 184, in setup
> return old_setup(**new_attr)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/core.py", line 152, in setup
> dist.run_commands()
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/dist.py", line 975, in run_commands
> self.run_command(cmd)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/dist.py", line 995, in run_command
> cmd_obj.run()
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/distutils/command/build.py", line 37, in run
> old_build.run(self)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/command/build.py", line 134, in run
> self.run_command(cmd_name)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/cmd.py", line 333, in run_command
> self.distribution.run_command(command)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/dist.py", line 995, in run_command
> cmd_obj.run()
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/distutils/command/build_src.py", line 130, in run
> self.build_sources()
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/distutils/command/build_src.py", line 147, in build_sources
> self.build_extension_sources(ext)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/distutils/command/build_src.py", line 256, in
> build_extension_sources
> sources = self.f2py_sources(sources, ext)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/distutils/command/build_src.py", line 514, in f2py_sources
> ['-m',ext_name]+f_sources)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/f2py/f2py2e.py", line 338, in run_main
> postlist=callcrackfortran(files,options)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/f2py/f2py2e.py", line 276, in callcrackfortran
> postlist=crackfortran.crackfortran(files)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/f2py/crackfortran.py", line 2683, in crackfortran
> readfortrancode(files,crackline)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/f2py/crackfortran.py", line 420, in readfortrancode
> dowithline(finalline)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/f2py/crackfortran.py", line 634, in crackline
> analyzeline(m,pat[1],line)
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy-1.3.0rc1-py2.6-macosx-10.5-fat.egg/
> numpy/f2py/crackfortran.py", line 980, in analyzeline
> v = eval(initexpr,{},params)
> File "<string>", line 1, in <module>
> TypeError: unsupported operand type(s) for //: 'str' and 'str'
>