sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.38k stars 469 forks source link

Update instructions for conda to use miniforge #30883

Closed isuruf closed 3 years ago

isuruf commented 3 years ago

Recommend Miniforge for installing Sage: works on more platforms than Miniconda and Anaconda and uses conda-forge by default.

CC: @mkoeppe @dimpase @saraedum @slel

Component: documentation

Keywords: conda

Author: Isuru Fernando, Samuel Lelièvre

Branch/Commit: 485eb7e

Reviewer: Dima Pasechnik, Isuru Fernando

Issue created by migration from https://trac.sagemath.org/ticket/30883

dimpase commented 3 years ago
comment:2

by the way, is there a way to install optional Sage packages, such as gap_packages ?

isuruf commented 3 years ago
comment:3

Not all optional packages are there, but you can use conda install gap to install all gap packages. conda install sage comes with only gap-defaults which is the standard set of packages that sage require.

dimpase commented 3 years ago
comment:4

It installs, but is somewhat broken:

Confirm changes: [Y/n] 
Finished e-antic                              (00m:00s)             117 KB    253 KB/s
Finished libsemigroups                        (00m:00s)               2 MB      2 MB/s
Finished normaliz                             (00m:01s)               4 MB      3 MB/s
Finished gap                                  (01m:06s)             191 MB      9 MB/s
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(sage) dima@x86_64-apple-darwin13 ~ % sage --gap
 ┌───────┐   GAP 4.10.2 of 19-Jun-2019
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: 64
 Configuration:  gmp 6.2.0, readline
 Loading the library and packages ...
 Packages:   AClib 1.3.1, Alnuth 3.1.1, AtlasRep 2.1.0, AutoDoc 2019.05.20, AutPGrp 1.10, Browse 1.8.8, Carat 2.2.3, CRISP 1.4.4, Cryst 4.1.19, CrystCat 1.1.9, CTblLib 1.2.2, FactInt 1.6.2, FGA 1.4.0, 
             Forms 1.2.5, GAPDoc 1.6.2, genss 1.6.5, IO 4.6.0, IRREDSOL 1.4, LAGUNA 3.9.3, orb 4.8.2, Polenta 1.3.8, Polycyclic 2.14, PrimGrp 3.3.2, RadiRoot 2.8, recog 1.3.2, ResClasses 4.7.2, 
             SmallGrp 1.3, Sophus 1.24, SpinSym 1.5.1, TomLib 1.2.8, TransGrp 2.0.4, utils 0.63
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'
gap> LoadPackage("semigroups");
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading  GRAPE 4.8.2 (GRaph Algorithms using PErmutation groups)
by Leonard H. Soicher (http://www.maths.qmul.ac.uk/~lsoicher/).
Homepage: https://gap-packages.github.io/grape
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading  Digraphs 0.15.2 (Digraphs - Methods for digraphs)
by Jan De Beule (http://homepages.vub.ac.be/~jdbeule/),
   Julius Jonusas (http://www-groups.mcs.st-andrews.ac.uk/~julius/),
   James Mitchell (http://goo.gl/ZtViV6),
   Michael Torpey (http://www-groups.mcs.st-andrews.ac.uk/~mct25/), and
   Wilf Wilson (http://wilf.me).
Homepage: https://gap-packages.github.io/Digraphs
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#W dlopen() error: dlopen(/Users/dima/opt/miniconda3/envs/sage/share/gap/pkg/semigroups-3.1.3/bin/64/semigroups.so, 9): Library not loaded: /usr/local/miniconda/conda-bld/gap-split_1565064241547/work/pk\
g/semigroups-3.1.3/libsemigroups/../bin/lib/libsemigroups.0.dylib
  Referenced from: /Users/dima/opt/miniconda3/envs/sage/share/gap/pkg/semigroups-3.1.3/bin/64/semigroups.so
  Reason: image not found
Error, module '/Users/dima/opt/miniconda3/envs/sage/share/gap/pkg/semigroups-3.1.3/bin/64/semigroups.so' not found in
  if not LOAD_DYN( arg[1], false ) then
    Error( "no support for dynamic loading" );
fi; at /Users/dima/opt/miniconda3/envs/sage/share/gap/lib/files.gd:583 called from 
<function "LoadDynamicModule">( <arguments> )
 called from read-eval loop at /Users/dima/opt/miniconda3/envs/sage/share/gap/pkg/semigroups-3.1.3/init.g:26
Error, was not in any namespace at /Users/dima/opt/miniconda3/envs/sage/share/gap/lib/variable.g:291 called from
LEAVE_NAMESPACE(  ); at /Users/dima/opt/miniconda3/envs/sage/share/gap/lib/package.gi:1253 called from
ReadPackage( pkgname, "init.g" ); at /Users/dima/opt/miniconda3/envs/sage/share/gap/lib/package.gi:1616 called from
<function "LoadPackage">( <arguments> )
 called from read-eval loop at *stdin*:1
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> 

The dylib in question has ended up here:

~/opt/miniconda3/pkgs/gap-4.10.2-he9bb3db_4/share/gap/pkg/semigroups-3.1.3/bin/64/semigroups.so
~/opt/miniconda3/envs/sage/share/gap/pkg/semigroups-3.1.3/bin/64/semigroups.so
~/opt/miniconda3/pkgs/libsemigroups-0.6.7-h6de7cb9_0/lib/libsemigroups.0.dylib
~/opt/miniconda3/envs/sage/lib/libsemigroups.0.dylib
isuruf commented 3 years ago
comment:5

This was fixed with gap 4.11, but sage 9.2 requires gap 4.10

isuruf commented 3 years ago
comment:6

Can you try install_name_tool -change /usr/local/miniconda/conda-bld/gap-split_1565064241547/work/pkg/semigroups-3.1.3/libsemigroups/../bin/lib/libsemigroups.0.dylib /Users/dima/opt/miniconda3/pkgs/libsemigroups-0.6.7-h6de7cb9_0/lib/libsemigroups.0.dylib /Users/dima/opt/miniconda3/envs/sage/share/gap/pkg/semigroups-3.1.3/bin/64/semigroups.so

dimpase commented 3 years ago
comment:7

Replying to @isuruf:

Can you try install_name_tool -change /usr/local/miniconda/conda-bld/gap-split_1565064241547/work/pkg/semigroups-3.1.3/libsemigroups/../bin/lib/libsemigroups.0.dylib /Users/dima/opt/miniconda3/pkgs/libsemigroups-0.6.7-h6de7cb9_0/lib/libsemigroups.0.dylib /Users/dima/opt/miniconda3/envs/sage/share/gap/pkg/semigroups-3.1.3/bin/64/semigroups.so

this fixes the problem, thanks

dimpase commented 3 years ago
comment:8

Replying to @isuruf:

This was fixed with gap 4.11, but sage 9.2 requires gap 4.10

you have my blessings to update conda to use gap 4.11. #29314 should have been merged ages ago. :-)

dimpase commented 3 years ago
comment:9

By the way, I also tried Conda's GAP outside of Sage, which happens to be version 4.11, but it is a bit broken:

% gap
 ┌───────┐   GAP 4.11.0 of 29-Feb-2020
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: 64
 Configuration:  gmp 6.2.0, GASMAN, readline
 Loading the library and packages ...
#W dlopen() error: dlopen(/Users/dima/opt/miniconda3/share/gap/pkg/Browse/bin/64/ncurses.so, 9): Library not loaded: @rpath/libpanel.6.dylib
  Referenced from: /Users/dima/opt/miniconda3/share/gap/pkg/Browse/bin/64/ncurses.so
  Reason: image not found
Error, module '/Users/dima/opt/miniconda3/share/gap/pkg/Browse/bin/64/ncurses.so' not found in
  LOAD_DYN( arg[1], false ) at /Users/dima/opt/miniconda3/share/gap/lib/files.gd:587 called from 
<function "LoadDynamicModule">( <arguments> )
 called from read-eval loop at /Users/dima/opt/miniconda3/share/gap/pkg/Browse/init.g:34
Error, was not in any namespace at /Users/dima/opt/miniconda3/share/gap/lib/variable.g:292 called from
LEAVE_NAMESPACE(  ); at /Users/dima/opt/miniconda3/share/gap/lib/package.gi:1303 called from
ReadPackage( pkgname, "init.g" ); at /Users/dima/opt/miniconda3/share/gap/lib/package.gi:1670 called from
LoadPackage( name, false ) at /Users/dima/opt/miniconda3/share/gap/lib/package.gi:1980 called from
func(  ); at /Users/dima/opt/miniconda3/share/gap/lib/system.g:220 called from
<function "CallAndInstallPostRestore">( <arguments> )
 called from read-eval loop at /Users/dima/opt/miniconda3/share/gap/lib/init.g:733
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> 
dimpase commented 3 years ago

Reviewer: Dima Pasechnik

dimpase commented 3 years ago
comment:10

the branch itself is good to go.

isuruf commented 3 years ago
comment:11

Thanks. Can you open an issue at https://github.com/conda-forge/gap-feedstock/ about gap 4.11?

dimpase commented 3 years ago
comment:12

Replying to @isuruf:

Thanks. Can you open an issue at https://github.com/conda-forge/gap-feedstock/ about gap 4.11?

done: https://github.com/conda-forge/gap-feedstock/issues/41

slel commented 3 years ago
comment:13

How about rewriting the whole section as follows, either here or on a follow-up ticket.

SageMath can be installed via Conda from the
`conda-forge <https://conda-forge.org>`_ conda channel.

This works on Linux and macOS on ``x86_64`` processors,
and on Linux on ``aarch64`` processors (using Miniforge).

This requires a working Conda installation: either Miniforge, Miniconda
or Anaconda. If you don't have one yet, we recommend installing
`Miniforge <https://github.com/conda-forge/miniforge#miniforge3>`_.

Miniforge uses conda-forge as the default channel. If you are
using Miniconda or Anaconda, set it up to use conda-forge:

* Add the conda-forge channel: ``conda config --add channels conda-forge``
* Change channel priority to strict: ``conda config --set channel_priority strict``

Optionally, use `mamba <https://github.com/mamba-org/mamba>`_
which uses a faster dependency solver than `conda`.

.. code-block:: shell

    conda install mamba

Create a new conda environment containing SageMath, either with ``mamba`` or ``conda``:

.. code-block:: shell

    mamba create -n sage sage python=X
    conda create -n sage sage python=X

where ``X`` is version of Python, e.g. ``3.8``.

To use Sage from there,

* Enter the new environment: ``conda activate sage``
* Start SageMath: ``sage``
slel commented 3 years ago

Changed keywords from none to conda

slel commented 3 years ago

Description changed:

--- 
+++ 
@@ -1 +1,2 @@
-
+Recommend Miniforge for installing Sage: works on more platforms
+than Miniconda and Anaconda and uses conda-forge by default.
slel commented 3 years ago
comment:14

And should we add something like the following?

To do Sage development using Conda, see
`https://wiki.sagemath.org/Conda`_.
dimpase commented 3 years ago
comment:15

well, update this branch, I'll be happy to review it

slel commented 3 years ago

Changed branch from u/isuruf/miniforge to u/slelievre/30883

slel commented 3 years ago

Changed commit from d1a865b to 6577ec2

slel commented 3 years ago

New commits:

6577ec230883: Recommend miniforge in conda install instructions
dimpase commented 3 years ago
comment:17

why is the last URL in the new commit not "hidden"?

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 6577ec2 to 485eb7e

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

485eb7e30883: hypertext link to Sage wiki Conda page
slel commented 3 years ago
comment:19

Better?

isuruf commented 3 years ago

Changed author from Isuru Fernando to Isuru Fernando, Samuel Lelièvre

isuruf commented 3 years ago

Changed reviewer from Dima Pasechnik to Dima Pasechnik, Isuru Fernando

vbraun commented 3 years ago

Changed branch from u/slelievre/30883 to 485eb7e