Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/README.txt
8814 views
1
Sage: Open Source Mathematical Software
2
3
"Creating a Viable Open Source Alternative to
4
Magma, Maple, Mathematica, and MATLAB"
5
6
Copyright (C) 2005-2012 William Stein and the Sage Development Team
7
8
http://www.sagemath.org
9
10
Over 200 people have contributed code to Sage. Please see the
11
following web page for a list:
12
13
http://www.sagemath.org/development-map.html
14
15
In many cases, documentation for modules and functions list the
16
authors.
17
18
19
GETTING STARTED
20
---------------
21
22
This README.txt contains build instructions for Sage. If you downloaded
23
a binary, you do not need to do anything; just execute:
24
25
./sage
26
27
from the command line. If you downloaded the sources, please read below
28
on how to build Sage and work around common issues.
29
30
If you have questions or encounter problems, please do not hesitate
31
to email the sage-support mailing list:
32
33
http://groups.google.com/group/sage-support
34
35
36
SUPPORTED PLATFORMS
37
-------------------
38
39
Sage fully supports several Linux distributions, recent versions of
40
Mac OS X, as well as a number of Solaris and OpenSolaris releases.
41
42
There should be no serious bugs in an officially released version of
43
Sage on any of the fully supported platforms, but any major issues with
44
a particular release will be documented on an errata page:
45
46
http://wiki.sagemath.org/errata
47
48
Ports are in progress to some other, less common platforms. The list of
49
supported platforms and their current statuses are given at the
50
following web page:
51
52
http://wiki.sagemath.org/SupportedPlatforms
53
54
If you are interested in helping port Sage to a new platform, please let
55
us know at the sage-devel mailing list:
56
57
http://groups.google.com/group/sage-devel
58
59
60
QUICK INSTRUCTIONS TO BUILD FROM SOURCE
61
---------------------------------------
62
63
The following steps briefly outline the process of building Sage from
64
source. More detailed instructions, including how to build faster on
65
multicore machines are contained later in this README and in the
66
Installation Guide:
67
68
http://www.sagemath.org/doc/installation
69
70
1. Make sure you have the dependencies and 3 GB of free disk space.
71
72
Linux: gcc, make, m4, perl, ranlib, and tar.
73
(install these using your package manager)
74
On recent Debian or Ubuntu systems (in particular Ubuntu 12.04
75
"Precise"), you need the dpkg-dev package.
76
77
OS X: Xcode. Make sure you have installed the most recent version
78
of Xcode. With recent versions of OS X (OS X Lion or later), you
79
can install Xcode for free from the App Store. For pre-Lion
80
versions of OS X, you can download Xcode from
81
http://developer.apple.com/downloads/.
82
83
With OS X, you also need to install the "command line tools". When
84
using OS X Mavericks, after installing Xcode, run this command from
85
a terminal window:
86
87
xcode-select --install
88
89
Then click "Install" in the pop-up window.
90
91
When using OS X Mountain Lion or earlier, you need to install the
92
command line tools from Xcode: run Xcode; then from the File
93
menu, choose "Preferences", then the "Downloads" tab, and then
94
"Install" the Command Line Tools.
95
96
Other platforms: See detailed instructions below.
97
98
2. Extract the tarball:
99
100
tar xvf sage-*.tar
101
102
3. cd into the Sage directory and type make:
103
104
cd sage-*/
105
make
106
107
That's it! Everything is automatic and non-interactive. The build
108
should work fine on all fully supported platforms. If it does not, we
109
want to know!
110
111
112
ENVIRONMENT VARIABLES
113
---------------------
114
115
There are a lot of environment variables which control the install
116
process of Sage, see:
117
118
http://sagemath.org/doc/installation/source.html#environment-variables
119
120
121
SELINUX
122
--------
123
124
On Linux, if you get this error message:
125
126
Error: cannot restore segment prot after reloc: Permission denied
127
128
the problem is probably related to SELinux. See the following URL for
129
further information:
130
131
http://www.exelisvis.com/Support/HelpArticleDetail/ArticleId/3092.aspx
132
133
134
IMPLEMENTATION
135
--------------
136
137
Sage has significant components written in the following languages:
138
C/C++, Python, Cython, Lisp, and Fortran. Lisp (ECL), Python, and Cython
139
are built as part of Sage and a GNU Fortran (gfortran) binary is
140
included (OS X only), so you do not need them in order to build Sage.
141
142
143
MORE DETAILED INSTRUCTIONS TO BUILD FROM SOURCE
144
-----------------------------------------------
145
146
1. Make sure you have about 3 GB of free disk space.
147
148
2. Install build dependencies.
149
150
Linux: See quick instructions above.
151
152
OS X: Make sure you have XCode version >= 2.4, i.e. "gcc -v" should
153
output build >= 5363. If you don't, go to:
154
155
http://developer.apple.com/
156
157
sign up, and download the free XCode package. Only OS X >= 10.4 is
158
supported.
159
160
Solaris and OpenSolaris: Building Sage on these platforms is more
161
tricky than on Linux or OS X. For details on how to build Sage on
162
these platforms, see:
163
164
http://wiki.sagemath.org/solaris
165
166
Windows: Not supported. A solution is to download and install
167
VirtualBox, install Linux into it, etc.
168
169
NOTE: On some operating systems, it might be necessary to install
170
gas/as, gld/ld, gnm/nm. On most platforms, these are automatically
171
installed when you install the programs listed above.
172
173
3. Extract the Sage source tarball and cd into a directory with no
174
spaces in it. If you have a machine with 4 processors, say, type
175
the following to configure the build script to perform a parallel
176
compilation of Sage using 4 jobs:
177
178
export MAKE="make -j4"
179
180
(With 4 processors, you might also consider "-j5" or "-j6" --
181
building with more jobs than CPU cores can speed things up.)
182
You might in addition pass a "-l" flag to "make": this
183
sets a load limit, so for example if you execute
184
185
export MAKE="make -j4 -l5.5"
186
187
then "make" won't start more than one job at a time if the system
188
load average is above 5.5. See
189
http://www.gnu.org/software/make/manual/make.html#Options-Summary
190
and http://www.gnu.org/software/make/manual/make.html#Parallel.
191
192
If you want to run the test suite for each individual spkg as it is
193
installed, type:
194
195
export SAGE_CHECK="yes"
196
197
before starting the Sage build. This will run each test suite and
198
will raise an error if any failures occur. Python's test suite has
199
been disabled by default, because it causes failures on most
200
systems. To renable the Python testsuite, set the environment
201
variable SAGE_CHECK_PACKAGES to "python".
202
203
To start the build, type:
204
205
make
206
207
4. Wait about 1 hour to 14 days, depending on your computer (it took
208
about 2 weeks to build Sage on the T-Mobile G1 Android cell phone).
209
210
5. Type "./sage" to try it out.
211
212
6. OPTIONAL: Start Sage and run the command
213
214
install_scripts("/usr/local/bin/") # change /usr/local/bin/
215
216
Type "install_scripts?" in Sage for more details about what this
217
command does.
218
219
7. OPTIONAL: Type "make ptest" to test all examples in the documentation
220
(over 93,000 lines of input!) -- this takes from 30 minutes to
221
several hours. Don't get too disturbed if there are 2 to 3 failures,
222
but always feel free to email the section of logs/ptest.log that
223
contains errors to the sage-support mailing list. If there are
224
numerous failures, there was a serious problem with your build.
225
226
8. OPTIONAL: If you want to (try to) build the documentation, run:
227
228
sage --docbuild --help
229
230
for instructions. The HTML version of the documentation is built
231
during the compilation process of Sage and resides in the directory:
232
233
$SAGE_ROOT/devel/sage/doc/output/html/
234
235
LaTeX is required to build the PDF version of the documentation.
236
237
9. OPTIONAL: It is highly recommended that you install the optional GAP
238
database by typing:
239
240
./sage --optional
241
242
then installing (with "./sage -i") the package whose name begins with
243
database_gap. This will download the package from
244
sage.math.washington.edu and install it. While you're at it, you
245
might install other databases of interest to you.
246
247
10. OPTIONAL: It is recommended that you have both LaTeX and the
248
ImageMagick tools (e.g. the "convert" command) installed since some
249
plotting functionality benefits from it.
250
251
11. OPTIONAL: Read this if you are intending to run a Sage notebook
252
server for multiple users. For security (i.e., to run
253
"notebook(secure=True)") you may wish users to access the server
254
using the HTTPS protocol. You also may want to use OpenID for user
255
authentication. The first of these requires you to install
256
pyOpenSSL, and they both require OpenSSL. If you have OpenSSL and
257
the OpenSSL development headers installed on your system, you can
258
install pyOpenSSL by building Sage and then typing
259
260
./sage -i pyopenssl
261
262
Note that this command requires internet access. Alternatively,
263
"make ssl" builds Sage and installs pyOpenSSL. If you are missing
264
either OpenSSL or OpenSSL's development headers, you can install a
265
local copy of both into your Sage installation first. Ideally,
266
this should be done before installing Sage; otherwise, you should
267
at least rebuild Sage's Python, and ideally any part of Sage
268
relying on it. So the procedure is as follows (again, with a
269
computer connected to the internet). Starting from a fresh Sage
270
tarball:
271
272
./sage -i patch
273
./sage -i openssl
274
make ssl
275
276
Alternatively, if you've already built Sage:
277
278
./sage -i openssl
279
./sage -f python # rebuilds Python
280
SAGE_UPGRADING=yes make ssl
281
282
The third line will rebuild all parts of Sage that depend on
283
Python; this can take a while.
284
285
PROBLEMS
286
--------
287
288
If you have problems building Sage, check the Sage Installation Guide,
289
and also note the following. Each separate component of Sage is
290
contained in an spkg; these are stored in spkg/standard/. As each one
291
is built, a build log is stored in logs/pkgs/, so you can browse these
292
to find error messages. If an spkg fails to build, the whole build
293
process will stop soon after, so check the most recent log files
294
first, or run
295
296
grep -li "^Error" logs/pkgs/*
297
298
from the top-level Sage directory to find log files with error
299
messages in them. Send (a small part of) the relevant log file to the
300
sage-devel mailing list, making sure to include at least some of the
301
error messages; probably someone there will have some helpful
302
suggestions.
303
304
305
SUPPORTED COMPILERS
306
-------------------
307
308
Sage includes a GCC (GNU Compiler Collection) package. In order to
309
build Sage, you need a C compiler which can build GCC and its
310
prerequisites. gcc version 4.0.1 or later should probably work. On
311
Solaris or OpenSolaris, building with the Sun compiler should also work.
312
313
The GCC package in Sage is not always installed. It is determined
314
automatically whether it needs to be installed. You can override this
315
by setting the environment variable SAGE_INSTALL_GCC=yes (to force
316
installation of GCC) or SAGE_INSTALL_GCC=no (to disable installation of
317
GCC). If you don't want to install GCC, you need to have recent
318
versions of gcc, g++ and gfortran; moreover, the versions must be equal.
319
320
There are some known problems with old assemblers, in particular when
321
building the ECM package. You should ensure that your assembler
322
understands all instructions for your processor. On Linux, this means
323
you need a recent version of binutils; on OS X you need a recent version
324
of XCode.
325
326
327
RELOCATION
328
----------
329
330
You *should* be able to move the sage-x.y.z/ directory anywhere you
331
want. If you copy the sage script or make a symbolic link to it, you
332
should modify the script to reflect this (as instructed at the top of
333
the script). It is best if the path to Sage does not have any spaces in
334
it.
335
336
For a system-wide installation, as root you can move the sage-x.y.z/
337
directory to a system-wide directory. Afterwards, you need to start up
338
Sage as root at least once prior to using the system-wide Sage as a
339
normal user. See the Installation Guide for further information on
340
performing a system-wide installation:
341
342
http://www.sagemath.org/doc/installation/source.html#installation-in-a-multiuser-environment
343
344
If you find anything that doesn't work correctly after you moved the
345
directory, please email the sage-support mailing list.
346
347
348
REDISTRIBUTION
349
--------------
350
351
Your local Sage install is almost exactly the same as any "developer"
352
install. You can make changes to documentation, source, etc., and very
353
easily package the complete results up for redistribution just like we
354
do.
355
356
1. To make your own source tarball (sage-x.y.z.tar) of Sage, type:
357
358
sage --sdist x.y.z
359
360
where the version is whatever you want.
361
362
2. To make a binary distribution with your currently installed packages,
363
type:
364
365
sage --bdist x.y.z
366
367
3. To make a binary that will run on the widest range of target
368
machines, set the SAGE_FAT_BINARY environment variable to "yes"
369
before building Sage:
370
371
export SAGE_FAT_BINARY="yes"
372
make
373
./sage --bdist x.y.z-fat
374
375
In all cases, the result is placed in the directory "$SAGE_ROOT/dist/".
376
377
378
CHANGES TO INCLUDED SOFTWARE
379
----------------------------
380
381
All software included with Sage is copyrighted by the respective authors
382
and released under an open source license that is "GPL version 3 or
383
later" compatible. See the file COPYING.txt for more details.
384
385
Almost every spkg in $SAGE_ROOT/spkg/standard/ is a bzip2-compressed
386
tarball (currently, the only exception is the bzip2 spkg itself, which
387
is gzip-compressed). You can extract it with:
388
389
tar xvf name-*.spkg
390
391
Inside the spkg, there is a file SPKG.txt that details all changes made
392
to the given package for inclusion with Sage. The inclusion of such a
393
file detailing changes is specifically required by some of the packages
394
included with Sage (e.g. for GAP).
395
396