When there's a --start-group argument in the DOLFIN_TARGET_LINK_LIBRARIES the creation of the PKG_LINKFLAGS goes wrong in dolfin/CMakeLists.txt
especially the regex used here seems to be flawed:
# Convert libraries to -L<libdir> -l<lib> form
foreach(_lib ${DOLFIN_TARGET_LINK_LIBRARIES})
string(REGEX REPLACE "(.?:?/[^ ]*)/lib([^ ]*)\\.(a|so|dylib|dll)" "-L\\1 -l\\2"
_linkflags
"${_lib}"
)
# Only add libraries that matches the form -L<libdir> -l<lib>
if ("${_linkflags}" MATCHES "-L.+ -l.+")
set(PKG_LINKFLAGS "${PKG_LINKFLAGS} ${_linkflags}")
endif()
endforeach()
I printed out DOLFIN_TARGET_LINK_LIBRARIES and PKG_LINKFLAGS just after this piece of code was run and got these results:
Note the "-L " : the space is after the -L instead of before it, making things fail when trying to use these flags when compiling with instant.
DOLFIN_TARGET_LINK_LIBRARIES:
/usr/lib64/libxml2.so;/tmp/software/Armadillo/2.4.4-ictce-4.0.6/lib/libarmadillo.so;optimized;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_filesystem.so;debug;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_filesystem.so;optimized;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_program_options.so;debug;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_program_options.so;optimized;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_system.so;debug;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_system.so;optimized;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_thread.so;debug;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_thread.so;optimized;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_iostreams.so;debug;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_iostreams.so;optimized;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_math_tr1.so;debug;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_math_tr1.so;optimized;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_mpi.so;debug;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_mpi.so;optimized;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_serialization.so;debug;/tmp/software/Boost/1.49.0-ictce-4.0.6/lib/libboost_serialization.so;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/UMFPACK/lib/libumfpack.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/UMFPACK/lib/libamd.a;-Wl,--start-group
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_intel_lp64.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_sequential.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_core.a
-Wl,--end-group;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CHOLMOD/lib/libcholmod.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/UMFPACK/lib/libamd.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CAMD/lib/libcamd.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/COLAMD/lib/libcolamd.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CCOLAMD/lib/libccolamd.a;-Wl,--start-group
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_intel_lp64.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_sequential.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_core.a
-Wl,--end-group;/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib/libparmetis.a;/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib/libmetis.a;-Wl,--start-group
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_intel_lp64.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_sequential.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_core.a
-Wl,--end-group;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CHOLMOD/lib/libcholmod.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/UMFPACK/lib/libamd.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CAMD/lib/libcamd.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/COLAMD/lib/libcolamd.a;/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CCOLAMD/lib/libccolamd.a;-Wl,--start-group
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_intel_lp64.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_sequential.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_core.a
-Wl,--end-group;/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib/libparmetis.a;/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib/libmetis.a;-Wl,--start-group
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_intel_lp64.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_sequential.a
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64/libmkl_core.a
-Wl,--end-group;/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib/libparmetis.a;/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib/libmetis.a;/usr/lib64/libz.so;/apps/gent/gengar/harpertown/software/impi/4.0.2.003/lib64/libmpi.so
PKG_LINKFLAGS: -L/apps/gent/gengar/harpertown/software/impi/4.0.2.003/lib64
-lmpi -L/usr/lib64 -lz -L/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib
-lmetis -L/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib -lparmetis
-Wl,--start-group-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_intel_lp64-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_sequential-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_core -Wl,--end-group -L/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib
-lmetis -L/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib -lparmetis
-Wl,--start-group-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_intel_lp64-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_sequential-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_core -Wl,--end-group
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CCOLAMD/lib
-lccolamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/COLAMD/lib
-lcolamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CAMD/lib -lcamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/UMFPACK/lib
-lamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CHOLMOD/lib
-lcholmod -Wl,--start-group-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_intel_lp64-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_sequential-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_core -Wl,--end-group -L/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib
-lmetis -L/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib -lparmetis
-Wl,--start-group-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_intel_lp64-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_sequential-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_core -Wl,--end-group
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CCOLAMD/lib
-lccolamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/COLAMD/lib
-lcolamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CAMD/lib -lcamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/UMFPACK/lib
-lamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/CHOLMOD/lib
-lcholmod -Wl,--start-group-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_intel_lp64-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_sequential-L
/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-lmkl_core -Wl,--end-group
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/UMFPACK/lib
-lamd
-L/tmp/software/SuiteSparse/3.7.0-ictce-4.0.6-withparmetis/UMFPACK/lib
-lumfpack -L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib
-lboost_serialization -L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib
-lboost_serialization -L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib
-lboost_mpi -L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_mpi
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_math_tr1
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_math_tr1
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_iostreams
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_iostreams
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_thread
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_thread
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_system
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_system
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_program_options
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_program_options
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_filesystem
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib -lboost_filesystem
-L/tmp/software/Armadillo/2.4.4-ictce-4.0.6/lib -larmadillo -L/usr/lib64
-lxml2
-L/apps/gent/gengar/harpertown/software/imkl/10.3.6.233/mkl/lib/intel64
-L/apps/gent/gengar/harpertown/software/Python/2.7.2-ictce-4.0.6/lib
-L/tmp/software/Boost/1.49.0-ictce-4.0.6/lib
-L/tmp/software/UFC/2.0.5-ictce-4.0.6/lib -L/tmp/software/FFC/1.0.0/lib
-L/tmp/software/FIAT/1.0.0/lib -L/tmp/software/Instant/1.0.0/lib
-L/tmp/software/Viper/1.0.0/lib -L/tmp/software/UFL/1.0.0/lib
-L/tmp/software/SCOTCH/5.1.12b_esmumps-ictce-4.0.6/lib
-L/tmp/software/Armadillo/2.4.4-ictce-4.0.6/lib
-L/tmp/software/ParMETIS/4.0.2-ictce-4.0.6/lib
Do you know where the -Wl,--start-group flag comes from. Why is it added to DOLFIN_ TARGET_ LINK_LIBRARIES?