Skip to content

Commit 363beb1

Browse files
author
Release Manager
committed
Trac #27270: spkg-configure.m4 for arb
{{{ SAGE_SPKG_CONFIGURE([arb], [ AC_CHECK_HEADER(arb.h, [], [sage_spkg_install_arb=yes]) dnl below function added in version 2.16 of arb AC_SEARCH_LIBS([acb_mat_eig_simple], [arb], [break], [sage_spkg_install_arb=yes]) }}} we also take care of non-standard naming of arb's dylib here. configure tarball http://users.ox.ac.uk/~coml0531/sage/configure- b5de899.tar.gz URL: https://trac.sagemath.org/27270 Reported by: dimpase Ticket author(s): Dima Pasechnik, Isuru Fernando Reviewer(s): François Bissey, Isuru Fernando
2 parents 8e66f62 + 29d4ce2 commit 363beb1

24 files changed

+95
-27
lines changed

bootstrap

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ save () {
151151
echo "$NEWCONFVERSION" >$PKG/package-version.txt
152152

153153
# Compute checksum
154-
sage --package fix-checksum configure
154+
./sage --package fix-checksum configure
155155
}
156156

157157

build/pkgs/arb/spkg-configure.m4

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
SAGE_SPKG_CONFIGURE([arb], [
2+
AC_REQUIRE([SAGE_SPKG_CONFIGURE_FLINT])
3+
SAGE_ARB_LIBRARY="arb"
4+
AC_MSG_CHECKING([installing flint? ])
5+
if test x$sage_spkg_install_flint = xyes; then
6+
AC_MSG_RESULT([yes; install arb as well])
7+
sage_spkg_install_arb=yes
8+
else
9+
AC_CHECK_HEADER(arb.h, [
10+
dnl below function added in version 2.16 of arb
11+
AC_CHECK_LIB([arb], [acb_mat_eig_simple], [],
12+
[dnl in Debian the name of dylib is different.
13+
AC_CHECK_LIB([flint-arb], [acb_mat_eig_simple],
14+
[SAGE_ARB_LIBRARY="flint-arb"], [sage_spkg_install_arb=yes])])
15+
], [sage_spkg_install_arb=yes])
16+
fi
17+
], [], [], [
18+
if test x$sage_spkg_install_arb = xyes; then
19+
AC_SUBST(SAGE_ARB_LIBRARY,["arb"])
20+
else
21+
AC_SUBST(SAGE_ARB_LIBRARY,[$SAGE_ARB_LIBRARY])
22+
fi
23+
])

build/pkgs/arb/spkg-install

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ cd src
44
# be removed in arb >= 2.8 when it is released
55
export EXTRA_SHARED_FLAGS=$LDFLAGS
66

7-
./configure --disable-static --prefix="$SAGE_LOCAL" --with-flint="$SAGE_LOCAL" \
8-
$SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR || \
7+
./configure --disable-static --prefix="$SAGE_LOCAL" $SAGE_CONFIGURE_GMP \
8+
$SAGE_CONFIGURE_MPFR $SAGE_CONFIGURE_FLINT || \
99
sdh_die "Error configuring arb."
1010

1111
sdh_make verbose

build/pkgs/configure/checksums.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=884916977f16b435feca568af4143d7b611ff296
3-
md5=cb3d4daa45edbf2bf0a6d36bb742404c
4-
cksum=2276007569
2+
sha1=6e37cc644bb94c7c0edfa4681a5d29e924ae37fd
3+
md5=cb511a70947d60f1d6274e3558398314
4+
cksum=3050333555
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0d04feb43bda005d57532404737fbb00bb094a96
1+
b5de8991395bbf58e663e69d6250de656897c4e2

build/pkgs/deformation/spkg-install

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cd src
44
# all standard flags, so we can't use sdh_configure
55
./configure --prefix="$SAGE_LOCAL" --disable-static \
66
$SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR \
7-
--with-flint="$SAGE_LOCAL" || \
7+
$SAGE_CONFIGURE_FLINT || \
88
sdh_die "Failed to configure deformation"
99
sdh_make
1010
sdh_make_install

build/pkgs/eclib/spkg-install

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ cd src/
3030

3131
sdh_configure $SAGE_CONFIGURE_NTL \
3232
--with-pari="$SAGE_LOCAL" \
33-
--with-flint="$SAGE_LOCAL" \
33+
$SAGE_CONFIGURE_FLINT \
3434
--with-boost="no" \
3535
--disable-allprogs
3636
sdh_make

build/pkgs/flint/spkg-configure.m4

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
SAGE_SPKG_CONFIGURE([flint], [
2+
AC_REQUIRE([SAGE_SPKG_CONFIGURE_MPFR])
3+
AC_REQUIRE([SAGE_SPKG_CONFIGURE_NTL])
4+
AC_MSG_CHECKING([installing mpfr or ntl? ])
5+
if test x$sage_spkg_install_mpfr = xyes -o x$sage_spkg_install_ntl = xyes; then
6+
AC_MSG_RESULT([yes; install flint as well])
7+
sage_spkg_install_flint=yes
8+
else
9+
AC_CHECK_HEADER(flint/flint.h, [
10+
dnl fmpz_mat_is_hadamard appears in Flint 2.5.0
11+
AC_SEARCH_LIBS([fmpz_mat_is_hadamard], [flint], [
12+
dnl check that NTL is linked in
13+
AC_SEARCH_LIBS([fmpz_poly_get_ZZX], [flint], [
14+
15+
AC_MSG_CHECKING([that GC is not enabled in Flint... ])
16+
AC_RUN_IFELSE([
17+
AC_LANG_PROGRAM([[#include <flint/flint.h>]], [[return HAVE_GC;]])],
18+
[AC_MSG_RESULT([GC not enabled. Good.])],
19+
[AC_MSG_RESULT([GC enabled. Incompatible with Sage.])
20+
sage_spkg_install_flint=yes])
21+
], [sage_spkg_install_flint=yes])
22+
], [sage_spkg_install_flint=yes])
23+
], [sage_spkg_install_flint=yes])
24+
fi
25+
], [], [], [
26+
if test x$sage_spkg_install_flint = xyes; then
27+
AC_SUBST(SAGE_FLINT_PREFIX, ['$SAGE_LOCAL'])
28+
AC_MSG_RESULT([using Sage's flint SPKG])
29+
else
30+
AC_SUBST(SAGE_FLINT_PREFIX, [''])
31+
AC_MSG_RESULT([using flint library from the system])
32+
fi
33+
])

build/pkgs/singular/spkg-install

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ config()
7979
--bindir="$SAGE_LOCAL/bin" \
8080
$SAGE_CONFIGURE_GMP \
8181
$SAGE_CONFIGURE_NTL \
82-
--with-flint="$SAGE_LOCAL" \
82+
$SAGE_CONFIGURE_FLINT \
8383
--enable-gfanlib \
8484
--enable-Singular \
8585
--enable-factory \

src/bin/sage-env-config.in

+10
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,14 @@ if [ -n "$SAGE_NTL_PREFIX" ]; then
8080
# SAGE_LOCAL it is useful to pass it.
8181
export SAGE_CONFIGURE_NTL="--with-ntl=$SAGE_NTL_PREFIX"
8282
fi
83+
84+
# The FLINT case is very close to the MPFR case above
85+
# This is usually blank if the system FLINT is used, or $SAGE_LOCAL otherwise
86+
export SAGE_FLINT_PREFIX="@SAGE_FLINT_PREFIX@"
87+
if [ -n "$SAGE_FLINT_PREFIX" ]; then
88+
# Some packages that depend on FLINT accept a --with-flint=<prefix> flag to
89+
# their ./configure scripts. Thus we deal with this just as with GMP above.
90+
export SAGE_CONFIGURE_FLINT="--with-flint=$SAGE_FLINT_PREFIX"
91+
fi
8392
export SAGE_FREETYPE_PREFIX="@SAGE_FREETYPE_PREFIX@"
93+
export SAGE_ARB_LIBRARY="@SAGE_ARB_LIBRARY@"

src/doc/en/installation/source.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ you would use
225225
# debian (Stretch or newer) / ubuntu
226226
$ sudo apt-get install binutils pixz gcc g++ gfortran make m4 perl tar \
227227
git patch openssl libssl-dev libz-dev bc libbz2-dev liblzma-dev libgmp-dev \
228-
libffi-dev libgf2x-dev libcurl4-openssl-dev curl yasm
228+
libffi-dev libgf2x-dev libcurl4-openssl-dev libzmq3-dev curl yasm
229229

230230
# redhat / fedora / centos
231231
$ sudo yum install binutils xz gcc gcc-c++ gcc-gfortran make m4 perl \
@@ -238,7 +238,7 @@ your OS, cf. the growing list of such packages on :trac:`27330`, install::
238238

239239
# debian / ubuntu
240240
$ sudo apt-get install libntl-dev libmpfr-dev libmpc-dev libflint-dev \
241-
libpcre3-dev libgd-dev \
241+
libpcre3-dev libgd-dev libflint-dev libflint-arb-dev \
242242
cmake libterm-readline-gnu-perl ninja-build librw-dev # not for standard Sage spkgs
243243

244244
# redhat / fedora / centos

src/module_list.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@
7575
from sage.env import cython_aliases
7676
aliases = cython_aliases()
7777

78+
arb_dylib_name = aliases["ARB_LIBRARY"]
7879
library_order_list = aliases["SINGULAR_LIBRARIES"] + [
7980
"ec", "ecm",
8081
] + aliases["LINBOX_LIBRARIES"] + aliases["FFLASFFPACK_LIBRARIES"] + aliases["GSL_LIBRARIES"] + [
8182
"pari", "flint", "ratpoints", "ecl", "glpk", "ppl",
82-
"arb", "mpfi", "mpfr", "mpc", "gmp", "gmpxx",
83+
arb_dylib_name, "mpfi", "mpfr", "mpc", "gmp", "gmpxx",
8384
"brial",
8485
"brial_groebner",
8586
"m4rie",
@@ -771,7 +772,7 @@ def uname_specific(name, value, alternative):
771772

772773
Extension("sage.matrix.matrix_complex_ball_dense",
773774
["sage/matrix/matrix_complex_ball_dense.pyx"],
774-
libraries=['arb']),
775+
libraries=[arb_dylib_name]),
775776

776777
Extension('sage.matrix.matrix_complex_double_dense',
777778
sources = ['sage/matrix/matrix_complex_double_dense.pyx']),

src/sage/env.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ def cython_aliases():
361361
sage: cython_aliases()
362362
{...}
363363
sage: sorted(cython_aliases().keys())
364-
['FFLASFFPACK_CFLAGS',
364+
['ARB_LIBRARY',
365+
'FFLASFFPACK_CFLAGS',
365366
'FFLASFFPACK_INCDIR',
366367
'FFLASFFPACK_LIBDIR',
367368
'FFLASFFPACK_LIBRARIES',
@@ -405,5 +406,5 @@ def cython_aliases():
405406
# This is not a problem in practice since LinBox depends on
406407
# fflas-ffpack and fflas-ffpack does add such a C++11 flag.
407408
aliases["LINBOX_CFLAGS"].append("-std=gnu++11")
408-
409+
aliases["ARB_LIBRARY"] = os.environ.get('SAGE_ARB_LIBRARY', 'arb')
409410
return aliases

src/sage/libs/arb/acb.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = acb.h
33

44
from sage.libs.arb.types cimport *

src/sage/libs/arb/acb_calc.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = acb_calc.h
33

44
from sage.libs.arb.types cimport *

src/sage/libs/arb/acb_elliptic.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = acb_elliptic.h
33

44
from sage.libs.arb.types cimport *

src/sage/libs/arb/acb_hypgeom.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = acb_hypgeom.h
33

44
from sage.libs.arb.types cimport *

src/sage/libs/arb/acb_modular.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = acb_modular.h
33

44
from sage.libs.arb.types cimport *

src/sage/libs/arb/acb_poly.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = acb_poly.h
33

44
from sage.libs.arb.types cimport *

src/sage/libs/arb/arb.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = arb.h
33

44
from sage.libs.arb.types cimport *

src/sage/libs/arb/arf.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = arf.h
33

44
from sage.libs.arb.types cimport *

src/sage/libs/arb/bernoulli.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = bernoulli.h
33

44
from ..flint.types cimport fmpq_t, ulong

src/sage/libs/arb/mag.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# distutils: libraries = gmp flint arb
1+
# distutils: libraries = gmp flint ARB_LIBRARY
22
# distutils: depends = mag.h
33

44
from sage.libs.arb.types cimport *

src/sage/misc/package.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def installed_packages(exclude_pip=True):
281281
EXAMPLES::
282282
283283
sage: installed_packages() # optional - build
284-
{...'arb': ...'pynac': ...}
284+
{...'brial': ...'pynac': ...}
285285
286286
.. SEEALSO::
287287

0 commit comments

Comments
 (0)