Ticket #11081: 11081installfromsource.patch
File 11081installfromsource.patch, 17.3 KB (added by , 10 years ago) 


doc/en/installation/source.rst
# HG changeset patch # User David Kirkby <david.kirkby@onetel.net> # Date 1301407867 3600 # Node ID 9e3f5e6c45b7689c6719c3febd19b68e43c4fcf9 # Parent 4fbd7d43079b02f3dd0a31af6e699c479cd26193 #11081 Update the "Install from Source Code" section of the Sage Installation Guide diff r 4fbd7d43079b r 9e3f5e6c45b7 doc/en/installation/source.rst
a b 5 5 More familiarity with computers may be required to build Sage from 6 6 source. If you do have all the prerequisite tools, the process should 7 7 be completely painless. It would take your computer a while to 8 compile dSage from source, though you don't have to watch. Compiling8 compile Sage from source, though you don't have to watch. Compiling 9 9 Sage from source has the major advantage that you have the latest 10 10 version of Sage with which you can change absolutely any part 11 or the programs on which Sage depends. You can also recompile Sage. 11 or the programs on which Sage depends. Also, some parts of Sage 12 will be optimised for your particular computer, so will run faster 13 than a binary that you have downloaded. You can also recompile Sage. 12 14 13 As of this writing, Sage is known to work on Linux (32bit x86, 64bit 14 x8664, IA64, or 32bit PPC) and OS X (10.4, 10.5, 10.6, PPC or 15 x86, 32bit only). (See http://wiki.sagemath.org/SupportedPlatforms 16 for the latest information.) 17 18 **Solaris? FreeBSD? OS X 10.5 in 64 bit mode?**: Complete compilation 19 of Sage is currently not supported on Solaris or \*BSD. It is 20 possible to compile most of Sage on Solaris machines and to fill in 21 the extra parts using standard packages; please email sagedevel if 22 you desperately need to run Sage on Solaris. We do plan to fully 23 support Solaris  it's a very important platform. Work is ongoing. 24 25 **Sage on FreeBSD**: The binaries can be run with the help of Linux 26 emulation. We are working on a fully native port and the number of 27 issues that need to be fixed are relatively small compared to the 28 other ports. 29 30 We hope to support OS X 10.5 in 64bit mode in our next 31 release. You can find some instructions to build Sage on OS X 10.5 32 in 64bit mode at 33 http://mvngu.wordpress.com/2009/09/02/compilesage41in64bitmodeonosx1058/ 34 15 See http://wiki.sagemath.org/SupportedPlatforms for the list of 16 platforms on which Sage is supported and the level of support 17 for these systems. 35 18 36 19 Assumptions: You have a computer with about 2 GB of free 37 disk space running Linux (32bit or 64bit), Mac OS X 10.4, 10.5, or 38 10.6 with XCode. In particular, under Linux the following standard 20 disk space running one of the supported operating systems listed at 21 http://wiki.sagemath.org/SupportedPlatforms 22 The following standard 39 23 commandline development tools must be installed on your computer 40 24 (under OS X they all come with XCode): 41 25 42 26 :: 43 27 44 gcc 45 g++ 46 gfortran 47 make 28 gcc (Version 4.0.1 or higher) 29 g++ (Version 4.0.1 or higher) 30 gfortran (Version 4.0.1 or higher) 31 make (The GNU version) 48 32 m4 49 perl 33 perl (Version 5.8.0 or higher) 50 34 ranlib 51 tar 52 readline and its development headers 53 sshkeygen  needed to run the notebook in secure mode. 54 latex  highly recommended, though not strictly required 35 tar (The GNU version) 36 sshkeygen (Needed to run the notebook in secure mode) 37 latex (Highly recommended, though not strictly required) 55 38 56 To check if you have ``m4`` installed, for example, type `` whichm4``39 To check if you have ``m4`` installed, for example, type ``command v m4`` 57 40 at a command line. If it gives an error (or returns nothing), then 58 it is not installed. It is highly recommended that you have LaTeX 59 installed, but not required. If you don't have ``sshkeygen`` on your 60 local system, then you cannot run the notebook in secure mode. To 61 run it in insecure mode, run the command ``notebook(secure=False)`` 62 instead of ``notebook()``. 41 either ``m4`` is not installed, or it is installed but not in your PATH 42 (On Solaris, ``m4`` resides in ``/usr/ccs/bin``). 43 It is highly recommended that you have LaTeX 44 installed, but it is not required. If you don't have ``sshkeygen`` on your 45 local system, then you cannot run the notebook in secure mode, which the uses 46 encrypted HTTPS protocol. To run it in secure mode, run the command 47 ``notebook(secure=True)`` 48 instead of ``notebook()``, which uses the HTTP protocol. 63 49 64 50 In OS X, make sure you have XCode version at least 2.4, i.e., ``gcc v`` 65 51 should output build at least 5363. If you don't, go to 66 52 http://developer.apple.com/ sign up, and download the free Xcode 67 package. Only OS X :math:`$\geq 10.4$` is supported. This will give 68 you all of the above commands. 53 package. 69 54 70 55 On a Debianbased system (e.g., Ubuntu), ranlib is in the binutils 71 56 package. On a newly installed Ubuntu system (this was tested on … … 75 60 76 61 sudo aptget install buildessential m4 gfortran 77 62 78 It is recommended that you install the readline package and its79 corresponding development headers. These packages make it easier to80 work with the Sage command line interface by providing text editing81 features at the command line level. On a Debian or Ubuntu system, use82 the following commands to install the readline library and its83 development headers:84 85 ::86 87 sudo aptget install readlinecommon libreadlinedev88 89 63 The LaTeX package and a PDF previewer are optional but they can be 90 64 installed using 91 65 … … 93 67 94 68 sudo aptget install texlive xpdf evince xdvi 95 69 96 (You must have the GNU version of ``make`` installed. 97 For example, Sage won't build on a FreeBSD install that doesn't 98 have the optional GNU version of ``make`` installed as well 99 (and named ``make``).) 70 On other systems it might be necessary to install TeX Live from source code, 71 which is quite easy, though a rather timeconsuming process. 72 73 (You must have the GNU version of ``make`` installed and it must be the first 74 ``make`` in your PATH. On Solaris, a version of GNU ``make`` may be found 75 at ``/usr/sfw/bin/gmake`` but you will need to copy it somewhere else 76 and rename it to ``make``. The same is true for GNU tar  there is a version 77 called ``gtar`` in ``/usr/sfw/bin`` but it will need to be copied somwhere 78 else and renamed to ``tar``. 79 80 For Solaris, it is recommended you create a directory ``$HOME/binsforsage`` and 81 put the GNU versions of ``tar`` and ``make`` in that directory. Then ensure that 82 ``$HOME/binsforsage`` is first in your PATH. That's because Sage also needs 83 ``/usr/ccs/bin`` in your PATH to get programs like ``ar`` and ``ranlib`, 84 but ``/usr/ccs/bin`` has the Sun/Oracle versions of ``make`` and ``tar`` 85 which are unsuitable for buidling Sage. For more information on 86 building Sage on Solaris, see http://wiki.sagemath.org/solaris 100 87 101 88 Although some of Sage is written in Python, you do not need Python 102 89 preinstalled on your computer, since the Sage installation … … 119 106 and installed Sage first anyway, all is not lost. 120 107 Just issue the command:: 121 108 122 sage f python2.5.2.p8# or the latest version available109 sage f python2.6.4.p9 # or the latest version available 123 110 124 111 after installing the Tcl/Tk development libraries as above. 125 112 If … … 133 120 134 121 does not raise an ``ImportError`` then it worked. 135 122 136  Sage is currently being developed using GCC version 4.3.x, and137 is likely to compile fine with other GCC versions in the 4.x138 series. It does not work with older GCC releases. If you are139 interested in working on support for Intel or Sun's CC compiler,123  Sage developers tend to use fairly recent versions of gcc, but 124 Sage should compile with any gcc of at least version 4.0.1 125 If you are interested in working on support for compilers 126 from HP, IBM, Intel, Sun/Oracle etc, 140 127 please email the sagedevel mailing list, otherwise known as the 141 128 sagedevel Google group at 142 129 http://groups.google.com/group/sagedevel 143 130 144  One reason ``perl`` is required is thatboth the NTL and PARI145 configuration scripts are written in Perl. 131  ``perl`` is required because both the NTL and PARI 132 configuration scripts are written in Perl. R also needs perl. 146 133 147 134 148 135 … … 170 157 On Linux and Solaris systems, a working Fortran compiler is required 171 158 for building Sage from source. If you are using Fortran on a platform 172 159 for which Sage does not include g95 binaries, you must use a 173 systemwide gFortran. For example, Solaris 10 does not ship with any 174 Fortran binaries. You need to explicitly tell the Sage build process 160 systemwide gfortran. You need to explicitly tell the Sage build process 175 161 about the Fortran compiler and library location. Do this by typing :: 176 162 177 163 export SAGE_FORTRAN=/exact/path/to/gfortran … … 295 281 ./sage 296 282 297 283 You should see the Sage prompt, which will look something like this 298 (starting the first time can take a few seconds):284 (starting the first time can take a few minutes): 299 285 300 286 :: 301 287 302 288 $ sage 303 289  304  S AGE Version 3.1, Release Date: 20080816290  Sage Version 4.6, Release Date: 20101030  305 291  Type notebook() for the GUI, and license() for information.  306 292  307 293 sage: … … 359 345 :: 360 346 361 347 sage: gap_console() 362 GAP4, Version: 4.4. 6 of 02Sep2005, x86_64unknownlinuxgnugcc348 GAP4, Version: 4.4.12 of 17Dec2008, i386pcsolaris2.11gcc 363 349 gap> 2+2; 364 350 4 365 351 [ctrld] … … 378 364 379 365 sage: singular_console() 380 366 SINGULAR / Development 381 A Computer Algebra System for Polynomial Computations / version 3 01367 A Computer Algebra System for Polynomial Computations / version 311 382 368 0< 383 by: G.M. Greuel, G. Pfister, H. Schoenemann \ October 2005369 by: G.M. Greuel, G. Pfister, H. Schoenemann \ Feb 2010 384 370 FB Mathematik der Universitaet, D67653 Kaiserslautern \ 385 371 // ** executing /usr/local/sage/sage0.8.2/bin/LIB/.singularrc 386 372 [ctrld] … … 451 437 Now typing ``sage`` within your terminal emulator should start 452 438 Sage. 453 439 454 #. Optional : Test the install by typing ``./sage testall``. This440 #. Optional, but highly recommended: Test the install by typing ``./sage testall``. This 455 441 runs most examples in the source code and makes sure that they run 456 442 exactly as claimed. To test all examples, use 457 443 ``./sage testall optional long``; this will run examples that take … … 460 446 likely fail because they assume that a database is installed. 461 447 Alternatively, from within ``$SAGE_ROOT``, you can type 462 448 ``make test`` to run all the standard test code. This can take 463 from 30 minutes to an hour or longer. 464 465 #. Optional: The directory ``spkg/build`` contains intermediate code 466 that is used to build sage. Type ``make clean`` to delete it and a 467 few other directories (e.g., ``spkg/archive`` and ``devel/old``). This 468 is safe and will save you about 500 MB of disk space. You may wish to 469 type this periodically. 449 from 25 minutes to several hours, depending on your hardware. On 450 very old hardware building Sage can take several days! 470 451 471 452 #. Optional: Install optional Sage packages and databases. Type 472 453 ``sage optional`` to see a list or visit … … 503 484 504 485  :envvar:`SAGE_PARALLEL_SPKG_BUILD`  set this to "yes" to build 505 486 multiple packages in parallel. This only has an effect if 506 :envvar:`MAKE` is also set to run several jobs in parallel. As of 507 this writing (June 2010), this is still in the experimental stages, 508 but turning this on can greatly speed up the build process. 487 :envvar:`MAKE` is also set to run several jobs in parallel. 509 488 510  :envvar:`SAGE64`  Set this to "yes" to build a 64bit binary . This511 is required if you want a 64bit binary but the default for your512 platform is to build 32bit binaries.It adds the compiler flag489  :envvar:`SAGE64`  Set this to "yes" to build a 64bit binary on platforms 490 which default to 32bit, even though they can build 64bit binaries. 491 It adds the compiler flag 513 492 m64 when compiling programs. The SAGE64 variable is mainly of use 514 493 is on OS X (pre 10.6), Solaris and OpenSolaris, though it will add 515 494 the m64 on any operating system. If you are running version 10.6 of … … 560 539 e.g., an unsupported machine or an unusual compiler: 561 540 562 541  :envvar:`SAGE_PORT`  if you try to build Sage on a platform which 563 is recognized as being unsupported (e.g. , x86 Solaris,AIX, or542 is recognized as being unsupported (e.g. AIX, or 564 543 HPUX), or with a compiler which is unsupported (anything except 565 544 gcc), you will see a message saying something like :: 566 545 … … 581 560  :envvar:`SAGE_USE_OLD_GCC`  the Sage build process requires version 582 561 4.0.1 of gcc. If the most recent version of gcc is 3.4.x and you 583 562 want to try building anyway, then set :envvar:`SAGE_USE_OLD_GCC` to 584 something non empty. Expect the build to fail in this case: Sage is563 something nonempty. Expect the build to fail in this case: Sage is 585 564 only guaranteed to build using gcc 4.0.1 or later, so if you insist 586 565 on working with gcc 3.4.x, you will have to modify some source code 587 566 to get things to work. … … 598 577 :file:`libf77blas.so`, and it should have a subdirectory 599 578 :file:`include/atlas/` containing header files. 600 579 601  :envvar:`SAGE_MATPLOTLIB_GUI`  set this to anything non empty except580  :envvar:`SAGE_MATPLOTLIB_GUI`  set this to anything nonempty except 602 581 "no", and Sage will attempt to build the graphical backend when it 603 582 builds the matplotlib package. 604 583 … … 680 659 your machine, set this variable to the appropriate command. 681 660 682 661  :envvar:`SAGE_ORIG_LD_LIBRARY_PATH_SET`  set this to something 683 non empty to force Sage to set the :envvar:`LD_LIBRARY_PATH` before662 nonempty to force Sage to set the :envvar:`LD_LIBRARY_PATH` before 684 663 executing system commands. 685 664 686 665  :envvar:`SAGE_ORIG_DYLD_LIBRARY_PATH_SET`  similar, but only used … … 709 688 seconds (30 minutes). 710 689 711 690  :envvar:`SAGE_PICKLE_JAR`  if you want to update the the standard 712 pickle jar, set this to something non empty and run the doctest691 pickle jar, set this to something nonempty and run the doctest 713 692 suite. See the documentation for the functions :func:`picklejar` 714 693 and :func:`unpickle_all` in 715 694 :file:`SAGE_ROOT/devel/sage/sage/structure/sage_object.pyx`, online … … 746 725 Systemwide install 747 726 ~~~~~~~~~~~~~~~~~~~ 748 727 749 This is a compilation of posts to the Sage support list (in750 particular those of Luis Finotti ).728 This is a compilation of posts to the Sage support list  in 729 particular those of Luis Finotti. 751 730 731 **Note from David Kirkby.** I would suggest the root account should 732 only be used when absolutely necessary  that would not include 733 building programs like Sage. When logged in as root, one mistyped command can 734 leave your system totally unbootable and lose all your data. Also, a mistake 735 in the Sage souce code could 736 overwrite your system files, as `documented here <http://trac.sagemath.org/sage_trac/ticket/9551/>`_. If you build Sage as root, you do so at your own risk. 752 737 753 738 #. Unpack the current Sage tarball (we shall assume it is 754 ``sage 2.5.2.tar``) at, e.g., ``/usr/local/`` and compile it as root.739 ``sage4.6.2.tar``) at, e.g., ``/usr/local/`` and compile it as root. 755 740 Assuming you are in a root shell and the tarball is in your current 756 741 directory, type: 757 742 758 743 :: 759 744 760 cp sage 2.5.2.tar /usr/local745 cp sage4.6.2.tar /usr/local 761 746 cd /usr/local 762 tar xvf sage 2.5.2.tar763 cd sage 2.5.2/747 tar xvf sage4.6.2.tar 748 cd sage4.6.2/ 764 749 make 765 750 766 751 (Comment: It's better to build in place. It's a bug if anything goes 767 752 wrong when relocating the entire tarball  unfortunately there 768 753 is one bug I haven't fixed along these lines, namely the 769 754 PARI install hardcodes the location of the "galois data" files. 770 (Fixes welcome!) )755 (Fixes welcome!).) 771 756 772 757 #. Make sure to modify the line with the ``.....``"'s at the top of the 773 758 ``sage`` script. In other words, edit ``SAGE_ROOT="....."`` to say 774 ``SAGE_ROOT="/usr/local/sage 2.5.2"``.759 ``SAGE_ROOT="/usr/local/sage4.6.2"``. 775 760 776 761 #. There are some initial files that have to be created during the 777 762 first run of Sage. Try starting up Sage once as root (or, to be … … 784 769 785 770 :: 786 771 787 cp /usr/local/sage 2.5.2/sage /usr/local/bin/772 cp /usr/local/sage4.6.2/sage /usr/local/bin/ 788 773 789 774 You make a copy instead of a symlink, since upgrading with 790 ``sage upgrade`` overwrites ``/usr/local/sage 2.5.2/sage``, hence775 ``sage upgrade`` overwrites ``/usr/local/sage4.6.2/sage``, hence 791 776 deleting the ``ROOT=...`` part of that file. 792 777 793 Make sure that all files in ``/usr/local/sage 2.5.2`` are readable by778 Make sure that all files in ``/usr/local/sage4.6.2`` are readable by 794 779 all: 795 780 796 781 :: 797 782 798 chmod a+rX R /usr/local/sage 2.5.2783 chmod a+rX R /usr/local/sage4.6.2 799 784 800 785 801 786 Special Notes