From help-request at octave dot org Fri Feb 18 22:16:48 2005 Subject: Re: gfortran vs ranlib From: "John W. Eaton" To: "Dmitri A. Sergatskov" Cc: octave help mailing list Date: Fri, 18 Feb 2005 23:22:31 -0500 On 18-Feb-2005, Dmitri A. Sergatskov wrote: | John W. Eaton wrote: | | > | END | > | 1 | > | Internal Error at (1): | > | TODO: Functions with alternate entry points | > | make: *** [pic/qrgnin.o] Error 1 | > | > OK, I see a way to avoid this limitation in gfortran using standard | > f77, but does anyone know if this TODO is expected to be done before | > GCC 4.0 is officially released? | > | | There is a meta-bug on gcc bugzilla | | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292 | | """ | | This is a metabug for all issues in gfortran that need to be resolved before | gfortran can be used as a complete replacement for g77. | | """ | | Perhaps this one should be added there as well... It looks like it already depends on the ENTRY bug. BTW, the report for that says that it should work now for subroutines but not functions. You reported a bug for a function that has a second entry point, but there are two other files with ENTRY statements, setall.f and getcgn.f, but those are subroutines. Do they compile cleanly? If so, I think the following patch will work around the problem with ENTRY in functions. It would be much better for this problem to be fixed in gfortran instead of trying to work around it in Octave, so I don't plan to apply this patch to Octave's sources unless gfortran is released without the fix for this bug. Let's hope that doesn't happen. jwe 2005-02-18 John W. Eaton Work around for gfortran ENTRY bug: * ranlib/qrgnin.f (xqrgnin): New subroutine with entry point xqrgnsn. (qrgnin, qrgnsn): Implement logical functions in terms of new subroutines. Index: qrgnin.f =================================================================== RCS file: /usr/local/cvsroot/octave/libcruft/ranlib/qrgnin.f,v retrieving revision 1.1 diff -u -r1.1 qrgnin.f --- qrgnin.f 19 Jul 1996 01:29:53 -0000 1.1 +++ qrgnin.f 19 Feb 2005 03:54:41 -0000 at @ -9,15 +9,54 @@ C it has, else .FALSE. C C********************************************************************** +C .. Local Scalars .. + LOGICAL retval +C .. +C .. Executable Statements .. + call xqrgnin(retval) + qrgnin = retval + RETURN + + END + LOGICAL FUNCTION qrgnsn(qvalue) +C********************************************************************** +C +C LOGICAL FUNCTION QRGNSN( QVALUE ) +C Q Random GeNerators Set whether iNitialized +C +C Sets state of whether random number generator is initialized +C to QVALUE. +C +C This routine was originally an entry in QRGNIN, hence it is a +C logical function. It returns the (meaningless) value .TRUE. +C +C********************************************************************** C .. Scalar Arguments .. LOGICAL qvalue C .. +C .. Executable Statements .. + CALL xqrgnsn(qvalue) + qrgnsn = .TRUE. + RETURN + + END + SUBROUTINE xqrgnin(retval) +C********************************************************************** +C +C SUBROUTINE XQRGNIN(RETVAL) +C Q Random GeNerators INitialized? +C +C A trivial routine to determine whether or not the random +C number generator has been initialized. Returns RETVAL = .TRUE. +C if it has, else .FALSE. +C +C********************************************************************** +C .. Scalar Arguments .. + LOGICAL retval,qvalue +C .. C .. Local Scalars .. LOGICAL qinit C .. -C .. Entry Points .. - LOGICAL qrgnsn -C .. C .. Save statement .. SAVE qinit C .. at @ -25,13 +64,13 @@ DATA qinit/.FALSE./ C .. C .. Executable Statements .. - qrgnin = qinit + retval = qinit RETURN - ENTRY qrgnsn(qvalue) + ENTRY xqrgnsn(qvalue) C********************************************************************** C -C LOGICAL FUNCTION QRGNSN( QVALUE ) +C SUBROUTINE QRGNSN( QVALUE ) C Q Random GeNerators Set whether iNitialized C C Sets state of whether random number generator is initialized at @ -42,7 +81,6 @@ C C********************************************************************** qinit = qvalue - qrgnsn = .TRUE. RETURN END ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------