From: heister Date: Tue, 7 Aug 2012 13:40:23 +0000 (+0000) Subject: link PETSc 3.1+ to libpetsc instead of libpetsccall to fix linking on gcc 4.7 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5df4174431c71de182e0088b4f5273810150c89d;p=dealii-svn.git link PETSc 3.1+ to libpetsc instead of libpetsccall to fix linking on gcc 4.7 git-svn-id: https://svn.dealii.org/trunk@25756 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/common/Make.global_options.in b/deal.II/common/Make.global_options.in index 3a0db5f6b1..80928d3ba8 100644 --- a/deal.II/common/Make.global_options.in +++ b/deal.II/common/Make.global_options.in @@ -157,7 +157,10 @@ endif # you switch from debug to optimized mode). To avoid messing with # -Wl,-rpath in our linker flags, we create one convenience library # for all PETSc libraries in our own lib directory, and have this one -# twiddle with whatever is necessary to link in PETSc. +# twiddle with whatever is necessary to link in PETSc. This is only +# used for PETSc <=3.0. After this version, PETSc creates one library +# we can link to directly. This avoids problems with recent versions +# of gcc. ifeq ($(USE_CONTRIB_PETSC),yes) ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2) lib-contrib-petsc-path.g = $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH) @@ -167,33 +170,27 @@ ifeq ($(USE_CONTRIB_PETSC),yes) lib-contrib-petsc-path.o = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib endif - # First up is a twiddle for Darwin/MacOSX - ifeq ($(findstring darwin,$(TARGET)),) + ifeq ($(enable-shared),yes) + # Starting with PETSc versions 2.3.*: + ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2) + lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix)) + lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix)) + else + # which is the similar as for PETSc 3.0.0: + ifeq ($(DEAL_II_PETSC_VERSION_MAJOR)$(DEAL_II_PETSC_VERSION_MINOR),30) + lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix)) + lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix)) + else + # but after that (petsc-3.1++), we can use the simpler PETSc + # default "--with-single-library=1" like this: + lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix)) + lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix)) + endif + endif # if PETSC_VERSION + else + # and finally this goes for static libraries lib-contrib-petsc.g = $(LIBDIR)/libpetscall.g$(lib-suffix) lib-contrib-petsc.o = $(LIBDIR)/libpetscall$(lib-suffix) - else - ifeq ($(enable-shared),yes) - # Starting with PETSc versions 2.3.*: - ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2) - lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix)) - lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix)) - else - # which is the similar as for PETSc 3.0.0: - ifeq ($(DEAL_II_PETSC_VERSION_MAJOR)$(DEAL_II_PETSC_VERSION_MINOR),30) - lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix)) - lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix)) - else - # but after that (petsc-3.1++), we can use the simpler PETSc - # default "--with-single-library=1" like this: - lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix)) - lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix)) - endif - endif # if PETSC_VERSION - else - # and finally this goes for static libraries - lib-contrib-petsc.g = $(LIBDIR)/libpetscall.g$(lib-suffix) - lib-contrib-petsc.o = $(LIBDIR)/libpetscall$(lib-suffix) - endif endif endif # USE_CONTRIB_PETSC diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 36057055e3..47c0cc5640 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -62,6 +62,13 @@ used to store boundary indicators internally.
    +
  1. +Changed: PETSc linking now prefers to use the libpetsc.so generated +by PETSc starting from version 3.1+. This fixes the problem +of linker errors on recent gcc/ubuntu versions. +
    +(Timo Heister, 2012/08/07) +
  2. Fixed: On some 64-bit systems, we build deal.II with the -m64 flag but forgot to build UMFPACK with this flag as well, leading to