Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge in sage-5.13.beta5
Browse files Browse the repository at this point in the history
  • Loading branch information
ohanar committed Dec 6, 2013
2 parents 0c6fcdf + 33dec52 commit 1e9e230
Show file tree
Hide file tree
Showing 42 changed files with 9,845 additions and 1,427 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Sage version 5.13.beta4, released 2013-11-24
Sage version 5.13.beta5, released 2013-12-05
7 changes: 7 additions & 0 deletions build/pkgs/atlas/SPKG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ The package can be configured via three environment variables:

== ChangeLog ==

=== atlas-3.10.1.p7, lapack-3.4.2 (Jean-Pierre Flori, 25 November 2013) ===
* Trac #14410: Let ATLAS build and install shared libraries on Cygwin.
* Bunch of modifications to the autotools project generating shared libraries
so that it does not invoke libtool on Cygwin.
* Fix a bug in spkg-install.
* Cleanup spkg-check.

=== atlas-3.10.1.p6, lapack-3.4.2 (Volker Braun, 11 October 2013) ===
* Trac #15270: Do not give up if the upstream shared library build
fails
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/atlas/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.1.p6
3.10.1.p7
114 changes: 56 additions & 58 deletions build/pkgs/atlas/patches/ATLAS-lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ SO_VERSION=3:0

# You shouldn't have to customize anything from here on

ATLAS_SERIAL_LIBS=libatlas.la libcblas.la libf77blas.la liblapack.la
ATLAS_SERIAL_LIBS=atlas cblas f77blas lapack

ATLAS_PARALLEL_LIBS=libptcblas.la libptf77blas.la libptlapack.la
ATLAS_PARALLEL_LIBS=ptcblas ptf77blas ptlapack

all: all_parallel

Expand All @@ -16,105 +16,103 @@ all_serial: $(ATLAS_SERIAL_LIBS)
all_parallel: all_serial $(ATLAS_PARALLEL_LIBS)

clean:
$(RM) -r -f .libs *.la *-obj
$(RM) -r -f .libs *.la *.dll *.dll.a *-obj

install: install_parallel

install_serial: $(ATLAS_SERIAL_LIBS)
$(MKDIR_P) @libdir@
@LIBTOOL@ --mode=install $(INSTALL) -c libatlas.la @libdir@/libatlas.la
@LIBTOOL@ --mode=install $(INSTALL) -c libcblas.la @libdir@/libcblas.la
@LIBTOOL@ --mode=install $(INSTALL) -c libf77blas.la @libdir@/libf77blas.la
@LIBTOOL@ --mode=install $(INSTALL) -c liblapack.la @libdir@/liblapack.la
$(MKDIR_P) @bindir@
for module in $(ATLAS_SERIAL_LIBS); do \
@LTINSTALL@; \
done;
@LIBTOOL@ --finish @libdir@
@LIBTOOL@ --finish @bindir@

install_parallel: install_serial $(ATLAS_PARALLEL_LIBS)
$(MKDIR_P) @libdir@
@LIBTOOL@ --mode=install $(INSTALL) -c libptcblas.la @libdir@/libptcblas.la
@LIBTOOL@ --mode=install $(INSTALL) -c libptf77blas.la @libdir@/libptf77blas.la
@LIBTOOL@ --mode=install $(INSTALL) -c libptlapack.la @libdir@/libptlapack.la
$(MKDIR_P) @bindir@
for module in $(ATLAS_PARALLEL_LIBS); do \
@LTINSTALL@; \
done;
@LIBTOOL@ --finish @libdir@

@LIBTOOL@ --finish @bindir@

