LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-10-2013, 02:55 PM   #1
Jay Braun
LQ Newbie
 
Registered: Jul 2013
Posts: 3

Rep: Reputation: Disabled
g77 invoking C functions when gcc 4.x is default


I was asked to consult on a migration of a legacy application from OpenVMS to Linux (Red Hat Enterprise 5 for now, RHEL 6 and/or 7 eventually), having performed a successful migration a few years ago.

The application is mostly written in Fortran, a mix of Fortran 77 and pre-F77 usages. Among the latter are non-standard approaches to handling character data. Due to these usages, such as REAL*8 for short strings up to 8 bytes, and LOGICAL*1 for individual characters, gfortran cannot be used. The developer has chosen g77 with switches like -fugly, and insists that that is more expedient than updating the thousands of lines of code in his application -- even to F77 standards.

I have pointed out that g77 is no longer supported, and that g77 requires gcc lib 3.4.x, which is outdated. But he is willing to live with that, and is using g77 on RHEL v5 to compile his code.

A complicating factor is that many recently written components of the application are C functions that were developed by a third organization. On OpenVMS, these were compatible with the Fortran code. On RHEL v5, the installed version of gcc is 4.2.x, and on RHEL v6, it is 4.4.x.

I am somewhat skittish about compiling the C code with the latest version of gcc, and then trying to link that into an application that has g77-generated object code intended for use with version 3.4.6 of the gcc library.

My questions:

1) Are my concerns valid? Is there a specific failure that would justify my reluctance to support this approach?
2) Can I use an older version of gcc for this application and simply compile statically with no library dependencies at run-time?
3) What factors might cause a statically linked gcc 3.4.x application to fail on a future version of RHEL?

Thanks -- and sorry for the length of this question.

-- Jay
 
Old 07-10-2013, 05:07 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

$ yum provides */g77
The reply is : compat-gcc-34-g77 , and that' both OS. RHEL 5 , RHEL 6.
→ → # yum install compat-gcc-34-g77


Besides that, the gfortran compiler provided the later gcc's,
will compile the most g77 code.


Redhat Enterprise 7 will most likely include the gcc-34-g77 too :
Fedora 19 has it. For good reasons.
There is plenty of very good but old code out there.

Using g77 and e.g. gcc-4.7 together : Should be OK, I think.

-

Last edited by knudfl; 07-10-2013 at 05:25 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Invoking parameterized functions in ad-hoc bash scripts. LXer Syndicated Linux News 0 04-28-2013 01:22 PM
downgrading gcc to gcc-3 to use g77 pibcrazy Linux - Newbie 4 02-05-2010 01:21 PM
g77 installation on gcc 4.3 rafopar Linux - Software 6 02-21-2009 07:33 PM
gcc/g77 compiler in FC2? serendipitysdc Fedora 1 06-24-2004 04:19 PM
gcc-g77 package neko Programming 12 07-22-2001 02:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration