Skip to content

SageMath Development on CoCalc

William Stein edited this page Jun 13, 2023 · 3 revisions

How to Get Started with Sage Development on CoCalc

These are instructions on how to quickly (ie., in a few minutes) get started with Sage development on CoCalc.

  1. Open the CoCalc project that you intend to use for development, or create a new project.

  2. Send an email with THE LINK TO YOUR PROJECT (under Settings) to help@sagemath.com and say that you are using this project for legit Sage development.

  3. Wait for the reply before continuing. You MUST DO THIS SINCE DEFAULT PROJECTS DO NOT HAVE SUFFICIENT DISK SPACE OR NETWORK ACCESS. Building Sage from source takes up just under 4GB of disk space in CoCalc (it's so "small" because our disk is compressed and dedup'd).

  4. Create an ssh key and upload the ssh key to the Sage trac server:

  5. Obtain the Sage source code and build Sage in the standard way from scratch. For more details, see this.

    Note: the first build after checking out Sage source can take several hours. Because of the large amount of output generated, you probably will not want to leave the build running in the foreground. To background the build, you can close the term, or use tmux and put it in the background (for example by detaching the session), or redirect output to a file.

  6. Add your trac account username and password:

     git trac config --user username --pass 'password'
    

    Note: You will have to do this once each time you do step 3 above.

  7. Checkout a ticket, that is, switch to a new branch:

     git trac checkout 18628
    

    Note: Make sure to do step 4 first!

  8. Recompile Sage:

     make start
    

    Note: this might take some time if it's an old ticket.

  9. Do some development or reviewing....

    • edit some files, then 'add' them, e.g., by running git add .
    • test changes, e.g., by running ./sage -br
    • 'commit' changes, e.g., git commit -m "added 'super_conjugate' method to partition.py"
    • push your changes: git trac push
  10. Go home:

     git checkout develop
    

    Note: this will bring you back to the development version of Sage without any of your modifications.

  11. Return to step 6 with another ticket!

Notes:

  • If you want to use the development version of Sage in your worksheets, then first run the following commands

      mkdir -p ~/bin
      cd ~/bin
      ln -sf ~/sage-dev-images/sage-6.8.beta3/sage .
    

    and then restart your worksheet server (in project settings). For details, see this entry in the FAQ.

  • For more information about the general Sage development process, see the Sage Developer's Guide).

  • For more information about the git trac command, see Collaborative Development with Git-Trac

Analytics

Clone this wiki locally