]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Link the library first on the local file system, and then move the result into its...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 28 Jan 2011 18:50:38 +0000 (18:50 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 28 Jan 2011 18:50:38 +0000 (18:50 +0000)
git-svn-id: https://svn.dealii.org/trunk@23271 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/source/Makefile

index f787685f2fd3cfd8a5b23600d4434e9143d133ac..2a6d72c5c8578f0028cf0d18310e1f7c947fa4b1 100644 (file)
@@ -29,6 +29,13 @@ inconvenience this causes.
 <h3>General</h3>
 
 <ol>
+<li> Improved: Linking the deal.II libraries on file systems that
+are mounted remotely from a file server took painfully long. This
+is now fixed by linking everything on the local file system
+and only subsequently moving the file into its final location.
+<br>
+(Wolfgang Bangerth, 2011/01/28)
+
 <li> Changed: Most classes in deal.II have a member function
 <code>memory_consumption</code> that used to return an unsigned int.
 However, on most 64-bit systems, unsigned int is still only 32-bit
index 3e3c3512e12ed3a710f5eb04974077b8dda86ed5..8fa17bc08587c4715e1f9cafc0209c73fbd20876 100644 (file)
@@ -1,5 +1,5 @@
 # $Id$
-# Copyright W. Bangerth, University of Heidelberg, 1998, 1999, 2000, 2001, 2002, 2010
+# Copyright W. Bangerth, University of Heidelberg, 1998, 1999, 2000, 2001, 2002, 2010, 2011
 
 
 ifneq ($(CLEAN),yes)
@@ -143,7 +143,7 @@ else
 endif
 
 
-# rules how to make the libraries themselves
+# rules for static libraries
 $(LIBDIR)/libdeal_II.g$(static-lib-suffix): $(go-files)
        @echo "=====deal.II==========debug======$(MT)== Linking library:   $(@F)"
        @$(AR) ru $@ $(go-files) $(extra-g.o-files)
@@ -154,14 +154,26 @@ $(LIBDIR)/libdeal_II$(static-lib-suffix): $(o-files)
        @$(RANLIB) $@
 
 
+# Rules for shared libraries. these are much more difficult to link
+# because the linker has to update relocations etc. This requires
+# seeking back and forth in memory mapped files and is excruciatingly
+# slow on remotely mounted file systems. Consequently, we link in a
+# local file in the $TMPDIR directory, and only after the fact move
+# them to their final location
 $(LIBDIR)/libdeal_II.g$(shared-lib-suffix): $(go-files)
        @echo "=====deal.II==========debug======$(MT)== Linking library:   $(@F)"
-       @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II.g) $(call DEAL_II_ADD_SONAME,deal_II.g) $(go-files) $(extra-g.o-files) $(deplibs.g)
+       @rm -f $@
+       @WORKFILE=`mktemp` && \
+               $(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $$WORKFILE $(call DEAL_II_ADD_SONAME,deal_II.g) $(go-files) $(extra-g.o-files) $(deplibs.g) && \
+               mv $$WORKFILE $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II.g)
        @ln -f -s $(call DEAL_II_SHLIB_NAME,deal_II.g) $@
 
 $(LIBDIR)/libdeal_II$(shared-lib-suffix): $(o-files)
        @echo "=====deal.II==========optimized==$(MT)== Linking library:   $(@F)"
-       @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II) $(call DEAL_II_ADD_SONAME,deal_II) $(o-files) $(extra-o-files) $(deplibs.o)
+       @rm -f $@
+       @WORKFILE=`mktemp` && \
+               $(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $$WORKFILE $(call DEAL_II_ADD_SONAME,deal_II) $(o-files) $(extra-o-files) $(deplibs.o) && \
+               mv $$WORKFILE $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II)
        @ln -f -s $(call DEAL_II_SHLIB_NAME,deal_II) $@
 
 

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.