No module nanobind

 cmake -DCMAKE_BUILD_TYPE=Release -B build-dir -S .

Cloning into '/home/prusso/basix/ext/nanobind/ext/robin_map'...
Submodule path 'ext/nanobind/ext/robin_map': checked out '68ff7325b3898fca267a103bad5c509e8861144d'
prusso@Yoga730-15ikb:~/basix$ cmake -DCMAKE_BUILD_TYPE=Release -B build-dir -S .
-- The following features have been enabled:

 * BUILD_SHARED_LIBS, Build Basix with shared libraries.

-- The following REQUIRED packages have been found:

 * BLAS
 * Threads
 * LAPACK

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'nanobind'
CMake Error at python/CMakeLists.txt:29 (find_package):
  Could not find a package configuration file provided by "nanobind" with any
  of the following names:

    nanobindConfig.cmake
    nanobind-config.cmake

  Add the installation prefix of "nanobind" to CMAKE_PREFIX_PATH or set
  "nanobind_DIR" to a directory containing one of the above files.  If
  "nanobind" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/home/prusso/basix/build-dir/CMakeFiles/CMakeOutput.log".
See also "/home/prusso/basix/build-dir/CMakeFiles/CMakeError.log".
prusso@Yoga730-15ikb:~/basix$

Seems no module nano bind when runnin cmake build for basix on WSL2. Any way to get things to buld WSL2? Is there a way to have things find nanobind?

Seems to me that you are trying to follow the instructions in basix/INSTALL.md at main · FEniCS/basix · GitHub, Advanced -> C++ library, but you missed the very first line

In the cpp/ directory:

(talk about the pot calling the kettle black: I’ve just done the same mistake in Compile Basix C++ backend and python wrappers separately · fem-on-colab/fem-on-colab@496b695 · GitHub)

1 Like