linking mkl in Xcode 3.2.4 IDE

linking mkl in Xcode 3.2.4 IDE

Hi,

I am a new user of Mac Os. I installed the Intel Compser Xe 2011 on my macbook (intel I7 processor). I have some codes developed in the windos environment, linking the mkl lapack library for solving linear systems. Now, I am searching to link mkl in the Xcode Ide. I followed the following steps in the build section of the project target windows:

  • In the 'other linking flags' inside the linking section: -lmkl_intel_lp64  -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm
  • In the header search paths inside th seach path section: /opt/intel/composerxe-2011.0.085/mkl/include
  • In the library search paths inside th seach path section: /opt/intel/composerxe-2011.0.085/mkl/lib/
  • In the 'Use INTEL Math Kernel LIBRARY'  inside Intel Fortran Compiler XE 12.0 (limited feature) - Performance library build components: use threated Intel Math Kernel Library

In the section rules I added the rule indicating to use Intel fortran compiler xe 12.0.

I tried to execute the script for the environment variables but I am not sure that I did it effectively.

In the section 'arguments' of the executable tab under "variables to be set in the environment' i put DYLD_LIBRARY_PATH in Name and I put '/opt/intel/composerxe-2011.0.085/mkl/lib' in value

Trying to build the project I retriev the subsequent warnings

ifort:0:0 warning #10315: specifying -lm before files may supercede the Intel(R) math library and affect performance

ld:0:0 warning: directory '/Users/fabio/Desktop/Barriera/build/Release' following -L not found

ld:0:0 warning: directory '/Users/fabio/Desktop/Barriera/build/Release' following -F not found

ld:0:0 library not found for -lmkl_solver

Command /Developer/usr/bin/ifort failed with exit code 1

As said I am a beginner with the Mac os, so I don't know even the simplest commnad. Thanks in advance for the time you will spend for helping me.

Greetings,

Fabio

12 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Hi Fabio,

Review the article here (http://software.intel.com/en-us/articles/intel-math-kernel-library-for-m...). If that does not help resolve the issue then consider visiting the two links at the bottom of that article. One offers a Fortran sample that you could perhaps try under your Xcode and Intel compiler configuration.

As for the warnings/error you show:

- It appears you specified -lm on the link which uses the system libm instead of the libm provided with the Intel compiler. You could remove -lm to use the Intel math functions (optimized for Intel architecture) or leave the option in place and ignore the warning.

- The other warnings suggest a path (under your HOME area) specified with -L does not exist.

- The last warning suggests no valid -L path to the MKL libraries (specifically libmkl_solver) was provided on the link command. That probably suggest an insufficient path settings in the Library Search Path setting.

Hope that helps.

Hi Kevin,

Many thanks for your help. I resolved the first warning concerning my HOME area, but not that concerning the library. I am not sure about the correct path to set in the Library Search path.
I followed the indication in the article suggested by you. But I can't resolve the warning.

I hope you will dedicate me some time for fixing this issue.

I put in the library search paths this string
"/opt/intel/composerxe-2011.0.085/mkl/lib/"
then I tried with this string
"/opt/intel/composerxe-2011.0.085/compiler/lib"
perhaps I must put together, I don't know the difference, but the warning "library not found for -lmkl_solver" remains.

Perhaps I should set the environments variables. If so, how?

Any suggestion are welcomed.

Assuming that the set-up of MKL on OSX is similar to that on Linux, I think that the following comments may be helpful.

Are you building a 32-bit application or a 64-bit application? If the latter (more likely since you have listed ...64 in your build choices), note that there are four versions of the MKL solver library, named

mkl_solver_ilp64.lib
mkl_solver_ilp64_sequential.lib
mkl_solver_lp64.lib
mkl_solver_lp64_sequential.lib

whereas for 32-bit applications the names are

mkl_solver.lib
mkl_solver_sequential.lib

You may find the MKL Link Line Advisor (http://software.intel.com/sites/products/mkl/ ) useful.

Fabio, I am looking into this further. It is taking a bit more time to re-create a configuration closure to yours. Please stand-by.

Dear Kevin,

Many thanks for your help. Please do not hesitate to ask me more information if necessary

Hi Fabio,

I apologize for the delay. I found the root cause. There is a defect in the initial XE 2011 release (2011.0.085) that you are using.

Odd as it sounds, set the Use INTEL Math Kernel LIBRARY to None. This prevents the compiler driver from using the -mkl option and thus including the -lmkl_solver in the link which is no longer a valid library beginning with MKL 10.3. From what you indicated setting elsewhere, your link should succeed by setting that option to None. I was able to successfully link the example provided in the earlier article I cited simply by setting these two fields:

Other linking flags: -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core
Library search path: /opt/intel/composerxe/mkl/lib/

There was a specific internal bug report (DPD200163092) regarding this defect and the corresponding ifort driver fix appears in the XE 2011 Update 2 (2011.2.142) release.

If you are able to upgrade (I do recommend you do) to a newer XE 2011 Release, preferably the latest (2011.13.380) but at least to Update 2 (2011.2.142), then you can clear all those MKL specific settings you setup and simply set the Use INTEL Math Kernel LIBRARY accordingly. I verified this using Update 2.

Finally, I did want to mention we have a newer XE2013 Update 1 release available now. I do not know if your configuration meets the minimum system requirements. You can read about the system requirements in the Release Notes: http://software.intel.com/en-us/articles/intel-fortran-composer-xe-2013-...

My apologies for the troubles you experienced and for my delay in unraveling this.

Hi Kevin,

Many thanks for your help. I resolved the warnings problems, following your indication. When I run the codes, instead to appear the console as usual for input data, it appears a debugger console, even if I run the code in the release configuration. The console contains the following

(gdb) run
[Switching to process 4601]
Running…
dyld: Library not loaded: libmkl_intel_lp64.dylib
Referenced from: /Users/fabio/Desktop/Barriera/build/Release/Barriera
Reason: image not found
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Cannot call into the loader at present, it is locked.)
(gdb)

I don't know how to proceed.

Hi Kevin,

Many thanks for your help. I resolved the warnings problems, following your indication. When I run the codes, instead to appear the console as usual for input data, it appears a debugger console, even if I run the code in the release configuration. The console contains the following

(gdb) run
[Switching to process 4601]
Running…
dyld: Library not loaded: libmkl_intel_lp64.dylib
Referenced from: /Users/fabio/Desktop/Barriera/build/Release/Barriera
Reason: image not found
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Cannot call into the loader at present, it is locked.)
(gdb)

I don't know how to proceed.

Good to hear the progress, Fabio. For that run-time error, revisit Arguments for the executable and set the DYLD_LIBRARY_PATH with the following value:

/opt/intel/composerxe/lib:/opt/intel/composerxe/mkl/lib

Make certain there is no space before or after the colon.

Hi Kevin,

Issue resolved. Again, many thanks for your help. I shouldn't be able to go on without.

Glad to hear that Fabio and I'm glad I could help.

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!