From 2a43ababb2f3c7678d245ba3239a71925a6cb049 Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 11 Feb 2013 17:29:06 +0000 Subject: [PATCH] On cygwin, do not build the library in a local directory first but right in place. git-svn-id: https://svn.dealii.org/trunk@28311 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 9 +++++++++ deal.II/source/Makefile | 34 +++++++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index fcc86e355e..50a23b7056 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -153,6 +153,15 @@ never working correctly and it is not used.
    +
  1. Fixed: Starting in release 7.1, we first built the deal.II shared libraries +in the local /tmp or similar directory rather than the final location +because linking becomes very slow over remotely mounted file systems. Unfortunately, +this schemes turns out not to work under Cygwin on Windows systems: executables +cannot link with libraries that have been moved/renamed after linking. If we are +running on Cygwin, we therefore revert to the old scheme. +
    +(Wolfgang Bangerth, 2013/02/11) +
  2. New: finite element FE_Q_DG0 that implements polynomials of order k with an additional discontinuous constant function.
    diff --git a/deal.II/source/Makefile b/deal.II/source/Makefile index d65507f956..81b7840cb8 100644 --- a/deal.II/source/Makefile +++ b/deal.II/source/Makefile @@ -1,5 +1,5 @@ # $Id$ -# Copyright by the deal.II authors, 1998, 1999, 2000, 2001, 2002, 2010, 2011, 2012 +# Copyright by the deal.II authors, 1998, 1999, 2000, 2001, 2002, 2010, 2011, 2012, 2013 ifneq ($(CLEAN),yes) @@ -170,20 +170,40 @@ $(LIBDIR)/libdeal_II$(static-lib-suffix): $(o-files) $(extra-o-files) # 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 +# +# That said, it turns out that on Cygwin, you can't simply rename a +# shared library after it has been created. Consequently, we can't +# use this trick on Cygwin. This is probably not half as bad since +# it's not commonly the case that Windows file system are remotely +# mounted as it likely is on other systems. $(LIBDIR)/libdeal_II.g$(shared-lib-suffix): $(go-files) $(extra-g.o-files) @echo "=====deal.II==========debug======$(MT)== Linking library: $(@F)" @rm -f $@ $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II.g) - @WORKFILE=`mktemp $${TMPDIR:-/tmp}/tmpg.XXXXXXXXXX` && \ - $(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) + @case $(TARGET) in \ + *cygwin*) \ + $(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) \ + ;; \ + *) \ + WORKFILE=`mktemp $${TMPDIR:-/tmp}/tmpg.XXXXXXXXXX` && \ + $(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) \ + ;; \ + esac @ln -f -s $(call DEAL_II_SHLIB_NAME,deal_II.g) $@ $(LIBDIR)/libdeal_II$(shared-lib-suffix): $(o-files) $(extra-o-files) @echo "=====deal.II==========optimized==$(MT)== Linking library: $(@F)" @rm -f $@ $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II) - @WORKFILE=`mktemp $${TMPDIR:-/tmp}/tmpo.XXXXXXXXXX` && \ - $(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) + @case $(TARGET) in \ + *cygwin*) \ + $(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) \ + ;; \ + *) \ + WORKFILE=`mktemp $${TMPDIR:-/tmp}/tmpo.XXXXXXXXXX` && \ + $(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) \ + ;; \ + esac @ln -f -s $(call DEAL_II_SHLIB_NAME,deal_II) $@ -- 2.39.5