f2py build with mkl lapack

Hi I'm trying to use fortran wrapper f2py with intel's mkl following is my command LIB='-L/opt/intel/Compiler/11.1/064/mkl/lib/em64t/ -lguide -lpthread -lmkl_core -lmkl_intel_lp64 -lmkl_sequential' INC=-I/opt/intel/Compiler/11.1/064/mkl/include f2py --fcompiler=intelem $INC $LIB -m solveLE -c solveLE2.f solveLE2.f is simple fortran code using lapack's linear equation solver SGESV ============= CALL SGESV(N, NRHS, A, LDA, IPIV, B, LDB, INFO) ============= When i use the command, compile was done. But when I use the solveLE.so, I received following error massage ================== $python test.py python: symbol lookup error: /opt/intel/Compiler/11.1/064/mkl/lib/em64t/libmkl_lapack.so: undefined symbol: mkl_lapack_sgetrf ================== I think "mkl_lapack_sgetrf" is defined in -lmkl_sequential. I don't know what should I do. Any help would be greatly appreciated! Sunghyun Kim Ph.D. Candidate Theoretical Condensed Matter Physics Group. KAIST 291 Daehak-ro(373-1 Guseong-dong), Yuseong-gu, Daejeon 305-701, Republic of Korea +10-4144-5946

On Mon, Jul 8, 2013 at 5:05 PM, sunghyun Kim <kimsunghyun@kaist.ac.kr>wrote:
Hi
I'm trying to use fortran wrapper f2py with intel's mkl
following is my command
LIB='-L/opt/intel/Compiler/11.1/064/mkl/lib/em64t/ -lguide -lpthread -lmkl_core -lmkl_intel_lp64 -lmkl_sequential'
Linking order matters: if A needs B, A should appear before B, so -lpthread/-lguide should be at the end, mkl_intel_lp64 before mkl_core, and mkl_sequential in front of that. See the MKL manual for more details, David
INC=-I/opt/intel/Compiler/11.1/064/mkl/include f2py --fcompiler=intelem $INC $LIB -m solveLE -c solveLE2.f solveLE2.f is simple fortran code using lapack's linear equation solver SGESV ============= CALL SGESV(N, NRHS, A, LDA, IPIV, B, LDB, INFO) =============
When i use the command, compile was done. But when I use the solveLE.so, I received following error massage
================== $python test.py python: symbol lookup error: /opt/intel/Compiler/11.1/064/mkl/lib/em64t/libmkl_lapack.so: undefined symbol: mkl_lapack_sgetrf ==================
I think "mkl_lapack_sgetrf" is defined in -lmkl_sequential.
I don't know what should I do.
Any help would be greatly appreciated!
Sunghyun Kim Ph.D. Candidate Theoretical Condensed Matter Physics Group. KAIST 291 Daehak-ro(373-1 Guseong-dong), Yuseong-gu, Daejeon 305-701, Republic of Korea +10-4144-5946
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

On Mon, Jul 8, 2013 at 10:15 AM, David Cournapeau <cournape@gmail.com> wrote:
On Mon, Jul 8, 2013 at 5:05 PM, sunghyun Kim <kimsunghyun@kaist.ac.kr> wrote:
Hi
I'm trying to use fortran wrapper f2py with intel's mkl
following is my command
LIB='-L/opt/intel/Compiler/11.1/064/mkl/lib/em64t/ -lguide -lpthread -lmkl_core -lmkl_intel_lp64 -lmkl_sequential'
Linking order matters: if A needs B, A should appear before B, so -lpthread/-lguide should be at the end, mkl_intel_lp64 before mkl_core, and mkl_sequential in front of that.
See the MKL manual for more details,
You may also want to consult the MKL Link Line Advsior [1], which in your case recommends an ordering like: -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm [1]: http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor -Brad

thank you for your help I tried following orders and many combinations... ===================== LIB='-L/opt/intel/Compiler/11.1/064/mkl/lib/em64t/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm' LIB='-L/opt/intel/Compiler/11.1/064/mkl/lib/em64t/ -lmkl_solver_lp64_sequential -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm' ==================== but I still got following massage ================ undefined symbol: mkl_lapack_sgetrf ================ Sunghyun Kim Ph.D. Candidate Theoretical Condensed Matter Physics Group. KAIST 291 Daehak-ro(373-1 Guseong-dong), Yuseong-gu, Daejeon 305-701, Republic of Korea +10-4144-5946 On Tue, Jul 9, 2013 at 3:37 AM, Bradley M. Froehle <brad.froehle@gmail.com>wrote:
On Mon, Jul 8, 2013 at 10:15 AM, David Cournapeau <cournape@gmail.com> wrote:
On Mon, Jul 8, 2013 at 5:05 PM, sunghyun Kim <kimsunghyun@kaist.ac.kr> wrote:
Hi
I'm trying to use fortran wrapper f2py with intel's mkl
following is my command
LIB='-L/opt/intel/Compiler/11.1/064/mkl/lib/em64t/ -lguide -lpthread -lmkl_core -lmkl_intel_lp64 -lmkl_sequential'
Linking order matters: if A needs B, A should appear before B, so -lpthread/-lguide should be at the end, mkl_intel_lp64 before mkl_core,
and
mkl_sequential in front of that.
See the MKL manual for more details,
You may also want to consult the MKL Link Line Advsior [1], which in your case recommends an ordering like:
-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm
[1]: http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
-Brad _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (3)
-
Bradley M. Froehle
-
David Cournapeau
-
sunghyun Kim