DL4J on Termux Linux Emulator on Android

@LobsterMan you don’t need openblas if you use nd4j-native-platform. Only specify that if you want to use nd4j-native only. For now this should be fine though. Make sure you start the JVM with the flags I show in the docs.

My advice here is to not rush and try to understand the different options.

I’m not quite sure of your environment but I think understanding the specifics and what would be right for you is worth doing.

Note if you use nd4j-native-platform that you should be careful that unrelated jars don’t show up.

Also again be aware of the versions. If you have to guess just ask instead.

I’m following up on this because the details to get termux going are subtle and took me a while to get right.

If you need help we can try to chase down a jdk that can run termux as well. I haven’t tried this in a while and it might need some updates.

Thank you for your patience, I really do appreciate it. I would love to get DL4J power on my tablet which is why I’m being so stubborn with this.

Now as far as the JVM flags are concerned, I used the following to test my new/improved pom file (from the DL4J doc you linked): mvn -DargLine=“org.bytedeco.javacpp.pathsfirst=true -Djavacpp.platform=android-arm” -Dorg.bytedeco.javacpp.pathsfirst=true -Djavacpp.platform=android-arm clean test

I get the error: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?

Also, if it provides insight, Termux recently migrated strictly to F-Droid. There was some problem with how Termux is made and now Google Play Store doesn’t support it. This new version now officially has java in Termux’s package manager (i.e. pkg install …). The official version Termux now has available in its package manager repository is jdk-17 which is not headless which is crucial to also process and create image files (i.e. jpg) that I need for what I want to do. The java useable on the old Play Store Termux was a headless version that came in the form of deb files from a 3rd party website which therefore didn’t allow me to process images. Thanks.

LM

Quick update, it turns out the flags for the VM was missing a “-D”, so the actual flags to get it to work ended up being: mvn -DargLine=“-Dorg.bytedeco.javacpp.pathsfirst=true -Djavacpp.platform=android-arm” -Dorg.bytedeco.javacpp.pathsfirst=true -Djavacpp.platform=android-arm clean package

The docs were missing that first “-D” immediately after “-DargLine=”

Now even though I was finally able to make an uber jar using these VM flags, it still won’t run and gives the same error that it cannot find jniopenblas_nolapack when I try to run the uber jar. Thanks.

@LobsterMan Could you try specifying -Dorg.bytedeco.javacpp.logger.debug=true and give me the output?

If not I’ll try to upload our new openblasless backend tomorrow and we can give that a shot for you. See: deeplearning4j/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-minimizer at master · deeplearning4j/deeplearning4j · GitHub

This is actually targeted at moblie/embedded since openblas can be a pretty big dependency.

I was able to get the build/compile working. It turns out there was a small typo in the docs where a “-D” was omitted in the argument of “-DargLine=”. So even though the flags are set as indicated in the docs and it does build my uber jar with no errors, running this uber jar still gives the error of the jniopenblas_nolapack not being found.

I looked at the indicated GitHub link and I’d like to ask, why is there no deeplearning4j dependency in its pom file? This GitHub link, am I just supposed to take the existing dependencies in its pom and use them/copy-paste in my actual pom file - which does have the deeplearning4j-core dependency? Thanks.

LM

@LobsterMan I linked you the backend here. There are different recipes you can use to run neural networks. This is an additional option that will allow you to run things without openblas. Not everyone needs it and binary sizes come first for people.

It comes down to different people having different requirements.

For example if you don’t need computer vision and are just using the deeplearning4j simpler api then you can just use deeplearning4j-nn and a backend.

If you are not using the deeplearning4j api but instead just samediff (the lower level api) then you just need an nd4j backend.

The complexity mainly comes from making sure you have the right combination of performance, binary size and combination of dependencies you need for your neural network pipeline.

We separate those things so people can mix and match. For example if you don’t need gpus (which you won’t need on say: android) then it shouldn’t be included in your application.

Since your goal is to just run dl4j on a tablet you should be able to get away with deeplearning4j-nn, a backend of your choice (in this case nd4j-native with android-arm64 bindings) and then data pipeline libraries such as opencv or other dependencies you need.

