Port IRIX 64 Fortran F90 to Red Hat Linux 86_64?

Hi, Has anyone performed a fortran 90 port from IRIX 64 ( 6.5) to Red Hat (2.6.9)? The code is totally self contained, it builds with very minor format changes for the Portland Group compiler on Linux, but at runtime I get memory faults as the code addresses invalid areas. It stinks of a COMMON data area issue, but no matter what compiler switches I enable/disable it will not run under Linux correctly!

The IRIX make file has these switches for the source compilations on the mips processor and linker file. ( The object .a libraries are all my Fortran code modules compiled using the options below)

f90 -mips4 -r10000 -default64 -O2

f90 -mips4 -r10000 -default64 -O2 -o i3810 …/pps/bdata.f
…/libi3810.a
…/libpps.a …/libctu.a
…/libi3830.a …/libi3820.a -lblas -Wl,-u,MAIN__

On linux I am doing

pgf90 -i8 -r8 -O2

otherwise the same…

( Actually optimisation -O2 is off and -g is on for a debugging version)


Help!

Phil

Hi Phil,

I think you need to get out the debugger, PGDBG, and track down where the memory fault is coming from.

Does your code make any assumptions about data type sizes? Are you also porting from 32-bit to 64-bits (IRIX 32-> Linux 64)? Do you really need “-r8 -i8”?

  • Mat

Thanks for the reply Mat… the code was modifed back in '04 to 64 bit on IRIX ( mips processor) …it works and the code looks robust around the use of REAL4, INTEGER4 for file handling where it is used… the ‘default’ REAL/INTEGER variables work as 8 byte sizes on IRIX it seems. When I use PGDBG on Linux the program seems to perform READS into global commons etc correctly using these object sizes…but it does make heavy use of EQUIVALENCES etc and this code is ANCIENT! it was written in '90 originally, the Fortran hardly uses include files so the COMMON definitions are different in different sources, there is no use of IMPLICIT NONE so its really difficult to find uninitialised variables (even with the switches) etc… Any ideas on any other switches to try out? Could be I have to do a massive rationalisation of the variables ( there are 450 source modules!) and COMMON data areas.

Any other ideas on what to try?

thanks again
Phil

Hi Phil,

If you think it might be an unitialized memory reference, the a good utility to try is Valgrind, http://www.valgrind.org. I use it quite often to find these types of problems.

  • Mat