[petsc-dev] [buildsystem] support for --start-group/--end-group

Chen Shen hashhsah at gmail.com
Mon Apr 11 10:01:57 CDT 2011


Yes. the LIBS way will certainly work. Thanks!
Our previous solution to this is to combine all mkl .a libraries I want to
use into a single mkl.a library. Looks stupid but works fine.

I'm posting the question in the devep list, because I wish to looking beyond
a quick fix.
I am setting up an automatic building system in the company, and with it, we
want to build many variants of Petsc and our application program for
benchmarking/testing/release. That's why I become interested in the
internals Petsc build system, and start thinking how it can work better.

I'll read this part of the code a bit more, and dig deeper in the past
discussions in this list...

regards,
shenchen

On Mon, Apr 11, 2011 at 10:29 PM, Satish Balay <balay at mcs.anl.gov> wrote:

> Currently things specified with LIBS option remain untouched by
> configure..
>
> so you could try
>
> LIBS="$(MKLROOT)/lib/intel64/libmkl_scalapack_lp64.a  -Wl,--start-group \
> $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a \
> $(MKLROOT)/lib/intel64/libmkl_sequential.a \
> $(MKLROOT)/lib/intel64/libmkl_core.a \
> $(MKLROOT)/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group \
> -lpthread " --with-scalapack=1
>
> Satish
>
> On Mon, 11 Apr 2011, Chen Shen wrote:
>
> > Hi all,
> >
> > Currently, there is an option to specify the blas/lapack library
> > files --with-scalapack-lib=[<list of .a files>]. This is indeed
> necessary,
> > because MKL provides a large choice of libraries to link against.
> >
> > However, MKL static libraries have object inter-dependencies, and
> requires
> > --start-group/--end-group linker options. All libraries in the group are
> > searched repeatedly until all inter-dependencies resolved.
> > For example, the following options is suggested for a configuration (
> > http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/):
> >
> > $(MKLROOT)/lib/intel64/libmkl_scalapack_lp64.a  -Wl,--start-group
> > $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a
> > $(MKLROOT)/lib/intel64/libmkl_sequential.a
> > $(MKLROOT)/lib/intel64/libmkl_core.a
> > $(MKLROOT)/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group
> > -lpthread
> >
> > I'd like to propose an extension to the --with-scalapack-lib syntax to
> > support start/end group. Consider the following example:
> > --with-blas-lapack-lib=[ /xxx/scalapack_lp64.a,
> [/xxx/libmkl_intel_lp64.a,
> > /xxx/libmkl_sequential.a, libmkl_core.a,
> /xxx/libmkl_blacs_intelmpi_lp64.a]
> > ]
> >
> > The embedded list indicates a set of libraries to be grouped up. Would
> this
> > be possible?
> >
> > This isn't a problem if we link to dynamic libraries, because -l for
> dynamic
> > libraries doesn't have to be ordered as in the case of static libraries.
> > I hate the wicked order rule for .a libraries, but have to live with
> it...
> >
> > Further, I guess -Bstatic options are dropped somewhere (I haven't
> checked
> > it in detail). The final PACKAGES_LIBS macro never contains -Bstatic, so
> end
> > application will always link to the static libraries.
> >
> >
> > Regards,
> > Shen Chen
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110411/1344b755/attachment.html>


More information about the petsc-dev mailing list