GithubHelp home page GithubHelp logo

Installation on MacOS X about jdime HOT 9 OPEN

jrfaller avatar jrfaller commented on July 25, 2024
Installation on MacOS X

from jdime.

Comments (9)

GSeibt avatar GSeibt commented on July 25, 2024

Hey,

JDime uses JNativeMerge under the hood to implement linebased merging via the libgit2 native library. This library ('libgit2.dylib' on MacOS) needs to be provided to the JVM. JNativeMerge includes the native library for Windows and Unix but we don't have any MacOS devices and therefore it doesn't for MacOS.

You need to compile or download libgit2 for MacOS and make it available to JNA (which is used by JNativeMerge for native library access). Read this tutorial (below the first code block) for how to do that.

Make sure that you use version 0.28.XX of libgit2, that's the only one we test with.

Best,
Georg

from jdime.

jrfaller avatar jrfaller commented on July 25, 2024

Hi Georg, and thanks a lot for your fast response.

I got it to work thank to your tutorial. I don't know why but I had no success with jna.library.path or with DYLD_LIBRARY_PATH, but I had more luck by:

  1. Modifying the path in build/install/JDime/bin/JDime shell script to include $APP_HOME/lib
  2. Add a link to libgit2.dylib in build/install/JDime/lib/darwin

from jdime.

GSeibt avatar GSeibt commented on July 25, 2024

That's good to hear. I had a look at the JNativeMerge source code and it seems that I enforced loading the library from the classpath (instead of other locations that one might specify via the properties you mentioned). I think that is because this way it's a lot harder to use an invalid version of the library.

Your modifications will only survive until the next time you rebuild JDime. Here is how to include an arbitrary library in the .jar file generated for JNativeMerge (and thereby the classpath).

  • Clone JNativeMerge (under exactly this name) as a sibling directory of the JDime directory
  • Set JNM_MAVEN=false in JDime/gradle.properties
  • Set jnativemerge.libgit2.path=<Absolute Path to Library> in JNativeMerge/gradle.properties
  • Run ./gradlew test in the JNativeMerge directory to test whether the library was correctly included
  • Run ./gradlew installDist in the JDime directory to build JDime

This should work with the develop branch of JDime.

from jdime.

jrfaller avatar jrfaller commented on July 25, 2024

Hi Georg and thanks for the tip!

Quick question, wouldn't it be possible for JNativeMerge to try to load first the library from the resource classpath and only if it does not found it, try loading it from the system path (that implies removing the System.setProperty("jna.nosys", "true");)? This way it would be the best of both worlds. I have tried to look for examples, I am not sure it can be done though.

from jdime.

GSeibt avatar GSeibt commented on July 25, 2024

Hey,

please apply the following patch to your build.gradle:

diff --git a/build.gradle b/build.gradle
index da729b05..a0165214 100644
--- a/build.gradle
+++ b/build.gradle
@@ -87,7 +87,7 @@ dependencies {
     implementation 'de.uni-passau.fim.seibt:kvconfig:1.0'
 
     if (project.ext.JNM_MAVEN.toBoolean()) {
-        implementation 'de.uni_passau.fim.seibt:jnativemerge:0.28.1_3'
+        implementation 'de.uni_passau.fim.seibt:jnativemerge-snapshot:95708997'
     } else {
         implementation project(':JNativeMerge')
     }

Also set JNM_MAVEN=false and rebuild JDime. You should be able to use the JVM property jnativemerge.syslib_fallback=true to have JNativeMerge check the other JNA locations as a fallback. You can pass JVM Options through the JDime start script (that is generated by Gradle) using the environment variable JAVA_OPTS.

Best,
Georg

from jdime.

jrfaller avatar jrfaller commented on July 25, 2024

Hi!

Thanks a lot, it's awesome!

Unfortunately, but I do not get it to work. When you mean rebuilt you mean gradle build followed by gradle installDist on the develop branch right? Maybe I should not set JNM_MAVEN to false, since I need to download the dependency from maven according to your patch?

from jdime.

jrfaller avatar jrfaller commented on July 25, 2024

(for info, I set JAVA_OPTS this way : set JAVA_OPTS "-Djnativemerge.syslib_fallback=true -Djna.library.path=/usr/local/lib")

from jdime.

GSeibt avatar GSeibt commented on July 25, 2024

Oh sorry, I meant JNM_MAVEN=true. That will cause the buildscript to download JNativeMerge as a Maven package instead of including the Gradle build directly. The snapshot version of JNativeMerge that I published should have the functionality you suggested.

Rebuilding would be ./gradlew clean installDist. The clean task should not be required even...

from jdime.

jrfaller avatar jrfaller commented on July 25, 2024

OK still no luck with JNM_MAVEN=true. I have looked in the build/install/JDime/lib folder and I have the correct library jnativemerge-snapshot-95708997.jar. Maybe there is a typo on the name of the property?

from jdime.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.