To play around with hnswlib, I created a very simple livebook. However, the livebook fails to load hswlib.
What did I do wrong?
Here is the contents of the livebook, and the output of it:
Mix.install([
{:hnswlib, "~> 0.1.2"},
])
Resolving Hex dependencies...
Resolution completed in 0.025s
New:
cc_precompiler 0.1.8
complex 0.5.0
elixir_make 0.7.7
hnswlib 0.1.2
nx 0.6.2
telemetry 1.2.1
* Getting hnswlib (Hex package)
* Getting cc_precompiler (Hex package)
* Getting elixir_make (Hex package)
* Getting nx (Hex package)
* Getting complex (Hex package)
* Getting telemetry (Hex package)
===> Analyzing applications...
===> Compiling telemetry
==> complex
Compiling 2 files (.ex)
Generated complex app
==> nx
Compiling 32 files (.ex)
Generated nx app
==> elixir_make
Compiling 6 files (.ex)
Generated elixir_make app
==> cc_precompiler
Compiling 3 files (.ex)
Generated cc_precompiler app
==> hnswlib
Downloading precompiled NIF to /home/livebook/.cache/hnswlib-nif-2.17-x86_64-linux-gnu-0.1.2.tar.gz
Compiling 4 files (.ex)
Generated hnswlib app
space = :l2
dim = 2
max_elements = 200
{:ok, index} = HNSWLib.Index.new(space, dim, max_elements)
** (ErlangError) Erlang error: :not_loaded
:erlang.nif_error(:not_loaded)
(hnswlib 0.1.2) lib/hnswlib_nif.ex:24: HNSWLib.Nif.index_new/7
(hnswlib 0.1.2) lib/hnswlib_index.ex:60: HNSWLib.Index.new/4
#cell:amn6iw5hct6ln65iovfz36i6t3qatv72:4: (file)