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

compiler main program with subroutine problem

phywork
Beginner
784 Views

 

I write three program, one main program pro1.f90,two subroutine pro2.f90 pro3.f90. then I use makefile tocompile it.The following is my makefile

================================

FC = ifort

OP = -O3

LIB = -L/opt/intel/mkl/8.1/lib/em64t -lmkl -lmkl_lapack -lguide -lpthread

 

a.out : pro1.f.f90 pro2.o pro3.o

$(FC) $(OP) -o a.out pro1.f90 pro2.o pro3.o $(LIB)

 

pro2.o : pro2.f

$(FC) $(OP) -c pro2.f90 $(LIB)

 

pro3.o : pro3.f

$(FC) $(OP) -c pro3.f90 $(LIB)

 

clean :

rm *.o

==========================================================

After compiling,I excute ./a.out and get such error:

====================================================

n= 100 particleN 1 L= 0 parL= 5

n= 100 L= 5 parL= 5

end of Pl(theta)

 

forrtl: severe (174): SIGSEGV, segmentation fault occurred

Image PC Routine Line Source

libifcore.so.5 0000002A959C45FC Unknown Unknown Unknown

libpthread.so.0 000000373870C4F0 Unknown Unknown Unknown

libifcore.so.5 0000002A959C45D5 Unknown Unknown Unknown

libpthread.so.0 000000373870C4F0 Unknown Unknown Unknown

============================================================

 

If I past the program pro2.f90 after the pro1.f90 in the same file,and compiler

 

ifort O3 -L/opt/intel/mkl/8.1/lib/em64t -lmkl -lmkl_lapack -lguide lpthread pro1.f90 pro3.o

 

it give me the correct answer.

 

For this reason, my progam should be right. Is there some problem with my compiler setting or makefile? Thanks!

 

 

0 Kudos
1 Reply
Steven_L_Intel1
Employee
784 Views
I don't see anything obvious in what you have posted here as to what the problem might be. Please submit an issue to Intel Premier Support and attach your source files and makefile so that we can look at it.
0 Kudos
Reply