Compile Sage 4.1 in 64-bit mode on OS X 10.5.8
Compiling Sage 4.1 on Mac OS X 10.5.8 is fairly easy, i.e. if you want to build Sage in 32-bit mode. You download a source version of Sage, uncompress the tarball, navigate to the top level directory of the source version, and issue make. But if you want to build in 64-bit mode, you need to replace the version of Fortran that is shipped with Sage with gfortran. For example, say you want to compile Sage 4.1 in 64-bit mode. Here is what you should do:
- Download the source tarball of Sage 4.1 and a custom-built Fortran spkg. The Sage source tarball can be found at the Sage download page. The custom-built Fortran spkg can be found at my development home directory on sage.math. It was built by Michael Abshoff (thank you very much, Michael).
- Uncompress the source tarball, delete the Fortran spkg that’s shipped with Sage, and move the custom-built Fortran package to the standard packages repository:
- Now compile in 64-bit mode:
$ tar -xf sage-4.1.tar $ rm sage-4.1/spkg/standard/fortran-20071120.p5.spkg $ mv fortran-OSX64-20090120.spkg sage-4.1/spkg/standard/
$ export SAGE64=yes $ cd sage-4.1/ $ make
Wait a while for Sage to build. You can use these steps to build Sage 4.1.1 in 64-bit mode under OS X 10.5.8. However, Sage 4.1.1 is known to fail to compile properly as documented in the release tour. This is due to a 32- versus 64-bit issue in cliquer. One way to get around this is to wait for make to finish running. Open the file sage/graphs/all.py and comment out the line that imports cliquer functionalities, like so:
#from sage.graphs.cliquer import *
From the top level Sage directory, issue make again. This would resume the build process where it left off when failing to compile cliquer.