# In presence of multiple definitions of thread related functions, use the ones from *_mut.o
# Works with all nm output formats (BSD/POSIX/System V)
libatlas.la: libatlas.a
atlas: libatlas.a
-$(RM) -r -f libatlas-obj
$(MKDIR) libatlas-obj
cd libatlas-obj && $(AR) x ../$<
cd libatlas-obj && $(AR) x ../$< && cd ..
if [ `$(NM) -g $< | $(EGREP) -w 'ATL_(Set|Reset|Free|Dec)AtomicCount' | $(GREP) -w T | wc -l` -gt 4 ]; then \
$(RM) `ls -1 libatlas-obj/ATL_{Set,Reset,Free,Dec}AtomicCount_*.o | $(GREP) -v '_mut.o$$'`; \
fi
@LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
-o $@ libatlas-obj/*.o \
@LTCLINK@ \
-o @LTPREFIX@$@@LTSUFFIX@ libatlas-obj/*.o \
@PTHREAD_LIB@ -lm \
-rpath @libdir@ -version-info $(SO_VERSION)

@LTLINKFLAGS@

libcblas.la: libcblas.a libatlas.la
cblas: libcblas.a @LTPREFIX@atlas@LTSUFFIX@
-$(RM) -r -f libcblas-obj
$(MKDIR) libcblas-obj
cd libcblas-obj && $(AR) x ../$<
@LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
-o $@ libcblas-obj/*.o \
cd libcblas-obj && $(AR) x ../$< && cd ..
@LTCLINK@ \
-o @LTPREFIX@$@@LTSUFFIX@ libcblas-obj/*.o \
-latlas \
-rpath @libdir@ -version-info $(SO_VERSION)

@LTLINKFLAGS@

libptcblas.la: libptcblas.a libatlas.la
ptcblas: libptcblas.a @LTPREFIX@atlas@LTSUFFIX@
-$(RM) -r -f libptcblas-obj
$(MKDIR) libptcblas-obj
cd libptcblas-obj && $(AR) x ../$<
@LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
-o $@ libptcblas-obj/*.o \
cd libptcblas-obj && $(AR) x ../$< && cd ..
@LTCLINK@ \
-o @LTPREFIX@$@@LTSUFFIX@ libptcblas-obj/*.o \
@PTHREAD_LIB@ -latlas \
-rpath @libdir@ -version-info $(SO_VERSION)
@LTLINKFLAGS@


libf77blas.la: libf77blas.a libatlas.la
f77blas: libf77blas.a @LTPREFIX@atlas@LTSUFFIX@
-$(RM) -r -f libf77blas-obj
$(MKDIR) libf77blas-obj
cd libf77blas-obj && $(AR) x ../$<
@LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
-o $@ libf77blas-obj/*.o \
cd libf77blas-obj && $(AR) x ../$< && cd ..
@LTF77LINK@ \
-o @LTPREFIX@$@@LTSUFFIX@ libf77blas-obj/*.o \
-latlas \
-rpath @libdir@ -version-info $(SO_VERSION)
@LTLINKFLAGS@

libptf77blas.la: libptf77blas.a libatlas.la
ptf77blas: libptf77blas.a @LTPREFIX@atlas@LTSUFFIX@
-$(RM) -r -f libptf77blas-obj
$(MKDIR) libptf77blas-obj
cd libptf77blas-obj && $(AR) x ../$<
@LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
-o $@ libptf77blas-obj/*.o \
cd libptf77blas-obj && $(AR) x ../$< && cd ..
@LTF77LINK@ \
-o @LTPREFIX@$@@LTSUFFIX@ libptf77blas-obj/*.o \
@PTHREAD_LIB@ -latlas \
-rpath @libdir@ -version-info $(SO_VERSION)
@LTLINKFLAGS@

libf77refblas.la: libf77refblas.a
f77refblas: libf77refblas.a
-$(RM) -r -f libf77refblas-obj
$(MKDIR) libf77refblas-obj
cd libf77refblas-obj && $(AR) x ../$<
@LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
-o $@ libf77refblas-obj/*.o \
cd libf77refblas-obj && $(AR) x ../$< && cd ..
@LTF77LINK@ \
-o @LTPREFIX@$@@LTSUFFIX@ libf77refblas-obj/*.o \
-latlas \
-rpath @libdir@ -version-info $(SO_VERSION)
@LTLINKFLAGS@

liblapack.la: liblapack.a libatlas.la libcblas.la libf77blas.la
lapack: liblapack.a @LTPREFIX@atlas@LTSUFFIX@ @LTPREFIX@cblas@LTSUFFIX@ @LTPREFIX@f77blas@LTSUFFIX@
-$(RM) -r -f liblapack-obj
$(MKDIR) liblapack-obj
cd liblapack-obj && $(AR) x ../$<
@LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
-o $@ liblapack-obj/*.o \
-latlas -lcblas -lf77blas -lm \
-rpath @libdir@ -version-info $(SO_VERSION)
cd liblapack-obj && $(AR) x ../$< && cd ..
@LTF77LINK@ \
-o @LTPREFIX@$@@LTSUFFIX@ liblapack-obj/*.o \
-lcblas -lf77blas -latlas -lm \
@LTLINKFLAGS@

libptlapack.la: libptlapack.a libatlas.la libptcblas.la libptf77blas.la
ptlapack: libptlapack.a @LTPREFIX@atlas@LTSUFFIX@ @LTPREFIX@ptcblas@LTSUFFIX@ @LTPREFIX@ptf77blas@LTSUFFIX@
-$(RM) -r -f libptlapack-obj
$(MKDIR) libptlapack-obj
cd libptlapack-obj && $(AR) x ../$<
@LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
-o $@ libptlapack-obj/*.o \
@PTHREAD_LIB@ -latlas -lptcblas -lptf77blas -lm \
-rpath @libdir@ -version-info $(SO_VERSION)

cd libptlapack-obj && $(AR) x ../$< && cd ..
@LTF77LINK@ \
-o @LTPREFIX@$@@LTSUFFIX@ libptlapack-obj/*.o \
@PTHREAD_LIB@ -lptcblas -lptf77blas -latlas -lm \
@LTLINKFLAGS@

.PHONY: all all_serial all_parallel build install install_serial install_parallel clean
.PHONY: all all_serial all_parallel build install install_serial install_parallel clean $(ATLAS_SERIAL_LIBS) $(ATLAS_PARALLEL_LIBS)
28 changes: 28 additions & 0 deletions build/pkgs/atlas/patches/ATLAS-lib/configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
AC_INIT([ATLAS],[3.10.1])
AM_INIT_AUTOMAKE(foreign)

AC_CANONICAL_HOST

LT_INIT

AC_PROG_CC
Expand All @@ -20,4 +22,30 @@ AS_IF([test "x$enable_static" = "xyes"],
[libtool_type=-shared])
AC_SUBST(LIBTOOL_TYPE, [$libtool_type])

case $host in
*-*-cygwin*)
LTPREFIX=cyg
LTSUFFIX=.dll
LTCLINK="\$(CC) -L. -shared"
LTF77LINK="\$(F77) -L. -shared"
LTLINKFLAGS="-Wl,--out-implib=lib\$@.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import"
LTINSTALL="\$(CP) \$(LTPREFIX)\$\${module}\$(LTSUFFIX) \$(bindir)/\$(LTPREFIX)\$\${module}\$(LTSUFFIX); \$(CP) lib\$\${module}.dll.a \$(libdir)/lib\$\${module}.dll.a"
;;
*)
LTPREFIX=lib
LTSUFFIX=.la
LTCLINK="\$(LIBTOOL) --tag=CC --mode=link \$(CC) \$(LIBTOOL_FLAG)"
LTF77LINK="\$(LIBTOOL) --tag=F77 --mode=link \$(F77) \$(LIBTOOL_FLAG)"
LTLINKFLAGS="-rpath \$(libdir) -version-info \$(SO_VERSION)"
LTINSTALL="\$(LIBTOOL) --mode=install \$(INSTALL) -c \$(LTPREFIX)\$\${module}\$(LTSUFFIX) \$(libdir)/\$(LTPREFIX)\$\${module}\$(LTSUFFIX)"
;;
esac

AC_SUBST(LTPREFIX)
AC_SUBST(LTSUFFIX)
AC_SUBST(LTCLINK)
AC_SUBST(LTF77LINK)
AC_SUBST(LTLINKFLAGS)
AC_SUBST(LTINSTALL)

AC_OUTPUT
51 changes: 22 additions & 29 deletions build/pkgs/atlas/spkg-check
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@
### Sanity check
######################################################################

if [ "$SAGE_LOCAL" = "" ]; then
echo "SAGE_LOCAL undefined ... exiting"
echo "Maybe run sage -sh?"
if [ -z "$SAGE_LOCAL" ]; then
echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
echo >&2 "Maybe run 'sage -sh'?"
exit 1
fi

######################################################################
### Skip building ATLAS on specific systems
######################################################################

if [ `uname` = "CYGWIN" ]; then
if [ "$UNAME" = "Darwin" -a -z "$SAGE_ATLAS_ARCH" ]; then
echo "System-wide accelerate framework is used on Darwin; skipping ATLAS test suite."
exit 0
fi

if [ `uname` = "Darwin" ]; then
exit 0
fi

if [ "x$SAGE_ATLAS_LIB" != "x" ]; then
echo "SAGE_ATLAS_LIB is set to \"$SAGE_ATLAS_LIB\"; skipping the test suite."
if [ ! -z "$SAGE_ATLAS_LIB" ]; then
echo "SAGE_ATLAS_LIB is set to \"$SAGE_ATLAS_LIB\"; skipping ATLAS test suite."
exit 0
fi

Expand All @@ -35,32 +32,28 @@ fi
make_check()
{
# make sure everything builds correctly
cd ATLAS-build
make check
if [ $? -ne 0 ]; then
echo "An error occurred when running the ATLAS self-tests."
exit 1
else
echo "The ATLAS self-tests successfully passed."
fi
cd ..
$MAKE check
if [ $? -ne 0 ]; then
echo >&2 "Error: The ATLAS self-tests failed."
exit 1
else
echo "The ATLAS self-tests successfully passed."
fi
}


make_time()
{
# collect some timings
cd ATLAS-build
make time
if [ $? -ne 0 ]; then
echo "The ATLAS timing data failed to be collected."
exit 1
else
echo "The ATLAS timing data was successfully collected."
fi
cd ..
$MAKE time
if [ $? -ne 0 ]; then
echo >&2 "Error: The ATLAS timing data failed to be collected."
exit 1
else
echo "The ATLAS timing data was successfully collected."
fi
}


cd src/ATLAS-build
make_check
make_time
43 changes: 16 additions & 27 deletions build/pkgs/atlas/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PATCH_DIR = os.path.join(conf['SPKG_DIR'], 'patches')
LAPACK_TARFILE = os.path.join(conf['SPKG_DIR'], 'src', 'lapack-3.4.2.tar')

# temporary directory to build everything in
BUILD_DIR = os.path.join(conf['SPKG_DIR'], 'ATLAS-build')
BUILD_DIR = os.path.join(conf['SPKG_DIR'], 'src', 'ATLAS-build')

# the shared library autotools stub project
BUILD_LIB_DIR = os.path.join(conf['SPKG_DIR'], 'src', 'ATLAS-lib')
Expand Down Expand Up @@ -66,27 +66,12 @@ def assert_success(rc, good=None, bad=None):
### Skip building ATLAS on specific systems
######################################################################

# On Cygwin we simply require that the system-wide lapack is installed.
# This includes BLAS and LAPACK and is enough to build the rest of Sage.
if conf['CYGWIN?'] and not os.environ.has_key('SAGE_ATLAS_ARCH'):
libraries = ['/usr/lib/libblas.dll.a', '/usr/lib/liblapack.dll.a']
for lib in libraries:
if not os.path.exists(lib):
print '*'*75
print 'Could not locate required file: "' + lib + '".'
print 'On Cygwin you must install the following standard LAPACK Cygwin packages'
print 'via the Cygwin setup.exe program in the "Math" category:'
print '* lapack,'
print '* liblapack-devel.'
print 'Alternatively you can try building your own ATLAS by setting'
print 'SAGE_ATLAS_ARCH to something sensible although that is not'
print 'officially supported.'
print '*'*75
sys.exit(1)
for lib in libraries:
cp(lib, os.path.join(conf['SAGE_LOCAL'], 'lib'))
sys.exit(0)

# On Cygwin, we used to require that the system-wide lapack packages were
# installed (this included the lapack-devel and lapack packages).
# These packages indeed include BLAS and LAPACK and are enough to build
# the rest of Sage, whereas building ATLAS was problematic.
# For the record, the corresponding files to symlink from the system-wide
# packages are: '/usr/lib/libblas.dll.a' and '/usr/lib/liblapack.dll.a'.

if conf['Darwin?'] and not os.environ.has_key('SAGE_ATLAS_ARCH'):
print 'Skipping build of ATLAS on OS X, using system library instead.'
Expand All @@ -107,8 +92,12 @@ if conf['Darwin?'] and not os.environ.has_key('SAGE_ATLAS_ARCH'):

if os.environ.has_key('SAGE_ATLAS_LIB'):
ATLAS_LIB = os.environ['SAGE_ATLAS_LIB']
libraries = ['libatlas', 'liblapack', 'libcblas', 'libf77blas']
libraries_optional = ['libptcblas', 'libptf77blas']
if conf['CYGWIN?']:
libraries = ['libblas', 'liblapack']
libraries_optional = []
else:
libraries = ['libatlas', 'liblapack', 'libcblas', 'libf77blas']
libraries_optional = ['libptcblas', 'libptf77blas']

def is_atlas_lib_path(path):
if path is None:
Expand Down Expand Up @@ -164,7 +153,7 @@ if os.environ.has_key('SAGE_ATLAS_LIB'):
for fname in filenames:
source = os.path.join(ATLAS_LIB, fname)
destination = os.path.join(SAGE_LOCAL_LIB, fname)
print 'Symlinking '+source+' -> '+destination
print 'Symlinking '+destination+' -> '+source
try:
os.remove(destination)
except OSError:
Expand Down Expand Up @@ -293,7 +282,7 @@ def configure(arch=None, isa_ext=None):
else:
CCbin, CCopt = CC, ''

cmd = '../src/ATLAS/configure'
cmd = '../ATLAS/configure'
cmd += ' --prefix=' + conf['SAGE_LOCAL']
cmd += ' --with-netlib-lapack-tarfile=' + LAPACK_TARFILE
cmd += ' --cc="' + CC + '"'
Expand Down Expand Up @@ -563,7 +552,7 @@ if rc!=0:
INSTALL_STATIC_LIBRARIES = True
else:
print 'Finished building serial shared ATLAS library (libtool).'
have_serial_libs = True
have_serial_libs = True
else:
have_parallel_libs = True

Expand Down

0 comments on commit 1e9e230

Please sign in to comment.