]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
link PETSc 3.1+ to libpetsc instead of libpetsccall to fix linking on gcc 4.7
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 7 Aug 2012 13:40:23 +0000 (13:40 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 7 Aug 2012 13:40:23 +0000 (13:40 +0000)
git-svn-id: https://svn.dealii.org/trunk@25756 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/common/Make.global_options.in
deal.II/doc/news/changes.h

index 3a0db5f6b1af5b9440d011d42d9f4e083f6f9d40..80928d3ba8ae29ed3ca861f314682b6181fa561b 100644 (file)
@@ -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
 
index 36057055e3cb3635adf3608e562a0e3a1b06c33d..47c0cc564084fcc81925b05377b0c18b3b847e28 100644 (file)
@@ -62,6 +62,13 @@ used to store boundary indicators internally.
 
 
 <ol>
+<li>
+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.
+<br>
+(Timo Heister, 2012/08/07)
+
 <li>
 Fixed: On some 64-bit systems, we build deal.II with the <code>-m64</code>
 flag but forgot to build UMFPACK with this flag as well, leading to

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.