From 1febff5f5b156ea06bda49ea169d50965ff9bb84 Mon Sep 17 00:00:00 2001 From: Nate MacFadden Date: Mon, 11 Mar 2024 18:08:17 -0400 Subject: [PATCH] arguments for installing up-to-date Macaulay2, sage --- Dockerfile | 25 +++++++++++++++++++++++++ Makefile | 10 ++++++++++ 2 files changed, 35 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4711c59..c61829e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \ @@ -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 diff --git a/Makefile b/Makefile index b947932..dbd09ac 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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)" @@ -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."