Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump factory to 4.4.1 and FLINT to 3.2.1 #3698

Merged
merged 8 commits into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
url = https://github.com/Macaulay2/bdwgc.git
[submodule "M2/submodules/flint"]
path = M2/submodules/flint
url = https://github.com/Macaulay2/flint2.git
url = https://github.com/flintlib/flint
[submodule "M2/submodules/frobby"]
path = M2/submodules/frobby
url = https://github.com/Macaulay2/frobby.git
1 change: 0 additions & 1 deletion M2/Macaulay2/e/NCAlgebras/FreeAlgebra.hpp
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
#include "ringelem.hpp" // for ring_elem
#include "style.hpp" // for GEOHEAP_SIZE

#include <gmp.h> // for mpz_srcptr, mpq_srcptr
#include <iosfwd> // for ostream, string
#include <utility> // for pair
#include <vector> // for vector
1 change: 0 additions & 1 deletion M2/Macaulay2/e/NCAlgebras/FreeAlgebraQuotient.hpp
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
#include "newdelete.hpp" // for our_new_delete
#include "ringelem.hpp" // for ring_elem

#include <gmp.h> // for mpz_srcptr, mpq_srcptr
#include <vector> // for vector

class Ring;
3 changes: 3 additions & 0 deletions M2/Macaulay2/e/aring-gf-flint-big.hpp
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@
// The following needs to be included before any flint files are included.
#include <M2/gc-include.h>

// includes gmp.h, which is required for FLINT functions that use GMP
#include <M2/math-include.h>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <flint/flint.h> // for flint_free, flint_rand_t, fmpz_t
3 changes: 3 additions & 0 deletions M2/Macaulay2/e/aring-gf-flint.hpp
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@
// The following needs to be included before any flint files are included.
#include <M2/gc-include.h>

