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.
$(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