[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#56729] [RFC PATCH 00/10] Add sagemath.

From: Andreas Enge
Subject: [bug#56729] [RFC PATCH 00/10] Add sagemath.
Date: Mon, 8 Aug 2022 16:40:37 +0200


Am Mon, Aug 01, 2022 at 11:24:31AM +0200 schrieb Ludovic Courtès:
> > This series adds SageMath. Everything compiles just fine and even the
> > Jupyter notebook interface works, but there is still much work to do. So
> > far, I have only added the minimal set of inputs required for the build
> > to succeed. Tests and documentations are still missing.
> This looks great already!  To make sure things don’t stall, we could
> apply the patch series piecemeal, starting with the dependencies that
> you think are ready, and leaving more time to polish the ‘sagemath’
> package.

thanks for letting me know, I will start by having a look at the patches
doing version updates.

Concerning sagemath itself, below is my very old version of an attempt at
packaging the library. Some things look reassuringly similar, my handling
of the number of cores is less nice, but I do delete the bundled packages.

Maybe you could copy useful parts into your recipe?

As for tests, indeed we should drop them for the time being until we have
a working sage package.

Thanks for these efforts!


(define-public sage
    (name "sage")
    (version "8.7")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    version ".tar.gz"))
              (modules '((guix build utils)))
              (snippet '(begin (delete-file-recursively "upstream")
                               (delete-file-recursively ".git")
    (build-system python-build-system)
     `(("cython" ,python-cython)
       ("pkg-config" ,pkg-config)
       ("python-cysignals" ,python-cysignals)
       ("python-pkgconfig" ,python-pkgconfig)
       ("python-jinja2" ,python-jinja2)))
     `(("arb" ,arb)
       ("boost" ,boost)
       ("brial" ,brial)
       ("cliquer" ,cliquer)
       ("ecl" ,ecl)
       ("eclib" ,eclib)
       ("gmp-ecm" ,gmp-ecm)
       ("edge-addition-planarity-suite" ,edge-addition-planarity-suite)
       ("fflas-ffpack" ,fflas-ffpack-2.3.2)
       ("flint" ,flint)
       ("gap" ,gap)
       ("gd" ,gd)
       ("gf2x" ,gf2x)
       ("givaro" ,givaro-4.0.4)
       ("glpk" ,glpk)
       ("gmp" ,gmp)
       ("gsl" ,gsl)
       ("iml" ,iml)
       ("lcalc" ,lcalc)
       ("libbraiding" ,libbraiding)
       ("libgc" ,libgc)
       ("libhomfly" ,libhomfly)
       ("linbox" ,linbox-1.5.2)
       ("lrcalc" ,lrcalc)
       ("m4ri" ,m4ri)
       ("m4rie" ,m4rie)
       ("mpc" ,mpc)
       ("mpfr" ,mpfi)
       ("ntl" ,ntl)
       ("pari-gp" ,pari-gp)
       ("ppl" ,ppl)
       ("pynac" ,pynac)
       ("python-cypari2" ,python-cypari2)
       ("python-gmpy2" ,python-gmpy2)
       ("python-numpy" ,python-numpy)
       ("python-six" ,python-six)
       ("ratpoints" ,ratpoints)
       ("readline" ,readline)
       ("rw" ,rw)
       ("singular" ,singular)
       ("symmetrica" ,symmetrica)
       ("zlib" ,zlib)
       ("zn-poly" ,zn-poly)))
     `(#:tests? #f ; a test since this phase fails with an error in
       #:use-setuptools? #f ; otherwise complains about
                            ; --single-version-externally-managed
       (modify-phases %standard-phases
         (add-before 'build 'setup
           (lambda _
             (setenv "SAGE_ROOT" (getcwd))
             (setenv "SAGE_LOCAL" (getcwd))
             (setenv "SAGE_SHARE" (string-append (getcwd) "/share"))
             (setenv "PATH" (string-append (getcwd) "/build/bin:"
                            (getcwd) "/src/bin:"
                            (getenv "PATH")))
             (setenv "SAGE_NUM_THREADS" "32") ; arbitrary number, 32 cores
                                              ; on bayfront
             (mkdir-p "var/lib/sage/installed")
             (mkdir-p (string-append (getcwd)
             (chdir "src")
         (add-after 'install 'save-space
           ;; The Nix package deletes a directory with over 100MB, which
           ;; apparently is not needed. Let us do the same.
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (python (assoc-ref inputs "python"))
                      ((@@ (guix build python-build-system)
                           get-python-version) python))
                    (site (string-append out "/lib/python"
                    (directory (string-append site "/sage/cython_debug")))
               (delete-file-recursively directory))
    (synopsis "SageMath computer algebra system")
     "SageMath is a mathematics software built on top of many existing
packages such as NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT,
R and others. Their combined power may be accessed through a common,
Python-based language or directly via interfaces or wrappers.")
    ;; documentation under cc-by-sa3.0, bundled packages under various
    ;; other licenses, see COPYING.txt in the distribution
    (license license:gpl3)
    (home-page "";)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]