Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7165669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:17:15+00:00 2026-05-28T14:17:15+00:00

I’m working with a legacy + academic + numerical fortran-77 code that requires g77

  • 0

I’m working with a legacy + academic + numerical fortran-77 code that requires g77 3.2.x in order to compile and run successfully … I’m using that compiler on Red Hat Linux 9 for i386

One of those fortran-77 files defines a subroutine with lots of real, integer, and double precision arrays as local variables … if I compile it using:

$ g77 -c thefile.F -o thefile.o

it produces an object file of size around 10kB … but the following:

$ g77 -finit-local-zero -c thefile.F -o thefile.o

produces an object file of size 14MB

I tried strip‘ing the object file but the size doesn’t change much

a couple dozen such files in the code and the executable binary ends up being 200MB in size

Any idea about what’s going on? more importantly what can I do to get back to saner object/binary sizes?

P.S.: when I compressed the 200MB binary into tar.gz, the tarball was under 1 MB … means probably the 200MB is full of 0’s or something (I could open it in a hex-editor but i’m feeling too lazy right now)

P.S.: the compiler details are given below (using the -v flag of g77)

$ g77 -v -finit-local-zero -c thefile.F -o thefile.o
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
 /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/tradcpp0 -lang-fortran -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ thefile.F /tmp/ccXXvzMA.f
GNU traditional CPP version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
 /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/f771 /tmp/ccXXvzMA.f -quiet -dumpbase thefile.F -version -finit-local-zero -o /tmp/cck0Blw1.s
GNU F77 version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) (i386-redhat-linux)
    compiled by GNU C version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
 as -V -Qy -o thefile.o /tmp/cck0Blw1.s
GNU assembler version 2.13.90.0.18 (i386-redhat-linux) using BFD version 2.13.90.0.18 20030206

EDIT: newer g77/gfortran versions don’t have that problem (object file size stays almost the same with -finit-local-zero) but I can’t use them (making the code produce correct results with latest compiler versions would be a project in itself) … and I need the -finit-local-zero flag (code hangs without it)

EDIT 2: I took a hex dump and sure enough 99% of the file consists of zeros!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:17:16+00:00Added an answer on May 28, 2026 at 2:17 pm

    From the on-line documentation:

    http://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html

    -finit-local-zero
    -finit-integer=n
    -finit-real=<zero|inf|-inf|nan|snan>
    -finit-logical=<true|false>
    -finit-character=n
        The -finit-local-zero option instructs the compiler to initialize local INTEGER,
        REAL, and COMPLEX variables to zero, LOGICAL variables to false, and CHARACTER 
        variables to a string of null bytes. Finer-grained initialization options are
        provided by the -finit-integer=n, -finit-real=<zero|inf|-inf|nan|snan> (which 
        also initializes the real and imaginary parts of local COMPLEX variables), 
        -finit-logical=<true|false>, and -finit-character=n (where n is an ASCII 
        character value) options. These options do not initialize
    
        * allocatable arrays
        * components of derived type variables
        * variables that appear in an EQUIVALENCE statement. 
    
        (These limitations may be removed in future releases). 
    

    Q: Any idea about what’s going on? and what can I do to get back to
    saner object/binary sizes?

    Means probably the 200MB is full of 0’s or something?

    A: Yup. Sounds like you’ve answered your own question 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.