Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Compile or executing problem with ifort on Mac OS X*

Belmiro_C_1
Beginner
1,099 Views

Hi,

I have just installed Intel® Parallel Studio XE Composer Edition for Fortran OS X* (m_fcompxe_2015.3.187.dmg), and I have just used it to compile my program on Mac OS 10.9.5 . It seems that there is no problem for compiling, creating the executable file (actually, there are still some warnings). However, error message came when I executed it... I really have no idea what is going on. Would you give me some comments on it ?

Here are some messages when I compile my program:

ifort -O2 -xSSSE3 -shared-intel -auto -openmp  -c  patom.f90 -L/opt/intel/mkl/lib/ -L/Users/mac/intel_ode/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -liode_intel64 -lm -I/opt/intel/mkl/include/intel64 -I/Users/mac/intel_ode/include
ifort -O2 -xSSSE3 -shared-intel -auto -openmp  -c sub19.f90
ifort -O2 -xSSSE3 -shared-intel -auto -openmp  -o  b.e patom.o sub19.o -L/opt/intel/mkl/lib/ -L/Users/mac/intel_ode/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -liode_intel64 -lm -I/opt/intel/mkl/include/intel64 -I/Users/mac/intel_ode/include
ipo: warning #11062: /Users/mac/intel_ode/lib/intel64/libiode_intel64.a is an archive, but has no symbols (this can happen if ar is used where xiar is needed)
ld: warning: ignoring file /Users/mac/intel_ode/lib/intel64/libiode_intel64.a, file was built for archive which is not the architecture being linked (x86_64): /Users/mac/intel_ode/lib/intel64/libiode_intel64.a

Here are the error messages after I execute the executable file:

dyld: Library not loaded: libmkl_intel_lp64.dylib
  Referenced from: /Users/mac/programming/Mac/patom2.2/./b.e
  Reason: image not found
Trace/BPT trap: 5

 

p.s.: this program works when I compile it on the Linux using ifort.

0 Kudos
10 Replies
Steven_L_Intel1
Employee
1,099 Views

There seems to be a problem with how iode_intel64.a was built, but you don't show the steps for that. The error message suggests that perhaps ar was used instead of xiar (if the library was compiled with -ipo), but that's just a guess.

0 Kudos
Belmiro_C_1
Beginner
1,099 Views

Steve,

Thanks for your rely!

Now, I make my program(which is just print out "Hello") and makefile simpler, and also ignore the intel ODE solver subroutine:

Here is the messages when compiling

ifort -O2 -xSSSE3 -auto -c  test.f90 -L/opt/intel/mkl/lib/ -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread  -lm -I/opt/intel/mkl/include/intel64
ifort -O2 -xSSSE3 -auto -c sub19.f90
ifort -O2 -xSSSE3 -auto -o  b.e test.o sub19.o -L/opt/intel/mkl/lib/ -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread  -lm -I/opt/intel/mkl/include/intel64

Again, the executable can be created. However, when I execute it, it fails.

Here is the error message:

dyld: Library not loaded: libmkl_intel_lp64.dylib
  Referenced from: /Users/mac/programming/Mac/test/./b.e
  Reason: image not found
Trace/BPT trap: 5

Do you know what is the problem???

 

0 Kudos
Steven_L_Intel1
Employee
1,099 Views

You probably need to set LD_LIBRARY_PATH to include MKL. I know this is needed on Linux, not sure if the variable is the same name on OS X. I am moving your question to the MKL forum where the experts there can help you.

0 Kudos
Lorri_M_Intel
Employee
1,099 Views

Please check the environment variable DYLD_LIBRARY_PATH.   It should contain the file directory where libmkl_intel_lp64.dylib can be found.

              --Lorri

0 Kudos
Belmiro_C_1
Beginner
1,099 Views

Steve and Lorri,

I am grateful for your relies! It works!! Thank you very much!!!

Besides, I have one more question about the ifort for Mac. I used to set "mcmodel" for my code. However, it seems that ifort for Mac does not support this option. Here is the error message:

ifort -O2 -xSSSE3 -mcmodel=medium -shared-intel -auto -openmp  -c  test.f90 -L/opt/intel/composer_xe_2015.3.187/mkl/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread  -lm -I/opt/intel/composer_xe_2015.3.187/mkl/include
ifort: command line warning #10152: option '-mcmodel medium' not supported
ifort -O2 -xSSSE3 -mcmodel=medium -shared-intel -auto -openmp  -c sub19.f90
ifort: command line warning #10152: option '-mcmodel medium' not supported
ifort -O2 -xSSSE3 -mcmodel=medium -shared-intel -auto -openmp  -o  b.e test.o sub19.o -L/opt/intel/composer_xe_2015.3.187/mkl/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread  -lm -I/opt/intel/composer_xe_2015.3.187/mkl/include
ifort: command line warning #10152: option '-mcmodel medium' not supported

 

But, I did see this option in the manual!! Would you tell me why I cannot use it in ifort for Mac ? (it works when I compile it in Linux)

Thank you!!

0 Kudos
Steven_L_Intel1
Employee
1,099 Views

OS X doesn't need (nor support) -mcmodel.

0 Kudos
TimP
Honored Contributor III
1,099 Views

Steve Lionel (Intel) wrote:

OS X doesn't need (nor support) -mcmodel.

Does that mean that, in effect, mcmodel=medium (or something else) is the default and only option for Mac?

0 Kudos
Steven_L_Intel1
Employee
1,099 Views

As I understand it, yes. At least medium, if not large.

0 Kudos
Ying_H_Intel
Employee
1,099 Views

Thanks Steve.  

We are supposed  to  addressed the link problem :   dyld: Library not loaded: libmkl_intel_lp64.dylib  in user guide or some articles. 

I found one: 

https://software.intel.com/en-us/articles/quick-link-intel-mkl-in-xcode-ide-a-fortran-sample

6. Troubleshooting

 dyld: Library not loaded: libmkl_intel_lp64.dylib

Please either set the environment variable DYLD_LIBRARY_PATH in Xcode environment as step 5  or use mkl environment setting tool before run the executable file in Command line windows, i.e .

>source /opt/intel/composer_xe_2013/mkl/bin/mklvars.sh intel 64
> executable

Best Regards,

Ying 

0 Kudos
Belmiro_C_1
Beginner
1,099 Views

Thank you very much Ying!!! 

It works ~ !!

0 Kudos
Reply