Ticket #10508: thread.patch

File thread.patch, 4.8 KB (added by jpflori, 8 years ago)

Use leif's fix.

  • .hgignore

    # HG changeset patch
    # User Jean-Pierre Flori <jean-pierre.flor@ssi.gouv.fr>
    # Date 1368606422 -7200
    # Node ID 22f79fdcf0ce240ae065adfedef207137775f6f2
    # Parent  4f5bace1140f1d78e77567ef2345e577f64ddd69
    #10508: fix build of shared library
    
    diff --git a/.hgignore b/.hgignore
    a b  
    11src
    22lapack.*tar
    33patches/ATLAS-lib/Makefile.in
    4 patches/ATLAS-lib/configure
    54patches/ATLAS-lib/aclocal.m4
     5patches/ATLAS-lib/configure$
    66patches/ATLAS-lib/config.guess
    77patches/ATLAS-lib/config.sub
    88patches/ATLAS-lib/install-sh
  • patches/ATLAS-lib/Makefile.am

    diff --git a/patches/ATLAS-lib/Makefile.am b/patches/ATLAS-lib/Makefile.am
    a b  
    1111
    1212all: all_parallel
    1313
    14 all_serial: $(ATLAS_SERIAL_LIBS) 
     14all_serial: $(ATLAS_SERIAL_LIBS)
    1515
    1616all_parallel: all_serial $(ATLAS_PARALLEL_LIBS)
    1717
     
    3636        @LIBTOOL@ --finish @libdir@
    3737
    3838
     39# In presence of multiple definitions of thread related functions, use the ones from *_mut.o
     40# Works with all nm output formats (BSD/POSIX/System V)
    3941libatlas.la: libatlas.a
    40         -rm -r -f libatlas-obj
    41         mkdir libatlas-obj
     42        -$(RM) -r -f libatlas-obj
     43        $(MKDIR) libatlas-obj
    4244        cd libatlas-obj && $(AR) x ../$<
     45        if [ `$(NM) -g $< | $(EGREP) -w 'ATL_(Set|Reset|Free|Dec)AtomicCount' | $(GREP) -w T | wc -l` -gt 4 ]; then \
     46          $(RM) `ls -1 libatlas-obj/ATL_{Set,Reset,Free,Dec}AtomicCount_*.o | $(GREP) -v '_mut.o$$'`; \
     47        fi
    4348        @LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
    4449            -o $@ libatlas-obj/*.o \
    4550            @PTHREAD_LIB@ -lm \
     
    4752
    4853
    4954libcblas.la: libcblas.a libatlas.la
    50         -rm -r -f libcblas-obj
    51         mkdir libcblas-obj
     55        -$(RM) -r -f libcblas-obj
     56        $(MKDIR) libcblas-obj
    5257        cd libcblas-obj && $(AR) x ../$<
    5358        @LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
    5459            -o $@ libcblas-obj/*.o \
     
    5762
    5863
    5964libptcblas.la: libptcblas.a libatlas.la
    60         -rm -r -f libptcblas-obj
    61         mkdir libptcblas-obj
     65        -$(RM) -r -f libptcblas-obj
     66        $(MKDIR) libptcblas-obj
    6267        cd libptcblas-obj && $(AR) x ../$<
    6368        @LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
    6469            -o $@ libptcblas-obj/*.o \
     
    6772
    6873
    6974libf77blas.la: libf77blas.a libatlas.la
    70         -rm -r -f libf77blas-obj
    71         mkdir libf77blas-obj
     75        -$(RM) -r -f libf77blas-obj
     76        $(MKDIR) libf77blas-obj
    7277        cd libf77blas-obj && $(AR) x ../$<
    7378        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
    7479            -o $@ libf77blas-obj/*.o \
     
    7681            -rpath @libdir@ -version-info $(SO_VERSION)
    7782
    7883libptf77blas.la: libptf77blas.a libatlas.la
    79         -rm -r -f libptf77blas-obj
    80         mkdir libptf77blas-obj
     84        -$(RM) -r -f libptf77blas-obj
     85        $(MKDIR) libptf77blas-obj
    8186        cd libptf77blas-obj && $(AR) x ../$<
    8287        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
    8388            -o $@ libptf77blas-obj/*.o \
     
    8590            -rpath @libdir@ -version-info $(SO_VERSION)
    8691
    8792libf77refblas.la: libf77refblas.a
    88         -rm -r -f libf77refblas-obj
    89         mkdir libf77refblas-obj
     93        -$(RM) -r -f libf77refblas-obj
     94        $(MKDIR) libf77refblas-obj
    9095        cd libf77refblas-obj && $(AR) x ../$<
    9196        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
    9297            -o $@ libf77refblas-obj/*.o \
    9398            -latlas \
    9499            -rpath @libdir@ -version-info $(SO_VERSION)
    95100
    96 liblapack.la: liblapack.a libatlas.la libcblas.la libf77blas.la 
    97         -rm -r -f liblapack-obj
    98         mkdir liblapack-obj
     101liblapack.la: liblapack.a libatlas.la libcblas.la libf77blas.la
     102        -$(RM) -r -f liblapack-obj
     103        $(MKDIR) liblapack-obj
    99104        cd liblapack-obj && $(AR) x ../$<
    100105        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
    101106            -o $@ liblapack-obj/*.o \
    102107            -latlas -lcblas -lf77blas -lm \
    103108            -rpath @libdir@ -version-info $(SO_VERSION)
    104109
    105 libptlapack.la: libptlapack.a libatlas.la libptcblas.la libptf77blas.la 
    106         -rm -r -f libptlapack-obj
    107         mkdir libptlapack-obj
     110libptlapack.la: libptlapack.a libatlas.la libptcblas.la libptf77blas.la
     111        -$(RM) -r -f libptlapack-obj
     112        $(MKDIR) libptlapack-obj
    108113        cd libptlapack-obj && $(AR) x ../$<
    109114        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
    110115            -o $@ libptlapack-obj/*.o \
     
    113118
    114119
    115120.PHONY: all all_serial all_parallel build install install_serial install_parallel clean
    116 
    117 
  • new file patches/ATLAS-lib/configure.ac

    diff --git a/patches/ATLAS-lib/configure.ac b/patches/ATLAS-lib/configure.ac
    new file mode 100644
    - +  
     1AC_INIT([ATLAS],[3.10.1])
     2AM_INIT_AUTOMAKE(foreign)
     3
     4LT_INIT
     5
     6AC_PROG_CC
     7AC_PROG_F77
     8
     9AC_CONFIG_FILES([Makefile])
     10AC_CONFIG_MACRO_DIR([m4])
     11
     12AC_CHECK_LIB(pthread, pthread_create, [PTHREAD_LIB="-lpthread"])
     13AC_SUBST(PTHREAD_LIB)
     14
     15AC_ARG_ENABLE([static],
     16    [AS_HELP_STRING([--enable-static],
     17                    [also install static libtool library (default: no)])])
     18AS_IF([test "x$enable_static" = "xyes"],
     19    [libtool_type=""],
     20    [libtool_type=-shared])
     21AC_SUBST(LIBTOOL_TYPE, [$libtool_type])
     22
     23AC_OUTPUT