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

ifort "-static" problems

jonas
Beginner
693 Views
Hello everyone,

I am having problems compiling fortran programs using "-static" flag. Although without "- static" everything compiles ok, but then run time errors occurs. Compile time error looks like this:

/opt/intel/fc/9.1.040/lib/libirc.a(tbk_backtrace.o): In function `tbk_stop_unwind_callback??unw':
tbk_backtrace.c:(.text+0x27e2): undefined reference to `_Unwind_GetIP'
tbk_backtrace.c:(.text+0x2a22): undefined reference to `_Unwind_GetRegionStart'
/usr/lib/libc.a(iofclose.o): In function `fclose':
(.text+0x5d2): undefined reference to `_Unwind_Resume'
/usr/lib/libc.a(iofread.o): In function `fread':
(.text+0x312): undefined reference to `_Unwind_Resume'
/usr/lib/libc.a(ioftell.o): In function `ftell':

and so on..
My OS is: SUSE Linux Enterprise Server 10 (ia64)
Intel compiler version is: 9.1

Maybe any of you know the solution to my problem ?

Thanx in advance.

p.s. The solution "not to use '- static' flag" does not fit to me.
0 Kudos
3 Replies
TimP
Honored Contributor III
693 Views
You may have run into a case where -lunwind is required, but not supplied by ifort, so you must add that library reference in your link step. libunwind.a has to be supplied by your linux installation; if not present, look on your install DVD.
0 Kudos
Ron_Green
Moderator
693 Views
This was a known bug in the older 9.1 compilers such as yours. If you want to use your compiler, there is a workaround to try: Add this early in your compile line:

-L/usr/lib

The functions you are missing are part of /usr/lib/libunwind.so.7

Again, this was a known issue in the older 9.1 compilers on SLES 10.

This bug was fixed in the 10.0 compiler and all newer compilers such as 10.1.x. I cannot tell when this was fixed in the 9.1 compiler versions, but it was after 9.1.046. The most recent 9.1 is 9.1.051, so you can see your .040 version is very out of date.

ron
0 Kudos
jonas
Beginner
693 Views
Hi,

thank you Ron very much. Your post was really helpful. Installing intel fortran 10.1 solved the "-static" problem.

Thanx again. smiley [:-)]
0 Kudos
Reply