注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "SageMath"

From Funtoo
Jump to navigation Jump to search
m (horizontal alignment to wrap text around thumbnail)
(alternative instructions for science and sage-on-gentoo without needing layman)
Line 4: Line 4:


== Installation ==
== Installation ==
There are two overlays that are needed to get Sage installed. The science-overlay and the sage-on-gentoo-overlay.
SageMath ebuilds are not present in the Funtoo portage tree. Instead these are available through separate overlays (repositories). To install SageMath on Funtoo Linux the overlay '''sage-on-gentoo''' is required, together with dependencies found in the overlay '''science'''. Gentoo users will be familiar with the science overlay from Gentoo's Science Project (https://wiki.gentoo.org/wiki/Project:Science).


=== Install and configure layman and overlays ===
=== Install Required Overlays ===
====Using layman====
====Using layman====
The preferred way of getting sage-on-gentoo is layman. Make sure layman is installed with USE=git and correctly configured. You may find a guide for layman at: http://www.gentoo.org/proj/en/overlays/userguide.xml
The easiest (fastest) method of installing the required overlays is via the package layman ({{package|app-portage/layman}}). Make sure layman is installed with USE=git and correctly configured. You may find a guide for layman at: http://www.gentoo.org/proj/en/overlays/userguide.xml
 
Update your layman list:
Update your layman list:
{{console|body=
{{console|body=
Line 14: Line 15:
}}
}}


This overlay depends on science overlay. You will also need to add it, if not already installed:
Add the two overlays to Funtoo. Firstly is the science overlay (if not already installed):
{{console|body=
{{console|body=
###i## layman -a science
###i## layman -a science
}}
}}


Finally, add this overlay:
Finally, add the SageMath overlay:
{{console|body=
{{console|body=
###i## layman -a sage-on-gentoo
###i## layman -a sage-on-gentoo
}}
}}
====(Alternative) Using Portage Repositories====
Users may add the '''science''' and '''sage-on-gentoo''' overlays as ''repositories'' in portage without the need for layman. Both overlays are available via https://github.com and portage is able to sync with them.
If not already present, first create a location for portage to store a local clone of the overlays.
{{console|body=
###i## mkdir /path/to/local-repos
}}
Before configuring portage we will manually clone the two repositories into this local folder using {{Package|dev-vcs/git}}. Starting with '''science''' for SageMath dependencies
{{console|body=
###i## cd /path/to/local-repos
###i## git clone https://github.com/gentoo-science/sci.git science
}}
and then '''sage-on-gentoo''' for the actual SageMath ebuilds
{{console|body=
###i## git clone https://github.com/cschwan/sage-on-gentoo.git
}}
The final step is to configure portage to be able to use these additional repositories. This is achieved by adding appropriate configuration settings to files saved within {{f|/etc/portage/repos.conf/}}. (More information on repositories can be found by reading {{c|man portage}}).
Using your favorite text editor, create and save the following file in {{f|/etc/portage/repos.conf/}} for the '''science''' repository.
{{file|name=/etc/portage/repos.conf/science.conf|body=
[science]
priority = 50
location = /path/to/local-repos/science
sync-type = git
sync-uri = https://github.com/gentoo-science/sci.git
auto-sync = Yes
}}
Now repeat the previous step for a second file in {{f|/etc/portage/repos.conf/}} corresponding to the '''sage-on-gentoo''' repository.
{{file|name=/etc/portage/repos.conf/sage.conf|body=
[sage-on-gentoo]
priority = 50
location = /path/to/local-repos/sage-on-gentoo
sync-type = git
sync-uri = https://github.com/cschwan/sage-on-gentoo.git
auto-sync = Yes
}}
If these previous steps are successful, portage will be able to access and update ebuilds within these two repositories. Initiate these repositories by simply running
{{console|body=
###i## emerge --sync
}}
====Ebuilds unmask====  
====Ebuilds unmask====  
Before being able to install you may need to unmask the required ebuilds. You can use already-made files, shipped with overlay, such as:
Before being able to install you may need to unmask the required ebuilds. You can use already-made files, shipped with overlay, such as:

