orml icon indicating copy to clipboard operation
orml copied to clipboard

Demos fail due to SNAPSHOT error

Open capital-G opened this issue 3 years ago • 9 comments

Cloning this repo (on commit https://github.com/openrndr/orml/commit/66758722bca35b3680ea98003584e62a9d086979) and trying to run any example fails

Execution failed for task ':orml-utils:compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':orml-utils:compileKotlin'
   > Could not resolve all files for configuration ':orml-utils:compileClasspath'.
      > Could not find org.openrndr.extra:orx-tensorflow:0.5.1-SNAPSHOT.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/org/openrndr/extra/orx-tensorflow/0.5.1-SNAPSHOT/maven-metadata.xml
          - https://repo.maven.apache.org/maven2/org/openrndr/extra/orx-tensorflow/0.5.1-SNAPSHOT/orx-tensorflow-0.5.1-SNAPSHOT.pom
          - file:/Users/xxx/.m2/repository/org/openrndr/extra/orx-tensorflow/0.5.1-SNAPSHOT/maven-metadata.xml
          - file:/Users/xxx/.m2/repository/org/openrndr/extra/orx-tensorflow/0.5.1-SNAPSHOT/orx-tensorflow-0.5.1-SNAPSHOT.pom
        Required by:
            project :orml-utils
      > Could not find org.openrndr:openrndr-draw:0.5.1-SNAPSHOT.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/org/openrndr/openrndr-draw/0.5.1-SNAPSHOT/maven-metadata.xml
          - https://repo.maven.apache.org/maven2/org/openrndr/openrndr-draw/0.5.1-SNAPSHOT/openrndr-draw-0.5.1-SNAPSHOT.pom
          - file:/Users/xxx/.m2/repository/org/openrndr/openrndr-draw/0.5.1-SNAPSHOT/maven-metadata.xml
          - file:/Users/xxx/.m2/repository/org/openrndr/openrndr-draw/0.5.1-SNAPSHOT/openrndr-draw-0.5.1-SNAPSHOT.pom
        Required by:
            project :orml-utils
      > Could not find org.openrndr:openrndr-application:0.5.1-SNAPSHOT.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/org/openrndr/openrndr-application/0.5.1-SNAPSHOT/maven-metadata.xml
          - https://repo.maven.apache.org/maven2/org/openrndr/openrndr-application/0.5.1-SNAPSHOT/openrndr-application-0.5.1-SNAPSHOT.pom
          - file:/Users/xxx/.m2/repository/org/openrndr/openrndr-application/0.5.1-SNAPSHOT/maven-metadata.xml
          - file:/Users/xxx/.m2/repository/org/openrndr/openrndr-application/0.5.1-SNAPSHOT/openrndr-application-0.5.1-SNAPSHOT.pom
        Required by:
            project :orml-utils

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Also switching

https://github.com/openrndr/orml/blob/0c731f72e22c6e27fb562dd6af666b8d631dee5d/buildSrc/src/main/kotlin/Versions.kt#L2-L3

to false so it does not rely on snapshot releases fails now with

Execution failed for task ':orml-ssd:compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':orml-ssd:compileKotlin'
   > Could not resolve all files for configuration ':orml-ssd:compileClasspath'.
      > Could not find org.openrndr:openrndr-application:0.4.0.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/org/openrndr/openrndr-application/0.4.0/openrndr-application-0.4.0.pom
        If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
        Required by:
            project :orml-ssd
      > Could not find org.openrndr:openrndr-draw:0.4.0.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/org/openrndr/openrndr-draw/0.4.0/openrndr-draw-0.4.0.pom
        If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
        Required by:
            project :orml-ssd

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

When using the the OPENRNDR template and uncomment e.g. dbface in

https://github.com/openrndr/openrndr-template/blob/71bb6c61c7ffdd5feca47b8168289a25d1b8c341/build.gradle.kts#L65-L67

yields the following error when trying to run any code in intellij idea

Execution failed for task ':compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':compileKotlin'
   > Could not resolve all files for configuration ':compileClasspath'.
      > Could not find org.openrndr.orml:orml-dbface:0.5.1-SNAPSHOT.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/org/openrndr/orml/orml-dbface/0.5.1-SNAPSHOT/maven-metadata.xml
          - https://repo.maven.apache.org/maven2/org/openrndr/orml/orml-dbface/0.5.1-SNAPSHOT/orml-dbface-0.5.1-SNAPSHOT.pom
          - file:/Users/xxx/.m2/repository/org/openrndr/orml/orml-dbface/0.5.1-SNAPSHOT/maven-metadata.xml
          - file:/Users/xxx/.m2/repository/org/openrndr/orml/orml-dbface/0.5.1-SNAPSHOT/orml-dbface-0.5.1-SNAPSHOT.pom
          - https://maven.openrndr.org/org/openrndr/orml/orml-dbface/0.5.1-SNAPSHOT/maven-metadata.xml
          - https://maven.openrndr.org/org/openrndr/orml/orml-dbface/0.5.1-SNAPSHOT/orml-dbface-0.5.1-SNAPSHOT.pom
        Required by:
            project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html


I am somehow always confused by the dependency management systems of programming languages [even python/pip confuses me enough although I code with it professionally] - this holds true for gradle. Isn't a dependency/building system there so it builds stuff for me if its not available?

I found https://openrndr.discourse.group/t/cant-get-orml-to-work/306/4 on the forum but in the end it links to a slack link which one can only visit with a slack account which I do not have. Maybe it is a naive error of mine, but even if it is it would be good to have it at least documented.

I am using macOS 11.6.2 with openjdk 17.

capital-G avatar Mar 22 '22 22:03 capital-G

Hi! I did copy the solution from Slack to the forum in the linked post. In that case it was simply that the environment JAVA_HOME variable was not set. Could you check if that is the case? Not sure this is the best link but at least it can get you started: https://www.wikihow.com/Set-Java-Home

Does your openrndr-template run the https://github.com/openrndr/openrndr-template/blob/master/src/main/kotlin/TemplateProgram.kt ?

hamoid avatar Mar 23 '22 05:03 hamoid

Thanks for the response - setting the JAVA_HOME variable does not make the error go away

❯ export | grep JAVA_HOME                          
JAVA_HOME=/Users/xxx/Library/Java/JavaVirtualMachines/openjdk-17.0.2/Contents/Home

The openrndr template works as long as I do not activate any orml features.

capital-G avatar Mar 23 '22 09:03 capital-G

In the examples I've seen the /Contents/Home part is not there. Could that be it?

Is there a bin folder inside /Users/xxx/Library/Java/JavaVirtualMachines/openjdk-17.0.2/Contents/Home ?

hamoid avatar Mar 23 '22 15:03 hamoid

Looks finde to me

❯ ls /Users/xxx/Library/Java/JavaVirtualMachines/openjdk-17.0.2/Contents/Home/bin
jar         jcmd        jhsdb       jpackage    jstatd
jarsigner   jconsole    jimage      jps         keytool
java        jdb         jinfo       jrunscript  rmiregistry
javac       jdeprscan   jlink       jshell      serialver
javadoc     jdeps       jmap        jstack
javap       jfr         jmod        jstat

capital-G avatar Mar 23 '22 17:03 capital-G

I tried on my system by cloning the orml repo and running orml-image-classifier/src/demo/kotlin/DemoClassifier.kt and orml-image-classifier/src/demo/kotlin/DemoEmbedding.kt inside IntelliJ Idea and they did run. I have an issue with ffmpeg versions so my webcam wasn't running (needed for other examples) but that's a different story. I have orx and opernrdr snapshot set to true, running on Linux with CUDA installed.

I'll try to find help :)

hamoid avatar Mar 23 '22 18:03 hamoid

I'll try to compile the matching versions to my local maven repository ~/.m2/repository/org/openrndr now but I do not understand how/why orml uses 0.5-snapshot as a version number for openrndr but I can not find a matching git tag for openrndr in https://github.com/openrndr/openrndr/tags

How did you manage to compile the proper versions for each? And why is gradle not doing this for me or is there a way to compile those for me automatically?

capital-G avatar Mar 28 '22 11:03 capital-G

Hi. I think Edwin was working in recent days to release orml in maven central. It will be there when he has a minute.

There's this: https://github.com/openrndr/openrndr/wiki/Version-matrix (don't know if it's up to date).

When making a local snapshot I just type something like this:

./gradlew publishToMavenLocal -Prelease.version=2.0-SNAPSHOT

As far as I understand, I can set any snapshot name I want there. The name should match the name another component tries to use.

I forgot to mention that in my last test I was using everything from git, no remote packages. I do that because I often make changes and send them back as pull requests.

hamoid avatar Mar 28 '22 15:03 hamoid

Thanks for the hint, it turns out reading README.md is sometimes a good idea as you start to not see the wood for the trees...

What worked for me was

  • Build openrndr to local maven repo w/ custom release tag as proposed by https://github.com/openrndr/openrndr/blame/master/README.md#L58
    git clone [email protected]:openrndr/openrndr.git && \
    cd openrndr && \
    ./gradlew -Prelease.version=0.5.1-SNAPSHOT publishToMavenLocal
    
  • Build orx b/c we need orx-tensorflow
    git clone [email protected]:openrndr/orx.git && \
    cd orx && \
    ./gradlew -Prelease.version=0.5.1-SNAPSHOT publishToMavenLocal
    
  • Build orml
    git clone [email protected]:openrndr/orml.git && \
    cd orml && \
    ./gradlew -Prelease.version=0.5.1-SNAPSHOT publishToMavenLocal
    

Now one can create a project from https://github.com/openrndr/openrndr-template and uncomment something from https://github.com/openrndr/openrndr-template/blob/71bb6c61c7ffdd5feca47b8168289a25d1b8c341/build.gradle.kts#L65-L75 and can start the coding :)

Still don't get why gradle can't build this for me automatically b/c with this global installations it is doomed to fail.

Shall we close this issue?

capital-G avatar Mar 28 '22 16:03 capital-G

Nice! Happy that you made it work :)

I would wait for Edwin to close it, maybe there's something that can be done to make this easier (either documentation or the maven-central package he was preparing).

Cheers!

hamoid avatar Mar 28 '22 16:03 hamoid