Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demos fail due to SNAPSHOT error #2

Open
capital-G opened this issue Mar 22, 2022 · 9 comments
Open

Demos fail due to SNAPSHOT error #2

capital-G opened this issue Mar 22, 2022 · 9 comments

Comments

@capital-G
Copy link

Cloning this repo (on commit 6675872) 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

var orxUseSnapshot = true
var openrndrUseSnapshot = true

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.

@hamoid
Copy link
Member

hamoid commented Mar 23, 2022

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 ?

@capital-G
Copy link
Author

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.

@hamoid
Copy link
Member

hamoid commented Mar 23, 2022

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 ?

@capital-G
Copy link
Author

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

@hamoid
Copy link
Member

hamoid commented Mar 23, 2022

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 :)

@capital-G
Copy link
Author

capital-G commented Mar 28, 2022

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?

@hamoid
Copy link
Member

hamoid commented Mar 28, 2022

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.

@capital-G
Copy link
Author

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 git@github.com:openrndr/openrndr.git && \
    cd openrndr && \
    ./gradlew -Prelease.version=0.5.1-SNAPSHOT publishToMavenLocal
  • Build orx b/c we need orx-tensorflow
    git clone git@github.com:openrndr/orx.git && \
    cd orx && \
    ./gradlew -Prelease.version=0.5.1-SNAPSHOT publishToMavenLocal
  • Build orml
    git clone git@github.com: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?

@hamoid
Copy link
Member

hamoid commented Mar 28, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants