From: Wolfgang Bangerth Date: Fri, 28 Jan 2011 18:50:38 +0000 (+0000) Subject: Link the library first on the local file system, and then move the result into its... X-Git-Tag: v8.0.0~4425 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37c6cb37c1a83c0d2ddba2f20537858d4e9a3bbf;p=dealii.git Link the library first on the local file system, and then move the result into its final destination. git-svn-id: https://svn.dealii.org/trunk@23271 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index f787685f2f..2a6d72c5c8 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -29,6 +29,13 @@ inconvenience this causes.

General

    +
  1. 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. +
    +(Wolfgang Bangerth, 2011/01/28) +
  2. Changed: Most classes in deal.II have a member function memory_consumption that used to return an unsigned int. However, on most 64-bit systems, unsigned int is still only 32-bit diff --git a/deal.II/source/Makefile b/deal.II/source/Makefile index 3e3c3512e1..8fa17bc085 100644 --- a/deal.II/source/Makefile +++ b/deal.II/source/Makefile @@ -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) $@