datalevin

chromalchemy 2025-11-15T15:26:51.052369Z

I am having trouble loading Datalevin. I installed the native libraries via brew on Macosx according to https://github.com/juji-io/datalevin/blob/master/doc/install.md#native-dependencies https://clojurians.slack.com/archives/C01RD3AF336/p1743174251541709 But still getting error like

Execution error (UnsatisfiedLinkError) at jdk.internal.loader.NativeLibraries/load (NativeLibraries.java:-2).
/Users/ryan/.javacpp/cache/dtlvnative-macosx-arm64-0.12.8.jar/datalevin/dtlvnative/macosx-arm64/libjniDTLV.dylib: dlopen(/Users/ryan/.javacpp/cache/dtlvnative-macosx-arm64-0.12.8.jar/datalevin/dtlvnative/macosx-arm64/libjniDTLV.dylib, 0x0001): Library not loaded: libdtlv.dylib

chromalchemy 2025-11-15T15:28:51.274649Z

Here is my deps jvm config

{:jvm-opts ["--add-opens=java.base/java.nio=ALL-UNNAMED"
              "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
              #_"--enable-native-access=ALL-UNNAMED"
              "-Djava.library.path=/Users/ryan/.javacpp/cache/dtlvnative-macosx-arm64-0.12.8.jar/datalevin/dtlvnative/macosx-arm64"]}
The last one was ai genertated trying to troubleshoot this. I am running the datalevin 0.9.22

chromalchemy 2025-11-15T15:31:24.694519Z

Here is the error with none of those jvm config flags loaded

Execution error (UnsatisfiedLinkError) at jdk.internal.loader.NativeLibraries/load (NativeLibraries.java:-2).
/Users/ryan/.javacpp/cache/dtlvnative-macosx-arm64-0.12.8.jar/datalevin/dtlvnative/macosx-arm64/libjniDTLV.dylib: dlopen(/Users/ryan/.javacpp/cache/dtlvnative-macosx-arm64-0.12.8.jar/datalevin/dtlvnative/macosx-arm64/libjniDTLV.dylib, 0x0001): Library not loaded: libdtlv.dylib
  Referenced from: <2A08DF9A-2B23-309A-B81F-16225AD373AA> /Users/ryan/.javacpp/cache/dtlvnative-macosx-arm64-0.12.8.jar/datalevin/dtlvnative/macosx-arm64/libjniDTLV.dylib
  Reason: tried: 'libdtlv.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibdtlv.dylib' (no such file), 'libdtlv.dylib' (no such file), '/Users/ryan/dev/gbo/libdtlv.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/ryan/dev/gbo/libdtlv.dylib' (no such file), '/Users/ryan/dev/gbo/libdtlv.dylib' (no such file)

chromalchemy 2025-11-15T15:32:43.562849Z

Here is what it looks like from when I try to install libs

brew install libomp llvm
✔︎ JSON API cask.jws.json                                                                       [Downloaded   15.0MB/ 15.0MB]
✔︎ JSON API formula.jws.json                                                                    [Downloaded   31.7MB/ 31.7MB]
Warning: libomp 21.1.5 is already installed and up-to-date.
To reinstall 21.1.5, run:
  brew reinstall libomp
Warning: llvm 21.1.5 is already installed and up-to-date.
To reinstall 21.1.5, run:
  brew reinstall llvm

chromalchemy 2025-11-15T15:32:57.994239Z

And i rebooted terminal tab

chromalchemy 2025-11-15T15:35:04.684759Z

Is this a complication?

your Homebrew is running under Rosetta.

Your Mac is Apple Silicon (arm64), but Homebrew is installed at /usr/local, which is the Intel x86_64 prefix. On Apple Silicon Macs, the native ARM version of Homebrew installs to /opt/homebrew.

This means all packages installed via this Homebrew instance will run under Rosetta 2 (Apple's x86_64 emulation).

michaelwhitford 2025-11-15T16:03:50.943579Z

I am seeing this exact same error on my new Mac. My homebrew is under /opt/homebrew and appears to not be using Rosetta. I see the same error when I try to load dataleven libraries in a require. I am running MacOS Sequoia 15.7.2 on a brand new M3 mac. The library loads in a podman container and on my linux machine, but on the new mac fails with the error: Library not loaded: libdtlv.dylib

Huahai 2025-11-15T16:44:59.673549Z

You are having different problems. Brand new MacOS may have too new libraries, while some are using rossenta. The CI build machine for 0.9.22 was latest-maosx I believe, but that's half a year ago. The current master branch build with maces-14, which works well on my MacOSX 15.6.1. So Really, it's about the version mismatch. That's the price to pay for going native.

chromalchemy 2025-11-15T16:50:02.232469Z

Im trying to migrate my homebrew setup to arm to see if that helps. i am running osx 15.6.1

Huahai 2025-11-15T17:07:00.422559Z

The one running the new Mac , make sure you read the instructions and install the native dependencies. These are the common dependencies for a dev machine, not something strange.

chromalchemy 2025-11-15T17:22:02.824139Z

After migrating homebrew installs and config, it is working for me! 🙌 Thanks for commenting

👍 1
michaelwhitford 2025-11-15T17:50:03.926159Z

Yes thank you for the pointer, I was able to brew install the native deps (libomp llvm) and datalevin is now working great on my new Mac.

👍 1
Huahai 2025-11-15T22:58:04.337149Z

With recent change to DLMDB, we cut query planning time in half, and also slightly increased query execution speed. JOB benchmark numbers update:

❤️ 12
🚀 8
littleli 2025-11-18T15:08:59.465069Z

Slightly? It's like 41% improvement 🚀 😅

😀 1
Huahai 2025-11-16T01:20:47.040379Z

After tuning the magic numbers of the optimizers a bit, Datalevin now is twice faster than PostgreSQL in JOB benchmark 🙂

🙌 2