The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

Problems in using lapack of mkl

Open discussion regarding features, bugs, issues, vendors, etc.

Problems in using lapack of mkl

Postby flygaoonly » Tue Nov 11, 2008 11:21 am

I need to call a subroutine from lapack, my source file is H0.f90 and I use the command as follows:

ifort H0.f90 -L /opt/intel/mkl/10.0.1.014/lib/32 -lmkl_lapack -lguide -lmkl

and get this error:

ld: skipping incompatible /opt/intel/mkl/10.0.1.014/lib/32/libmkl_lapack.so when searching for -lmkl_lapack
ld: skipping incompatible /opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel.a when searching for libmkl_intel.a
ld: cannot find libmkl_intel.a

Also, I tried this command:

ifort H0.f90 -L /opt/intel/mkl/10.0.1.014/lib/64 -lmkl_lapack -lguide -lmkl

and got this error:

ld: skipping incompatible /opt/intel/mkl/10.0.1.014/lib/64/libmkl_lapack.so when searching for -lmkl_lapack
ld: skipping incompatible /opt/intel/mkl/10.0.1.014/lib/64/libmkl_intel_lp64.a when searching for libmkl_intel_lp64.a
ld: cannot find libmkl_intel_lp64.a

So, at last I used

ifort H0.f90 -L /opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_lapack -lguide -lmkl

but got:

/opt/intel/mkl/10.0.1.014/lib/em64t/libguide.so: undefined reference to `pthread_atfork'

Because I have three folders 32, 64 and em64t in mkl and I don't know which one to choose, so I tried all of them, but none of them works. Besides, when I want to use the command:

export LD_LIBRARY_PATH=/opt/intel/mkl/10.0.1.014/lib/32

it always says:

export: Command not found.

So what should I do to call the subroutines from lapack of mkl, need help, thanks.
flygaoonly
 
Posts: 8
Joined: Thu Oct 23, 2008 1:23 pm

Re: Problems in using lapack of mkl

Postby Julie » Tue Nov 11, 2008 11:38 am

Code: Select all
So, at last I used

ifort H0.f90 -L /opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_lapack -lguide -lmkl

but got:

/opt/intel/mkl/10.0.1.014/lib/em64t/libguide.so: undefined reference to `pthread_atfork'


this looks fine, you just need to add the pthread library with -lphread at linking.
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Re: Problems in using lapack of mkl

Postby flygaoonly » Tue Nov 11, 2008 11:50 am

So this time I use

ifort H0.f90 -L /opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_lapack -lguide -lmkl -lphread

and got

ld: cannot find -lphread

still doesn't work.
flygaoonly
 
Posts: 8
Joined: Thu Oct 23, 2008 1:23 pm

Re: Problems in using lapack of mkl

Postby Julie » Tue Nov 11, 2008 11:52 am

Sorry I forgot the t: it should be -lpthread
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Re: Problems in using lapack of mkl

Postby flygaoonly » Tue Nov 11, 2008 12:09 pm

That works, thank you. But I still have a problem, after compiling, I get 'a.out', if I directly type './a.out', it says
'./a.out: error while loading shared libraries: libmkl_lapack.so: cannot open shared object file: No such file or directory'

So first I use this command:

export LD_LIBRARY_PATH=/opt/inel/mkl/10.0.1.014/lib/em64t

then I got:
export: Command not found.

So what can I do?
flygaoonly
 
Posts: 8
Joined: Thu Oct 23, 2008 1:23 pm

Re: Problems in using lapack of mkl

Postby Julie » Tue Nov 11, 2008 12:13 pm

Use setenv instead of export.
You may want to read further documentation on the Linux system on linking and setting variables depending on the type of shell.
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Re: Problems in using lapack of mkl

Postby flygaoonly » Tue Nov 11, 2008 12:27 pm

And when I use

setenv LD_LIBRARY_PATH /opt/inel/mkl/10.0.1.014/lib/em64t:/opt/intel/fce/10.1.012/lib

and then type

./a.out

it still says

./a.out: error while loading shared libraries: libmkl_lapack.so: cannot open shared object file: No such file or directory

But I can see 'libmkl_lapack.so' is in '/opt/inel/mkl/10.0.1.014/lib/em64t' Really thank you for your help, but I'm not familiar with Linux at all.
flygaoonly
 
Posts: 8
Joined: Thu Oct 23, 2008 1:23 pm

Re: Problems in using lapack of mkl

Postby Julie » Tue Nov 11, 2008 12:38 pm

setenv LD_LIBRARY_PATH /opt/inel/mkl/10.0.1.014/lib/em64t:/opt/intel/fce/10.1.012/lib


You forgot the t of intel
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Re: Problems in using lapack of mkl

Postby flygaoonly » Tue Nov 11, 2008 12:41 pm

Oh, I'm sorry, this time everything goes right. Really thank you for your patience and kindly help.
flygaoonly
 
Posts: 8
Joined: Thu Oct 23, 2008 1:23 pm

Re: Problems in using lapack of mkl

Postby flygaoonly » Tue Nov 11, 2008 1:39 pm

And when I want to use a makefile to compile this program, the makefile is as follows:

#Intel Fortran
FC = ifort
FFLAGS = -O2 -L /opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_lapack -lguide -lmkl -lpthread
LDFLAGS = $(FFLAGS)

SC = export
SFLAGS = LD_LIBRARY_PATH=/opt/intel/mkl/10.0.1.014/lib/em64t:/opt/intel/fce/10.1.012/lib


source = H0.f90


all: file.out

#suffixes
.SUFFIXES: .f90 .o
objects = $(source:.f90=.o)

.f90.o:
$(FC) $(FFLAGS) -c $<

#Explicit rules

file.out: $(objects)
$(FC) $(LDFLAGS) -o $@ $(objects)
#export
export:
$(SC) $(SFLAGS)


#clean
clean:
rm *.o *.mod *.f90~ *.ex *.e


the red parts are what I added. After type "make" and "make export", then execute "file.out", it says:

file.out: error while loading shared libraries: libmkl_lapack.so: cannot open shared object file: No such file or directory

if I change the red part to:

SC = setenv
SFLAGS = LD_LIBRARY_PATH /opt/intel/mkl/10.0.1.014/lib/em64t:/opt/intel/fce/10.1.012/lib

then appears:

setenv LD_LIBRARY_PATH /opt/intel/mkl/10.0.1.014/lib/em64t:/opt/intel/fce/10.1.012/lib
make: setenv: Command not found
make: *** [export] Error 127

file.out: error while loading shared libraries: libmkl_lapack.so: cannot open shared object file: No such file or directory


So I want to know how to correct the makefile, thanks.
flygaoonly
 
Posts: 8
Joined: Thu Oct 23, 2008 1:23 pm

Re: Problems in using lapack of mkl

Postby thomas » Wed Dec 24, 2008 1:17 pm

I'm having a similar sort of Issue.
but It's a Bit different to this.
but I think If I get the answer to this one,Il'l get the answer to my Problem as well.
thomas
 
Posts: 1
Joined: Mon Dec 22, 2008 8:33 am


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 7 guests