hi all, I have an .f90 file with a routine that I intend to connect to Python via f2py (the file is http://users.bigpond.net.au/amiller/bvls.f90 ) I have gfortran and f95 installed (KUBUNTU 7.10), *no f90* (f90 is absent in KUBUNTU software update channel as well). Both they work with the file correctly, so I can get both a.out and bvlc.o (however I don't know how to get *.so files) So f2py -c -m bvls bvls.f90 yields: ... Fortran f77 compiler: /usr/bin/g77 -g -Wall -fno-second-underscore -fPIC -O3 -funroll-loops -march=athlon64 -mmmx -m3dnow -msse2 -msse compile options: '-I/tmp/tmpK2eM1Z/src.linux-x86_64-2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c' error: f90 not supported by GnuFCompiler needed for bvls.f90 if I rename the file extension to f95 I have the same problem: error: f90 not supported by GnuFCompiler needed for bvls.f95 Any suggestions? Thank you in advance, D.
On Thu, February 21, 2008 8:36 pm, dmitrey wrote:
hi all, I have an .f90 file with a routine that I intend to connect to Python via f2py
(the file is http://users.bigpond.net.au/amiller/bvls.f90 )
I have gfortran and f95 installed (KUBUNTU 7.10), *no f90* (f90 is absent in KUBUNTU software update channel as well).
Both they work with the file correctly, so I can get both a.out and bvlc.o (however I don't know how to get *.so files)
So f2py -c -m bvls bvls.f90 yields: ... Fortran f77 compiler: /usr/bin/g77 -g -Wall -fno-second-underscore -fPIC -O3 -funroll-loops -march=athlon64 -mmmx -m3dnow -msse2 -msse compile options: '-I/tmp/tmpK2eM1Z/src.linux-x86_64-2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c' error: f90 not supported by GnuFCompiler needed for bvls.f90
if I rename the file extension to f95 I have the same problem: error: f90 not supported by GnuFCompiler needed for bvls.f95
Any suggestions?
You need to specify F90 complier explicitly (default compiler for f2py is g77): f2py -c -m bvls bvls.f90 --fcompiler=gnu95 HTH, Pearu
Pearu, I have spent several days trying to connect bvls.f and/or bvls.f90 routines (linear least squares, box-bounded), but it still doesn't yield correct results: they are different according to input precision (float32, float64, float128) and noone yields correct solution - neither for finite nor for infinite bounds. Could you take a look at the files? http://www.box.net/shared/1gaauhrcoo This problem is the one of big importance (and very urgent), because 1) lots of users are interested in constrained LLS problems (AFAIK there are no Python-connected solvers for the ones, at least, free solvers) 2) it could essentially enhance scikits.openopt lincher and ralg solvers. The attached script yields: using bvls.f Type: float32 ; xf= [ 0. 0.] ; type(xf[0])= <type 'numpy.float32'> Type: float64 ; xf= [ 1. -Inf] ; type(xf[0])= <type 'numpy.float64'> Type: float128 ; xf= [0.0 0.0] ; type(xf[0])= <type 'numpy.float128'> using bvls.f90 Type: float32 ; xf= [ 0. -0.] ; type(xf[0])= <type 'numpy.float32'> Type: float64 ; xf= [ 0. -0.] ; type(xf[0])= <type 'numpy.float32'> Type: float128 ; xf= [ 0. -0.] ; type(xf[0])= <type 'numpy.float32'> (while xf should be [15,15]) Thank you in advance, D. Pearu Peterson wrote:
On Thu, February 21, 2008 8:36 pm, dmitrey wrote:
hi all, I have an .f90 file with a routine that I intend to connect to Python via f2py
(the file is http://users.bigpond.net.au/amiller/bvls.f90 )
I have gfortran and f95 installed (KUBUNTU 7.10), *no f90* (f90 is absent in KUBUNTU software update channel as well).
Both they work with the file correctly, so I can get both a.out and bvlc.o (however I don't know how to get *.so files)
So f2py -c -m bvls bvls.f90 yields: ... Fortran f77 compiler: /usr/bin/g77 -g -Wall -fno-second-underscore -fPIC -O3 -funroll-loops -march=athlon64 -mmmx -m3dnow -msse2 -msse compile options: '-I/tmp/tmpK2eM1Z/src.linux-x86_64-2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c' error: f90 not supported by GnuFCompiler needed for bvls.f90
if I rename the file extension to f95 I have the same problem: error: f90 not supported by GnuFCompiler needed for bvls.f95
Any suggestions?
You need to specify F90 complier explicitly (default compiler for f2py is g77):
f2py -c -m bvls bvls.f90 --fcompiler=gnu95
HTH, Pearu
_______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
On Tue, February 26, 2008 11:38 am, dmitrey wrote:
Pearu, I have spent several days trying to connect bvls.f and/or bvls.f90 routines (linear least squares, box-bounded), but it still doesn't yield correct results: they are different according to input precision (float32, float64, float128) and noone yields correct solution - neither for finite nor for infinite bounds.
Could you take a look at the files? http://www.box.net/shared/1gaauhrcoo
Sure. Could you send also the .pyf file of the bvls module or a f2py command line that you are using to wrap bvls? Pearu
I have seen the pyf-files appearing from time to time, but now they are absent (in the directory where I have used f2py), and do not appear after f2py using. As for commands, I have used f2py -c -m bvls bvls.f and f2py -c -m bvls bvls.f90 --fcompiler=gnu95 I have tried Linux KUBUNTU 7.10 and UBUNTU 7.04 AFAIK compilers used were gfortran and f95 HTH, D. Pearu Peterson wrote:
On Tue, February 26, 2008 11:38 am, dmitrey wrote:
Pearu, I have spent several days trying to connect bvls.f and/or bvls.f90 routines (linear least squares, box-bounded), but it still doesn't yield correct results: they are different according to input precision (float32, float64, float128) and noone yields correct solution - neither for finite nor for infinite bounds.
Could you take a look at the files? http://www.box.net/shared/1gaauhrcoo
Sure. Could you send also the .pyf file of the bvls module or a f2py command line that you are using to wrap bvls?
Pearu
_______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
On Tue, February 26, 2008 12:01 pm, dmitrey wrote:
I have seen the pyf-files appearing from time to time, but now they are absent (in the directory where I have used f2py), and do not appear after f2py using.
As for commands, I have used f2py -c -m bvls bvls.f and f2py -c -m bvls bvls.f90 --fcompiler=gnu95
Ok, thanks for the info. In general, it is recommended to use a modified .pyf when wrapping Fortran functions with longish argument list that may contain output-type arguments. See f2py users guide for more information. Below follows the content of a .pyf file that I have modified to meet the docs of bvls.f (there are some room for improvements). Then I used the following command line f2py -c bvls.pyf bvls.f to build the bvls extension module. In test_bvls.py file I changed the bvls.bvls call to xf,w,istate,loopa = bvls.bvls(a,b,bl,bu) And, most importantly, set inf=100. Now I get the correct results: using bvls.f Type: float32 ; xf= [ 15. 15.] ; type(xf[0])= <type 'numpy.float64'> Type: float64 ; xf= [ 15. 15.] ; type(xf[0])= <type 'numpy.float64'> Type: float128 ; xf= [ 15. 15.] ; type(xf[0])= <type 'numpy.float64'> Btw, I believe that your approach of not using .pyf file would also worked when not using inf as an bound parameter - obviosly the underlying Fortran code is not designed to handle float infinities. HTH, Pearu ! -*- f90 -*- ! Note: the context of this file is case sensitive. !FILE: bvls.pyf python module bvls ! in interface ! in :bvls subroutine bvls(key,m,n,a,b,bl,bu,x,w,act,zz,istate,loopa) ! in :bvls:bvls.f integer :: key = 0 integer optional,check(shape(a,0)==m),depend(a) :: m=shape(a,0) integer optional,check(shape(a,1)==n),depend(a) :: n=shape(a,1) double precision dimension(m,n) :: a double precision dimension(m),depend(m) :: b double precision dimension(n),depend(n) :: bl double precision dimension(n),depend(n) :: bu double precision dimension(n),depend(n),intent(out) :: x double precision dimension(n),depend(n),intent(out) :: w double precision dimension(m,m + 2),depend(m), intent(cache), optional :: act double precision dimension(m),depend(m), intent(cache), optional :: zz integer dimension(n + 1),depend(n),intent(out) :: istate integer intent(out) :: loopa end subroutine bvls end interface end python module bvls ! This file was auto-generated with f2py (version:2_3744). ! See http://cens.ioc.ee/projects/f2py2e/
So I have tried the pyf-file attached but unfortunately it yields text output using bvls.f Type: float32 ; and then nothing (for all finite-box bounded as well) Fortunately, all-finite box-bounds now work correctly, but only for f77-version (with f2py -c -m bvls bvls.f) and numpy.float64 type: using bvls.f Type: float32 ; xf= [ 0. 0.] ; type(xf[0])= <type 'numpy.float32'> Type: float64 ; xf= [ 15. 15.] ; type(xf[0])= <type 'numpy.float64'> Type: float128 ; xf= [0.0 0.0] ; type(xf[0])= <type 'numpy.float128'> using bvls.f90 Type: float32 ; xf= [ 0. -0.] ; type(xf[0])= <type 'numpy.float32'> Type: float64 ; xf= [ 0. -0.] ; type(xf[0])= <type 'numpy.float32'> Type: float128 ; xf= [ 0. -0.] ; type(xf[0])= <type 'numpy.float32'> Ok, let's not use f90 version anymore. But is it possible to make somehow bvls.f working correctly with other types then numpy.float64, i.e. with float32 and float128? Regards, D. Pearu Peterson wrote:
On Tue, February 26, 2008 12:01 pm, dmitrey wrote:
I have seen the pyf-files appearing from time to time, but now they are absent (in the directory where I have used f2py), and do not appear after f2py using.
As for commands, I have used f2py -c -m bvls bvls.f and f2py -c -m bvls bvls.f90 --fcompiler=gnu95
Ok, thanks for the info. In general, it is recommended to use a modified .pyf when wrapping Fortran functions with longish argument list that may contain output-type arguments. See f2py users guide for more information.
Below follows the content of a .pyf file that I have modified to meet the docs of bvls.f (there are some room for improvements). Then I used the following command line
f2py -c bvls.pyf bvls.f
to build the bvls extension module. In test_bvls.py file I changed the bvls.bvls call to
xf,w,istate,loopa = bvls.bvls(a,b,bl,bu)
And, most importantly, set inf=100. Now I get the correct results:
using bvls.f Type: float32 ; xf= [ 15. 15.] ; type(xf[0])= <type 'numpy.float64'> Type: float64 ; xf= [ 15. 15.] ; type(xf[0])= <type 'numpy.float64'> Type: float128 ; xf= [ 15. 15.] ; type(xf[0])= <type 'numpy.float64'>
Btw, I believe that your approach of not using .pyf file would also worked when not using inf as an bound parameter - obviosly the underlying Fortran code is not designed to handle float infinities.
HTH, Pearu
! -*- f90 -*- ! Note: the context of this file is case sensitive. !FILE: bvls.pyf
python module bvls ! in interface ! in :bvls subroutine bvls(key,m,n,a,b,bl,bu,x,w,act,zz,istate,loopa) ! in :bvls:bvls.f integer :: key = 0 integer optional,check(shape(a,0)==m),depend(a) :: m=shape(a,0) integer optional,check(shape(a,1)==n),depend(a) :: n=shape(a,1) double precision dimension(m,n) :: a double precision dimension(m),depend(m) :: b double precision dimension(n),depend(n) :: bl double precision dimension(n),depend(n) :: bu double precision dimension(n),depend(n),intent(out) :: x double precision dimension(n),depend(n),intent(out) :: w double precision dimension(m,m + 2),depend(m), intent(cache), optional :: act double precision dimension(m),depend(m), intent(cache), optional :: zz integer dimension(n + 1),depend(n),intent(out) :: istate integer intent(out) :: loopa end subroutine bvls end interface end python module bvls
! This file was auto-generated with f2py (version:2_3744). ! See http://cens.ioc.ee/projects/f2py2e/
_______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
On Tue, February 26, 2008 12:43 pm, dmitrey wrote:
So I have tried the pyf-file attached but unfortunately it yields text output using bvls.f Type: float32 ; and then nothing (for all finite-box bounded as well)
You can use --debug-capi to see where the processing stops. May be you should skip float32 and try float64 case first.
Fortunately, all-finite box-bounds now work correctly, but only for f77-version (with f2py -c -m bvls bvls.f) and numpy.float64 type:
using bvls.f Type: float32 ; xf= [ 0. 0.] ; type(xf[0])= <type 'numpy.float32'> Type: float64 ; xf= [ 15. 15.] ; type(xf[0])= <type 'numpy.float64'> Type: float128 ; xf= [0.0 0.0] ; type(xf[0])= <type 'numpy.float128'>
But is it possible to make somehow bvls.f working correctly with other types then numpy.float64, i.e. with float32 and float128?
The above results are expected. Note that by default all array arguments are intent(in) and when using f2py as you do, the float64 result is correct by accident (in the meaning that only in this case numpy array can be passed directly to Fortran, in other cases a copy is made and you cannot expect f2py to copy the computed results back to original arrays if the intent(in) is specified). Sure it is possible to make bvls.f work correctly with other precision types but note that this involves making copies to float64 that the fortran function expects. To make it work, you have to use the .pyf file and design it to be robust to all types. I am afraid, you should use the .pyf file anyway in order to make the results unaccidental. Regards, Pearu
Pearu, could you take a look at the toms/587 routine (another one constrained LLS)? I guess it could be connected to scipy. f2py yields lots of bugs when I try to build .so-file. (I have downloaded the one with option "include (unoptimized) BLAS routines" turned on, tgz file ~48 kb with a single file inside 587 that I have renamed to toms587.f). http://netlib.org/cgi-bin/netlibfiles.pl?filename=/toms/587 Here's full output below. (Unfortunately I'm not skilled in Fortran) Regards, D. f2py -c -m toms587 toms587.f 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 "toms587" sources f2py options: [] f2py:> /tmp/tmphN_0T5/src.linux-x86_64-2.5/toms587module.c creating /tmp/tmphN_0T5 creating /tmp/tmphN_0T5/src.linux-x86_64-2.5 Reading fortran codes... Reading file 'toms587.f' (format:fix,strict) rmbadname1: Replacing "size" with "size_bn". crackline: groupcounter=1 groupname={0: '', 1: 'module', 2: 'function', 3: 'subroutine'} crackline: Mismatch of blocks encountered. Trying to fix it by assuming "end" statement. Post-processing... Block: toms587 Block: lsei Block: lsi Block: lpdp Block: wnnls Block: wnlsm Block: wnlit Block: hfti Block: h12 Block: diff Block: srotmg Block: scopy Block: sswap Block: snrm2 Block: sasum Block: sscal Block: isamax Block: sdot Block: saxpy Block: srotm Block: drotmg Block: dcopy Block: dswap Block: dnrm2 Block: dasum Block: dscal Block: idamax Block: ddot Block: daxpy Block: drotm Block: fdump Block: xerabt Block: j4save Block: numxer Block: s88fmt Block: xerclr Block: xerctl Block: xerdmp Block: xermax Block: xerprt Block: xerror Block: xerrwv Block: xersav Block: xgetf Block: xgetua Block: xgetun Block: xsetf Block: xsetua Block: xsetun Block: i1mach Block: clstp Block: ran Post-processing (stage 2)... Building modules... Building module "toms587"... buildmodule: Expected interface block. Skipping. Constructing wrapper function "lsei"... lsei(w,me,ma,mg,n,prgopt,x,rnorme,rnorml,mode,ws,ip,[mdw]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "lsi"... lsi(w,ma,mg,n,prgopt,x,rnorm,mode,ws,ip,[mdw]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "lpdp"... lpdp(a,m,n1,n2,prgopt,x,wnorm,mode,ws,is,[mda]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "wnnls"... wnnls(w,me,ma,n,l,prgopt,x,rnorm,mode,iwork,work,[mdw]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "wnlsm"... wnlsm(w,mme,ma,n,l,prgopt,x,rnorm,mode,ipivot,itype,wd,h,scale,z,temp,d,[mdw]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "wnlit"... wnlit(w,m,n,l,ipivot,itype,h,scale,rnorm,idope,dope,done,[mdw]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "hfti"... hfti(a,m,b,tau,krank,rnorm,h,g,ip,[mda,n,mdb,nb]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "h12"... h12(mode,lpivot,l1,u,up,c,ice,icv,ncv,[m,iue]) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "diff"("diff")... Constructing wrapper function "diff"... diff = diff(x,y) buildmodule: Expected interface block. Skipping. Constructing wrapper function "srotmg"... srotmg(sd1,sd2,sx1,sy1,sparam) buildmodule: Expected interface block. Skipping. Constructing wrapper function "scopy"... scopy(n,sx,incx,sy,incy) buildmodule: Expected interface block. Skipping. Constructing wrapper function "sswap"... sswap(n,sx,incx,sy,incy) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "snrm2"("snrm2")... Constructing wrapper function "snrm2"... snrm2 = snrm2(n,sx,incx) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "sasum"("sasum")... Constructing wrapper function "sasum"... sasum = sasum(n,sx,incx) buildmodule: Expected interface block. Skipping. Constructing wrapper function "sscal"... sscal(n,sa,sx,incx) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "isamax"("isamax")... Constructing wrapper function "isamax"... isamax = isamax(n,sx,incx) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "sdot"("sdot")... Constructing wrapper function "sdot"... sdot = sdot(n,sx,incx,sy,incy) buildmodule: Expected interface block. Skipping. Constructing wrapper function "saxpy"... saxpy(n,sa,sx,incx,sy,incy) buildmodule: Expected interface block. Skipping. Constructing wrapper function "srotm"... srotm(n,sx,incx,sy,incy,sparam) buildmodule: Expected interface block. Skipping. Constructing wrapper function "drotmg"... drotmg(dd1,dd2,dx1,dy1,dparam) buildmodule: Expected interface block. Skipping. Constructing wrapper function "dcopy"... dcopy(n,dx,incx,dy,incy) buildmodule: Expected interface block. Skipping. Constructing wrapper function "dswap"... dswap(n,dx,incx,dy,incy) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "dnrm2"("dnrm2")... Constructing wrapper function "dnrm2"... dnrm2 = dnrm2(n,dx,incx) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "dasum"("dasum")... Constructing wrapper function "dasum"... dasum = dasum(n,dx,incx) buildmodule: Expected interface block. Skipping. Constructing wrapper function "dscal"... dscal(n,da,dx,incx) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "idamax"("idamax")... Constructing wrapper function "idamax"... idamax = idamax(n,dx,incx) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "ddot"("ddot")... Constructing wrapper function "ddot"... ddot = ddot(n,dx,incx,dy,incy) buildmodule: Expected interface block. Skipping. Constructing wrapper function "daxpy"... daxpy(n,da,dx,incx,dy,incy) buildmodule: Expected interface block. Skipping. Constructing wrapper function "drotm"... drotm(n,dx,incx,dy,incy,dparam) buildmodule: Expected interface block. Skipping. Constructing wrapper function "fdump"... fdump() buildmodule: Expected interface block. Skipping. Constructing wrapper function "xerabt"... xerabt(messg,[nmessg]) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "j4save"("j4save")... Constructing wrapper function "j4save"... j4save = j4save(iwhich,ivalue,iset) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "numxer"("numxer")... Constructing wrapper function "numxer"... numxer = numxer(nerr) buildmodule: Expected interface block. Skipping. Constructing wrapper function "s88fmt"... s88fmt(ivalue,ifmt,[n]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xerclr"... xerclr() buildmodule: Expected interface block. Skipping. Constructing wrapper function "xerctl"... xerctl(messg1,nmessg,nerr,level,kontrl) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xerdmp"... xerdmp() buildmodule: Expected interface block. Skipping. Constructing wrapper function "xermax"... xermax(max) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xerprt"... xerprt(messg,[nmessg]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xerror"... xerror(messg,nerr,level,[nmessg]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xerrwv"... xerrwv(messg,nerr,level,ni,i1,i2,nr,r1,r2,[nmessg]) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xersav"... xersav(messg,nmessg,nerr,level,icount) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xgetf"... xgetf(kontrl) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xgetua"... xgetua(iunit,n) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xgetun"... xgetun(iunit) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xsetf"... xsetf(kontrl) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xsetua"... xsetua(iunit,n) buildmodule: Expected interface block. Skipping. Constructing wrapper function "xsetun"... xsetun(iunit) buildmodule: Expected interface block. Skipping. Creating wrapper for Fortran function "i1mach"("i1mach")... Constructing wrapper function "i1mach"... i1mach = i1mach(i) buildmodule: Expected interface block. Skipping. Constructing wrapper function "clstp"... clstp(klog,cond,istat) Wrote C/API module "toms587" to file "/tmp/tmphN_0T5/src.linux-x86_64-2.5/toms587module.c" Fortran 77 wrappers are saved to "/tmp/tmphN_0T5/src.linux-x86_64-2.5/toms587-f2pywrappers.f" adding '/tmp/tmphN_0T5/src.linux-x86_64-2.5/fortranobject.c' to sources. adding '/tmp/tmphN_0T5/src.linux-x86_64-2.5' to include_dirs. copying /usr/lib/python2.5/site-packages/numpy/f2py/src/fortranobject.c -> /tmp/tmphN_0T5/src.linux-x86_64-2.5 copying /usr/lib/python2.5/site-packages/numpy/f2py/src/fortranobject.h -> /tmp/tmphN_0T5/src.linux-x86_64-2.5 adding '/tmp/tmphN_0T5/src.linux-x86_64-2.5/toms587-f2pywrappers.f' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext customize GnuFCompiler Found executable /usr/bin/g77 gnu: no Fortran 90 compiler found gnu: no Fortran 90 compiler found customize GnuFCompiler gnu: no Fortran 90 compiler found gnu: no Fortran 90 compiler found customize GnuFCompiler using build_ext building 'toms587' extension compiling C sources C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -fPIC creating /tmp/tmphN_0T5/tmp creating /tmp/tmphN_0T5/tmp/tmphN_0T5 creating /tmp/tmphN_0T5/tmp/tmphN_0T5/src.linux-x86_64-2.5 compile options: '-I/tmp/tmphN_0T5/src.linux-x86_64-2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c' gcc: /tmp/tmphN_0T5/src.linux-x86_64-2.5/toms587module.c gcc: /tmp/tmphN_0T5/src.linux-x86_64-2.5/fortranobject.c compiling Fortran sources Fortran f77 compiler: /usr/bin/g77 -g -Wall -fno-second-underscore -fPIC -O3 -funroll-loops -march=athlon64 -mmmx -m3dnow -msse2 -msse compile options: '-I/tmp/tmphN_0T5/src.linux-x86_64-2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c' g77:f77: toms587.f toms587.f: In subroutine `lsei': In file included from toms587.f:0: toms587.f:463: warning: 'imax' might be used uninitialized in this function toms587.f: In subroutine `lsi': toms587.f:813: warning: IP(2) = N + MAX0(M,N) + (MG+2)*(N+7) ^ Array element value at (^) out of defined range toms587.f: In subroutine `lpdp': toms587.f:1149: warning: IS(2) = 0 ^ Array element value at (^) out of defined range toms587.f:1193: warning: IS(2) = 0 ^ Array element value at (^) out of defined range toms587.f: In subroutine `wnnls': toms587.f:1496: warning: 20 IF (.NOT.(IWORK(2).GT.0)) GO TO 40 ^ Array element value at (^) out of defined range toms587.f:1498: warning: IF (.NOT.(IWORK(2).LT.LIW)) GO TO 30 ^ Array element value at (^) out of defined range toms587.f: In subroutine `wnlsm': toms587.f:1603: warning: 'alamda' might be used uninitialized in this function toms587.f:1603: warning: 'alpha' might be used uninitialized in this function toms587.f:1603: warning: 'alsq' might be used uninitialized in this function toms587.f:1603: warning: 'bnorm' might be used uninitialized in this function toms587.f:1603: warning: 'eanorm' might be used uninitialized in this function toms587.f:1608: warning: 'hitcon' might be used uninitialized in this function toms587.f:1608: warning: 'feasbl' might be used uninitialized in this function toms587.f:1608: warning: 'pos' might be used uninitialized in this function toms587.f:1637: warning: '__g77_ASSIGN_igo991' might be used uninitialized in this function toms587.f:1643: warning: '__g77_ASSIGN_igo986' might be used uninitialized in this function toms587.f:1649: warning: '__g77_ASSIGN_igo983' might be used uninitialized in this function toms587.f:1657: warning: '__g77_ASSIGN_igo980' might be used uninitialized in this function toms587.f:1749: warning: 'iter' might be used uninitialized in this function toms587.f:1750: warning: 'itmax' might be used uninitialized in this function toms587.f:1752: warning: 'lp1' might be used uninitialized in this function toms587.f:1754: warning: 'nsp1' might be used uninitialized in this function toms587.f:1756: warning: 'nm1' might be used uninitialized in this function toms587.f:1757: warning: 'l1' might be used uninitialized in this function toms587.f:1822: warning: 'krank' might be used uninitialized in this function toms587.f:1826: warning: 'niv1' might be used uninitialized in this function toms587.f:1859: warning: 'jcon' might be used uninitialized in this function toms587.f: In subroutine `wnlit': toms587.f:2237: warning: 'hbar' might be used uninitialized in this function toms587.f:2242: warning: 'indep' might be used uninitialized in this function toms587.f:2333: warning: 'max' might be used uninitialized in this function toms587.f: In subroutine `srotmg': toms587.f:3070: warning: 'sh21' might be used uninitialized in this function toms587.f:3071: warning: 'sh12' might be used uninitialized in this function toms587.f:3091: warning: 'sh11' might be used uninitialized in this function toms587.f:3092: warning: 'sh22' might be used uninitialized in this function toms587.f: In function `snrm2': toms587.f:3328: warning: 'xmax' might be used uninitialized in this function toms587.f: In subroutine `drotmg': toms587.f:3817: warning: 'dh11' might be used uninitialized in this function toms587.f:3817: warning: 'dh21' might be used uninitialized in this function toms587.f:3818: warning: 'dh12' might be used uninitialized in this function toms587.f:3818: warning: 'dh22' might be used uninitialized in this function toms587.f: In function `dnrm2': toms587.f:4219: warning: 'xmax' might be used uninitialized in this function toms587.f: In subroutine `clstp': toms587.f:6131: warning: 'bnorm' might be used uninitialized in this function toms587.f:6408: warning: 'mepma' might be used uninitialized in this function toms587.f: Outside of any program unit: toms587.f:6667: 3 1 2 0 2 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6667: 3 1 2 0 2 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6668: 1. 1000. 1000. ^ Non-numeric character at (^) in label field [info -f g77 M LEX] toms587.f:6669: 3 1 2 1 2 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6669: 3 1 2 1 2 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6670: 1. 1000. 1000. ^ Non-numeric character at (^) in label field [info -f g77 M LEX] toms587.f:6671: 3 1 2 2 2 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6671: 3 1 2 2 2 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6672: 1000. 1000. 1000. ^ Non-numeric character at (^) in label field [info -f g77 M LEX] toms587.f:6673: 4 2 2 2 3 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6673: 4 2 2 2 3 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6674: 1000. 1000. 1000. ^ Non-numeric character at (^) in label field [info -f g77 M LEX] toms587.f:6675: 5 3 2 2 4 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6675: 5 3 2 2 4 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6676: 10000. 1000. 1000. 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6676: 10000. 1000. 1000. ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6677: 0 0 0 0 -1 1 2 Extra label definition 00 at (2) -- perhaps previous label definition 0 at (1) should have CONTINUE statement? toms587.f:6677: 0 0 0 0 -1 ^ Statement at (^) begins with invalid token [info -f g77 M LEX] toms587.f: In subroutine `lsei': In file included from toms587.f:0: toms587.f:463: warning: 'imax' might be used uninitialized in this function toms587.f: In subroutine `lsi': toms587.f:813: warning: IP(2) = N + MAX0(M,N) + (MG+2)*(N+7) ^ Array element value at (^) out of defined range toms587.f: In subroutine `lpdp': toms587.f:1149: warning: IS(2) = 0 ^ Array element value at (^) out of defined range toms587.f:1193: warning: IS(2) = 0 ^ Array element value at (^) out of defined range toms587.f: In subroutine `wnnls': toms587.f:1496: warning: 20 IF (.NOT.(IWORK(2).GT.0)) GO TO 40 ^ Array element value at (^) out of defined range toms587.f:1498: warning: IF (.NOT.(IWORK(2).LT.LIW)) GO TO 30 ^ Array element value at (^) out of defined range toms587.f: In subroutine `wnlsm': toms587.f:1603: warning: 'alamda' might be used uninitialized in this function toms587.f:1603: warning: 'alpha' might be used uninitialized in this function toms587.f:1603: warning: 'alsq' might be used uninitialized in this function toms587.f:1603: warning: 'bnorm' might be used uninitialized in this function toms587.f:1603: warning: 'eanorm' might be used uninitialized in this function toms587.f:1608: warning: 'hitcon' might be used uninitialized in this function toms587.f:1608: warning: 'feasbl' might be used uninitialized in this function toms587.f:1608: warning: 'pos' might be used uninitialized in this function toms587.f:1637: warning: '__g77_ASSIGN_igo991' might be used uninitialized in this function toms587.f:1643: warning: '__g77_ASSIGN_igo986' might be used uninitialized in this function toms587.f:1649: warning: '__g77_ASSIGN_igo983' might be used uninitialized in this function toms587.f:1657: warning: '__g77_ASSIGN_igo980' might be used uninitialized in this function toms587.f:1749: warning: 'iter' might be used uninitialized in this function toms587.f:1750: warning: 'itmax' might be used uninitialized in this function toms587.f:1752: warning: 'lp1' might be used uninitialized in this function toms587.f:1754: warning: 'nsp1' might be used uninitialized in this function toms587.f:1756: warning: 'nm1' might be used uninitialized in this function toms587.f:1757: warning: 'l1' might be used uninitialized in this function toms587.f:1822: warning: 'krank' might be used uninitialized in this function toms587.f:1826: warning: 'niv1' might be used uninitialized in this function toms587.f:1859: warning: 'jcon' might be used uninitialized in this function toms587.f: In subroutine `wnlit': toms587.f:2237: warning: 'hbar' might be used uninitialized in this function toms587.f:2242: warning: 'indep' might be used uninitialized in this function toms587.f:2333: warning: 'max' might be used uninitialized in this function toms587.f: In subroutine `srotmg': toms587.f:3070: warning: 'sh21' might be used uninitialized in this function toms587.f:3071: warning: 'sh12' might be used uninitialized in this function toms587.f:3091: warning: 'sh11' might be used uninitialized in this function toms587.f:3092: warning: 'sh22' might be used uninitialized in this function toms587.f: In function `snrm2': toms587.f:3328: warning: 'xmax' might be used uninitialized in this function toms587.f: In subroutine `drotmg': toms587.f:3817: warning: 'dh11' might be used uninitialized in this function toms587.f:3817: warning: 'dh21' might be used uninitialized in this function toms587.f:3818: warning: 'dh12' might be used uninitialized in this function toms587.f:3818: warning: 'dh22' might be used uninitialized in this function toms587.f: In function `dnrm2': toms587.f:4219: warning: 'xmax' might be used uninitialized in this function toms587.f: In subroutine `clstp': toms587.f:6131: warning: 'bnorm' might be used uninitialized in this function toms587.f:6408: warning: 'mepma' might be used uninitialized in this function toms587.f: Outside of any program unit: toms587.f:6667: 3 1 2 0 2 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6667: 3 1 2 0 2 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6668: 1. 1000. 1000. ^ Non-numeric character at (^) in label field [info -f g77 M LEX] toms587.f:6669: 3 1 2 1 2 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6669: 3 1 2 1 2 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6670: 1. 1000. 1000. ^ Non-numeric character at (^) in label field [info -f g77 M LEX] toms587.f:6671: 3 1 2 2 2 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6671: 3 1 2 2 2 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6672: 1000. 1000. 1000. ^ Non-numeric character at (^) in label field [info -f g77 M LEX] toms587.f:6673: 4 2 2 2 3 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6673: 4 2 2 2 3 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6674: 1000. 1000. 1000. ^ Non-numeric character at (^) in label field [info -f g77 M LEX] toms587.f:6675: 5 3 2 2 4 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6675: 5 3 2 2 4 ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6676: 10000. 1000. 1000. 1 2 Label at (1) invalid with continuation line indicator at (2) [info -f g77 M LEX] toms587.f:6676: 10000. 1000. 1000. ^ Continuation indicator at (^) invalid on first non-comment line of file or following END or INCLUDE [info -f g77 M LEX] toms587.f:6677: 0 0 0 0 -1 1 2 Extra label definition 00 at (2) -- perhaps previous label definition 0 at (1) should have CONTINUE statement? toms587.f:6677: 0 0 0 0 -1 ^ Statement at (^) begins with invalid token [info -f g77 M LEX] error: Command "/usr/bin/g77 -g -Wall -fno-second-underscore -fPIC -O3 -funroll-loops -march=athlon64 -mmmx -m3dnow -msse2 -msse -I/tmp/tmphN_0T5/src.linux-x86_64-2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c -c toms587.f -o /tmp/tmphN_0T5/toms587.o" failed with exit status 1
dmitrey wrote:
Pearu, could you take a look at the toms/587 routine (another one constrained LLS)? I guess it could be connected to scipy. f2py yields lots of bugs when I try to build .so-file. (I have downloaded the one with option "include (unoptimized) BLAS routines" turned on, tgz file ~48 kb with a single file inside 587 that I have renamed to toms587.f).
http://netlib.org/cgi-bin/netlibfiles.pl?filename=/toms/587 Here's full output below. (Unfortunately I'm not skilled in Fortran)
The file has some non-Fortran footer. I cleaned it up and then it compiles with g77. You can grab the file from http://cens.ioc.ee/~pearu/toms587.f HTH, Pearu
participants (2)
-
dmitrey
-
Pearu Peterson