// includes gmp.h, which is required for FLINT functions that use GMP
#include <M2/math-include.h>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <flint/flint.h> // for flint_rand_t, fmpz_t, ulong
1 change: 0 additions & 1 deletion M2/Macaulay2/e/schreyer-resolution/res-f4-m2-interface.cpp
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@
#include "schreyer-resolution/res-schreyer-frame.hpp" // for SchreyerFrame
#include "schreyer-resolution/res-schreyer-order.hpp" // for ResSchreyer...
#include "timing.hpp" // for timer, seconds
#include <gmp.h> // for mpz_clear
#include <cstdlib> // for exit, size_t
#include <chrono> // for common_type...
#include <iostream> // for operator<<
15 changes: 9 additions & 6 deletions M2/Macaulay2/m2/programs.m2
Original file line number Diff line number Diff line change
@@ -89,18 +89,21 @@ findProgram(String, List) := opts -> (name, cmds) -> (
instance(opts.MinimumVersion, Sequence) and
class \ opts.MinimumVersion === (String, String)) then
error "expected MinimumVersion to be a sequence of two strings";
pathsToTry := fixPath \ join(
pathsToTry := fixPath \ nonnull flatten {
-- try user-configured path first
if programPaths#?name then {programPaths#name} else {},
if programPaths#?name then programPaths#name,
-- now try M2-installed path
{prefixDirectory | currentLayout#"programs"},
prefixDirectory | currentLayout#"programs",
-- any additional paths specified by the caller
opts.AdditionalPaths,
opts.AdditionalPaths,
-- try PATH
if getenv "PATH" == "" then {} else apply(separate(":", getenv "PATH"),
if getenv "PATH" =!= "" then apply(
separate(":", getenv "PATH"),
dir -> if dir == "" then "." else dir),
-- try directory containing M2-binary
{bindir});
bindir,
-- try usr-host/bin
if topBuilddir =!= null then topBuilddir | "usr-host/bin"};
prefixes := {(".*", "")} | opts.Prefix;
errorCode := didNotFindProgram;
versionFound := "0.0";
1 change: 0 additions & 1 deletion M2/Macaulay2/m2/startup.m2.in
Original file line number Diff line number Diff line change
@@ -40,7 +40,6 @@ if not firstTime then debug Core -- we need access to the private symbols (we re
toString := value' getGlobalSymbol if firstTime then "simpleToString" else "toString"

local exe
local topBuilddir

-- this next bit has to be *parsed* after the "debug" above, to prevent the symbols from being added to the User dictionary
if firstTime then (
6 changes: 2 additions & 4 deletions M2/Macaulay2/packages/Macaulay2Doc/ov_preface.m2
Original file line number Diff line number Diff line change
@@ -344,10 +344,8 @@ document {
G.-M. Greuel, R. Stobbe, G. Pfister, H. Schoenemann, and J. Schmidt,
University of Kaiserslautern, Macaulay2 incorporates ", TT "Singular-Factory", ",
version ", version#"factory version", ", a free library of polynomial routines
that provides for factorization of polynomials. It is available at
", HREF "ftp://www.mathematik.uni-kl.de/pub/Math/Singular/Factory"," and at
", HREF "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES", ". It
is part of ", TT "Singular", ", whose home page is ", HREF "http://www.singular.uni-kl.de/", ".",
that provides for factorization of polynomials. It is part of ",
TT "Singular", ", whose home page is ", HREF "https://www.singular.uni-kl.de/", ".",
PARA{},
"The following important routines call upon it:",
UL {
3 changes: 2 additions & 1 deletion M2/check-configure/Makefile.in
Original file line number Diff line number Diff line change
@@ -18,7 +18,8 @@ check-config:
@abs_top_srcdir@/configure \
PKG_CONFIG_PATH=$(BUILTLIBPATH)/lib/pkgconfig:$(PKG_CONFIG_PATH) \
GFTABLESDIR=@PRE_GFTABLESDIR@ \
LDFLAGS="@BUILTLIBS@ $(LDFLAGS)" \
LDFLAGS="$(LDFLAGS)" \
LIBS="@BUILTLIBS@" \
--with-gtest-source-path="@GTEST_PATH@" \
CPPFLAGS="$(CPPFLAGS)" \
CC="$(CC)" \
39 changes: 20 additions & 19 deletions M2/cmake/build-libraries.cmake
Original file line number Diff line number Diff line change
@@ -343,25 +343,26 @@ _ADD_COMPONENT_DEPENDENCY(libraries ntl gmp NTL_FOUND)
ExternalProject_Add(build-flint
PREFIX libraries/flint
SOURCE_DIR ${CMAKE_SOURCE_DIR}/submodules/flint
BINARY_DIR libraries/flint/build
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${M2_HOST_PREFIX}
-DCMAKE_SYSTEM_PREFIX_PATH=${M2_HOST_PREFIX}
-DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/cmake
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_FLAGS=${CFLAGS}
-DCMAKE_CXX_FLAGS=${CXXFLAGS}
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DIPO_SUPPORTED=OFF # TODO: because of clang; see https://github.com/wbhart/flint2/issues/644
-DWITH_NTL=ON
INSTALL_COMMAND ${CMAKE_COMMAND} --install . ${strip_setting}
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND ./bootstrap.sh &&
${CONFIGURE} --prefix=${M2_HOST_PREFIX}
${shared_setting}
"CPPFLAGS=${CPPFLAGS} -I${GMP_INCLUDE_DIRS}"
CFLAGS=${CFLAGS}
CXXFLAGS=${CXXFLAGS}
"LDFLAGS=${LDFLAGS} -L${GMP_LIBRARY_DIRS}"
CC=${CMAKE_C_COMPILER}
CXX=${CMAKE_CXX_COMPILER}
AR=${CMAKE_AR}
OBJDUMP=${CMAKE_OBJDUMP}
STRIP=${CMAKE_STRIP}
RANLIB=${CMAKE_RANLIB}
BUILD_COMMAND ${MAKE} -j${PARALLEL_JOBS}
INSTALL_COMMAND ${MAKE} -j${PARALLEL_JOBS} install
COMMAND ${CMAKE_COMMAND} -E make_directory ${M2_INSTALL_LICENSESDIR}/flint
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/submodules/flint/README.md ${M2_INSTALL_LICENSESDIR}/flint
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/submodules/flint/LICENSE ${M2_INSTALL_LICENSESDIR}/flint
TEST_COMMAND ${CMAKE_COMMAND} . -DBUILD_TESTING=ON
COMMAND ${CMAKE_COMMAND} --build .
COMMAND ${CMAKE_COMMAND} --build . --target test
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/submodules/flint/COPYING ${M2_INSTALL_LICENSESDIR}/flint
TEST_COMMAND ${MAKE} -j${PARALLEL_JOBS} check
EXCLUDE_FROM_ALL ON
TEST_EXCLUDE_FROM_MAIN ON
STEP_TARGETS install test
@@ -376,8 +377,8 @@ _ADD_COMPONENT_DEPENDENCY(libraries flint "gmp;mpfr;ntl" FLINT_FOUND)
# https://service.mathematik.uni-kl.de/ftp/pub/Math/Singular/Factory/
# TODO: what is ftmpl_inst.o?
ExternalProject_Add(build-factory
URL https://www.singular.uni-kl.de/ftp/pub/Math/Factory/factory-4.4.0.tar.gz
URL_HASH SHA256=baf31159578463e26bf18ec68ec901228d79a819866dd96c02d85c73dfbaf030
URL https://macaulay2.com/Downloads/OtherSourceCode/factory-4.4.1.tar.gz
URL_HASH SHA256=345ec8ab2481135d18244e2a2ff6bc16e812a39a9eb5ac5d578956d8e0526e6e
PREFIX libraries/factory
SOURCE_DIR libraries/factory/build
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/BUILD/tarfiles
8 changes: 3 additions & 5 deletions M2/configure.ac
Original file line number Diff line number Diff line change
@@ -615,7 +615,7 @@ AC_SUBST(BUILTLIBS)
AC_SUBST(LIBLIST, " gc gdbm gmp mpfr mpfi normaliz readline ntl flint factory lapack mpsolve frobby glpk cddlib fplll givaro fflas_ffpack linbox gtest tbb memtailor mathic mathicgb eigen ")
# The list LIBLIST is the list of libraries that might be used and linked into M2.

AC_SUBST(PROGLIST, "4ti2 gfan csdp nauty cddplus lrslib gftables topcom cohomcalg msolve")
AC_SUBST(PROGLIST, "4ti2 gfan csdp nauty cddplus lrslib topcom cohomcalg msolve")
# The list PROGLIST is the list of programs and libraries for them that are distributed with M2.
# Initially, we offer no option for not compiling some of them.

@@ -678,7 +678,7 @@ PKGNAME_fflas_ffpack=fflas-ffpack
#############################################################################

LIBLIST=" $LIBLIST "
AC_ARG_ENABLE(build-libraries, AS_HELP_STRING(--enable-build-libraries=...,[list of libraries and programs to build from downloaded source code (e.g., gc gdbm mpfr mpfi readline ntl gftables factory lapack mpsolve frobby glpk cddlib givaro fflas_ffpack linbox 4ti2 gfan normaliz csdp nauty cddplus lrslib msolve)]),
AC_ARG_ENABLE(build-libraries, AS_HELP_STRING(--enable-build-libraries=...,[list of libraries and programs to build from downloaded source code (e.g., gc gdbm mpfr mpfi readline ntl factory lapack mpsolve frobby glpk cddlib givaro fflas_ffpack linbox 4ti2 gfan normaliz csdp nauty cddplus lrslib msolve)]),
[for i in $enableval
do case " $LIBLIST $PROGLIST " in
*" $i "*)
@@ -1490,10 +1490,8 @@ AC_ARG_VAR([GFTABLESDIR],
[path to gftables directory if factory is already installed])
if test $BUILD_factory = yes
then
BUILD_gftables=yes
GFTABLESDIR="${datadir}/Macaulay2/Core/factory/"
else
BUILD_gftables=no
if test x$GFTABLESDIR = x
then
if test $FACTORY_NAME = factory
@@ -1969,7 +1967,7 @@ done
prefix=$save_prefix
exec_prefix=$save_exec_prefix

if test $BUILD_gftables = no
if test $BUILD_factory = no
then PRE_GFTABLESDIR="$GFTABLESDIR"
else
PRE_GFTABLESDIR="$pre_datadir/Macaulay2/Core/factory/"
39 changes: 20 additions & 19 deletions M2/libraries/factory/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# https://www.singular.uni-kl.de/
# svn co svn+ssh://monty.mathematik.uni-kl.de/usr/local/Singular/svn/trunk
# svn co http://www.singular.uni-kl.de/svn/trunk
# old URL = ftp://www.mathematik.uni-kl.de/pub/Math/Singular/Factory
# URL = ftp://jim.mathematik.uni-kl.de/pub/Math/Factory
# https://github.com/Singular/Sources
# https://service.mathematik.uni-kl.de/ftp/pub/Math/Factory/factory-4.2.0.tar.gz
# ftp://jim.mathemathematik.uni-kl.de/pub/Math/Singular
# https://www.singular.uni-kl.de
# https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/4-3-0/singular-4.3.0.tar.gz

# We seem to be the only users of the factory library, which is part of
# Singular. Its source code accompanies binary installations of Singular,
# under Arch Linux, for example. To get a more recent tar file for factory,
# I ask Hans Schoenemann <hannes@mathematik.uni-kl.de> to make one and post
# it at one of the ftp sites above. Version 4.1.3 is available.

URL = https://www.singular.uni-kl.de/ftp/pub/Math/Factory
VERSION = 4.4.0
# The Singular developers no longer publish a factory tarball on their
# website, so we generate our own. To do so, run:
# make -C libraries/factory dist
# This will generate a tarball in BUILD/tarfiles
# Upload this to https://macaulay2.com/Downloads/OtherSourceCode/

URL = https://macaulay2.com/Downloads/OtherSourceCode
VERSION = 4.4.1
#PATCHFILE = @abs_srcdir@/patch-$(VERSION)
PRECONFIGURE = autoreconf -vif

@@ -48,6 +37,7 @@ CONFIGOPTIONS += --disable-omalloc --enable-streamio
CONFIGOPTIONS += --includedir='$(LIBRARIESDIR)/include/'
CONFIGOPTIONS += --disable-shared
CONFIGOPTIONS += --without-Singular
CONFIGOPTIONS += --datadir=@pre_packagesdir@/Core # for gftables

ifeq (@DEBUG@,yes)
CONFIGOPTIONS += --enable-assertions
@@ -100,6 +90,17 @@ uninstall clean ::
include/factory.h include/factoryconf.h include/cf_gmp.h include/templates/ftmpl_* include/factory ; \
fi

dist:
rm -rf Singular
@GIT@ clone https://github.com/Singular/Singular --single-branch \
-b Release-$(subst .,-,$(VERSION)) --depth=1
# Remove if https://github.com/Singular/Singular/pull/1265 merged
sed -i 's/make dist/.\/configure \&\& make dist/' \
Singular/factory/make_factory_dist
cd Singular/factory && sh make_factory_dist
cp Singular/factory/factory-$(VERSION).tar.gz $(TARFILE_DIR)
rm -rf Singular

#post-install: $(LIBRARIESDIR)/lib/libcfmem-newdelete-removed
#$(LIBRARIESDIR)/lib/libcfmem-newdelete-removed : $(LIBRARIESDIR)/lib/libcfmem.a
# ar -d "$^" newdelete.o
4 changes: 2 additions & 2 deletions M2/libraries/flint/Makefile.in
Original file line number Diff line number Diff line change
@@ -2,14 +2,14 @@ SUBMODULE = true
# LIBNAME = flint2
HOMEPAGE = http://flintlib.org
# git://github.com/wbhart/flint2.git
VERSION = 3.0.0
VERSION = 3.2.1
# PATCHFILE = @abs_srcdir@/patch-$(VERSION)
PARALLEL = yes

# Many other tests keep failing, so disable them all:
CHECKTARGET = .

LICENSEFILES = LICENSE
LICENSEFILES = COPYING
ifeq (@DEBUG@,yes)
CONFIGOPTIONS += --enable-assert
CFLAGS += -O0 -fno-unroll-loops
27 changes: 0 additions & 27 deletions M2/libraries/gftables/Makefile.in

This file was deleted.

1 change: 0 additions & 1 deletion M2/m4/files
Original file line number Diff line number Diff line change
@@ -42,7 +42,6 @@ libraries/frobby/Makefile
libraries/gc/Makefile
libraries/gdbm/Makefile
libraries/gfan/Makefile
libraries/gftables/Makefile
libraries/givaro/Makefile
libraries/glpk/Makefile
libraries/gmp/Makefile
2 changes: 1 addition & 1 deletion M2/submodules/flint
Submodule flint updated 10327 files