• Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program

    From Sam@21:1/5 to Lynn McGuire on Tue Apr 8 20:34:12 2025
    XPost: comp.lang.fortran

    Lynn McGuire writes:

    I am back on this project again. I have converted over 100,000 lines of the F77 code to C++ now and am debugging character string issues.

    Thanks for the update. Good job. Here's a cookie for you. Keep up the good work.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Lynn McGuire on Wed Apr 9 07:18:34 2025
    XPost: comp.lang.fortran

    On Tue, 8 Apr 2025 15:06:06 -0500, Lynn McGuire wrote:

    I tried GFortran and GCC with Simply Fortran for a long while but the debugging is simply horrible.

    Have you tried using the GNU tools (gfortran, gcc, gdb etc) directly,
    leaving out the Simply Fortran middleman?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Lynn McGuire on Thu Apr 10 00:35:41 2025
    XPost: comp.lang.fortran

    On Wed, 9 Apr 2025 14:48:12 -0500, Lynn McGuire wrote:

    On 4/9/2025 2:18 AM, Lawrence D'Oliveiro wrote:

    On Tue, 8 Apr 2025 15:06:06 -0500, Lynn McGuire wrote:

    I tried GFortran and GCC with Simply Fortran for a long while but the
    debugging is simply horrible.

    Have you tried using the GNU tools (gfortran, gcc, gdb etc) directly,
    leaving out the Simply Fortran middleman?

    No, we want to get away from compiling and linking directly. That is
    what we use with Open Watcom F77 and C++.

    With over 5,000 subroutines, each in their own file, keeping track of everything is difficult on a good day.

    This is why you have build systems.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Lynn McGuire on Thu Apr 10 12:11:53 2025
    XPost: comp.lang.fortran

    On Wed, 9 Apr 2025 14:48:59 -0500
    Lynn McGuire <lynnmcguire5@gmail.com> wrote:

    On 4/8/2025 7:34 PM, Sam wrote:
    Lynn McGuire writes:

    I am back on this project again.  I have converted over 100,000
    lines of the F77 code to C++ now and am debugging character string
    issues.

    Thanks for the update. Good job. Here's a cookie for you. Keep up
    the good work.

    Sigh, the virtual cookie sucked. And I am on a diet and not supposed
    to eat cookies for a long while.

    Lynn


    If I understand the poster Sam correctly, he wanted to tell you that if
    you don't keep him updated about progress of your conversion project
    then he wouldn't be terribly upset.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Lynn McGuire on Thu Apr 10 19:52:41 2025
    XPost: comp.lang.fortran

    On Thu, 10 Apr 2025 14:39:02 -0500, Lynn McGuire wrote:

    On 4/9/2025 7:35 PM, Lawrence D'Oliveiro wrote:

    This is why you have build systems.

    I started using the first IDE (interactive development environment) in
    1983 ??? with Turbo Pascal. $49 IIRC. It was a simply amazing way of
    doing things. Nowadays, Visual Studio comes closest to the Turbo Pascal
    IDE but even it is not quite there. Visual Studios lack of a decent
    Fortran compiler sucks.

    IDEs tend to be limited in their build systems. They’re not flexible: they insist you build things their way.

    I moved back to build systems on the Apollo Domain in 1989 using DSEE
    but it was a downer compared to Turbo Pascal. It did allow multiple
    user development teams to work together though. We only had a few
    hallway fights on code conflicts, most were resolved by DSEE.

    Back in the day, we called them “CASE tools”, and they cost €€€. Nowadays,
    they are just “developer tools”, and they are part of the standard package repositories.

    The one thing Git does better than any other VCS is merging branches. No
    more hallway fights ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to Bonita Montero on Fri Apr 11 16:00:19 2025
    XPost: comp.lang.fortran

    On Fri, 11 Apr 2025 11:37:17 +0200, Bonita Montero wrote:

    Am 09.04.2025 um 21:48 schrieb Lynn McGuire:

    No, we want to get away from compiling and linking directly.
    That is what we use with Open Watcom F77 and C++.

    The Watcom stuff is totally outdated.
    Is there no way to get something newer ?

    You must be new here in c.l.f. Lynn has been converting
    his 700 KLOC of Fortran to C++ for 2+ decades. It seems
    his code, which clearly isn't Fortran, can only be compiled
    by a Watcom language compiler. For those playing along,
    that's roughy converting 140 lines of code per workday
    with 2 weeks for good behavior (ie., 700000 / (50*5*20)).

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to James Kuyper on Fri Apr 11 16:57:53 2025
    XPost: comp.lang.fortran

    On Fri, 11 Apr 2025 12:25:53 -0400, James Kuyper wrote:

    On 4/11/25 12:00, Steven G. Kargl wrote:
    ...
    You must be new here in c.l.f. Lynn has been converting
    his 700 KLOC of Fortran to C++ for 2+ decades. It seems
    his code, which clearly isn't Fortran, can only be compiled

    This is cross-posted to comp.lang.c++, which is where I'm seeing it.
    It's not very important, but I'm curious as to what about his code makes
    it clearly not Fortran code. Has he conceded that it isn't actually
    fortran? The Subject of this thread implies otherwise.

    Vendor extensions.

    We have here a classic example of code, purportedly written
    in a language with an international standard, doomed by
    vendor lock-in.

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Steven G. Kargl on Fri Apr 11 12:25:53 2025
    XPost: comp.lang.fortran

    On 4/11/25 12:00, Steven G. Kargl wrote:
    ...
    You must be new here in c.l.f. Lynn has been converting
    his 700 KLOC of Fortran to C++ for 2+ decades. It seems
    his code, which clearly isn't Fortran, can only be compiled

    This is cross-posted to comp.lang.c++, which is where I'm seeing it.
    It's not very important, but I'm curious as to what about his code makes
    it clearly not Fortran code. Has he conceded that it isn't actually
    fortran? The Subject of this thread implies otherwise.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Lynn McGuire on Sun Apr 13 23:10:57 2025
    XPost: comp.lang.fortran

    On Sun, 13 Apr 2025 17:59:26 -0500, Lynn McGuire wrote:

    And don't forget that we spent a lot of time updating the code by
    converting all of the Hollerith characters to character strings.

    34HSee, that I would have left alone.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Lynn McGuire on Tue Apr 15 23:14:16 2025
    XPost: comp.lang.fortran

    On Mon, 14 Apr 2025 23:50:32 -0500, Lynn McGuire wrote:

    Got rid of a few nasty bugs like:

    iword = 6Habcdef

    Surely whether that’s a bug or not would depend on the type of “iword” ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Louis Krupp@21:1/5 to Lynn McGuire on Tue Apr 15 23:19:11 2025
    XPost: comp.lang.fortran

    On 4/15/2025 5:28 PM, Lynn McGuire wrote:
    On 4/15/2025 6:14 PM, Lawrence D'Oliveiro wrote:
    On Mon, 14 Apr 2025 23:50:32 -0500, Lynn McGuire wrote:

    Got rid of a few nasty bugs like:

            iword = 6Habcdef

    Surely whether that’s a bug or not would depend on the type of
    “iword” ...

    iword is a implicit 4 byte integer capable of storing 4 characters.

    Out of curiosity, what system was this originally written for?

    Louis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Lynn McGuire on Wed Apr 16 07:44:08 2025
    XPost: comp.lang.fortran

    On Tue, 15 Apr 2025 18:28:31 -0500, Lynn McGuire wrote:

    On 4/15/2025 6:14 PM, Lawrence D'Oliveiro wrote:

    On Mon, 14 Apr 2025 23:50:32 -0500, Lynn McGuire wrote:

    Got rid of a few nasty bugs like:

    iword = 6Habcdef

    Surely whether that’s a bug or not would depend on the type of “iword” >> ...

    iword is a implicit 4 byte integer capable of storing 4 characters.

    I thought you got rid of all the implicit typing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to Lawrence D'Oliveiro on Wed Apr 16 17:24:26 2025
    XPost: comp.lang.fortran

    On Wed, 16 Apr 2025 07:44:08 +0000, Lawrence D'Oliveiro wrote:

    On Tue, 15 Apr 2025 18:28:31 -0500, Lynn McGuire wrote:

    On 4/15/2025 6:14 PM, Lawrence D'Oliveiro wrote:

    On Mon, 14 Apr 2025 23:50:32 -0500, Lynn McGuire wrote:

    Got rid of a few nasty bugs like:

    iword = 6Habcdef

    Surely whether that’s a bug or not would depend on the type of “iword”
    ...

    iword is a implicit 4 byte integer capable of storing 4 characters.

    I thought you got rid of all the implicit typing.

    Implicit typing has nothing do with numeric storage size.

    program foo
    use iso_fortran_env, only : numeric_storage_size
    integer :: j = 0
    i = 6Habcdef ! i has an implicit type of default integer kind
    j = 6Habcdef ! j has an explicit type of default integer kind
    print *, i, j
    print *, numeric_storage_size
    end program foo

    % gfcx -std=legacy -o z a.f90
    % ./z
    1684234849 1684234849
    32

    Many (most? all?) systems today likely have a 4-byte internal
    representation for a default integer. The Fortran standard simply
    states that 'i' and 'j' occupy one numeric storage unit. Here,
    the size of that unit is 32 bits.

    PS: The gfortran's -Wall option reports a few warnings with
    the above code.

    % gfcx -std=legacy -o z -Wall a.f90
    a.f90:26:7:

    26 | i = 6Habcdef
    | 1
    Warning: Conversion from HOLLERITH to INTEGER(4) at (1)
    [-Wconversion]
    a.f90:26:7:

    26 | i = 6Habcdef
    | 1
    Warning: The Hollerith constant at (1) is truncated in
    conversion to 'INTEGER(4' [-Wcharacter-truncation]

    and similar warnings for 'j'.

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R Daneel Olivaw@21:1/5 to Steven G. Kargl on Thu Apr 17 12:24:22 2025
    XPost: comp.lang.fortran

    Steven G. Kargl wrote:
    On Wed, 16 Apr 2025 07:44:08 +0000, Lawrence D'Oliveiro wrote:

    On Tue, 15 Apr 2025 18:28:31 -0500, Lynn McGuire wrote:

    On 4/15/2025 6:14 PM, Lawrence D'Oliveiro wrote:

    On Mon, 14 Apr 2025 23:50:32 -0500, Lynn McGuire wrote:

    Got rid of a few nasty bugs like:

    iword = 6Habcdef

    Surely whether that’s a bug or not would depend on the type of “iword”
    ...

    iword is a implicit 4 byte integer capable of storing 4 characters.

    I thought you got rid of all the implicit typing.

    Implicit typing has nothing do with numeric storage size.

    program foo
    use iso_fortran_env, only : numeric_storage_size
    integer :: j = 0
    i = 6Habcdef ! i has an implicit type of default integer kind
    j = 6Habcdef ! j has an explicit type of default integer kind
    print *, i, j
    print *, numeric_storage_size
    end program foo

    % gfcx -std=legacy -o z a.f90
    % ./z
    1684234849 1684234849
    32

    Many (most? all?) systems today likely have a 4-byte internal
    representation for a default integer. The Fortran standard simply
    states that 'i' and 'j' occupy one numeric storage unit. Here,
    the size of that unit is 32 bits.

    PS: The gfortran's -Wall option reports a few warnings with
    the above code.

    % gfcx -std=legacy -o z -Wall a.f90
    a.f90:26:7:

    26 | i = 6Habcdef
    | 1
    Warning: Conversion from HOLLERITH to INTEGER(4) at (1)
    [-Wconversion]
    a.f90:26:7:

    26 | i = 6Habcdef
    | 1
    Warning: The Hollerith constant at (1) is truncated in
    conversion to 'INTEGER(4' [-Wcharacter-truncation]

    and similar warnings for 'j'.


    I believe you'll find that some of that syntax did not exist under
    Fortran 77, in particular the "use" line.
    Did Lynn convert to F90 first?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to R Daneel Olivaw on Thu Apr 17 15:06:12 2025
    XPost: comp.lang.fortran

    On Thu, 17 Apr 2025 12:24:22 +0200, R Daneel Olivaw wrote:

    Steven G. Kargl wrote:
    On Wed, 16 Apr 2025 07:44:08 +0000, Lawrence D'Oliveiro wrote:

    On Tue, 15 Apr 2025 18:28:31 -0500, Lynn McGuire wrote:

    On 4/15/2025 6:14 PM, Lawrence D'Oliveiro wrote:

    On Mon, 14 Apr 2025 23:50:32 -0500, Lynn McGuire wrote:

    Got rid of a few nasty bugs like:

    iword = 6Habcdef

    Surely whether that’s a bug or not would depend on the type of “iword”
    ...

    iword is a implicit 4 byte integer capable of storing 4 characters.

    I thought you got rid of all the implicit typing.

    Implicit typing has nothing do with numeric storage size.

    program foo
    use iso_fortran_env, only : numeric_storage_size
    integer :: j = 0
    i = 6Habcdef ! i has an implicit type of default integer kind
    j = 6Habcdef ! j has an explicit type of default integer kind
    print *, i, j
    print *, numeric_storage_size
    end program foo


    (snip)

    I believe you'll find that some of that syntax did not exist under
    Fortran 77, in particular the "use" line.
    Did Lynn convert to F90 first?

    Of course, the USE statement was not part of FORTRAN 77.
    (It was added in Fortran 90). The intrinsic module
    iso_fortran_env was not part of FORTRAN 77. (It was
    added in Fortran 2003). I included that line to easily
    get to the number of bits in a numeric storage unit.
    From ANSI X3.9-1978 (i.e., FORTRAN 77):

    An integer, real, or logical datum has one numeric
    storage unit in a storage sequence.
    ...
    This standard does not specify a relationship between
    the storage sequence concept and the physical properties
    or implementation of storage.

    The size of the unit was not specified in FORTRAN 77, and
    this concept is still alive in Fortran 2023.

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)