[NumPy-Tickets] [NumPy] #1614: f2py seems to have problem processing $ extended lines?

NumPy Trac numpy-tickets@scipy....
Wed Sep 15 13:50:10 CDT 2010


#1614: f2py seems to have problem processing $ extended lines?
------------------------------------+---------------------------------------
 Reporter:  gbrault                 |       Owner:  pearu      
     Type:  defect                  |      Status:  new        
 Priority:  normal                  |   Milestone:  Unscheduled
Component:  numpy.f2py              |     Version:  1.3.0      
 Keywords:  f2py continuation char  |  
------------------------------------+---------------------------------------
 I have this example fortran file from the slicot library, where the $ sign
 is used to make line extension.
 I get an error with f2py

 sage@ubuntu:~/sage/slicot/src_py$ f2py -c -m slycot MD03BD.f -llapack
 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 "slycot" sources
 f2py options: []
 f2py:> /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c
 creating /tmp/tmpdSKvbW
 creating /tmp/tmpdSKvbW/src.linux-i686-2.6
 Reading fortran codes...
         Reading file 'MD03BD.f' (format:fix,strict)
 Post-processing...
         Block: slycot
                         Block: md03bd
                                         Block: fcn
                                         Block: qrfact
                                         Block: lmparm
 Post-processing (stage 2)...
 Building modules...
         Constructing call-back function "cb_fcn_in_md03bd__user__routines"
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
           def
 fcn(iflag,m,n,ipar,lipar,dpar1,ldpar1,dpar2,ldpar2,x,nfevl,dwork,dwork,ldjsav,dwork,ldwork,infol):
 return
         Constructing call-back function
 "cb_lmparm_in_md03bd__user__routines"
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
           def
 lmparm(cond,n,ipar,lipar,e_dwork_jac_e,ldj,iwork,diag,e_dwork_e_e,delta,par,e_iwork_n_1_e,e_dwork_iw1_e,e_dwork_iw2_e,toldef,e_dwork_iw3_e,e_ldwork_iw3_1_e,infol):
 return
         Constructing call-back function
 "cb_qrfact_in_md03bd__user__routines"
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
           def
 qrfact(n,ipar,lipar,fnorm,e_dwork_jac_e,ldj,e_dwork_e_e,e_dwork_jw1_e,gnorm,iwork,e_dwork_jw2_e,e_ldwork_jw2_1_e,infol):
 return
         Building module "slycot"...
                 Constructing wrapper function "md03bd"...
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 getarrdims:warning: assumed shape array, using 0 instead of '*'
 md03bd(xinit,scale,cond,fcn,qrfact,lmparm,m,n,itmax,factor,nprint,ipar,lipar,dpar1,ldpar1,dpar2,ldpar2,x,diag,nfev,njev,ftol,xtol,gtol,tol,iwork,dwork,ldwork,iwarn,info,[fcn_extra_args,qrfact_extra_args,lmparm_extra_args])
         Wrote C/API module "slycot" to file
 "/tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c"
   adding '/tmp/tmpdSKvbW/src.linux-i686-2.6/fortranobject.c' to sources.
   adding '/tmp/tmpdSKvbW/src.linux-i686-2.6' to include_dirs.
 copying /usr/lib/python2.6/dist-packages/numpy/f2py/src/fortranobject.c ->
 /tmp/tmpdSKvbW/src.linux-i686-2.6
 copying /usr/lib/python2.6/dist-packages/numpy/f2py/src/fortranobject.h ->
 /tmp/tmpdSKvbW/src.linux-i686-2.6
 running build_ext
 customize UnixCCompiler
 customize UnixCCompiler using build_ext
 customize GnuFCompiler
 Could not locate executable g77
 Could not locate executable f77
 customize IntelFCompiler
 Could not locate executable ifort
 Could not locate executable ifc
 customize LaheyFCompiler
 Could not locate executable lf95
 customize PGroupFCompiler
 Could not locate executable pgf90
 Could not locate executable pgf77
 customize AbsoftFCompiler
 Could not locate executable f90
 customize NAGFCompiler
 Found executable /usr/bin/f95
 customize VastFCompiler
 customize GnuFCompiler
 customize CompaqFCompiler
 Could not locate executable fort
 customize IntelItaniumFCompiler
 Could not locate executable efort
 Could not locate executable efc
 customize IntelEM64TFCompiler
 customize Gnu95FCompiler
 Found executable /usr/bin/gfortran
 customize Gnu95FCompiler
 customize Gnu95FCompiler using build_ext
 building 'slycot' extension
 compiling C sources
 C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
 -Wall -Wstrict-prototypes -fPIC

 creating /tmp/tmpdSKvbW/tmp
 creating /tmp/tmpdSKvbW/tmp/tmpdSKvbW
 creating /tmp/tmpdSKvbW/tmp/tmpdSKvbW/src.linux-i686-2.6
 compile options: '-I/tmp/tmpdSKvbW/src.linux-i686-2.6 -I/usr/lib/python2.6
 /dist-packages/numpy/core/include -I/usr/include/python2.6 -c'
 gcc: /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c:379: error: redefinition
 of parameter ‘dwork’
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c:379: note: previous
 definition of ‘dwork’ was here
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c:379: error: redefinition
 of parameter ‘dwork’
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c:379: note: previous
 definition of ‘dwork’ was here
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c:379: error: redefinition
 of parameter ‘dwork’
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c:379: note: previous
 definition of ‘dwork’ was here
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c:379: error: redefinition
 of parameter ‘dwork’
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c:379: note: previous
 definition of ‘dwork’ was here
 error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
 -Wall -Wstrict-prototypes -fPIC -I/tmp/tmpdSKvbW/src.linux-i686-2.6
 -I/usr/lib/python2.6/dist-packages/numpy/core/include
 -I/usr/include/python2.6 -c
 /tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.c -o
 /tmp/tmpdSKvbW/tmp/tmpdSKvbW/src.linux-i686-2.6/slycotmodule.o" failed
 with exit status 1

 The only difference I see is that this module use $ for line continuation.

 Do you think this is the issue?

 I have uploaded the fortran file for you to try

 BR

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1614>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list