Orekit Python Wrapper with develop version

Hello,

I use orekit with its python wrapper.
I have successfully compiled with version 11.3

However, I failed to compile it with orekit develop version.

First, I downloaded orekit-develop zip in GitHub - petrushy/Orekit: This branch contain the java classes for orekit-python-wrapper and I build Orekit with mvn package command.
Then I put .jar file in orekit_python_artifacts folder and I modified build.sh with the right orekit .jar filename.

When I run build.sh I have this error :
jcc.cpp.JavaError: java.lang.NoClassDefFoundError: org/hipparchus/ode/events/FieldODEEventDetector
Java stacktrace:
java.lang.NoClassDefFoundError: org/hipparchus/ode/events/FieldODEEventDetector
Caused by: java.lang.ClassNotFoundException: org.hipparchus.ode.events.FieldODEEventDetector
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)

I think this error come from wrong hipparchus version.
I tried with 2.1 and 2.3 version but that didn’t worked.

Could you help me ?

Thanks
Victor

The Orekit development version currently needs the Hipparchgus development version (which will become 3.0 when published).

Note that Hipparchus does not use the gitflow model, so the development version corresponds to the master git branch.

Thanks for this information.

However, when I run buils.sh by using Hipparchus develop version (master git branch) I have a lot of errors like that :
build/_orekit/wrap83.cpp: In static member function ‘static _jclass* java::util::Map$Entry::initializeClass(bool)’:
build/_orekit/wrap83.cpp:108:15: error: ‘mid_comparingByKey_a201f30ccce87e8a’ was not declared in this scope
mids$[mid_comparingByKey_a201f30ccce87e8a] = env->getStaticMethodID(cls, “comparingByKey”, “()Ljava/util/Comparator;”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/_orekit/wrap83.cpp:108:15: note: suggested alternative: ‘mid_comparingByKey_142a1fa1c1bd038f’
mids$[mid_comparingByKey_a201f30ccce87e8a] = env->getStaticMethodID(cls, “comparingByKey”, “()Ljava/util/Comparator;”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mid_comparingByKey_142a1fa1c1bd038f
build/_orekit/wrap83.cpp:109:15: error: ‘mid_comparingByKey_9d63152b635c9115’ was not declared in this scope
mids$[mid_comparingByKey_9d63152b635c9115] = env->getStaticMethodID(cls, “comparingByKey”, “(Ljava/util/Comparator;)Ljava/util/Comparator;”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/_orekit/wrap83.cpp:109:15: note: suggested alternative: ‘mid_comparingByKey_142a1fa1c1bd038f’
mids$[mid_comparingByKey_9d63152b635c9115] = env->getStaticMethodID(cls, “comparingByKey”, “(Ljava/util/Comparator;)Ljava/util/Comparator;”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mid_comparingByKey_142a1fa1c1bd038f
build/_orekit/wrap83.cpp:110:15: error: ‘mid_comparingByValue_a201f30ccce87e8a’ was not declared in this scope
mids$[mid_comparingByValue_a201f30ccce87e8a] = env->getStaticMethodID(cls, “comparingByValue”, “()Ljava/util/Comparator;”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/_orekit/wrap83.cpp:110:15: note: suggested alternative: ‘mid_comparingByValue_142a1fa1c1bd038f’
mids$[mid_comparingByValue_a201f30ccce87e8a] = env->getStaticMethodID(cls, “comparingByValue”, “()Ljava/util/Comparator;”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mid_comparingByValue_142a1fa1c1bd038f
build/_orekit/wrap83.cpp:111:15: error: ‘mid_comparingByValue_9d63152b635c9115’ was not declared in this scope
mids$[mid_comparingByValue_9d63152b635c9115] = env->getStaticMethodID(cls, “comparingByValue”, “(Ljava/util/Comparator;)Ljava/util/Comparator;”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/_orekit/wrap83.cpp:111:15: note: suggested alternative: ‘mid_comparingByValue_142a1fa1c1bd038f’
mids$[mid_comparingByValue_9d63152b635c9115] = env->getStaticMethodID(cls, “comparingByValue”, “(Ljava/util/Comparator;)Ljava/util/Comparator;”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mid_comparingByValue_142a1fa1c1bd038f
build/_orekit/wrap83.cpp:112:15: error: ‘mid_equals_869955b1b19eeaab’ was not declared in this scope
mids$[mid_equals_869955b1b19eeaab] = env->getMethodID(cls, “equals”, “(Ljava/lang/Object;)Z”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~

Sorry, I have no idea what happens.
@petrus.hyvonen do you understand what is the problem?

Hi,

Oh hard to say. Some approaches I would suggest:

  • First try to compile it as-is from the orekit-artifacts to see if your environment is working properly with the “known working” code
  • There may be some keywords that may mess with python, add these to build scripts with the “reserverd” parameter
  • You can also try to exclude classes from being wrapped with the “exclude” directive, to try to figure out what is going wrong.

It can require a bit of messing about to build it from scratch, that’s why I typically recommend using the coda package if posisible.

Depending on your use case, it can also be worth having a look at the experimental alternative orekit_jpype, it works differently based on jpype which is not wrapping but interfacing java on-the-fly., less risk of building issues. Not possible to subclass in jpype but most things are still available through specifying interfaces. Files · master · Petrus Hyvönen / orekit_jpype · GitLab

It’s ok, I made it.

The problem was build folder generated by build.sh was not right because script wrap83.cpp and wrap84.cpp are in the build/_orekit folder of master version but not in build/_orekit folder of develop version.
When I run the build.sh of develop version, these files are not automatically remove.
So I remove build folder before running build.sh.

1 Like