Ok, so I went ahead and modified my pom file to incorporate the dependencies of the backend you linked me to along with incorporating the dependency of deeplearning4j-nn as found on maven and I also used the flags discussed earlier. I however now get the following compile/build error:

The following artifacts could not be resolved: org.nd4j:nd4j-cpu-backend-common:jar:1.0-SNAPSHOT, org.nd4j:nd4j-minimizer-preset:jar:1.0-SNAPSHOT: Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/)

I tried replacing the ${project.version} in the two backend dependencies with “1.0.0-M2.1”, but it still gave the same error.

Are there new names for these two dependencies? I saw another backend on maven that looks like the following, it’s a bit different from what is on the GitHub link you gave me (but couldn’t find another one for “nd4j-minimizer-preset”):

   <dependency>
          <groupId>org.nd4j</groupId>
          <artifactId>nd4j-backends</artifactId>
          <version>1.0.0-M2.1</version>
          <type>pom</type>
   </dependency>

Below is how my pom file now looks:

    <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
    </dependency>

    <!-- deeplearning4j-core: contains main functionality and neural networks --> 
<dependency>
	<groupId>org.deeplearning4j</groupId>
	<artifactId>deeplearning4j-nn</artifactId>
	<version>1.0.0-M2.1</version>
</dependency>

    <dependency>
           <groupId>org.nd4j</groupId>
           <artifactId>nd4j-native-platform</artifactId>
           <version>1.0.0-M2.1</version>
    </dependency>

    <dependency>
           <groupId>ch.qos.logback</groupId>
           <artifactId>logback-classic</artifactId>
           <version>${logback.version}</version>
    </dependency>

<dependency>
          <groupId>org.nd4j</groupId>
          <artifactId>nd4j-cpu-backend-common</artifactId>
          <version>${project.version}</version>
    </dependency>
    <dependency>
          <groupId>org.nd4j</groupId>
          <artifactId>nd4j-minimizer-preset</artifactId>
          <version>${project.version}</version>
    </dependency>

    <dependency>
          <groupId>org.bytedeco</groupId>
          <artifactId>javacpp</artifactId>
          <version>1.5.8</version>
    </dependency>

@LobsterMan

JFYI use https://s01.oss.sonatype.org - the link I gave you should have that. Was there somewhere else in our docs that I missed? Apologies if that’s the case.

From what I remember I didn’t publish nd4j-minimizer yet. I need to setup some new build files to do that.

Beyond that…please quit guessing and just post earlier. nd4j-backends doesn’t show up in our docs and is just a parent module. It doesn’t do anything if you add a pom classifier dependency and that’s going to be true 99% of the time for any java library.

You also don’t need to add the -preset dependencies directly either. Those are transitive dependencies.

When I mention “just add this” there’s usually a reason for that.

Lastly, note that nd4j-minimizer is its own backend. You do not include multiple backends on your classpath.

With all this out of the way what are you trying to do? I guess you’re still getting the openblas error?

I’ll reiterate you did everything but what I asked you to do. Please post the output of org.bytedeco.javacpp.logger.debug=true so I can try to see what error you’re getting.

When I ran with those settings on termux I didn’t have any issues. I’d like to see what issues you might be having and what library it’s struggling with.

My ultimate goal is this: be able to train a deep learning model on Termux by giving the deep learning network a data file - all of this done on termux - and then save this trained model for future use where I then give a new data file to this trained model so the model can make its predictions. I want to do absolutely all of this on termux.

Right now, the program isn’t even compiling anymore because it looks like it cannot find the indicated dependencies, even with the changes to the pom file dependency section.

Now, as of right now, my pom file dependencies looks like the following, and below this pom is the debug output:

   <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
   </dependency>

    <!-- deeplearning4j-core: contains main functionality and neural networks --> 
<dependency>
	<groupId>org.deeplearning4j</groupId>
	<artifactId>deeplearning4j-nn</artifactId>
	<version>1.0.0-M2.1</version>
