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

ifort Mac OS X linking problem

Tom_S_1
Beginner
2,086 Views

Hi,


I am trying to compile some code I wrote for my research on an Intel Mac Pro running Mac OS X Tiger 10.4.11 using ifort. As I managed to this before on Fedora 8 with ifort, as well as on this Mac Pro using gfortran 4.3, I expected no problems. However things to took a different turn...

My software consists of a shared library, written in C, Obj-C and fortran, and a bunch of executables written in C and Obj-C that link to this library.

I compiled the library without problems but when I want to try the executables I receive a bunch of ld errors like this:

FYI: libxmi-quant.dylib is the name of my shared library.

/usr/bin/ld: warning can't open dynamic library: libifcore.dylib referenced from: ../lib/libxmi-quant.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: libifcoremt.dylib referenced from: ../lib/libxmi-quant.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: libifport.dylib referenced from: ../lib/libxmi-quant.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: libimf.dylib referenced from: ../lib/libxmi-quant.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: libintlc.dylib referenced from: ../lib/libxmi-quant.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: libirc.dylib referenced from: ../lib/libxmi-quant.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: libguide.dylib referenced from: ../lib/libxmi-quant.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: libsvml.dylib referenced from: ../lib/libxmi-quant.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: Undefined symbols:
_for_write_seq_lis referenced from libxmi-quant expected to be defined in libifcore.dylib
_for_read_seq_lis referenced from libxmi-quant expected to be defined in libifcore.dylib
___libm_sse2_exp referenced from libxmi-quant expected to be defined in libimf.dylib
c_f_pointer_set_desc4 referenced from libxmi-quant expected to be defined in libifcore.dylib
_for_check_mult_overflow referenced from libxmi-quant expected to be defined in libifcore.dylib
_for_alloc_allocatable referenced from libxmi-quant expected to be defined in libifcore.dylib
_for_write_seq_fmt referenced from libxmi-quant expected to be defined in libifcore.dylib
_for_write_seq_fmt_xmit referenced from libxmi-quant expected to be defined in libifcore.dylib
___svml_exp2 referenced from libxmi-quant expected to be defined in libsvml.dylib
_for_allocate referenced from libxmi-quant expected to be defined in libifcore.dylib
_for_deallocate referenced from libxmi-quant expected to be defined in libifcore.dylib
_iso_c_binding_mp_c_loc_ referenced from libxmi-quant expected to be defined in libifcore.dylib
_for_e xit referenced from libxmi-quant expected to be defined in libifcore.dylib
___libm_sse2_sincos referenced from libxmi-quant expected to be defined in libimf.dylib
_for_dealloc_allocatable referenced from libxmi-quant expected to be defined in libifcore.dylib
___libm_sse2_sin referenced from libxmi-quant expected to be defined in libimf.dylib
_for_write_seq_lis_xmit referenced from libxmi-quant expected to be defined in libifcore.dylib
_for_stop_core referenced from libxmi-quant expected to be defined in libifcore.dylib
___libm_sse2_tan referenced from libxmi-quant expected to be defined in libimf.dylib
___libm_sse2_cos referenced from libxmi-quant expected to be defined in libimf.dylib

I used the default installation of the Intel Fortran and the environment is set correctly.

Any help would be greatly appreciated!


 

0 Kudos
10 Replies
Ron_Green
Moderator
2,086 Views
Tom,

The runtime is not finding the Intel runtime libraries, such as libifcore.dylib. Before you run,

source /opt/intel/fc//bin/ifortvars.sh

This will set up the dynamic library path to include the Intel Fortran Runtime Libraries (RTL).

If you use the 64 bit compiler, use the path to /opt/intel/fce//bin/ifortvars.sh

Let us know if this fixes the problem (it should).

ron
0 Kudos
Tom_S_1
Beginner
2,086 Views
Thanks for the quick answer ron.

This doesn't fix the problem though.

I already added that line to my .bashrc so I'm pretty sure the environment is OK. $DYLD_LIBRARY_PATH is defined and points to the right directory.

Tom


0 Kudos
Ron_Green
Moderator
2,086 Views
Interesting. Would otool -L on your dylib give any hints:

otool -L libxmi-quant.dylib

Also, is LD_LIBRARY_PATH set correctly at runtime? (will indicate if the ifortvars.sh was sourced correctly)

0 Kudos
Tom_S_1
Beginner
2,086 Views
This is the otool -L output:

libxmi-quant.dylib:
/Users/schoon/xmi-quant/src/../lib/libxmi-quant.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.10)
/Users/schoon/xraylib_v2.9/src/../lib/libxrl.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/local/lib/libxml2.2.dylib (compatibility version 9.0.0, current version 9.31.0)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/local/lib/libgsl.0.dylib (compatibility version 13.0.0, current version 13.0.0)
/opt/local/lib/libgslcblas.0.dylib (compatibility version 1.0.0, current version 1.0.0)
libifcore.dylib (compatibility version 0.0.0, current version 1.0.0)
libifcoremt.dylib (compatibility version 0.0.0, current version 1.0.0)
libifport.dylib (compatibility version 0.0.0, current version 1.0.0)
libimf.dylib (compatibility version 0.0.0, current version 0.0.0)
libintlc.dylib (compatibility version 0.0.0, current version 0.0.0)
libirc.dylib (compatibility version 0.0.0, current version 0.0.0)
libguide.dylib (compatibility version 4.0.0, current version 4.0.0)
libsvml.dylib (compatibility version 0.0.0, current version 0.0.0)


And the LD_LIBRARY_PATH is also set correctly.

Tom
0 Kudos
Ron_Green
Moderator
2,086 Views
when you compiled on Tiger, do you use the 32bit compiler in path /opt/intel/fc/....etc...?

and what compiler version do you have? ifort -V

0 Kudos
Tom_S_1
Beginner
2,086 Views
I used the 32 bit compiler

output of ifort -V:

Intel Fortran Compiler for applications running on IA-32, Version 10.1 Build 20080312 Package ID: m_fc_p_10.1.014
0 Kudos
Bonnie_A_Intel
Employee
2,086 Views
While we run some testson this problem, I just wanted to mention that in the one case where we saw something similar on a Tiger system, the problem went away after logging out and logging back in.
0 Kudos
Tom_S_1
Beginner
2,086 Views
Thanks for investigating this problem.


The logging out/logging in doesn't work though.

Tom
0 Kudos
gflat
Beginner
2,086 Views

I was wondering if there was any resolutin to this problem. I am having a similar issue linking my application to the included libguide.dylib. I'm running the 64-bit ifort. 10.0.016

-Jeff

0 Kudos
Kevin_D_Intel
Employee
2,086 Views

Hi Jeff,

First, just a heads-up. If you are using Leopard, then you need to upgrade to our latest 10.1 update. Our 10.0 compiler does not support Leopard. I do not know if that will affect your issue.

What run-time errors do you see?

0 Kudos
Reply