Drop explicit support for Fortran 77 in Cactus

Issue #849 closed
Erik Schnetter created an issue

I suggest to drop explicit support for Fortran 77 in Cactus. Fortran 77 is, for all practical purposes, a subset of Fortran 90, and thus Fortran 77 code can be compiled by Fortran 90 compilers.

There is currently no platform that has a Fortran 77 and no Fortran 90 compiler, and there is no Fortran source code in Cactus that cannot be compiled by a Fortran 90 compiler.

In a way, supporting Fortran 77 as language is similar to supporting K&R C as a language. We don't do this either.

I suggest to remove/ignore all configuration options regarding Fortran 77, and to compile .f77 and .F77 files with a Fortran 90 compiler. This change will simplify the configuration stage of Cactus. I don't expect any user to notice.

Keyword:

Comments (9)

  1. Roland Haas
    • changed status to open
    • removed comment

    Fine with me. Have you tested this with eg BLAS and LAPACK (those being F77 codes)? Cactus will already use F90 to compile Fortran 77 files if F77 is unset as far as I know.

  2. Erik Schnetter reporter
    • removed comment

    BLAS and LAPACK use *.f as file names; Cactus interprets that as Fortran 90, and builds them using the Fortran 90 compiler. You have to use .f77 to make Cactus use a Fortran 77 compiler.

  3. Roland Haas
    • removed comment

    Would that not only apply to source files in a thorn's src directory (since it is tied one of Cactus' makefile fragments in Cactus/libs/make)? An ExternalLibrary's configure.sh could do whatever it wants to do. BLAS in particular contains:

            cat > make.cactus <<EOF
    SRCS = $(echo *.f)
    libblas.a: \$(SRCS:%.f=%.o)
            ${AR} ${ARFLAGS} \$@ \$^
            ${RANLIB} ${RANLIBFLAGS} \$@
    %.o: %.f
            ${F77} ${F77FLAGS} ${FIXEDF77FLAGS} -c \$*.f -o \$*.o
    EOF
            ${MAKE} -f make.cactus
    

    so it uses the F77 compiler for the .f files inside of BLAS. It does compile though when I comment out F77 in my option list (though there are lots of warnings), which given that there is no difference between the F77 options and the F90 option in my optionlist is not that surprising I guess.

    The reason I bring this up that I know of some old code (spherepack https://www2.cisl.ucar.edu/resources/legacy/spherepack) that does actually use arithmetic if statements that are (I think) no longer allowed in new Fortran versions. Since we need to support Fortran 2003 (LoopControl uses it) we need to be a bit more careful than supporting only F90 (which I think is indeed a proper superset of F77).

  4. Erik Schnetter reporter
    • changed status to open
    • assigned issue to
    • removed comment

    The attached patch ignores all Fortran 77 configuration options. It also provides all existing Fortran 77 make variables, as copies of the respective Fortran 90 make variables.

  5. Log in to comment