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

Library Links/Architecture

courtiamjmu_edu
Beginner
800 Views
I am new to Intel Fortran and MKL and cannot get the libraries to link properties. I appreciate any help you can give!

I either get a message like:
ld warning: file is not of required architecture or
ld: library not found for -lmkl_intel

I'm using the FFTW package and have compiled the wrappers in /mkl/interfaces and run make lib32 and make libem64t

I'm not sure what my architecture is supposed to be, as I've tried all of the options in the MKL Library Link generator for my DYLD_LIBRARY_PATH and LIBRARY_PATH environmental variables and nothing has run successfully.

Running /tools/environment/mklvars32.csh or the 64-bit version does not seem to set or change any of my environmental variables.

I am running (or trying to run) Intel Fortran Compiler with MKL for Mac OSX v. 11.0/064

I am running Mac OS X 10.5.7 on the following machine:
Model Name: Mac Pro
Model Identifier:MacPro3,1
Processor Name:Quad-Core Intel Xeon
Processor Speed:2.8 GHz
Number Of Processors:2
Total Number Of Cores:8
L2 Cache (per processor):12 MB
Memory: 4 GB
Bus Speed: 1.6 GHz
Boot ROM Version:MP31.006C.B05
SMC Version (system):1.25f4
Serial Number (system):G881934XXYL

0 Kudos
3 Replies
Todd_R_Intel
Employee
800 Views
You might have just run the env script rather than 'sourcing' it. For example, I use the following: "source ./mklvarsem64t.sh".

You're OS might run both 32- and 64-bit programs, but certainly you'll want to match the libraries against the program you are compiling. Perhaps you could use the -V compiler option.

Todd
0 Kudos
courtiamjmu_edu
Beginner
800 Views
Thanks - using source at least helped the .cshrc file. I'm still not entirely sure on the 32 vs 64 bit but it seems happier with 64 for now. Any suggestions on how to decide if I need 32 or 64 bit integers, and multi-thread or sequential format? I'm getting my links from the Intel Library Link Line Advisor and it wants to know those options.

Also, slightly unrelated, the Library Link Line Advisor always has -lphread at the end, but it seems like it should be -lpthread. True?
0 Kudos
TimP
Honored Contributor III
800 Views
Quoting - courtiamjmu.edu
Thanks - using source at least helped the .cshrc file. I'm still not entirely sure on the 32 vs 64 bit but it seems happier with 64 for now. Any suggestions on how to decide if I need 32 or 64 bit integers, and multi-thread or sequential format? I'm getting my links from the Intel Library Link Line Advisor and it wants to know those options.

Also, slightly unrelated, the Library Link Line Advisor always has -lphread at the end, but it seems like it should be -lpthread. True?
You must use the 32- or 64-bit MKL corresponding to the mode for which you compiled. If you use the Intel64 or em64t compiler, or the gnu 64-bit compiler without -m32 option, it requires the 64-bit em64t MKL.
The 32- or 64-bit integers correspond to the data types you use when calling the MKL functions.
Multi-thread means that the MKL function itself may add threads; this is usually done when you don't call MKL from threads in your own application. You might want to start with sequential, and later check whether thread gives you better performance.
When I looked at the advisor, I wasn't sure why it seemed to be mixing up the static and dynamic link options. Dynamic is usually a good starting point.
Right on the spelling of pthread. That option is supplied for you if you link with the OpenMP option of a compiler. The mkl_sequential option doesn't require OpenMP or pthread libraries, unless you use them elsewhere in your application.
0 Kudos
Reply