F77: compilation problem with g77 - a program that is usually compiled using the Absoft compiler

I'm not a Fortran programmer (just a short experience), but I need to compile a program partially written in F77. Someone compiled it with the compiler Absoftin front of me, but now I need to repeat the procedure on another machine with g77. For Absoft, the makefile has

f77 -f  -w -O -B100 -B108 -c *.f
mv *.f flib && mv *.o olib
f77  -B100 -o runme olib/*.o clib/*.o -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -L$PVM_ROOT/lib/$PVM_ARCH  -lfpvm3 -lpvm3 -L$ABSOFT/lib -lU77

I changed these lines to

g77   -w -O -B100 -B108 -c *.f
mv *.f flib && mv *.o olib
g77  -B100 -o runme olib/*.o clib/*.o -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -L$PVM_ROOT/lib/$PVM_ARCH  -lfpvm3 -lpvm3  -lgfortran -lgfortranbegin

But I get the following error messages

somefile.f:(.text+0x93): undefined reference to `for_open'
somefile.f:(.text+0xf4): undefined reference to `for_write_seq_fmt'
somefile.f:(.text+0x128): undefined reference to `for_write_seq_fmt_xmit'
somefile.f:(.text+0x454): undefined reference to `for_read_seq'

How can i fix this?


Update1

If I add -libifcoreat the end of the last line (linker), I get

/usr/bin/ld: cannot find -libifcore

I found a library

$ find /opt/intel/* -name 'libifcore*'
/opt/intel/fce/9.1.036/lib/libifcore.a
/opt/intel/fce/9.1.036/lib/libifcore.so
/opt/intel/fce/9.1.036/lib/libifcore.so.5
/opt/intel/fce/9.1.036/lib/libifcore_pic.a
/opt/intel/fce/9.1.036/lib/libifcoremt.a
/opt/intel/fce/9.1.036/lib/libifcoremt.so
/opt/intel/fce/9.1.036/lib/libifcoremt.so.5
/opt/intel/fce/9.1.036/lib/libifcoremt_pic.a

But even if I do the following in the source directory

$ export PATH=$PATH:/opt/intel/fce/9.1.036/lib/
$ ln -s /opt/intel/fce/9.1.036/lib/libifcore.so

he was not found.

, , -libm MPICC? libimf.so: warning: feupdateenv

, ,

$ echo $LD_LIBRARY_PATH
/opt/intel/fce/9.1.036/lib:/opt/intel/cce/9.1.042/lib:/usr/local/lib/openmpi:/usr/local/lib:/usr/lib:
+3
5

, , Absoft . g77 , ( ) .

ifort, , .

fortcom: Error: somefile.f, line 703: An extra comma appears in the format list.   [)]
     & (1p5e12.3,5h  ...,))                                             
-------------------------^
compilation aborted for somefile.f (code 1)

, , ifort .

, , , Intel, , g77 , .

, , , , , .

0

Absoft Fortran 77, Fortran 77, g77.

, , . , , , Absoft , g77.

+2

, libifcore.

Edit: , '-lifcore' . gcc tutorial

, -lNAME libNAME.a .

+1

g77, - "g77". ( f77 ? "f77 -v" ...) g77 , Fortran. Fortran, gfortran, . gfortran - , , , Fortran 77 , , - "gfortran".

g77 gfortran Intel - , f77 ifort, Intel, ?

:

- , .

FORTRAN 77 "junk.f"

C234567
      write (6, *) "Hello World"
      stop
      end

:

g77 junk.f -o junk.exe

:

./junk.exe

, g77.

+1

g77, gfortran? ? openmp ?

openmp gfortran, , , ifort, sse .

+1

Source: https://habr.com/ru/post/1757200/


All Articles