Skip to content

Compiling Old fortran programs(&link pgplot) on 64-bit system

This post is for the old fortran computing programs (except TEMPO)

The moral of the story to compile those old programs in 32-bit on the 64-bit machines, because I could not find any documentation online re how f77 compiles differently in 64-bit and 32-bit. However, we do know that programs compiled in 64 bit behave differently from those compiled in 32-bit (for example the size of some data type are different). Therefore, on the 64-bit machines we should force compile these old programs in 32-bit to ensure consistency. The steps are as follows.

1. Make sure that your $PGPLOT_DIR environmental variable points to /usr/share/astro/psrchive/pgplot_32bits

2. Look at the make file. Add “-m32” to FFLAGS (meaning force compile in 32 bit for fortran) and make sure that the f77 step says f77 $(FFLAGS)     in order that the FFLAGS be invoked.

Make sure that the LIBS line have all of the following especially $(PGPLOT_DIR)

LIBS = -L$(PGPLOT_DIR) -lpgplot -L/usr/X11R6/lib -lX11 -lpng

Then we should be fine

–Yuping

—————————————————————————-

Pulling in additional 32-bit compat library when the compiler complains about not having it:

Do a google search to see what packages provide those libraries (theoretically “yum provides filename” should work but I never succeed on our computer. Useful stuff is “yum search keyword” which search through the available packages. Always pick the package ending with i686 (which stands for 32-bit) and devel if available

for example I see -lz and google tells me zlib is what I need. I run “yum search zlib” and just pick the one with “devel” and “i686″(meaning 32 bit). So I will type “sudo yum install zlib-xxxx-devel-i686

Published inConfigurationCross CompilationInstalled softwareUnix Hint

Comments are closed.