HP Forums
FORTRAN on HP ? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: FORTRAN on HP ? (/thread-1187.html)



FORTRAN on HP ? - Alvaro - 04-26-2014 10:05 PM

Hi everyone,

I have been reading the article at http://sense.net/~egan/hpgcc/#Gauss%20AGM from Egan the Author of HPGCC .

There he says "][i]With little effort other languages like Fortran could also be added[/i".

Did some one ever get FORTRAN added to HPGCC?

That would be just fantastic Smile


RE: FORTRAN on HP ? - Paul Dale - 04-26-2014 11:32 PM

I'd have guessed that it wouldn't be a lot more effort than rebuilding the cross compiler with FORTRAN enabled.

- Pauli


RE: FORTRAN on HP ? - Egan Ford - 04-27-2014 03:57 AM

(04-26-2014 10:05 PM)Alvaro Wrote:  I have been reading the article at http://sense.net/~egan/hpgcc/#Gauss%20AGM from Egan the Author of HPGCC .

I just wrote that how-to to help others, not HPGCC itself.

Quote:There he says "][i]With little effort other languages like Fortran could also be added[/i".

HPGCC is nothing more that some headers and libraries. The actual compiler is gcc with ARM cross compiling. If you want gfortran, g++, etc... you'll have to build your own gcc. Google for "gcc arm fortran".

I do not know how Fortran works with C headers or libraries. You may have some additional work to do.


RE: FORTRAN on HP ? - Alvaro - 04-27-2014 10:16 AM

(04-27-2014 03:57 AM)Egan Ford Wrote:  
(04-26-2014 10:05 PM)Alvaro Wrote:  I have been reading the article at http://sense.net/~egan/hpgcc/#Gauss%20AGM from Egan the Author of HPGCC .

I just wrote that how-to to help others, not HPGCC itself.

Quote:There he says "][i]With little effort other languages like Fortran could also be added[/i".

HPGCC is nothing more that some headers and libraries. The actual compiler is gcc with ARM cross compiling. If you want gfortran, g++, etc... you'll have to build your own gcc. Google for "gcc arm fortran".

I do not know how Fortran works with C headers or libraries. You may have some additional work to do.

Hi Egan,
Thank you for your information.
I am sorry for my confusion about the Author of HPGCC.

From the "LICENSE.TXT" file that comes along with HPGCC-2.0-native-win32-SP2:
"Copyright (C) 2004-2007, The HP-GCC Development Team
All rights reserved, worldwide.
"

And from the file "HPGCC-TEAM.TXT" from the above mentioned package:
"The HP-GCC core development team are the following persons (in alphabetical order):
Ingo Blank
Claudio Lapilli
Benjamin Maurin
"


RE: FORTRAN on HP ? - Alvaro - 04-27-2014 11:38 AM

(04-27-2014 03:57 AM)Egan Ford Wrote:  Google for "gcc arm fortran".

I do not know how Fortran works with C headers or libraries. You may have some additional work to do.

I did Google for "gcc arm fortran" and seems that there are FORTRAN for ARM but looks like to be for ANDROID.

Also seems to be quite easy to have FORTRAN compiled in C just using F2C tool.

I do not have any Linux version installed, neither I have any knowledge around Linux or GCC world. That are total unknown world for me.

Can someone be so kind to point me where I can get a "GFortran.C" file to download so that I could compile it using HPGCC?

FORTRAN77 will be just fine.


RE: FORTRAN on HP ? - Egan Ford - 04-27-2014 02:31 PM

(04-27-2014 11:38 AM)Alvaro Wrote:  Can someone be so kind to point me where I can get a "GFortran.C" file to download so that I could compile it using HPGCC?

There is no gfortran.c per se, but a bunch of *.c files. You'll need to download gcc 4.8 or 4.9, read the docs on how to run ./configure with the options you need to build an ARM cross compiler with C and Fortran support.

That first hit about Android has a script, it probably has 90% of what you need. When running configure make sure you select the correct ARM targets for the 50g.

To make this work with HPGCC, I'd suggest a C wrapper and the Fortran code be compiled as a library. Fortran read/write will be a challenge, but if you are simply just trying to port over Fortran math routines/logic, then you should be able to build libraries that can be linked to HPGCC C programs.

If you want a 100% Fortran experience (e.g. HPGFORTRAN), then you'll have to port over C headers, etc... Someone determined. could knock this out in a weekend.


RE: FORTRAN on HP ? - Egan Ford - 04-27-2014 02:34 PM

(04-27-2014 11:38 AM)Alvaro Wrote:  Also seems to be quite easy to have FORTRAN compiled in C just using F2C tool.

Yes and no. F2C has a library to translate Fortran I/O calls to C. You'll need work the F2C library code to use HPGCC libraries. Again a weekend project.


RE: FORTRAN on HP ? - Alvaro - 04-27-2014 03:27 PM

(04-27-2014 02:31 PM)Egan Ford Wrote:  Someone determined. could knock this out in a weekend.

Hi Egan,
Thank you again for your helpful information.

What should I say....well, I think I had a moment of "dreaming" awake Smile