</dependency>

    <dependency>
           <groupId>org.nd4j</groupId>
           <artifactId>nd4j-native-platform</artifactId>
           <version>1.0.0-M2.1</version>
    </dependency>

    <dependency>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
          <version>${logback.version}</version>
    </dependency>

    <dependency>
          <groupId>org.nd4j</groupId>
          <artifactId>nd4j-cpu-backend-common</artifactId>
          <version>1.0.0-SNAPSHOT</version>
    </dependency>

    <dependency>
          <groupId>org.bytedeco</groupId>
          <artifactId>javacpp</artifactId>
          <version>1.5.8</version>
    </dependency>

Now I ran the flag you indicated as: mvn -DargLine=“-Dorg.bytedeco.javacpp.pathsfirst=true -Dorg.bytedeco.javacpp.logger.debug=true -Djavacpp.platform=android-arm” -Dorg.bytedeco.javacpp.pathsfirst=true -Dorg.bytedeco.javacpp.logger.debug=true -Djavacpp.platform=android-arm clean package

and it still just gave me the same generic error with no additional info: The following artifacts could not be resolved: org.nd4j:nd4j-cpu-backend-common:jar:1.0-SNAPSHOT, org.nd4j:nd4j-minimizer-preset:jar:1.0-SNAPSHOT: Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/)

Using the -X flag for debugging, however, I get the following (I hope this offers some insight into why it’s not compiling/building):

ERROR] Failed to execute goal on project dl4jTesting: Could not resolve dependencies for project eruptus.volcano:dl4jTesting:jar:1.0-SNAPSHOT: Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/) → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project dl4jTesting: Could not resolve dependencies for project eruptus.volcano:dl4jTesting:jar:1.0-SNAPSHOT: Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:269)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project eruptus.volcano:dl4jTesting:jar:1.0-SNAPSHOT: Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:209)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:243)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:357)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:202)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:243)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:424)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:340)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:202)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:243)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed (ArtifactTransportListener.java:48)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:369)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute (BasicRepositoryConnector.java:644)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get (BasicRepositoryConnector.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:499)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:401)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:340)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:202)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:243)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

@LobsterMan you don’t need javacpp either. It’s also a transitive dependency.

Sorry but your pom and stack trace are physically impossible. Snapshots aren’t anywhere to be found nor is there an oss repo mentioned. I also already mentioned that that was the wrong one anyways.

Could you please clean this up? You’re making this a lot harder than necessary on both of us.

You still ignored my very basic ask of setting a jvm property so I can see some debug output. If you don’t know how to do that please ask.

I don’t think I’m asking for much here. I just want you to keep your versions straight, give me some basic information to see what might be different from my termux setup I use and as a last resort I can spend some time making the non openblas build work for you.

Yes, could you please tell me how to use the jvm debug property.

My apologies, but I am indeed a novice trying to break into this field so I am sorry if my questions are basic.

You mentioned snapshots aren’t found and that I didn’t mention an oss repo. What does this mean? Is this stuff that’s supposed to be in the dependencies section, or beyond just the dependencies section I’ve been providing?

Is there a working pom file set up for the termux version you got working on your end (if my problem is my pom file)? That would make it easier for me to see what a working setup should look like because to tell you the truth, I am grasping about here in the complete dark.

Again, my apologies for the elementary questions I have and I do greatly appreciate and thank you for your patience and understanding.

LM

@LobsterMan awesome thanks for clarifying. Nothing wrong with being a novice I just want to help you better. When I have to reverse engineer what it is you do/don’t know or I have to guess it makes things difficult.

If you are running using java -cp use java -D

Note you’ll need to do the same for the other system properties as well in order for this to work.

If you are using maven are you using the mvn exec plugin?

I’m trying to build compile this way:

mvn -DargLine=“-Dorg.bytedeco.javacpp.pathsfirst=true -Dorg.bytedeco.javacpp.logger.debug=true -Djavacpp.platform=android-arm” -Dorg.bytedeco.javacpp.pathsfirst=true -Dorg.bytedeco.javacpp.logger.debug=true -Djavacpp.platform=android-arm clean package

