-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #29792: proper fix for "fedora-30-standard: Doctests using syste…
…m brial crash" This is a followup to #29490. We now add code rejecting Brial 1.2.5 - provided it can be recognised from `VERSION` macro in `polybory/config.h` header. This identifies standard Brial on Fedora 30 (and possibly elsewhere, but tough luck then). URL: https://trac.sagemath.org/29792 Reported by: dimpase Ticket author(s): Dima Pasechnik Reviewer(s): Jonathan Kliem
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
SAGE_SPKG_CONFIGURE([brial], [ | ||
SAGE_SPKG_DEPCHECK([boost m4ri], [ | ||
# If we're using the system m4ri and boost, ensure that we can | ||
# compile and run an executable linked against both libbrial and | ||
# libbrial_groebner (both are used by SageMath). | ||
AC_LANG_PUSH(C++) | ||
SAVED_LIBS=$LIBS | ||
LIBS="$LIBS -lbrial -lbrial_groebner" | ||
AC_MSG_CHECKING([if we can link against brial libraries]) | ||
AC_RUN_IFELSE([ | ||
AC_LANG_PROGRAM([ | ||
#include <polybori.h> | ||
#include <polybori/groebner/groebner_alg.h> | ||
USING_NAMESPACE_PBORI | ||
USING_NAMESPACE_PBORIGB | ||
class MyConstant : public BooleConstant{ | ||
public: void negate() { this->m_value = !this->m_value; } | ||
}; | ||
],[ | ||
BoolePolyRing r = BoolePolyRing(2, COrderEnums::dlex); | ||
ReductionStrategy rs = ReductionStrategy(r); | ||
rs.llReduceAll(); // uses groebner lib | ||
if (2 != r.nVariables()) { return 1; } | ||
if (r.constant(true) == r.constant(false)) { return 2; } | ||
MyConstant f = MyConstant(); | ||
f.negate(); // ensures v1.1.0+ if m_value isn't const | ||
if (!f.isOne()) { return 3; } | ||
return 0; | ||
]) | ||
], | ||
[ | ||
dnl check we're not on Fedora 30 - more precisely, we reject version 1.2.5 | ||
dnl for which the version is verifiable by the following code. | ||
AC_MSG_CHECKING([version not equal to 1.2.5]) | ||
AC_RUN_IFELSE([ | ||
AC_LANG_PROGRAM( | ||
[[#include <polybori.h> | ||
#include <polybori/config.h> | ||
]], [[ | ||
if (VERSION=="1.2.5") return 0; | ||
else return 1; | ||
]]) | ||
], [ | ||
AC_MSG_RESULT([found a possibly buggy 1.2.5. Rejecting]) | ||
sage_spkg_install_brial=yes | ||
], [ | ||
AC_MSG_RESULT([yes]) | ||
sage_spkg_install_brial=no | ||
]) | ||
], | ||
[ | ||
AC_MSG_RESULT([no]) | ||
sage_spkg_install_brial=yes | ||
]) | ||
LIBS=$SAVED_LIBS | ||
AC_LANG_POP | ||
], | ||
[ # If we're installing sage's boost or m4ri, then we have to | ||
# install its BRiAl, too. | ||
sage_spkg_install_brial=yes | ||
]) | ||
]) |