PETSc configure with Intel-compiler static linking
Satish Balay
balay at mcs.anl.gov
Thu Jul 9 21:37:02 CDT 2009
For one - shell is not expanding ${MKL_DIR} for you. Perhaps you used
the wrong quotes?
Anyway - the current configure interface to --with-blas-lapack-lib
prevents listing files as I mentioned before. So you can try the
following workarround:
- create a different mkl location for just the .a files - and use it
with configure - as follows:
[choose any convinent location]
mkdir /foo/mkl-static
cp /opt/intel/mkl/10.0.010/lib/em64t/*.a /foo/mkl-static/
cd $PETSC_DIR
./configure .... --with-blas-lapack-lib=[/foo/mkl-static/libmkl_lapack.a,mkl_intel_lp64.a,libmkl_core.a,libguide.a,libthread.a]
Also we prevent flooding the mailing list with configure.log - so such
issues [requiring communicating configure.log] can be sent to
petsc-maint at mcs.anl.gov
Satish
On Fri, 10 Jul 2009, Takuya Sekikawa wrote:
> Dear Matt and Satish,
>
> Thank you for quick response.
>
> On Thu, 9 Jul 2009 06:08:00 -0500
> Matthew Knepley <knepley at gmail.com> wrote:
>
> > For any configure problem, you MUST send configure.log or we have no idea
> > what happened.
>
> Oh, Sorry.
> I attached latest configure.log.
>
> On Thu, 9 Jul 2009 09:50:21 -0500 (CDT)
> Satish Balay <balay at mcs.anl.gov> wrote:
>
> > On Thu, 9 Jul 2009, Takuya Sekikawa wrote:
> >
> > > Hello petsc users,
> > >
> > > I need to know how to configure PETSc with Intel-compiler (icc/icpc) on
> > > static linking.
> >
> > Why?
>
> Mainly because of license problem.
> .so version needs target user to purchase licsense.
>
> > > shared linking is just fine,
> > > but I need to build PETSc with static-linking. so I tried several description.
> > >
> > > [1]
> > > $ ./config/configure.py --with-cc=icc --with-cxx=icpc --with-fc=0
> > > --with-shared=0 --with-blas-lapack-dir=${MKL_DIR}
> > >
> > > environment variable MKL_DIR is set to intel MKL library directory.
> > > this one is fine, (also compiling and running is ok)
> > > but is spite of "--with-shared=0" flag, executable still link with .so
> > > (libmkl_lapack.so, etc)
> >
> > --with-shared=0 refers to petsc libraries. It doesn't mean static
> > linking or shared linking.
>
> Ok. I understood.
>
> > Generally static linking is done by the linker option [with icc/ifort
> > its: -Bstatic]. But since all system libraries might not be available
> > as static libraries - this might not work.
> >
> > Esp with MKL - since the librariry names are different between .so and
> > .a files. [so PETSc configure doesn't explicitly look for tha .a
> > names.
> >
> > >
> > > so I tried another one:
> > >
> > > [2]
> > > $ ./config/configure.py --with-cc=icc --with-cxx=icpc --with-fc=0
> > > --with-shared=0 --with-blas-lapack-lib=${MKL_DIR}/libmkl_lapack.a
> >
> > Generally - you need -lmkl_lapack -lmkl -lpthread -lguide
> >
> > However -lmkl is only available as .so. So you'll have to cat
> > libmkl.so to see what the actual libraries it links with: For me I
> > have:
> >
> > [petsc:10.0.2.018/lib/em64t] petsc> cat libmkl.so
> > GROUP (libmkl_intel_lp64.so libmkl_intel_thread.so libmkl_core.so)
> > [petsc:10.0.2.018/lib/em64t] petsc>
> >
> >
> > So you might be able to use:
> >
> > --with-blas-lapack-lib="${MKL_DIR}/libmkl_lapack.a ${MKL_DIR}/libmkl_intel_lp64.a ${MKL_DIR}/libmkl_core.a -lpthread ${MKL_DIR}/libguide.a"
>
> Thank you.
> I tried as you wrote, but unsuccessful.
> configure.py said:
>
> *********************************************************************************
> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):
> ---------------------------------------------------------------------------------------
> You set a value for --with-blas-lapack-lib=<lib>, but ['${MKL_DIR}/libmkl_lapack.a ${MKL_DIR}/libmkl_intel_lp64.a ${MKL_DIR}/libmkl_core.a -lpthread ${MKL_DIR}/libguide.a'] cannot be used
> *********************************************************************************
>
> What is the real cause of "cannot be used" ?
> I cannot make out why "cannot be used" (.a is collapsed? or simply need
> to specify more .a?)
>
> Takuya
>
More information about the petsc-users
mailing list