Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

compiling fortran 77 code

Milenko_M_
Beginner
2,529 Views

I have compiled fortran 77 code for geophysical processing(written by other person).When I tried to change parameters file to allow for larger chunks and larger matrices to be inverted I got this
rm -f *.o 
rm -f birrp
ifort -fast  -Wl -o birrp birrp.f  coherence.f  dataft.f  diagnostic.f  fft.f  filter.f  math.f  rarfilt.f  response.f  rtpss.f  utils.f  weight.f  zlinpack.f  
ifort: command line warning #10157: ignoring option '-W'; argument is of wrong type
filter.f(1): warning #6178: The return value of this FUNCTION has not been defined.   [FILTER]
      complex function filter(f,fpar,npar)
-----------------------^
utils.f(890): warning #7532: The number of arguments is incompatible with intrinsic procedure, assume 'external'.   [DATE]
      call date( 0, time1, year1, month1, day1, hour1, min1, sec1 )
-----------^
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu//libc.a(libc_fatal.o): In function `__libc_message.constprop.0':
(.text+0x13b): relocation truncated to fit: R_X86_64_PC32 against symbol `__abort_msg' defined in .bss section in /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu//libc.a(abort.o)
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu//libc.a(libc_fatal.o): In function `__libc_message':
(.text+0x421): relocation truncated to fit: R_X86_64_PC32 against symbol `__abort_msg' defined in .bss section in /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu//libc.a(abort.o)
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu//libc.a(gconv_db.o): In function `__gconv_get_modules_db':

I am on Ubuntu 14.04.How should I set the compilation options?My makefile

FC90 = ifort
FCFLAGS= -fast  -Wl

TARGETS= clean  birrp
OBJSOC= birrp.f  coherence.f  dataft.f  diagnostic.f  fft.f  filter.f  math.f  rarfilt.f  response.f  rtpss.f  utils.f  weight.f  zlinpack.f
        
all:  $(TARGETS)

clean:
        rm -f *.o 
        rm -f birrp

birrp:$(OBJSOC)
        $(FC90) $(FCFLAGS) -o $@ $(OBJSOC)  $(LIBS)

# General compile rules

.SUFFIXES: .f .o 

.f90.o:    
    $(FC90) $(FCFLAGS)    -c -o $@ $< 

0 Kudos
8 Replies
mecej4
Honored Contributor III
2,529 Views

The -Wl option prefix is used by some compilers to signify that what follows is an option that you want the compiler to pass to the linker (ld in Unix/Linux) as-is. You probably do not need it at all here. The warning about DATE is also something that you can ignore (you have an external subroutine with the same as an Intel-supplied intrinsic subroutine).

However, the warning about the function FILTER not returning a value is probably serious. You need to fix it and, since I do not know anything about your application or BIRRP, I have to see the lines of code where that function is used in an expression before giving any suggestions.

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,529 Views

>> relocation truncated to fit: R_X86_64_PC32

You may have issues with static data > 2GB

https://software.intel.com/en-us/articles/avoiding-relocation-errors-when-building-applications-with-large-global-or-static-data-on-intel64

You may need to change your very large arrays to ALLOCATABLE if -mcmodel=medium does not resolve the issue.

Jim Dempsey

 

0 Kudos
Milenko_M_
Beginner
2,529 Views

Jim

Yes,I have large arrays.Should I add -mcmodel=medium to my FCFLAGS?

0 Kudos
Milenko_M_
Beginner
2,529 Views

Well i have managed to compile but I have this problem

milenko@milenko-X58-USB3:~/birrp$ ./birrp < in131072.mt1
./birrp: error while loading shared libraries: libifport.so.5: cannot open shared object file: No such file or directory

 

0 Kudos
mecej4
Honored Contributor III
2,529 Views

Are you attempting to run BIRRP from an Ifort session? If not, make sure that LD_LIBRARY_PATH contains the directories of all the shared libraries that are required by your application.

0 Kudos
Milenko_M_
Beginner
2,529 Views

Yes,I am running BIRRP from an ifort session. I have edited makefile like this
FCFLAGS=-mcmodel=medium

Is this wright?

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,529 Views

The environment variable LD_LIBRARY_PATH must include the paths to all the shared libraries.

On Linux, you command shell should set this via

export LD_LIBRARY_PATH= (list of paths to search using ; separator)

Jim Dempsey

0 Kudos
Lorri_M_Intel
Employee
2,529 Views

If you have LD_FLAGS, you may need to add it there as well.

               --Lorri

0 Kudos
Reply