Revision as of 05:40, March 21, 2017

SageMath is mathematical software with features covering many aspects of mathematics, including algebra, combinatorics, numerical mathematics, number theory, and calculus.

Screenshot from SageMath

Installation

SageMath ebuilds are not present in the Funtoo portage tree. Instead these are available through separate overlays (repositories). To install SageMath on Funtoo Linux the overlay sage-on-gentoo is required, together with dependencies found in the overlay science. Gentoo users will be familiar with the science overlay from Gentoo's Science Project (https://wiki.gentoo.org/wiki/Project:Science).

Install Required Overlays

Using layman

The easiest (fastest) method of installing the required overlays is via the package layman (app-portage/layman). Make sure layman is installed with USE=git and correctly configured. You may find a guide for layman at: http://www.gentoo.org/proj/en/overlays/userguide.xml

Update your layman list:

root # layman -L

Add the two overlays to Funtoo. Firstly is the science overlay (if not already installed):

root # layman -a science

Finally, add the SageMath overlay:

root # layman -a sage-on-gentoo

(Alternative) Using Portage Repositories

Users may add the science and sage-on-gentoo overlays as repositories in portage without the need for layman. Both overlays are available via https://github.com and portage is able to sync with them.

If not already present, first create a location for portage to store a local clone of the overlays.

root # mkdir /path/to/local-repos

Before configuring portage we will manually clone the two repositories into this local folder using dev-vcs/git. Starting with science for SageMath dependencies

root # cd /path/to/local-repos
root # git clone https://github.com/gentoo-science/sci.git science

and then sage-on-gentoo for the actual SageMath ebuilds

root # git clone https://github.com/cschwan/sage-on-gentoo.git

The final step is to configure portage to be able to use these additional repositories. This is achieved by adding appropriate configuration settings to files saved within /etc/portage/repos.conf/. (More information on repositories can be found by reading man portage).

Using your favorite text editor, create and save the following file in /etc/portage/repos.conf/ for the science repository.

   /etc/portage/repos.conf/science.conf
[science]
priority = 50
location = /path/to/local-repos/science
sync-type = git
sync-uri = https://github.com/gentoo-science/sci.git
auto-sync = Yes

Now repeat the previous step for a second file in /etc/portage/repos.conf/ corresponding to the sage-on-gentoo repository.

   /etc/portage/repos.conf/sage.conf
[sage-on-gentoo]
priority = 50
location = /path/to/local-repos/sage-on-gentoo
sync-type = git
sync-uri = https://github.com/cschwan/sage-on-gentoo.git
auto-sync = Yes

If these previous steps are successful, portage will be able to access and update ebuilds within these two repositories. Initiate these repositories by simply running

root # emerge --sync

Ebuilds unmask

Before being able to install you may need to unmask the required ebuilds. You can use already-made files, shipped with overlay, such as: sage-on-gentoo/package.unmask/sage

To use this file permanently, place symbolic link to this file into your /etc/portage/package.unmask directory as shown below.

Default directory for layman overlays, if not set manually, is /var/lib/layman.

root #   ln -s /var/lib/layman/sage-on-gentoo/package.unmask/sage  /etc/portage/package.unmask/sage

Notice, that in this example, portage's package.unmask is directory , make sure to apply masks entries according to your preferred way of masks handle (directory or a flat file).

Use flags

Since Sage's ebuild requires its dependencies to be built with several USE- flags a standard package.use file is provided as well:

root #   ln -s <path-to-layman>/sage-on-gentoo/package.use/sage /etc/portage/package.use/sage

On a stable build installations you may also need following file:

root #    ln -s <path-to-layman>/sage-on-gentoo/package.use/sage-unstable /etc/portage/package.use/sage-unstable
   Note

With sage 6.8 a 99sage-doc-bin file installed that makes it easy to use pre-built html documentation. This is recommended for ~arch users.

Installing Sage

root # emerge -va sage

Please, note that this will pull in a lot of dependencies. If you can not proceed with this step (because of circular dependencies, missing USE-flags, and so on), report this behavior.