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

Compilation error on Mac :Undefined symbols for architecture x86_64

E_K_
Beginner
2,353 Views

Hi 
I'm using Intel Fortran version 14.0.2 20140121 on Mac OS X and Xcode 6.1.1.

After Installing and sourcing files like

source /opt/intel/bin/compilervars.sh intel64
source /opt/intel/mkl/bin/intel64/mklvars_intel64.sh

 

tried to compile a test file (Hello world) and got the following error:

**********************

Undefined symbols for architecture x86_64:

  "__Unwind_Backtrace", referenced from:

      _tbk_trace_stack in libirc.a(tbk_backtrace.o)

  "__Unwind_ForcedUnwind", referenced from:

      _tbk_trace_stack in libirc.a(tbk_backtrace.o)

  "__Unwind_GetIP", referenced from:

      _tbk_stop_unwind_callback in libirc.a(tbk_backtrace.o)

      _backtrace_callback in libirc.a(tbk_backtrace.o)

  "__Unwind_GetRegionStart", referenced from:

      _tbk_stop_unwind_callback in libirc.a(tbk_backtrace.o)

ld: symbol(s) not found for architecture x86_64

**********************

I've read that this combination of OS and Xcode is not supported by the version 14, 
but as I saw a similar error when I compiled the same file with gfortran,

I think this might not be due to the combination problem. 

 

I'm glad if someone could find how to fix this error.
 

 

 

 

 

0 Kudos
8 Replies
TimP
Honored Contributor III
2,353 Views

Did you check whether libunwind is linked.  If not, does specifying it help?

0 Kudos
E_K_
Beginner
2,353 Views

Thank you for your comment !
I couldn't find libunwind.a in /opt/intel/lib/intel64.
There is libunwind.h in an irreverent folder, but I guess this is for another compiler.
 

 

 

0 Kudos
JVanB
Valued Contributor II
2,353 Views

I know nothing about Mac, however it does name libraries more like libunwind.dylib than libunwind.a . Maybe you can modify your search accordingly.

0 Kudos
Steven_L_Intel1
Employee
2,353 Views

Do you have gcc installed? That is required. Missing gcc could cause this error.

0 Kudos
Kevin_D_Intel
Employee
2,353 Views

I have not been able to coax ld into shedding light on where those external references are resolved so I cannot tell which location might be used. On our Mac running OS X 10.10 (Yosemite) with Xcode 6.1 it has:

/usr/lib/system/libunwind.dylib

-OR-

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/system/libunwind.dylib

I somewhat suspect the latter is used since the compiler-driver includes most of the path to the latter copy on the ld command-line for the -syslibroot argument.

i.e.
    -syslibroot \
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk \


Along the lines of Steve’s comment, I was wondering whether a trivial C/C++ program will compile and link.

Also, did you install the Intel 14.0 release after the Xcode 6.1 install?  If not, you should reinstall the Intel 14.0 release.

0 Kudos
Kevin_D_Intel
Employee
2,353 Views

I just confirmed that it is the version found under the -syslibroot path. You can compile using the ifort -dryrun option to see what path the compiler uses for -syslibroot.

0 Kudos
E_K_
Beginner
2,353 Views

Thank you so much for the people who kindly commented!
The one causing the trouble was gcc.  
I could compile a c program, but after I installed another gcc via macports, 
the error on ifort disappeared.

Thank you all again!

0 Kudos
Kevin_D_Intel
Employee
2,353 Views

Interesting. I'm not sure what the root cause was but am glad you were able to resolve this.
 

0 Kudos
Reply