Kwant install on Ubuntu Nobel LTS 24.04.3 LTS
Hello, I am trying to install kwant on unbuntu nodel release. I also tried building it from source but no source packages are available for this release of Ubuntu. Would this install be possible on LTS 24? Appreciate your help. Kam
kkomeyli--- via Kwant-discuss wrote:
I am trying to install kwant on unbuntu nodel release. I also tried building it from source but no source packages are available for this release of Ubuntu. Would this install be possible on LTS 24?
Hi, yes the PPA has not been updated yet. For now the packaging experience is unsatisfactory on Ubuntu, but it’s quite easy nevertheless. In my opinion the easiest way is to • run ‘apt install python3-tinyarray’ (there’s an official package for it) • Download the Kwant 1.4.4 tarball from https://pypi.org/project/kwant/1.4.4/ (Kwant 1.5.0 no longer contains the mumps bindings and instead depends on the new python-mumps package which hasn’t been packages for Ubuntu yet.) • Unpack and follow points 1 & 3 of https://kwant-project.org/doc/1/pre/install#unix-like-systems-gnu-linux (No need for point 2 since we installed tinyarray from a package.) There are also other ways to install Kwant (e.g. conda), but this is the most Ubuntu-native way. Hope this helps Christoph
Thank you , it helps . step 3 - python3 setup.build * gets a fatal error on the include file; FYI python3 is mapped to python3.13.8 I am not certain if this include file needed for build is available for this version of python ? I may have to revert to an older version if workaround is not available. Kwant/_system.c:222:12: fatal error: longintrepr.h: No such file or directory 222 | #include "longintrepr.h" | ^~~~~~~~~~~~~~~ compilation terminated.
I managed to install kwant successfully through git clone on ubuntu 24 LTS with Python 3.13 using these steps these are the steps someone else may find useful sudo apt-get install python3-dev python3-setuptools python3-scipy python3-matplotlib python3-pytest python3-sympy g++ gfortran libmumps-scotch-dev sudo apt-get install build-essential gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev pip install cython pytest git clone https://gitlab.kwant-project.org/kwant/kwant.git kwant/kwant.git cd kwant/kwant.git pip install -e . pip list | grep kwant ( gives the following output) kwant 1.5.0.dev4+g442b296 /home/q/Q03/kwant/kwant/kwant.git Running the test python3 -c 'import kwant; kwant.test()' produces this output - 6 test errors, 470 tests passed Will give it a try =========================== short test summary info ============================ FAILED kwant/kwant.git/kwant/continuum/tests/test_discretizer.py::test_integer_float_input - assert {(0, 0, 0): 1.00000000000000} == {(0, 0, 0): 1} FAILED kwant/kwant.git/kwant/physics/tests/test_gauge.py::test_unfixable_gauge - AttributeError: 'lil_matrix' object has no attribute 'A' FAILED kwant/kwant.git/kwant/tests/test_plotter.py::test_matplotlib_backend_unset - assert True is False FAILED kwant/kwant.git/kwant/tests/test_plotter.py::test_matplotlib_plot - TypeError: Axes3D.auto_scale_xyz() missing 2 required positional arguments:... FAILED kwant/kwant.git/kwant/tests/test_plotter.py::test_spectrum[matplotlib] - TypeError: can only concatenate tuple (not "list") to tuple FAILED kwant/kwant.git/kwant/tests/test_wraparound.py::test_plot_2d_bands - TypeError: can only concatenate tuple (not "list") to tuple =========== 6 failed, 470 passed, 1 skipped, 3534 warnings in 22.21s ===========
kkomeyli--- via Kwant-discuss wrote:
I managed to install kwant successfully through git clone on ubuntu 24 LTS with Python 3.13 using these steps these are the steps someone else may find useful
Sounds good! But for decent performance, do make sure that MUMPS is available and being used. (Check if importing kwant.solvers.mumps gives an error or not.) If it isn’t, I believe you’ll have to install python-mumps (e.g. via pip), or go back to Kwant 1.4, or use a different installation method. Christoph
participants (2)
-
Christoph Groth -
kkomeyli@pm.me