Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into complexes-pr-3
Browse files Browse the repository at this point in the history
# Conflicts:
#	M2/Macaulay2/packages/PencilsOfQuadrics.m2
  • Loading branch information
mikestillman committed Nov 4, 2024
2 parents 127ff9f + 6a1ee7c commit 06b4341
Show file tree
Hide file tree
Showing 182 changed files with 10,588 additions and 6,504 deletions.
16 changes: 15 additions & 1 deletion .codespell_ignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
afile
alledges
allready
ans
Expand All @@ -8,11 +9,13 @@ ba
bloks
braket
bu
commun
comon
conet
coo
dorder
damon
debugg
dorder
egal
enew
euclidian
Expand All @@ -22,10 +25,13 @@ falt
firsth
fo
formes
fpt
frational
freee
froms
geometrie
hart
htpt
includee
inh
inot
Expand All @@ -36,27 +42,35 @@ ket
lod
lond
lsat
manuel
methd
mis
mor
multidimension
nam
nd
nin
nome
numer
oint
openin
ore
ot
packge
pres
pring
projet
returne
ser
singl
skelton
sring
sring
strat
strin
sur
te
thets
toom
tring
ue
9 changes: 5 additions & 4 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y -q --no-install-recommends clang-16 gfortran libtool-bin ninja-build yasm ccache
sudo apt-get install -y -q --no-install-recommends liblzma-dev libboost-stacktrace-dev \
libncurses-dev libncurses5-dev libreadline-dev libeigen3-dev liblapack-dev libxml2-dev \
libncurses-dev libncurses5-dev libreadline-dev libeigen3-dev libopenblas-dev libxml2-dev \
libgc-dev libgdbm-dev libglpk-dev libgmp3-dev libgtest-dev libmpfr-dev libmpfi-dev libntl-dev gfan \
libgivaro-dev libboost-regex-dev fflas-ffpack libflint-dev libmps-dev libfrobby-dev \
libsingular-dev singular-data libcdd-dev cohomcalg topcom 4ti2 libnormaliz-dev normaliz coinor-csdp \
Expand Down Expand Up @@ -130,7 +130,6 @@ jobs:
-DCMAKE_BUILD_TYPE=Release -DBUILD_NATIVE=OFF \
-DCMAKE_PREFIX_PATH="`brew --prefix`;`brew --prefix libffi`" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_PYTHON=ON \
--debug-trycompile
- name: Build libraries using Ninja
Expand All @@ -155,13 +154,14 @@ jobs:
- name: Configure Macaulay2 using Autotools
if: matrix.build-system == 'autotools'
run: |
make -C ../.. all
../../autogen.sh
export PYVERSION=`python3 -c "from sys import version_info; \
print(f'{version_info.major}.{version_info.minor}')"`
export CPPFLAGS="-I`brew --prefix`/include -I`brew --prefix libomp`/include"
export LDFLAGS="-L`brew --prefix`/lib -L`brew --prefix libomp`/lib \
-L/Library/Frameworks/Python.framework/Versions/${PYVERSION}/lib"
../../configure --enable-download --with-python --with-system-gc
export F77=gfortran-14
../../configure --enable-download --with-system-gc
- name: Build Macaulay2 using Make
if: matrix.build-system == 'autotools'
Expand Down Expand Up @@ -225,6 +225,7 @@ jobs:
path: |
# Autotools
M2/BUILD/build/config.log
M2/BUILD/build/check-configure/tmp/config.log
M2/BUILD/build/include/*
M2/BUILD/build/libraries/*/build/*/config.log
# CMake
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
/M2/autom4te.cache
/M2/configure
/M2/include/M2/config.h.in
/M2/include/M2/config.h.in~
/M2/include/M2/config.h
/M2/include/M2/config.h.in.stamp
/M2/.idea
/M2/tmp
/builds
*~
.DS_Store
.#*
.*.swp

48 changes: 7 additions & 41 deletions M2/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
*~
/M2
/config.args
/config.log
/config.status
/config.guess
/config.sub
/install-sh
/include/M2/config.h
/srcdir
/GNUmakefile
/Makefile
/check-configure/Makefile
/include/config.Makefile
/include/configuration
Expand Down Expand Up @@ -40,47 +42,10 @@
/Macaulay2/bin/M2
/Macaulay2/c/.gdbinit
/Macaulay2/m2/.gdbinit
/libraries/atomic_ops/Makefile
/libraries/cohomcalg/Makefile
/libraries/csdp/Makefile
/libraries/topcom/Makefile
/libraries/M2/Makefile
/libraries/gc/Makefile
/libraries/gdbm/Makefile
/libraries/flint/Makefile
/libraries/gmp/Makefile
/libraries/mpfr/Makefile
/libraries/mpir/Makefile
/libraries/boost/Makefile
/libraries/memtailor/Makefile
/libraries/mathic/Makefile
/libraries/mathicgb/Makefile
/libraries/gtest/Makefile
/libraries/4ti2/Makefile
/libraries/gfan/Makefile
/libraries/fflas_ffpack/Makefile
/libraries/nauty/Makefile
/libraries/cddplus/Makefile
/libraries/lrslib/Makefile
/libraries/cddlib/Makefile
/libraries/glpk/Makefile
/libraries/linbox/Makefile
/libraries/givaro/Makefile
/libraries/fplll/Makefile
/libraries/polymake/Makefile
/libraries/normaliz/Makefile
/libraries/pari/Makefile
/libraries/readline/Makefile
/libraries/ntl/Makefile
/libraries/libtool/Makefile
/libraries/gftables/Makefile
/libraries/factory/Makefile
/libraries/libfac/Makefile
/libraries/frobby/Makefile
/libraries/lapack/Makefile
/libraries/blas/Makefile
/libraries/*/Makefile
/Macaulay2/Makefile
/Macaulay2/README
/Macaulay2/packages/Makefile
/Macaulay2/packages/SCSCP/docinput/Makefile
/Macaulay2/book/Makefile
/Macaulay2/c/Makefile
Expand Down Expand Up @@ -129,6 +94,7 @@
/Macaulay2/tests/goals/Makefile
/Macaulay2/tests/quarantine/Makefile
/Macaulay2/tests/rationality/Makefile
/Macaulay2/tests/threads/Makefile
/Macaulay2/util/Makefile
/Macaulay2/kernel/Makefile
/Macaulay2/kernel/bibasis/Makefile
Expand Down
2 changes: 1 addition & 1 deletion M2/BUILD/build/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GNUmakefile
Makefile
Macaulay2
check-configure
config.args
Expand Down
2 changes: 1 addition & 1 deletion M2/BUILD/dan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CONFIGOPTIONS += --with-python
endif

