Fork me on GitHub
#datalevin
<
2022-06-01
>
vlad_poh15:06:58

Is anyone using datalevin on an M1 mac? I'm getting the following error

Retrieving datalevin/datalevin/0.6.13/datalevin-0.6.13.jar from clojars
#error {
 :cause could not get native definition for type `POINTER`, original error message follows: java.lang.UnsatisfiedLinkError: Unable to execute or load jffi binary stub from `/var/folders/6w/mtgd7hkj2yg0w3bmblzxmdc80000gn/T/`. Set `TMPDIR` or Java property `java.io.tmpdir` to a read/write path that is not mounted "noexec".
Can't load library: /Users/Kay/Sources/spcmig/jffi17166356791235202256.dylib
        at com.kenai.jffi.internal.StubLoader.tempLoadError(StubLoader.java:448)
        at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:433)
        at spcmig.core.<clinit>(Unknown Source)
        ... 27 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.lmdbjava.Library
        at org.lmdbjava.Env$Builder.open(Env.java:486)
        at org.lmdbjava.Env$Builder.open(Env.java:512)
I have no issues with the babashka pod which i'd been using till yesterday.

Josh16:06:00

someone on my team had a similar error, I think he had to use datalevin from a rosetta terminal

👍 1
Huahai19:06:04

Pod and dtlv use lmdb lib that we compiled ourselves, library uses lmdbjava’s, hence the difference. Someone did report here that he got dtlv to work in docker on M1

vlad_poh22:06:21

i tried so many things and it is now working but not sure what really worked Incase anyone runs into this issue 1. Using the latest graalvm 22.2.0-dev 2. excluded lmdbjava from datalevin 3. required lmdbjava 0.8.3-snapshot 4. I also followed the instructions https://github.com/lmdbjava/native/issues/10 and copied the liblmdb.dyliblib to /usr/local/lib For leiningen i also had to set LEIN_SNAPSHOTS_IN_RELEASE to true to use the 0.8.3 snapshot.

👍 1
Huahai22:06:54

You may want to copy these to that issue comment, so people may find it there. thanks.

mokr07:06:54

I’m running embedded Datalevin on M1 Pro without issues, but I’m using OpenJDK x64 + Rosetta. To get my app running in a Docker container (openjdk:11-jre-slim-buster) I had to add “liblmdb-dev” to the image. Hope it helps.

baibhavbista08:06:17

I got embedded datalevin working on M1 in docker in a manner similar to @U1S4F3M4M Image used: clojure:openjdk-11-tools-deps Second that we need to run apt install -y liblmdb-dev to get it to work The only point I have to make is that I'm pretty sure I didn't use Rosetta. afaik datalevin works on ARM linux, it just doesn't work in ARM Apple (M1). So you shouldn't even need to do x86 emulation in case you use linux arm image

👍 1