|
Size: 1810
Comment:
|
Size: 3673
Comment: replace some info with a link to https://trac.sagemath.org/wiki/Distribution
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| [[https://conda.io/docs/|Conda]] packages for Linux & OSX are available through [[https://conda-forge.github.io/|conda-forge]]. | [[https://conda.io/docs/|Conda]] packages for Linux & macOS are available through [[https://conda-forge.github.io/|conda-forge]]. |
| Line 7: | Line 7: |
| In short: Install `sage` from conda-forge. | In short: Install `sage` from [[https://conda-forge.org|conda-forge]]. |
| Line 9: | Line 9: |
| To install sage on your machine (without the need for root permissions): | * Download and install [[https://github.com/conda-forge/miniforge/#mambaforge|Mambaforge]]. i.e., open a Terminal, `curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-\$(uname)-\$(uname -m).sh` |
| Line 11: | Line 13: |
| * Install [[https://conda.io/miniconda.html|Miniconda for Python 3]] * export your `PATH` (and `hash -r` or `rehash`) * Make sure your locale is UTF-8. * Use conda-forge packages: `conda config --add channels conda-forge; conda config --set channel_priority strict` * create an environment for sage: `conda create -n sage sage` * enter your environment: `source activate sage` * enjoy: `sage` |
`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` |
| Line 19: | Line 17: |
| = Maintenance = The packages necessary to run sage are developed on the github pages of conda-forge. The actual [[https://github.com/conda-forge/sage-feedstock/tree/master/recipe|sage package]] and many of its dependencies are maintained by Isuru Fernando (and a few volunteers). |
The above instructions are being added to the Sage documentation in https://trac.sagemath.org/ticket/33655 |
| Line 25: | Line 21: |
| You can develop Sage without building any of its dependencies (experimental). On my machine this takes 5 minutes: | 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]] and are being added to the Sage installation guide in [[https://trac.sagemath.org/ticket/33426|#33426]] |
| Line 28: | Line 24: |
| $ export SAGE_NUM_THREADS=24 $ conda install mamba $ mamba create -n sage-build sage boost-cpp |
$ export SAGE_NUM_THREADS=24 # or whatever the meaningful value # for your machine is - no more than # the number of cores. $ conda install mamba # This is a recommended optional step. # If you skip it, replace "mamba" by # "conda" in the following steps. $ mamba create -n sage-build python=3.9 \ gettext autoconf automake libtool pkg-config # or replace 3.9 by another version |
| Line 32: | Line 36: |
| $ mamba uninstall --force sagelib $ ./configure --prefix=$CONDA_PREFIX $ cd src $ python setup.py install |
$ ./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 --editable pkgs/sage-conf pkgs/sage-setup $ pip install --no-build-isolation -v -v --editable src |
| Line 37: | Line 58: |
| SageMath version 9.2, Release Date: 2020-10-24 | SageMath version 9.6.beta5, Release Date: 2022-03-12 |
| Line 40: | Line 61: |
| = Open Issues = | By using `pip install --editable`, the Sage library is installed in editable mode. This means that when you only edit Python files, there is no need to rebuild the library; it suffices to restart Sage. |
| Line 42: | Line 65: |
| == General == There are still some issues with Conda. Not all tests pass and some things don't work: * #20382 * … |
After editing any Cython files, rebuild by repeating the command {{{ $ pip install --no-build-isolation -v -v --editable src }}} |
| Line 47: | Line 70: |
| == 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. |
= More information = see https://trac.sagemath.org/wiki/Distribution#CondaAnacondaMinicondaCondaForge |
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
- i.e., open a Terminal,
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
The above instructions are being added to the Sage documentation in https://trac.sagemath.org/ticket/33655
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 and are being added to the Sage installation guide in #33426
$ export SAGE_NUM_THREADS=24 # or whatever the meaningful value
# for your machine is - no more than
# the number of cores.
$ conda install mamba # This is a recommended optional step.
# If you skip it, replace "mamba" by
# "conda" in the following steps.
$ mamba create -n sage-build python=3.9 \
gettext autoconf automake libtool pkg-config # or replace 3.9 by another version
$ conda activate 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 --editable pkgs/sage-conf pkgs/sage-setup
$ pip install --no-build-isolation -v -v --editable src
$ sage -c 'print(version())'
SageMath version 9.6.beta5, Release Date: 2022-03-12By using pip install --editable, the Sage library is installed in editable mode. This means that when you only edit Python files, there is no need to rebuild the library; it suffices to restart Sage.
After editing any Cython files, rebuild by repeating the command
$ pip install --no-build-isolation -v -v --editable src
More information
see https://trac.sagemath.org/wiki/Distribution#CondaAnacondaMinicondaCondaForge
