[petsc-users] MKL library - how to force static linking

Satish Balay balay at mcs.anl.gov
Wed Mar 9 16:36:34 CST 2011


On Wed, 9 Mar 2011, Robert Ellis wrote:

> Hi Satish,
> 
> I've looked at the Intel docs and find that to have ifort use static MKL libraries I need to add /Qopenmp-link:static to the ifort command. Given this information, is the correct form for the config script (options preceded by - and space separated)?
> 
> --FOPTFLAGS='-Qopenmp-link:static -O3'

Sure this is fine. You might also want to add in similar COPTFLAGS.

> and the libraries I need are: mkl_intel_lp64.lib, mkl_intel_thread.lib, mkl_core.lib, libiomp5mt.lib
> 
> Is the correct form full-pathname-comma-separated?
> 
> --with-blas-lapack-lib='/cygdrive/
> c/mkl/lib/intel64/mkl_intel_lp64.lib,/cygdrive/c/mkl/lib/intel64/mkl_intel_thread.lib,/cygdrive/c/mkl/lib/intel64/mkl_core.lib,/cygdrive/c/Program\ Files\ \(x86\)/Intel/ComposerXE-2011/compiler/lib/intel64/libiomp5mt.lib'
> 
> I've tried various things but keep getting the error
> 
> Invalid library: /cygdrive/c/mkl/lib/intel64/mkl_intel_lp64.lib,/cygdrive/c/mkl/lib/intel64/mkl_intel_thread.lib,/cygdrive/c/mkl/lib/intel64/mkl_core.lib,/cygdrive/c/Program\ Files\ \(x86\)/Intel/ComposerXE-2011/compiler/lib/intel64/libiomp5mt.lib for key with-blas-lapack-lib

For one the above should be a python list. And then -
configure has trouble with 'spaces' and 'braces' in these paths. Suggest doing:

- create a dir for the required libs - say
mkdir $(HOME)/MKL

copy the required files over here.

and now use:

--with-blas-lapack-lib=[$(HOME)/MKL/mkl_intel_lp64.lib,$(HOME)/MKL/mkl_intel_thread.lib,...]

Also the following might work - but I'm not sure..

--with-blas-lapack-lib="-L$(HOME)/MKL mkl_intel_lp64.lib mkl_intel_thread.lib ..."

If you have issues - send configure.log to petsc-maint

Satish

> 
> 
> The following link is helpful for those of us trying to link MKL statically http://software.intel.com/en-us/forums/showthread.php?t=64254
> 
> Cheers,
> Rob
> 
> 
> 
> -----Original Message-----
> From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Satish Balay
> Sent: Wednesday, March 09, 2011 10:31 AM
> To: PETSc users list
> Subject: Re: [petsc-users] MKL library - how to force static linking
> 
> If you know the correct MLK library list for static linking- you can
> try specifying with --with-blas-lapack-lib option
> 
> Satish
> 
> 
> On Wed, 9 Mar 2011, Robert Ellis wrote:
> 
> > Hi PETSc Experts,
> > 
> > Environment: Win, Cygwin, ifort, MKL to produce Win exes.
> > 
> > I'm using the MKL blas-lapack with the configure parameter  --with-blas-lapack-dir=/cygdrive/c/mkl/lib/intel64. The resultant executable requires MKL dlls to run, specifically fmpich2.dll, libiomp5md.dll, mkl_core.dll, mkl_intel_thread.dll, mpich2mpi.dll. Can I force a static PETSc  build using the MKL libraries? (BTW, using --download-f-blas-lapack produces a statically linked exe.)
> > 
> > Thanks for any help,
> > Cheers,
> > Rob
> > 
> 
> 



More information about the petsc-users mailing list