# We may distribute the result, so prevent aggressive optimizations based on the current architecture:
CONFIGOPTIONS += --build=$(shell ../../config/config.guess)
CONFIGOPTIONS += --build=$(shell ../../config.guess)

ifeq ($(MACOSX),yes)
# # if we don't do this, we may get an absolute path in currentLayout:
Expand Down
2 changes: 1 addition & 1 deletion M2/BUILD/dan/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ CONFIGOPTIONS += CC="$(CC)" CXX="$(CXX)" FC="$(FC)" AR="$(AR)" CPPFLAGS="$(CPPFL
AM_DEFAULT_VERBOSITY = 1
PREFIX ?= /usr
CONFIGOPTIONS += --prefix=$(PREFIX)
CONFIGOPTIONS += --build=$(shell ../../config/config.guess)
CONFIGOPTIONS += --build=$(shell ../../config.guess)
# Local Variables:
# compile-command: "time make -f Makefile.include find-M2 DIRECTORY=none"
# End:
2 changes: 1 addition & 1 deletion M2/BUILD/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ clean-ccache: rm -rf $(STORAGE)/.ccache

build: build-image

build-image:; docker build --tag $(TAG) .
build-image:; docker build $(BUILD_ARGS) --tag $(TAG) .

###############################################################################
# M2 targets
Expand Down
1 change: 1 addition & 0 deletions M2/BUILD/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The `Dockerfile` in this directory creates a container image based on latest Ubu
- [`ubuntu`](ubuntu): Compiling Macaulay2 in a Container
- [`debian`](debian): Packaging Macaulay2 for Debian (.deb)
- [`fedora`](fedora): Packaging Macaulay2 for Fedora (.rpm)
- [`rhel`](rhel): Packaging Macaulay2 for Red Hat Enterprise Linux (.rpm)
- [`testbot`](testbot): Macaulay2 testbot for GitHub Actions
- [`brew`](brew): Bottling Macaulay2 for [Homebrew](https://brew.sh/)
- [`nightly`](nightly): Testing the Nightly Build of Macaulay2
Expand Down
26 changes: 16 additions & 10 deletions M2/BUILD/docker/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,33 @@
# Net usage: 54+124+
# Disk usage: ??

FROM registry.fedoraproject.org/fedora-minimal:32
ARG RELEASE=latest

FROM quay.io/fedora/fedora-minimal:$RELEASE

# Programs we require to build
# kernel-devel rpm-build rpm-sign rpmdevtools
RUN microdnf install autoconf bison ccache cmake curl diffutils file gcc-c++ git \
gnupg libtool make ninja-build patch yasm rpm-build rpmlint which
RUN microdnf install -y autoconf bison ccache cmake curl diffutils file \
gcc-c++ git gnupg libtool make ninja-build patch yasm rpm-build rpmlint \
which flex gcc-gfortran

# Libraries we require
RUN microdnf install openblas-devel libxml2-devel readline-devel gdbm-devel \
boost-devel libomp-dev libtbb-dev
RUN microdnf install -y openblas-devel libxml2-devel readline-devel gdbm-devel \
boost-devel libomp-devel tbb-devel python3-devel libffi-devel

# Libraries we can build (factory not available on ubuntu)
RUN microdnf install eigen3-devel glpk-devel gmp-devel mpfr-devel ntl-devel \
libnauty-devel libnormaliz-devel libfrobby-devel gc-devel
RUN microdnf install -y eigen3-devel glpk-devel gmp-devel mpfr-devel ntl-devel \
libnauty-devel libnormaliz-devel libfrobby-devel gc-devel mpfi-devel \
factory-devel mpsolve-devel fflas-ffpack-devel memtailor-devel \
mathic-devel mathicgb-devel

# Programs we can build
# TODO: cohomcalg available soon. Polymake requires firefox???
#RUN microdnf install libcdd-devel 4ti2 gfan normaliz coinor-csdp nauty lrslib
# TODO: Polymake requires firefox???
RUN microdnf install -y cddlib-devel 4ti2 gfan normaliz csdp-tools nauty \
lrslib-utils cohomCalg msolve

# Optional packages
RUN microdnf install mlocate bash-completion
RUN microdnf install -y plocate bash-completion R

# Add non-root user for building and running Macaulay2
RUN useradd -G wheel -g root -u 1000 -m macaulay && echo "macaulay ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
Expand Down
25 changes: 24 additions & 1 deletion M2/BUILD/docker/fedora/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
include ../ubuntu/Makefile

## Parameters
TAG = m2-fedora-build
RELEASE = latest
BUILD_ARGS = --build-arg RELEASE=$(RELEASE)
TAG = m2-fedora-$(RELEASE)-build
BUILD_DIR = M2/BUILD/build-docker
BUILD_OPT = -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr

rpm:; docker run $(VOLUME) -it --entrypoint "" $(TAG) bash -c "cd M2/$(BUILD_DIR); cpack -G RPM"

rpmlint:; docker run $(VOLUME) -it --entrypoint "" $(TAG) bash -c "rpmlint M2/$(BUILD_DIR)/Macaulay2-*.rpm"

## autotools build
## TODO: generalize this to other distros, move to toplevel Makefile

CONFIG_OPT = --with-system-gc --with-system-memtailor --with-system-mathic \
--with-system-mathicgb --enable-download --enable-rpm --prefix=/usr

define M2_BUILD_SCRIPT_autotools
set -xe

mkdir -p M2/$(BUILD_DIR)
cd M2/$(BUILD_DIR)
$(M2_HOME)/M2/M2/autogen.sh
$(M2_HOME)/M2/M2/configure $(CONFIG_OPT)
make
endef
export M2_BUILD_SCRIPT_autotools

build-autotools: build-image
docker run $(VOLUME) -it --entrypoint="" $(TAG) \
bash -c "$$M2_BUILD_SCRIPT_autotools"
25 changes: 25 additions & 0 deletions M2/BUILD/docker/rhel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG DISTRIBUTION=rockylinux
ARG RELEASE=9

FROM $DISTRIBUTION:$RELEASE
ARG RELEASE

# Configure EPEL
RUN dnf install -y 'dnf-command(config-manager)' && \
if [ $RELEASE = 8 ]; \
then \
dnf config-manager --set-enabled powertools; \
else \
dnf config-manager --set-enabled crb; \
fi && \
dnf install -y epel-release

# Install dependencies
RUN dnf -y install autoconf automake bison boost-devel bzip2 cmake \
diffutils eigen3 flex gc-devel gcc-c++ gcc-gfortran gdbm-devel git \
glpk-devel gmp-devel lapack-devel libffi-devel libtool \
libxml2-devel make mpfr-devel ncurses-devel openblas-devel patch \
python3-devel R readline-devel rpm-build tbb-devel which xz-devel \
zlib-devel

WORKDIR /home/macaulay
31 changes: 31 additions & 0 deletions M2/BUILD/docker/rhel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
include ../Makefile

## Parameters
DISTRIBUTION = rockylinux
RELEASE = 9
BUILD = autotools
BUILD_ARGS = --build-arg DISTRIBUTION=$(DISTRIBUTION) \
--build-arg RELEASE=$(RELEASE)
TAG = m2-$(BUILD)-$(DISTRIBUTION)-$(RELEASE)-build
BUILD_DIR = M2/BUILD/build-docker

## Script for building Macaulay2 (autotools)
define M2_BUILD_SCRIPT_autotools
set -xe

git config --global --add safe.directory $(M2_HOME)/M2
mkdir -p M2/$(BUILD_DIR)
cd M2/$(BUILD_DIR)
$(M2_HOME)/M2/M2/autogen.sh
$(M2_HOME)/M2/M2/configure --with-system-gc --enable-download --enable-rpm \
--prefix=/usr
make
endef
export M2_BUILD_SCRIPT_autotools

###############################################################################
# Build targets

build: build-image
docker run $(VOLUME) -it --entrypoint="" $(TAG) \
bash -c "$$M2_BUILD_SCRIPT_$(BUILD)"
20 changes: 20 additions & 0 deletions M2/BUILD/docker/rhel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiling Macaulay2 in a Red Hat Enterprise Linux-compatible Container

The `Dockerfile` in this directory creates a container image based a Red Hat Enterprise Linux-compatible distribution (either Rocky Linux or AlmaLInux) with all the required libraries and software for compiling Macaulay2.

## Getting Started
0. Install Docker and start the daemon.

1. Compile Macaulay2 in a container:
```
make build
```

After the build is complete, rpm packages will be available in `M2/BUILD/build-docker`.

2. Run Macaulay2:
```
make run
```

By default, the above targets are run on Rocky Linux 9. To switch to AlmaLinux, add `DISTRIBUTION=almalinux`. To switch to an RHEL 8-compatible release, add `RELEASE=8`.
Loading

0 comments on commit 06b4341

Please sign in to comment.