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

Intel Fortran Compiler Core Dumped because of CLOG FUNCTION?

irongreat
Beginner
1,150 Views

Hi,

I've just installed the intel fortranVersion 12.0.3. I build a static library of spec func with the open source code. I call it in my code. But the program allways core dumped. I debugged it and found it died at CLOG function. It sees to be an intrisinc function. Consequently, I write the following simple code and call CLOG only. In result, the core dumped when I compile it.
 
program main
implicit none
complex X,Y
integer N
real A
complex,external::BESSELJ
 
 
X=(0,1)
Y=CLOG(X)
N=1
Y=BESSELJ(N,X)
 
WRITE(*,*) REAL(Y),AIMAG(Y)
end program
 
 
function BESSELJ(N,X)
implicit none
complex,intent(in)::X
integer,intent(in)::N
complex CY(2),BESSELJ
real FNU
integer KODE,NZ,IERR
external CBESJ
 
KODE=1
NZ=0
FNU=FLOAT(N)
 
! call CBESJ(X,FNU,KODE,2, CY,NZ,IERR)
 
BESSELJ=CY(2)
end function

function BESSELJ(N,X)implicit nonecomplex,intent(in)::Xinteger,intent(in)::Ncomplex CY(2),BESSELJreal FNUinteger KODE,NZ,IERRexternal CBESJ
KODE=1NZ=0FNU=FLOAT(N)
! call CBESJ(X,FNU,KODE,2, CY,NZ,IERR)
BESSELJ=CY(2)end function
 
The error reported by ifort is as follows.
ifort specfunctest.f90 -c -g
ifort: error #10105: /opt/intel/composerxe-2011.3.174/bin/ia32/fortcom: core dumped
ifort: error #10106: Fatal error in /opt/intel/composerxe-2011.3.174/bin/ia32/fortcom, terminated by unknown signal(139)
compilation aborted for specfunctest.f90 (code 1)
 
However, when I hide the CLOG function, the compiler works properly. Why??
I compile the same code with gfortran. It does well.
 
In addition, sometimes the code is compiled by ifort properly. But the core dumped when it excute. I debug it and find it core dumped when call clog func. why?
 
 
 
0 Kudos
3 Replies
TimP
Honored Contributor III
1,150 Views
One question would be what you are trying to achieve here. You write code which should give an exception (log(0.) might produce -Inf, but this isn't guaranteed) but then expect to mask it by a following assignment to the same variable. Either compiler might change its behavior when you set normal optimization.
0 Kudos
Ron_Green
Moderator
1,150 Views
something is wrong with your installation. I tried your code with 12.0.3.174 on both Intel 64 and IA32 systems. It compiles without a problem.

From your post, it appears you are running the 32bit version of the Intel compiler 12.0 Update 3. What OS distro and version are you using? Did you install the prerequisites listed here: http://software.intel.com/en-us/articles/intel-compilers-linux-installation-help/

Did you source compilervars.sh properly before compilation:

source /opt/intel/bin/compilervars.sh ia32

Can you compile and run a hello world program?

What is the output of

ifort -c -g -dryrun specfunctest.f90

Here is my output on a 32bit linux system:

[rwgreen@spdr16 85528]$ ifort -g -c u85528.f90
[rwgreen@spdr16 85528]$ more u85528.f90
program main
implicit none
complex X,Y
integer N
real A
complex,external::BESSELJ
X=(0,1)
Y=CLOG(X)
N=1
Y=BESSELJ(N,X)
WRITE(*,*) REAL(Y),AIMAG(Y)
end program

function BESSELJ(N,X)
implicit none
complex,intent(in)::X
integer,intent(in)::N
complex CY(2),BESSELJ
real FNU
integer KODE,NZ,IERR
external CBESJ
KODE=1
NZ=0
FNU=FLOAT(N)
! call CBESJ(X,FNU,KODE,2, CY,NZ,IERR)
BESSELJ=CY(2)
end function

0 Kudos
TimP
Honored Contributor III
1,150 Views
I was guessing that the failure occurred at run time, not compile time (as stated in the original post), although it's conceivable that an attempt to evaluate clog could be made at compile time with such an example.
0 Kudos
Reply