Jupyter notebook and compiling from source

I was able to compile and install ngsolve and netgen on WSL (under windows). netgen loads fine. I can run an example just fine.

But I tried to install the jupyter notebook by doing this:

pip install --upgrade webgui_jupyter_widgets
jupyter nbextension install --user --py webgui_jupyter_widgets
jupyter nbextension enable --user --py webgui_jupyter_widgets

But when I execute the second line, it says:
Jupyter command jupyter-nbextension not found.

What am I missing? Before, when I installed ngsolve directly with sudo apt-get, the above commands worked fine.

Hi,

according to the documentation for Windows you need to do

pip install --upgrade jupyter
pip install --upgrade ipykernel
pip install webgui_jupyter_widgets
jupyter nbextension install --user --py widgetsnbextension
jupyter nbextension enable --user --py widgetsnbextension
jupyter nbextension install --user --py webgui_jupyter_widgets
jupyter nbextension enable --user --py webgui_jupyter_widgets

I guess you have to install the widgetsnbextension package before webgui_jupyter_widgets.

Best,
Michael

Ok, I had to do: sudo apt install jupyter, and some of what you said to get it working.

When I try to run the “unit-1.1-poisson” notebook, it’s able to run the first cell with importing ngsolve just fine. But when I run the cell for generating the mesh, it gives me this error: ‘unit_square’ not defined.

It seems that needs to be imported also? But I remember I was able to run this notebook at the usermeeting, but with a different install setup.

Note: I can run the Navier-Stokes example just fine.

Just to be clear, if I add this line to the jupyter notebook:

from netgen.geom2d import unit_square

Then, the whole notebook runs fine. But why do I have to do that now? At the user meeting, the notebook worked as is.

it seems you are missing OCC - we have now switched all geometries (including the default unit_square) to OCC

Yes, I had turned off OCC when debugging the install.

Do I need to install OCC before I install NGSolve? Or will it download it automatically and install for me?

You can either install the packages and set
-DUSE_OCC=ON
or you set
-DUSE_OCC=ON -DBUILD_OCC=ON to have it built automatically before Netgen is compiled (this takes a while).

I recommend the first variant with following Ubuntu dependencies:

libocct-data-exchange-dev
libocct-draw-dev
occt-misc

Best,
Matthias

PS: Please let the other forum users know how you fixed the MKL/MPI/Mumps build issues.

I assume I install those dependencies by apt-get?

I’ve made notes of my install procedure, but is a bit of a mess. Once I clean it up (and add OCC), I’ll make a new post with the instructions.

I still need to figure out how to install NGSolve on a cluster where oneAPI MKL may not be available.

You do not need to install with mkl, you can (and mpi parallel want to) use other solvers then anyway. Just set USE_MKL=OFF there.

Ok, so MKL is only for direct solving of large spare systems.

Yes, shared memory parallel, but there you have also 2 alternatives, umfpack for general matrices and sparsecholesky for spd

When I try to include OCC, I get this during the “make” step:

No rule to make target ‘/usr/lib/x86_64-linux-gnu/libtbb.so’, needed by ‘libnglib.so’. Stop.

This is some kind of visualization lib, I think. So I assume it is tied to OpenCascade. Does anyone know how to fix?