-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #28242: spkg-configure.m4 for pari
libpari-gmp is a dependency of many packages, so it's important to be able to use the one from the system. We check that system's PARI/GP environment is close enough to what we would install in Sage (i.e. versions of GP and libpari, and that they share the datadir). Also, PARI packages need to be checked. URL: https://trac.sagemath.org/28242 Reported by: dimpase Ticket author(s): Dima Pasechnik Reviewer(s): Isuru Fernando
- Loading branch information
Showing
22 changed files
with
204 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
SAGE_SPKG_CONFIGURE([gp2c], [ | ||
AC_REQUIRE([SAGE_SPKG_CONFIGURE_PARI]) | ||
AC_MSG_CHECKING([installing pari? ]) | ||
if test x$sage_spkg_install_pari = xyes; then | ||
AC_MSG_RESULT([yes; install gp2c as well]) | ||
sage_spkg_install_gp2c=yes | ||
libpari_pari_cfg='$SAGE_LOCAL/lib/pari/pari.cfg' | ||
AC_MSG_NOTICE([pari.cfg is $libpari_pari_cfg ]) | ||
else | ||
AC_MSG_RESULT([no]) | ||
AC_PATH_PROG([GP2C], [gp2c]) | ||
if test x$GP2C = x; then | ||
AC_MSG_NOTICE([using pari/gp from the system, but building gp2c]) | ||
AC_MSG_NOTICE([one might prefer to install a system-wide gp2c, instead]) | ||
AC_MSG_NOTICE([and re-run configure.]) | ||
dnl need to figure out libpari prefix | ||
gp_prefix=`dirname $GP` | ||
gp_prefix=`dirname $gp_prefix` | ||
AC_MSG_NOTICE([gp prefix is $gp_prefix ]) | ||
libpari_pari_cfg=`find $gp_prefix -name pari.cfg` | ||
AC_MSG_NOTICE([pari.cfg is $libpari_pari_cfg ]) | ||
sage_spkg_install_gp2c=yes | ||
fi | ||
fi | ||
], [], [], [ | ||
if test x$sage_spkg_install_gp2c = xyes; then | ||
AC_SUBST(SAGE_PARI_CFG, [$libpari_pari_cfg]) | ||
AC_MSG_RESULT([using Sage's gp2c SPKG]) | ||
else | ||
AC_SUBST(SAGE_PARI_CFG, ['']) | ||
AC_MSG_RESULT([using gp2c from the system]) | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cd src | ||
sdh_configure --with-paricfg="$SAGE_LOCAL/lib/pari/pari.cfg" | ||
sdh_configure --with-paricfg=$SAGE_PARI_CFG | ||
sdh_make | ||
sdh_make_install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
SAGE_SPKG_CONFIGURE([pari], [ | ||
dnl See gp_version below on how the version is computed from MAJV.MINV.PATCHV | ||
m4_pushdef([SAGE_PARI_MINVER],["133889"]) | ||
AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP]) | ||
AC_REQUIRE([SAGE_SPKG_CONFIGURE_READLINE]) | ||
AC_MSG_CHECKING([installing gmp/mpir or readline? ]) | ||
if test x$sage_spkg_install_mpir = xyes -o x$sage_spkg_install_gmp = xyes -o x$sage_spkg_install_readline = xyes; then dnl deps test | ||
AC_MSG_RESULT([yes; install pari as well]) | ||
sage_spkg_install_pari=yes | ||
else | ||
AC_MSG_RESULT([no]) | ||
AC_MSG_CHECKING([installing PARI/GP packages? ]) | ||
AC_PATH_PROG([GP], [gp]) | ||
if test x$GP = x; then dnl GP test | ||
AC_MSG_NOTICE([gp is not found]) | ||
sage_spkg_install_pari=yes | ||
else | ||
AC_MSG_CHECKING([is pari_elldata installed? ]) | ||
gp_ell_check=`echo "r=ellinit(\"11a1\"); r[[11]]" | $GP -qf 2>> config.log` | ||
if test x$gp_ell_check = x20008; then | ||
AC_MSG_RESULT([yes]) | ||
else | ||
AC_MSG_RESULT([no; cannot use system pari/GP without elldata package]) | ||
AC_MSG_NOTICE([Install elldata package and reconfigure.]) | ||
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.]) | ||
sage_spkg_install_pari=yes | ||
fi | ||
AC_MSG_CHECKING([is pari_galdata installed? ]) | ||
gp_gal_check=`echo "polgalois(x^8-2)[[1]]" | $GP -qf 2>> config.log` | ||
if test x$gp_gal_check = x16; then | ||
AC_MSG_RESULT([yes]) | ||
else | ||
AC_MSG_RESULT([no; cannot use system pari/GP without gapdata package]) | ||
AC_MSG_NOTICE([Install galdata package and reconfigure.]) | ||
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.]) | ||
sage_spkg_install_pari=yes | ||
fi | ||
AC_MSG_CHECKING([is pari_galpol installed? ]) | ||
gp_galp_check=`echo "galoisgetname(12,1)" | $GP -qf 2>> config.log` | ||
if test "x$gp_galp_check = xC3\ \:\ C4"; then | ||
AC_MSG_RESULT([yes]) | ||
else | ||
AC_MSG_RESULT([no; cannot use system pari/GP without galpol package]) | ||
AC_MSG_NOTICE([Install galpol package and reconfigure.]) | ||
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.]) | ||
sage_spkg_install_pari=yes | ||
fi | ||
AC_MSG_CHECKING([is pari_seadata installed? ]) | ||
gp_seadat_check=`echo "poldegree(ellmodulareqn(211)[[1]])" | $GP -qf 2>> config.log` | ||
if test x$gp_seadat_check = x212; then | ||
AC_MSG_RESULT([yes]) | ||
else | ||
AC_MSG_RESULT([no; cannot use system pari/GP without seadata package]) | ||
AC_MSG_NOTICE([Install seadata package and reconfigure.]) | ||
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.]) | ||
sage_spkg_install_pari=yes | ||
fi | ||
fi dnl end GP test | ||
if test x$sage_spkg_install_pari = x; then dnl main PARI test | ||
AC_MSG_RESULT([no]) | ||
AC_CHECK_HEADER([pari/pari.h], [], [sage_spkg_install_pari=yes]) | ||
dnl matpermanent appears in pari 2.11 | ||
AC_SEARCH_LIBS([matpermanent], [pari], [ | ||
AC_MSG_CHECKING([getting GP's version ]) | ||
gp_version=`echo "v=version(); v[[1]]<<16 + v[[2]]<<8 + v[[3]]" | $GP -qf 2>> config.log` | ||
AC_MSG_RESULT([$gp_version]) | ||
AC_MSG_CHECKING([comparing GP and libpari versions]) | ||
AC_LANG_PUSH(C) | ||
AC_RUN_IFELSE([AC_LANG_PROGRAM([ | ||
[#include <pari/pari.h>]], | ||
[[long vers;] | ||
[pari_init(5000000, 2);] | ||
[vers=paricfg_version_code;] | ||
[pari_close()]; | ||
[return vers!=$gp_version;]])], | ||
[AC_MSG_RESULT([libpari's and GP's versions match. Good])], | ||
[AC_MSG_RESULT([libpari's version does not match GP's version. Not good]) | ||
sage_spkg_install_pari=yes]) | ||
AC_MSG_CHECKING([is GP's version good enough? ]) | ||
AX_COMPARE_VERSION([$gp_version], [ge], [$SAGE_PARI_MINVER], [ | ||
AC_MSG_RESULT([yes]) | ||
AC_MSG_CHECKING([getting GP's datadir]) | ||
gp_datadir=`echo "default(datadir)" | $GP -qf 2>> config.log` | ||
AC_MSG_RESULT([$gp_datadir]) | ||
AC_MSG_CHECKING([comparing GP's and libpari's datadirs]) | ||
AC_RUN_IFELSE([AC_LANG_PROGRAM([ | ||
[#include <pari/pari.h>]], | ||
[[int t;] | ||
[pari_init(5000000, 2);] | ||
[t=strcmp(paricfg_datadir,$gp_datadir);] | ||
[pari_close()]; | ||
[return t;]])], | ||
[AC_MSG_RESULT([libpari's and GP's datadirs match. Good])], | ||
[AC_MSG_RESULT([libpari's datadir does not match GP's datadir. Not good]) | ||
sage_spkg_install_pari=yes]) | ||
], [ | ||
AC_MSG_RESULT([no]) | ||
sage_spkg_install_pari=yes]) | ||
AC_LANG_POP() | ||
], [sage_spkg_install_pari=yes]) | ||
fi dnl end main PARI test | ||
fi dnl end deps test | ||
m4_popdef([SAGE_PARI_MINVER]) | ||
], [], [], [ | ||
if test x$sage_spkg_install_pari = xyes; then | ||
AC_SUBST(SAGE_PARI_PREFIX, ['$SAGE_LOCAL']) | ||
AC_MSG_RESULT([using Sage's pari SPKG]) | ||
else | ||
AC_SUBST(SAGE_PARI_PREFIX, ['']) | ||
AC_MSG_RESULT([using pari/gp from the system]) | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SAGE_SPKG_CONFIGURE([pari_elldata], [ | ||
SAGE_CHECK_PARI_DEP([pari_elldata]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sdh_install src/* "$GP_DATA_DIR" | ||
sdh_install src/* "$SAGE_LOCAL/share/pari" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SAGE_SPKG_CONFIGURE([pari_galdata], [ | ||
SAGE_CHECK_PARI_DEP([pari_galdata]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sdh_install src/* "$GP_DATA_DIR" | ||
sdh_install src/* "$SAGE_LOCAL/share/pari" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SAGE_SPKG_CONFIGURE([pari_galpol], [ | ||
SAGE_CHECK_PARI_DEP([pari_galpol]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sdh_install src/* "$GP_DATA_DIR" | ||
sdh_install src/* "$SAGE_LOCAL/share/pari" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
SAGE_SPKG_CONFIGURE([pari_nftables], [ | ||
AC_REQUIRE([SAGE_SPKG_CONFIGURE_PARI]) | ||
AC_MSG_CHECKING([installing pari? ]) | ||
if test x$sage_spkg_install_pari = xyes; then | ||
AC_MSG_RESULT([yes; install pari_nftables as well]) | ||
sage_spkg_install_pari_nftables=yes | ||
else | ||
AC_MSG_RESULT([no]) | ||
AC_MSG_NOTICE([Installing nftables should be done by the user,]) | ||
AC_MSG_NOTICE([cf. http://pari.math.u-bordeaux1.fr/pub/pari/packages/nftables/README.txt]) | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sdh_install src/* "$GP_DATA_DIR/nftables" | ||
sdh_install src/* "$SAGE_LOCAL/share/pari/nftables" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SAGE_SPKG_CONFIGURE([pari_seadata], [ | ||
SAGE_CHECK_PARI_DEP([pari_seadata]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sdh_install src/* "$GP_DATA_DIR" | ||
sdh_install src/* "$SAGE_LOCAL/share/pari" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SAGE_SPKG_CONFIGURE([pari_seadata_small], [ | ||
SAGE_CHECK_PARI_DEP([pari_seadata_small]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sdh_install src/* "$GP_DATA_DIR" | ||
sdh_install src/* "$SAGE_LOCAL/share/pari" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
AC_DEFUN([SAGE_CHECK_PARI_DEP],[ | ||
AC_REQUIRE([SAGE_SPKG_CONFIGURE_PARI]) | ||
AC_MSG_CHECKING([installing pari? ]) | ||
if test x$sage_spkg_install_pari = xyes; then | ||
AC_MSG_RESULT([yes; install $1 as well]) | ||
[sage_spkg_install_]$1=yes | ||
else | ||
AC_MSG_RESULT([no]) | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters