-
Notifications
You must be signed in to change notification settings - Fork 0
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
VRL-UG-API recompiles always #2
Comments
It should not report successful compilation. From your output I can see that it didn't create the Java library. That's a bug. You could try to copy the tmp-folder with the gradle-project (see this line in your log):
If you open that in an IDE it should highlight compile errors that occur during the build process. You can also manually build the gradle project via the gradle CLI. In the past, most of these compile errors are related to ug4-registry-entries that violate the inheritance rules used by most statically typed languages (C++, Java, ...). For other bindings, such as LUA, Groovy and Python this would most likely not be a problem. |
@miho thank you. I will give this a shot and will then come back to you. |
I invoked ./gradlew jar on this Gradle project. Here is the output (Attached). Here is the beginning of the full
|
It looks like it doesn't find all dependencies. Could it be that you are using a different VRL version for building the VRL-UG plugin? Maybe try to set the vrl directory in the build.properties file of the generated gradle project. Does that help? |
Okay, so I should put the VRL.jar I build during VRL-UG into the VRL-UG-API Gradle project? |
No, but my guess is that it uses a different .vrl directory (e.g. /home/user123/.vrl/0.4.3/default vs 0.4.5/...). It is using the VRL-UG.jar plugin as dependency during the build. If the VRL versions do match nothing needs to be specified here. But if they differ, you might run into problems. Option 1: change the VRL dependency in the generated build.gradle file so it matches the correct version build.gradle: L82-83 compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.3.2.3')
compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.3.2.3', classifier: 'javadoc') Option 2: set the vrldir property in the build.properties file (see https://github.com/VRL-Studio/VRL-UG/blob/master/src/main/resources/edu/gcsc/vrl/ug/build.properties) |
Okay I have set this in VRL-UG gradle project's The VRL-UG-API gradle project has the same: My VRL Studio uses Might this be an issue? |
Yes, see my previous post for potential fixes. |
and note, that the generated project in the temp folder needs the correct version as well. here's a link to the template used for generating the project: https://github.com/VRL-Studio/VRL-UG/blob/master/src/main/resources/edu/gcsc/vrl/ug/build.gradle |
@miho I see. So I need to specify for my two projects (VRL-UG) and the generated (VRL-UG-API) the same VRL version as my VRL Studio uses, thus version |
Yes. |
I changed in VRL-UG project the dependency to use VRL The effect is as before?
|
You also need to change the version in the template gradle (see build.gradle link to the resource folder from above). |
Yes, I did change the version in the template gradle (build.gradle). |
Ok, then I will try to compile it on my machine. Maybe you can just copy the 0.4.4 to 0.4.3 in the meantime. Symlink might also work. |
I am confused about the 0.4.4 to 0.4.3. I have only one folder in .vrl: 0.4.4 |
Did you have a chance to test this? |
@miho could you give me some more advice here? |
It seems to be related to an out-of-memory error. If I compile the api manually via gradle (see README.md) I get an out-of-memory error. It looks like the number of registered classes highly increased. I would recommend you copy the auto generated gradle project to a safe location where it's not overwritten by VRL. I made some changes to the build.gradle file to compile it with the newest version of java and vrl. Here's the modified file (I will commit the file if it works for you): apply plugin: 'groovy'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
wrapper {
gradleVersion = '6.8'
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.5.0.0')
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.10'
compileClasspath group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.12'
compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.5.0.0')
compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.5.0.0', classifier: 'javadoc')
compile group: 'org.apache.xmlrpc', name: 'xmlrpc-client', version: '3.1.3'
compile group: 'org.apache.xmlrpc', name: 'xmlrpc-server', version: '3.1.3'
// local dependencies can be added by putting them to the lib/jar folder
compile files("lib/jars/vrl-ug.jar")
compile files(getVRLDir() + "/plugins/VRL-UG.jar")
}
def loadProperties(String sourceFileName) {
def config = new Properties()
def propFile = new File(projectDir,sourceFileName)
if (propFile.isFile()) {
config.load(new FileInputStream(propFile))
for (Map.Entry property in config) {
ext.set(property.key, property.value)
}
}
}
// loads the property file
loadProperties('build.properties')
String getVRLDir() {
loadProperties('build.properties')
String result
if (vrldir == null || vrldir.isEmpty()) {
result = System.getProperty("user.home");
result+= "/.vrl/"
result+= eu.mihosoft.vrl.system.Constants.VERSION_MAJOR
result+= "/default"
} else {
result = vrldir
}
return result
}
// compiles and installs the vrl plugin to the specified folder
task installVRLPlugin(dependsOn: [clean,jar]) {
doLast {
println(">> copying vrl plugin to: " + getVRLDir() + "/plugin-updates")
copy {
from buildDir.getPath() + "/libs/" + rootProject.name + ".jar"
into getVRLDir() + "/plugin-updates"
include '**/*.jar'
}
}
}
tasks.withType(GroovyCompile) {
configure(groovyOptions.forkOptions) {
memoryMaximumSize = '1g'
jvmArgs = ['-XX:MaxPermSize=512m', '-Xms512m', '-Xmx4096g']
}
}
Please make sure the path to the vrl-ug.jar is set correctly in the dependency section. I just copied it to lib/jars/ and specified it (see build file above). Now you can build it in most IDEs (IntellIJ, Eclipse, VS Code etc.). But I prefer the CLI:
or
to install the plugin. When I tried to compile it I got several errors. It looks like the structure of the registered UG classes has changed. If you want to give it a try make sure class groups have a common base class. Alternatively, you could update the code generator to generate common base classes for each class group if none has been provided. Let me know if this works for you.
|
I should have mentioned that the erros you got are gone. All the classes it complained about are found on my system. Here are the errors I am getting (which are presumably related to the class group issue mentioned above):
|
Thank you @miho. I will now try and see if it works for me. Anyway I should end up with the 3 errors you show above, correct? Update: I see, I reproduce the same three errors. |
@miho: Do I understand correctly that |
It looks like this error was also related to the memory issue. Considering the fact that the code generator creates more that half a million lines of code just for the ConvectionDiffusion & SmallStrainMechanics plugins with default options I think we should disable the auto-compile feature that was once very convenient. I just updated the gradle files. So the issue should be fixed now. You should be able to compile the API with BTW. the code generation takes some time. Make sure you wait until it's done. If you run VRL from the terminal you should see the following output:
Let me know if there are remaining issues. |
Here's my version of the compiled API: |
@miho do I also have to re-compile ug4/ugcore? I clone the VRL-UG repository, put the binaries in the natives folder, and used The natives I put into: |
I see, my UG API isn't build because of this:
Any idea how to handle this @miho ? Can't I use OpenJDK? Best, |
For this type of error it's important to know the OS, the exact Java version etc. Without this information I can only guess. Anyway, here are some thoughts: First of all, you can use OpenJDK. It's the reference implementation of Java and we use it almost exclusively. I only test on other JVMs to see if VRL is compatible to those implementations as well. The error message is not directly related to the Java heap. It's related to the native parts of Java and it's the operating system that cannot supply the amount of RAM requested by the JVM process. Files like hs_err_pid32611.log indicate that the process crashed in native code. The Java equivalent of this would be an "out of memory" exception. Are you running the build process inside a virtualized server (travis, gh action etc.) or a machine with only 4GB of RAM or less? In this case you could reduce the amount of RAM for the Groovy compiler in the build.gradle file. |
Please @miho let me know fi there is anything apparently wrong below: Yes I think you specified 4096G instead of 4096M in the Okay, I recompiled Here are my
Here are the first 100 lines of error:
One thing I noted is that the binaries/natives go to |
Sorry, that was a typo ;) The location of the native libraries and the package of the Java-Classes are not related. The import seems correct. What irritates me is that you could reproduce the errors I got earlier, which means the compiler found the classes from edu.gcsc.vrl.ug.. Please check that the dependencies for VRL-UG in the auto-generated gradle-file are specified correctly: dependencies {
// other dependencies...
// local dependencies can be added by putting them to the lib/jar folder
compile files(getVRLDir() + "/plugins/VRL-UG.jar") // check upper- vs. lower-case
} Try adding the vrl-ug.jar manually, e.g., by adding |
Thanks. I added the line to the
|
I am pretty sure that I recompiled ug4 with DIM=ALL, but I wonder if DIM=3 or so, would lead to the errors above, or not. Would DIM=3 result in these kind of errors above?! Are my UG build settings okay? |
Any hints here? |
I could successfully compile it with your DIM settings (on Windows 10). |
Thank you, could you let us know which JDK you used and which ug revision / plugins? (A colleague and I both could not make it work so far on Windows or Ubuntu) |
I recently tested it with JDK 8, 11 and 14, UG commit id: c3345494625ba56e29c4c461bcd0b33dfd32a8bd). I compiled the API for the plugins ConvectionDiffusion, SmallStrainMechanics and LuaShell. |
Thank you, we will try this. |
After installing VRL-UG the API is being recompiled, which is fine.
There seems to be no error in compilation of the API I presume, because it reports as successful.
Then I restart VRL-Studio as suggested and then the API is being recompiled again (See screenshot below).
Repeat workflow, e.g. close VRL-Studio, and start VRL-Studio will compile the API again... and so on.
Is there anything I am missing here?
Here is the log which I did not save by accident previously:
The text was updated successfully, but these errors were encountered: