Ticket #11227: cliquer-1.2.p7-p8.diff

File cliquer-1.2.p7-p8.diff, 4.1 KB (added by jdemeyer, 11 years ago)

Diff for the cliquer spkg, for reviewing only

  • SPKG.txt

    diff -r 32f77d3e2d12 SPKG.txt
    a b  
    2424
    2525== Changelog ==
    2626
     27=== cliquer-1.2.p8 (Jeroen Demeyer, 25 April 2011) ===
     28 * #11227: When compiling with gcc 4.6.0, add compiler flag -fno-ivopts
     29   to work around a gcc bug.
     30 * Use `patch` for patching the Makefile and put patches/Makefile.patch
     31   under hg control.
     32 * Some minor cleanup of spkg-install and Makefile.
     33
    2734=== cliquer-1.2.p7 David Kirkby, Leif Leonhardy  (14 September 2010) ===
    2835 * #9871 Change flags passed to the linker on Solaris to avoid problems with the
    2936   link-editor believing the shared library contains text relocations. This
  • new file patches/Makefile.patch

    diff -r 32f77d3e2d12 patches/Makefile.patch
    - +  
     1diff -ur src/Makefile src.patched/Makefile
     2--- src/Makefile        2010-02-16 05:26:57.000000000 +0100
     3+++ src.patched/Makefile        2011-04-26 09:46:41.000000000 +0200
     4@@ -1,14 +1,17 @@
     5 
     6 ##### Configurable options:
     7 
     8+# Don't need to set any of these compiler variables. They have already been
     9+# set when running SAGE_ROOT/local/bin/sage-env as part of installing a
     10+# package.
     11 ## Compiler:
     12-CC=gcc
     13+#CC=gcc
     14 #CC=cc
     15 
     16 ## Compiler flags:
     17 
     18 # GCC:  (also -march=pentium etc, for machine-dependent optimizing)
     19-CFLAGS=-Wall -O3 -fomit-frame-pointer -funroll-loops
     20+#CFLAGS=-Wall -O3 -fomit-frame-pointer -funroll-loops
     21 
     22 # GCC w/ debugging:
     23 #CFLAGS=-Wall -g -DINLINE=
     24@@ -29,14 +32,14 @@
     25 ##### End of configurable options
     26 
     27 
     28-all: cl
     29+all: libcliquer.so
     30 
     31 
     32 testcases: testcases.o cliquer.o graph.o reorder.o
     33        $(CC) $(LDFLAGS) -o $@ testcases.o cliquer.o graph.o reorder.o
     34 
     35-cl: cl.o cliquer.o graph.o reorder.o
     36-       $(CC) $(LDFLAGS) -o $@ cl.o cliquer.o graph.o reorder.o
     37+libcliquer.so: cl.o cliquer.o graph.o reorder.o
     38+       $(CC) $(LDFLAGS) $(SAGESOFLAGS) -o $@ cl.o cliquer.o graph.o reorder.o
     39 
     40 
     41 cl.o testcases.o cliquer.o graph.o reorder.o: cliquer.h set.h graph.h misc.h reorder.h Makefile cliquerconf.h
  • spkg-install

    diff -r 32f77d3e2d12 spkg-install
    a b  
    1212
    1313# Add a sensible default optimisation flag. Change if necessary.
    1414OPTIMIZATION_FLAGS="-O2"
     15# Work around a bug in gcc 4.6.0, probably http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48702
     16if [ "x`$SAGE_LOCAL/bin/testcc.sh $CC`" = xGCC ] && [ "x`$CC -dumpversion 2>/dev/null`" = x4.6.0 ] ; then
     17    echo "Warning: Working around bug in gcc 4.6.0"
     18    OPTIMIZATION_FLAGS="$OPTIMIZATION_FLAGS -fno-ivopts"
     19fi
    1520
    1621# Most packages do not need all these set. But it is better to do them all
    1722# each time, rather than omit a flag by mistake.
     
    148153SAGESOFLAGS=" "
    149154if [ "$UNAME" = "Linux" ] || [ "$UNAME" = "FreeBSD" ]; then
    150155    SAGESOFLAGS="-shared -Wl,-soname,libcliquer.so"
    151     export SAGESOFLAGS
    152156elif [ "$UNAME" = "Darwin" ]; then
    153157    MACOSX_DEPLOYMENT_TARGET="10.3"
    154158    export MACOSX_DEPLOYMENT_TARGET
    155159    SAGESOFLAGS="-dynamiclib -single_module -flat_namespace -undefined dynamic_lookup"
    156     export SAGESOFLAGS
    157160elif [ "$UNAME" = "SunOS" ]; then
    158161    SAGESOFLAGS="-shared -Wl,-h,libcliquer.so -Wl,-ztext"
    159     export SAGESOFLAGS
    160162elif [ "$UNAME" = "CYGWIN" ]; then
    161163    SAGESOFLAGS="-shared -Wl,-soname,libcliquer.so"
    162     export SAGESOFLAGS
    163164else
    164165    echo "Cannot determine your platform or it is not supported"
    165166    echo "Since SAGE_PORT is set, setting SAGESOFLAGS to Linux defaults."
    166167    SAGESOFLAGS="-shared -Wl,-soname,libcliquer.so"
    167     export SAGESOFLAGS
    168168fi
     169export SAGESOFLAGS
    169170
    170 # Copy over custom Makefile for Sage. This custom Makefile contains Sage
     171cd src
     172
     173# Patch the Makefile for Sage. This custom Makefile contains Sage
    171174# specific compilation and linking flags. More importantly, we're building
    172175# cliquer as a dynamic shared library, instead of a stand alone program.
    173 cp -f patch/Makefile src/
    174 
    175 cd src
     176patch -p1 <../patches/Makefile.patch
    176177
    177178#Do not exit script if there is an error, but instead print an
    178179# informative error message.