Closed a-alhazmi closed 1 year ago
Hello. This is a VLog bug. I link it here: Issue 96
Did you try updating the VLog dependency version in the rulewerk-vlog
pom.xml
file prior to running build-vlog-library.sh
? Perhaps if not, maven could use the old dependency and not the newly built one.
In case you did, did you get this error when trying to build VLog, or did it build successfully?
Hello, Thanks for your answer.
The Vlog dependency version in therulewerk-vlog
pom.xml
file is: <karmaresearch.vlog.version>1.3.5</karmaresearch.vlog.version>
, which match the Vlog release that in Vlog GitHub.
It built successfully without any errors, but when I run the client jar file it throws that error (incompatible architecture).
We see that the released karmaresearch.vlog (vlog-java) jar version 1.3.5 does not work on M1 Mac, as you reported in this issue. Thank you for finding it! I linked it to the related VLog issue.
We want to see if the current main branch in VLog that is built on M1 Mac can run there successfully. When running build-vlog-library.sh
, this builds a new VLog (specifically, vlog-java.jar
) and places it in your local maven repository, with the version given by <karmaresearch.vlog.version>
property. To make sure the newly built vlog-java.jar
is used, it is recommended to follow the steps below:
vlog-java
( <karmaresearch.vlog.version>
property in rulewerk-vlog/pom.xml
) before executing the next steps.local_builds
directory).rulewerk-vlog/lib/jvlog-local.jar
, and install the new jar in your local Maven repository in place of the distributed version of vlog-java
.mvn install
to test if the setup works.Does the bug still occur when following these steps?
Also, what command issues this error? We want to make sure we can reproduce the bug.
Yes, I followed all these steps, and the error was there. The error was thrown not from build commands, it was from running the produced stand-alone jar file.
Exception in thread "main" java.lang.UnsatisfiedLinkError: while loading kognac-core: /private/var/folders/nk/mg7msvvx4rg7d9bht0l7lnwr0000gp/T/VLog-tmp164877341971675468/libkognac-core.dylib: dlopen(/private/var/folders/nk/mg7msvvx4rg7d9bht0l7lnwr0000gp/T/VLog-tmp164877341971675468/libkognac-core.dylib, 0x0001): tried: '/private/var/folders/nk/mg7msvvx4rg7d9bht0l7lnwr0000gp/T/VLog-tmp164877341971675468/libkognac-core.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libkognac-core.dylib' (no such file)
at karmaresearch.vlog.VLog.loadLibrary(VLog.java:72)
at karmaresearch.vlog.VLog.<clinit>(VLog.java:22)
at org.semanticweb.rulewerk.reasoner.vlog.VLogReasoner.<init>(VLogReasoner.java:82)
at org.semanticweb.rulewerk.client.picocli.RulewerkClientMaterialize.run(RulewerkClientMaterialize.java:102)
at picocli.CommandLine.executeUserObject(CommandLine.java:1729)
at picocli.CommandLine.access$900(CommandLine.java:145)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2101)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2068)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1935)
at picocli.CommandLine.execute(CommandLine.java:1864)
at org.semanticweb.rulewerk.client.picocli.Main.main(Main.java:77)
The good news the problem is resolved. Here what I did:
i386
instead ofarm64
). Java 18.0.2
, (I was using Java 11
).cmake
command, and installed it again.And it worked.
This issue can probably be fixed by providing "universal" binaries for the Mac (these work for i386 as well as arm64). I'm looking into how to do this.
@a-alhazmi, Could you please try again on M1 Mac with the provided VLog jar attached in try-solve-vlog-bug-96.zip? This .zip
archive contains a jar with "universal binaries" for Mac, but we didn't have access to an M1 Mac to test it ourselves.
jvlog-local.jar
file from .zip, and save it in rulewerk-vlog\lib
folder<karmaresearch.vlog.version>1.3.5</karmaresearch.vlog.version>
version in rulewerk-vlog\pom.xml
filemvn initialize -Pdevelopment
from rulewerk-parent
dirmvn clean install
fixed here: https://github.com/karmaresearch/vlog/issues/96
Hello, I am PhD student, who working on ForBackBench project. I am using Rulewerk as a standalone client in my project. The client jar file working perfectly on Linux and Mac with Intel processors.
At some point, I tried to run the client on the new M1 Mac (Mac with architecture arm64) , but I got that error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: while loading kognac-core: /private/var/folders/nk/mg7msvvx4rg7d9bht0l7lnwr0000gp/T/VLog-tmp6815360794293855698/libkognac-core.dylib: dlopen(/private/var/folders/nk/mg7msvvx4rg7d9bht0l7lnwr0000gp/T/VLog-tmp6815360794293855698/libkognac-core.dylib, 0x0001): tried: '/private/var/folders/nk/mg7msvvx4rg7d9bht0l7lnwr0000gp/T/VLog-tmp6815360794293855698/libkognac-core.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libkognac-core.dylib' (no such file)
I downloaded the code again and tried to using thebuild-vlog-library.sh
to build new client on the M1 Mac, but the error is still exist.How could I run the standalone client on M1 Mac?