[SciPy-dev] compilation with fort77

David Cournapeau david at silveregg.co.jp
Sun Jan 24 19:48:09 EST 2010


Thomas Tanner wrote:
> Hello,
> 
> I'm trying to port scipy 0.7.1 to the Maemo platform (Linux/ARM).
> There is no Fortran compiler for this platform so I have to use
> fort77 (and f2c) to compile numpy and scipy.
> However, f2c does not seem to be 100% Fortran77 compatible (or may scipy
> is not?). I get (only :) two compilation errors.
> The first one is a trivial type conversion and fixed by my attached patch.
> the full build output can be found at
> https://garage.maemo.org/builder/fremantle/python-scipy_0.7.1-1maemo1/armel.build.log.OK.txt
> 
> I don't know how to fix the second error:
> 
> compiling Fortran sources
> Fortran f77 compiler: /usr/bin/f77 -g -Wall -fno-second-underscore -fPIC
> -O2 -funroll-loops
> compile options: '-Ibuild/src.linux-armv5tel-2.5
> -I/usr/lib/python2.5/site-packages/numpy/core/include
> -I/usr/include/python2.5 -c'
> f77:f77: scipy/stats/mvndst.f
>    mvnun:
> Error on line 76: Declaration error for rho: adjustable dimension on
> non-argument
> Error on line 76: Declaration error for infin: adjustable dimension on
> non-argument
> Error on line 76: Declaration error for stdev: adjustable dimension on
> non-argument
> Error on line 76: Declaration error for nlower: adjustable dimension on
> non-argument
> Error on line 76: Declaration error for nupper: adjustable dimension on
> non-argument
> Error on line 24: wr_ardecls:  nonconstant array size
> Error on line 24: wr_ardecls:  nonconstant array size
> Error on line 24: wr_ardecls:  nonconstant array size
> Error on line 24: wr_ardecls:  nonconstant array size
> Error on line 24: wr_ardecls:  nonconstant array size
>    mvndst:
>    mvndfn:
>        entry    mvndnt:
>    mvnlms:
>    covsrt:
>    dkswap:
>    rcswp:
>    dkbvrc:
>    dksmrc:
>    mvnphi:
>    phinvs:
>    bvnmvn:
>    bvu:
>    mvnuni:
> 
> the problem is that fort77 cannot deal with those variable sized
> input arguments:
> 
>       SUBROUTINE mvnun(d, n, lower, upper, means, covar, maxpts,
>      &                   abseps, releps, value, inform)
> ...
>       integer n, d, infin(d), maxpts, inform, tmpinf
>       double precision lower(d), upper(d), releps, abseps,
>      &                 error, value, stdev(d), rho(d*(d-1)/2),
>      &                 covar(d,d),
>      &                 nlower(d), nupper(d), means(d,n), tmpval
>       integer i, j
> 
> Could some Fortran expert please help me to make it fort77 compatible?

This file is using some F90/F95 - I am not sure what the policy is on 
this point, but don't think we want to guarantee that we will never use 
fortran > F77.

Can't you get gfortran running on your platform ? Cross-compiling 
gfortran  for your platform should not be difficult

David



More information about the SciPy-Dev mailing list