Is the “org.bytedeco.javacpp.logger.debug=true” in the correct location above? I have it both inside the “-DargLine=” argument (enclosed in the quotes “”) and after it. Thanks.

LM

@LobsterMan you’ll need those when you run your application. That is just the build unfortunately. Could you please set those properties when you run the program as I mentioned above? You’d usually do that with java -Dorg.bytedeco.javacpp.pathsfirst=true -Dorg.bytedeco.javacpp.logger.debug=true -Djavacpp.platform=android-arm” -Dorg.bytedeco.javacpp.pathsfirst=true -Dorg.bytedeco.javacpp.logger.debug=true

You mainly need -Djavacpp.platform when building your far file and using nd4j-native-platform.

Hi, I am back again to continue with setup. Is there a new version that I should be using for the following dependency (I’m at the compiling stage right now)? It used to compile with what’s below, but now I’m getting a compile error (using maven) that says “Could not find artifact org.nd4j:nd4j-cpu-backend-common:jar:1.0.0-SNAPSHOT in snapshots (https://oss.sonatype.org/content/groups/public/)”.

  <dependency>
    <groupId>org.nd4j</groupId>
    <artifactId>nd4j-cpu-backend-common</artifactId>
    <version>1.0.0-SNAPSHOT</version>
  </dependency>

@LobsterMan I think I covered this before…that is not the correct snapshots repository. See: Snapshots - Deeplearning4j

Hello again (I’m tackling this project on and off so hence the time gap in following up).

A quick refresher of my situation: I want to code Java on my Android tablet using Termux with DL4J, but some native libraries don’t seem to be found, or even downloaded altogether. The project build works fine, but it’s not executing due to these missing native libraries. This is the problem I want to troubleshoot.

So I went ahead and ran the debug flag that you recommended me (I learned how to use it) and my output result details from using the debug flag is below (hopefully it gives some clues on where the problem lies):

Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.javacpp.Loader
Debug: Loading library jnijavacpp
Debug: Failed to load for jnijavacpp: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Could not load Loader: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.openblas.global.openblas_nolapack
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.openblas.global.openblas_nolapack
Debug: Loading library gcc_s
Debug: Failed to load for gcc_s@.1: java.lang.UnsatisfiedLinkError: no gcc_s in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Loading library quadmath
Debug: Failed to load for quadmath@.0: java.lang.UnsatisfiedLinkError: no quadmath in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Loading library gfortran
Debug: Failed to load for gfortran@.5: java.lang.UnsatisfiedLinkError: no gfortran in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Loading library gfortran
Debug: Failed to load for gfortran@.4: java.lang.UnsatisfiedLinkError: no gfortran in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Loading library gfortran
Debug: Failed to load for gfortran@.3: java.lang.UnsatisfiedLinkError: no gfortran in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Loading library openblas
Debug: Failed to load for openblas@.0#openblas_nolapack@.0: java.lang.UnsatisfiedLinkError: no openblas in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Loading library openblas_nolapack
Debug: Failed to load for openblas_nolapack@.0: java.lang.UnsatisfiedLinkError: no openblas_nolapack in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib
Debug: Loading library jniopenblas_nolapack
Debug: Failed to load for jniopenblas_nolapack: java.lang.UnsatisfiedLinkError: no jniopenblas_nolapack in java.library.path: /data/data/com.termux/files/usr/java/packages/lib:/data/data/com.termux/files/usr/lib

@LobsterMan it looks like it’s failing to load openblas. Do you have anything more for me there? At some point I just need to be able to recreate your environment. Could you just tell me more about it? This shouldn’t be rocket science and should be very doable to setup. I did it pretty easily on my raspberry pi android setup last year. There’s zero reason it should be this hard…

Well my machine is a Samsung Galaxy tab E running Android 8.1 (not a pi). I’m using Termux obtained from F-Droid (the latest place to get it from) since the they had to migrate from the Google Playstore due to some restrictions. In Termux, I’m using Java 17 as well as the official Maven package now provided by Termux in their package repository. I can post my pom file again if you want to look at it.

@LobsterMan yes please do.