Differences between revisions 27 and 28
Revision 27 as of 2022-02-12 18:17:29
Size: 2439
Editor: mkoeppe
Comment: Remove memory_allocator from pip install, no longer needed
Revision 28 as of 2022-03-21 06:58:35
Size: 3307
Editor: mkoeppe
Comment:
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
You can develop Sage without building any of its dependencies (experimental) --- on my machine this takes 5 minutes. Assume you obtained Sage source tree and changed to its root. You can develop Sage without building any of its dependencies (experimental) --- on my machine this takes 5 minutes. Assume you obtained Sage source tree and changed to its root. These instructions have been updated for [[https://trac.sagemath.org/ticket/30845|#30845]]
Line 26: Line 26:
$ export SAGE_NUM_THREADS=24 # or whatever the meaningful value for you is - no more than the number of cores. $ export SAGE_NUM_THREADS=24                             # or whatever the meaningful value
                                                         #
for your machine is - no more than
                                                         #
the number of cores.
Line 28: Line 30:
$ mamba create -n sage-build python=3.9 gettext autoconf automake libtool pkg-config
$ mamba create -n sage-build python=3.9 \
      gettext autoconf automake libtool pkg-config # or replace 3.9 by another version

$ conda run -n sage-build ./bootstrap # this generates src/environment.yml
                                                         # used in the next step

$ mamba env update -n sage-build -f src/environment.yml # alternatively, use
                                                         # src/environment-optional.yml
                                                         # for some additional packages
Line 30: Line 41:
$ ./bootstrap # this generates src/environment.yml
$ mamba env update -n sage-build -f src/environment.yml
$ conda activate sage-build
$ ./configure --with-python=$CONDA_PREFIX/bin/python --with-system-gcc=force --enable-download-from-upstream-url
$ pip install --no-build-isolation -v -v pkgs/sage-conf pkgs/sage-setup
$ pip install --no-build-isolation -v -v -r src/requirements.txt -e src

$ ./configure --with-python=$CONDA_PREFIX/bin/python \
              --prefix=$CONDA_PREFIX \
              $(for pkg in $(./sage -package list :standard: \
                               --has-file spkg-configure.m4 \
                               --has-file distros/conda.txt); do \
                    echo --with-system-$pkg=force; \
                done)

$ pip install --no-build-isolation -v -v -e pkgs/sage-conf pkgs/sage-setup

$ pip install --no-build-isolation -v -v -e src
Line 37: Line 55:
SageMath version 9.5, Release Date: 2022-01-30 SageMath version 9.6.beta5, Release Date: 2022-03-12

https://conda.io/docs/_images/conda_logo.svg

Conda packages for Linux & macOS are available through conda-forge.

Setting Up

In short: Install sage from conda-forge.

  • Download and install Mambaforge.

    • i.e., open a Terminal,
      • curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-\$(uname)-\$(uname -m).sh

        sh Mambaforge-\$(uname)-\$(uname -m).sh

  • Create a "sage" environment and pick a version of SageMath, i.e., open a new terminal and mamba create -n sage sage=9.3

  • To run SageMath, activate the environment you just created and run SageMath, i.e., source activate sage and sage

Maintenance

The packages necessary to run sage are developed on the github pages of conda-forge. The actual sage package and many of its dependencies are maintained by Isuru Fernando (and a few volunteers).

Conda for Sage Developers

You can develop Sage without building any of its dependencies (experimental) --- on my machine this takes 5 minutes. Assume you obtained Sage source tree and changed to its root. These instructions have been updated for #30845

$ export SAGE_NUM_THREADS=24                             # or whatever the meaningful value
                                                         # for your machine is - no more than 
                                                         # the number of cores.
$ conda install mamba

$ mamba create -n sage-build python=3.9 \
      gettext autoconf automake libtool pkg-config       # or replace 3.9 by another version

$ conda run -n sage-build ./bootstrap                    # this generates src/environment.yml
                                                         # used in the next step

$ mamba env update -n sage-build -f src/environment.yml  # alternatively, use 
                                                         # src/environment-optional.yml 
                                                         # for some additional packages
$ conda activate sage-build

$ ./configure --with-python=$CONDA_PREFIX/bin/python             \
              --prefix=$CONDA_PREFIX                             \
              $(for pkg in $(./sage -package list :standard:     \
                               --has-file spkg-configure.m4      \
                               --has-file distros/conda.txt); do \
                    echo --with-system-$pkg=force;               \
                done)

$ pip install --no-build-isolation -v -v -e pkgs/sage-conf pkgs/sage-setup 

$ pip install --no-build-isolation -v -v -e src

$ sage -c 'print(version())'
SageMath version 9.6.beta5, Release Date: 2022-03-12

Open Issues

General

To check whether there are known issues with Conda:

Windows

There is likely not going to be a working package in the near future, see https://groups.google.com/d/msg/sage-devel/wyaV8x5qolI/jVS4DKBvCAAJ.

Conda (last edited 2022-04-25 21:52:34 by mkoeppe)