Porting from Solaris to Linux

I’m trying to port a mixed language (C, C++, Fortran) application from Solaris SPARC (Big Endian) compiled with Greenhills compiler to Linux Redhat x86-64 (little endian) platform. I’m using pgf77 and pgcc. It compiles but gives a seg fault when running. I suspect endianness and alignment issues among other things. What I’m looking for is a porting guide and porting tool that may help facilitate the porting process. Are there any specific compiler options that may help pgcc/pgf77 compile “like” the Greenhills gcc compiler? Thx.

Did the Greenhills compiler give local variables in Fortran subprograms the SAVE attribute, and did the author of the code that you are working on depend on such variables retaining their value from one call to the next?

It is better for you to track down any non-standard Fortran extensions that are used in the application and bring the code into compliance with current Fortran standards, than to look for semi-magical compiler options that help a new compiler emulate the quirks of an old compiler.

The only “magical” compiler options I’m using is -Msave and -Mextend. That said, the code is rather old and contains some obsolete but supported contexts (GOTO’s, etc.). Exacerbating the problem is that the application is multithreaded… it links to both thread and pthread libraries… and the semaphore libraries are different between Solaris and Linux. Is there a porting guide that may show me what to look for and look out for?

Having never ported from Solaris to Linux, unfortunately, I don’t have any general advice. Though, if you have a specific question, we may be able to help.

Is there a porting guide that may show me what to look for and look out for?

We don’t have any PGI specific Solaris to Linux porting guides, but you might be able to find something more general on the web.

  • Mat