Skip to content

Commit

Permalink
arguments for installing up-to-date Macaulay2, sage
Browse files Browse the repository at this point in the history
  • Loading branch information
natemacfadden committed Mar 11, 2024
1 parent 4af7f68 commit 1febff5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,25 @@ ARG ALLOW_ROOT_ARG
ARG PORT_ARG
ENV ALLOW_ROOT=$ALLOW_ROOT_ARG
ENV PORT=$PORT_ARG

# Arguments for optinal packages
ARG OPTIONAL_PKGS=0
ARG INSTALL_M2=0
ARG INSTALL_SAGE=0

# Use noninteractive to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Add Macaulay2 repo
# (MUST BE DONE BEFORE Python 3.11)
RUN if [ "$INSTALL_M2" = "1" ]; then \
apt-get update; \
apt-get install -y --no-install-recommends gpg-agent; \
apt-get install -y --no-install-recommends software-properties-common apt-transport-https; \
add-apt-repository ppa:macaulay2/macaulay2; \
apt-get update && apt-get clean; \
fi

# Install Python 3.11
RUN apt-get update && \
apt-get install -y software-properties-common && \
Expand Down Expand Up @@ -44,6 +58,17 @@ RUN apt-get -yqq install autoconf build-essential nano cmake libgmp-dev libcgal-
libc6 libcdd0d libgmp10 libgmpxx4ldbl libstdc++6 palp\
libflint-dev libflint-arb-dev curl\
wget libmath-libm-perl normaliz libqsopt-ex2
RUN apt-get -yqq install nodejs

# Install Macaulay2 (optional)
RUN if [ "$INSTALL_M2" = "1" ]; then \
apt-get -yqq install macaulay2; \
fi

# Install Sage (optional)
RUN if [ "$INSTALL_SAGE" = "1" ]; then \
apt-get -yqq install sagemath; \
fi

# Make a soft link to the arb library and flint headers so that python-flint can install
RUN ln -s /usr/lib/${AARCH}-linux-gnu/libflint-arb.so /usr/lib/${AARCH}-linux-gnu/libarb.so
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ USERID_N := $(shell id -u -n)
# Option to install additional packages, set to 0/false by default
OPTIONAL_PKGS ?= 0

# Option to install Macaulay2
INSTALL_M2 ?= 0

# Option to install Sage
INSTALL_SAGE ?= 0

# Default build type is set to 'build'
BUILD_TYPE := build

Expand Down Expand Up @@ -50,6 +56,8 @@ build-common:
--build-arg VIRTUAL_ENV=/home/cytools/cytools-venv/ \
--build-arg ALLOW_ROOT_ARG=" " \
--build-arg OPTIONAL_PKGS=$(OPTIONAL_PKGS) \
--build-arg INSTALL_M2=$(INSTALL_M2) \
--build-arg INSTALL_SAGE=$(INSTALL_SAGE) \
--build-arg PORT_ARG=$$(( $(USERID) + 2875 )) .; } > build.log
@echo "Successfully built CYTools image for user $(USERID_N)"

Expand Down Expand Up @@ -85,6 +93,8 @@ build-with-root-user:
--build-arg VIRTUAL_ENV=/opt/cytools/cytools-venv/ \
--build-arg ALLOW_ROOT_ARG="--allow-root" \
--build-arg OPTIONAL_PKGS=$(OPTIONAL_PKGS) \
--build-arg INSTALL_M2=$(INSTALL_M2) \
--build-arg INSTALL_SAGE=$(INSTALL_SAGE) \
--build-arg PORT_ARG=2875 .; } > build.log
@echo "Successfully built CYTools image with root user."

Expand Down

0 comments on commit 1febff5

Please sign in to comment.