Jupyterlab installation very slow in Sage 9.6

91 views
Skip to first unread message

Eric Gourgoulhon

unread,
May 22, 2022, 1:39:49 PM5/22/22
to sage-devel
Hi,

In a newly installed Sage 9.6 from source, I've moved on to install Jupyterlab (since it's still an optional package, cf. https://groups.google.com/g/sage-devel/c/orUpb-YXIHk/) by running
./sage -i jupyterlab_widgets
as advertised in
This triggered the recompilation of 531 Cython files in sage-lib on a single thread, which on my i7 computer takes about half an hour or so.
Is this really necessary? (a priori I don't see the link between Jupyterlab and these 531 Cython files in src/sage). If yes, is there any possibility to speed up the process by running it on multiple threads?

Eric.

Nils Bruin

unread,
May 22, 2022, 4:23:35 PM5/22/22
to sage-devel
On Sunday, 22 May 2022 at 19:39:49 UTC+2 Eric Gourgoulhon wrote:
This triggered the recompilation of 531 Cython files in sage-lib on a single thread, which on my i7 computer takes about half an hour or so.
Is this really necessary? (a priori I don't see the link between Jupyterlab and these 531 Cython files in src/sage). If yes, is there any possibility to speed up the process by running it on multiple threads?

The rebuild should go through make nowadays. If you do
export MAKE="make -j8"
I think it should use up to 8 parallel jobs

Eric Gourgoulhon

unread,
May 23, 2022, 5:18:34 PM5/23/22
to sage-devel
Le dimanche 22 mai 2022 à 22:23:35 UTC+2, Nils Bruin a écrit :
The rebuild should go through make nowadays. If you do
export MAKE="make -j8"
I think it should use up to 8 parallel jobs

Thanks for the tip. It works! I've tested it when installing Jupyterlab in Sage 9.7.beta0.
There remains the first question: why does installing Jupyterlab trigger the recompilation of all Cython files in src/sage ?

Eric.

Samuel Lelievre

unread,
May 24, 2022, 5:04:17 AM5/24/22
to sage-devel
Side note: if using `sage -i`, prepending `V=0` will
suppress most of the build's verbosity. Example:
```
$ V=0 sage -i jupyterlab_widgets
```

I cannot answer the following two questions:

- why does installing JupyterLab after building Sage
  trigger recompilation of all Cython files in src/sage?

- how can that be fixed?

but there might be a workaround consisting in
configuring the build so that JupyterLab is built
along with the rest, rather than afterwards.

After getting a new development release of Sage
(with `git pull origin develop --tags` or by getting
and unpacking the source tarball), do this:

```
$ export MAKE='make -j8'
$ ./bootstrap
$ ./configure --enable-jupyterlab_widgets
$ make -s V=0
```

instead of something like

```
$  export MAKE='make -j8'
$ ./bootstrap
$ ./configure
$ make -s V=0
$ ./sage -i jupyterlab_widgets
```

Maybe fixing the unwanted recompilation of all
cython files deserves a ticket?

Dima Pasechnik

unread,
May 24, 2022, 6:07:33 AM5/24/22
to sage-devel
On Tue, May 24, 2022 at 10:04 AM Samuel Lelievre
<samuel....@gmail.com> wrote:
>
> Side note: if using `sage -i`, prepending `V=0` will
> suppress most of the build's verbosity. Example:
> ```
> $ V=0 sage -i jupyterlab_widgets
> ```
>
> I cannot answer the following two questions:
>
> - why does installing JupyterLab after building Sage
> trigger recompilation of all Cython files in src/sage?
>
sagelib (including all Cython files in src/sage) has dependencies on
e.g. jupyter-core
(no idea why). Perhaps building jupyterlab leads to touching this or
some other dependency of sagelib, in turn triggering its rebuilding.

Dima


> - how can that be fixed?
>
> but there might be a workaround consisting in
> configuring the build so that JupyterLab is built
> along with the rest, rather than afterwards.
>
> After getting a new development release of Sage
> (with `git pull origin develop --tags` or by getting
> and unpacking the source tarball), do this:
>
> ```
> $ export MAKE='make -j8'
> $ ./bootstrap
> $ ./configure --enable-jupyterlab_widgets
> $ make -s V=0
> ```
>
> instead of something like
>
> ```
> $ export MAKE='make -j8'
> $ ./bootstrap
> $ ./configure
> $ make -s V=0
> $ ./sage -i jupyterlab_widgets
> ```
>
> Maybe fixing the unwanted recompilation of all
> cython files deserves a ticket?
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/e9011f7c-6126-439c-90ef-718e35e82cd1n%40googlegroups.com.

Dima Pasechnik

unread,
May 24, 2022, 9:01:59 AM5/24/22
to sage-devel
On Tue, May 24, 2022 at 11:07 AM Dima Pasechnik <dim...@gmail.com> wrote:
>
> On Tue, May 24, 2022 at 10:04 AM Samuel Lelievre
> <samuel....@gmail.com> wrote:
> >
> > Side note: if using `sage -i`, prepending `V=0` will
> > suppress most of the build's verbosity. Example:
> > ```
> > $ V=0 sage -i jupyterlab_widgets
> > ```
> >
> > I cannot answer the following two questions:
> >
> > - why does installing JupyterLab after building Sage
> > trigger recompilation of all Cython files in src/sage?
> >
> sagelib (including all Cython files in src/sage) has dependencies on
> e.g. jupyter-core
> (no idea why). Perhaps building jupyterlab leads to touching this or
> some other dependency of sagelib, in turn triggering its rebuilding.

On sage 9.7.beta0, running `make jupyterlab_widgets` triggers (re)builds of
ipympl jupyterlab jupyterlab_widgets jupyter_packaging
nodeenv nodejs-12.18.3 sagelib-9.7.beta0

it does not look like the rebuild of sagelib is triggered via
build/pkgs/*/dependencies

It's probably some Python packages magic I have no idea about.
Reply all
Reply to author
Forward
0 new messages