Skip to content
Snippets Groups Projects
Commit 4af53ece authored by Petrus Hyvönen's avatar Petrus Hyvönen
Browse files

updates for orekit 10.3.1

parent b8782311
No related branches found
No related tags found
No related merge requests found
:: adding compile parameters explicitly as relocation for conda does not seem to detect JCC path under windows
@set "JCC_INCLUDES=%JCC_JDK%\include;%JCC_JDK%\include\win32"
@set "JCC_JDK=%PREFIX%\Library"
@set "JCC_INCLUDES=%PREFIX%\Library\include\win32;%PREFIX%\Library\include"
@set "JCC_CFLAGS=/EHsc;/D_CRT_SECURE_NO_WARNINGS"
@set "JCC_LFLAGS=/DLL;/LIBPATH:%JCC_JDK%\lib;Ws2_32.lib;jvm.lib"
@set "JCC_LFLAGS=/DLL;/LIBPATH:%PREFIX%\Library\lib;Ws2_32.lib;jvm.lib"
@set "JCC_DEBUG_CFLAGS=/Od;/DDEBUG"
@set "JCC_JAVAC=%JCC_JDK%\bin\javac.exe"
@set "JCC_JAVADOC=%JCC_JDK%\bin\javadoc.exe"
@set "JCC_JAVAC=%PREFIX%\Library\bin\javac.exe"
@set "JCC_JAVADOC=%PREFIX%\Library\bin\javadoc.exe"
"%PYTHON%" -m jcc ^
--use_full_names ^
--python orekit ^
--version %PKG_VERSION% ^
--jar %SRC_DIR%\orekit-10.1.jar ^
--jar %SRC_DIR%\hipparchus-core-1.6.jar ^
--jar %SRC_DIR%\hipparchus-filtering-1.6.jar ^
--jar %SRC_DIR%\hipparchus-fitting-1.6.jar ^
--jar %SRC_DIR%\hipparchus-geometry-1.6.jar ^
--jar %SRC_DIR%\hipparchus-ode-1.6.jar ^
--jar %SRC_DIR%\hipparchus-optim-1.6.jar ^
--jar %SRC_DIR%\hipparchus-stat-1.6.jar ^
--jar %SRC_DIR%\rugged-2.1.jar ^
--jar %SRC_DIR%\orekit-10.3.1.jar ^
--jar %SRC_DIR%\hipparchus-clustering-1.8.jar ^
--jar %SRC_DIR%\hipparchus-core-1.8.jar ^
--jar %SRC_DIR%\hipparchus-fft-1.8.jar ^
--jar %SRC_DIR%\hipparchus-filtering-1.8.jar ^
--jar %SRC_DIR%\hipparchus-fitting-1.8.jar ^
--jar %SRC_DIR%\hipparchus-geometry-1.8.jar ^
--jar %SRC_DIR%\hipparchus-migration-1.8.jar ^
--jar %SRC_DIR%\hipparchus-ode-1.8.jar ^
--jar %SRC_DIR%\hipparchus-optim-1.8.jar ^
--jar %SRC_DIR%\hipparchus-stat-1.8.jar ^
--jar %SRC_DIR%\rugged-2.2.jar ^
--package java.io ^
--package java.util ^
--package java.text ^
......@@ -53,6 +57,9 @@ java.util.TreeSet ^
java.util.stream.Collectors ^
java.util.stream.Stream ^
java.util.stream.DoubleStream ^
java.util.function.LongConsumer ^
java.util.function.IntConsumer ^
java.util.function.DoubleConsumer ^
--module %SRC_DIR%\pyhelpers.py ^
--reserved INFINITE ^
--reserved ERROR ^
......@@ -79,4 +86,4 @@ copy %RECIPE_DIR%\scripts\activate.bat %ACTIVATE_DIR%\orekit-activate.bat
if errorlevel 1 exit 1
copy %RECIPE_DIR%\scripts\deactivate.bat %DEACTIVATE_DIR%\orekit-deactivate.bat
if errorlevel 1 exit 1
\ No newline at end of file
if errorlevel 1 exit 1
#!/bin/bash
if [ "$(uname)" == "Darwin" ]
then
export JCC_JDK=${PREFIX}
export JCC_ARGSEP=";"
export JCC_INCLUDES="${PREFIX}/include;${PREFIX}/include/darwin"
export JCC_LFLAGS="-v;-L${PREFIX}/jre/lib;-ljava;-L${PREFIX}/jre/lib/server;-ljvm;-Wl,-rpath;-Wl,${PREFIX}/jre/lib;-Wl,-rpath;-Wl,${PREFIX}/jre/lib/server;-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export JCC_CFLAGS="-fno-strict-aliasing;-Wno-write-strings;-Qunused-arguments;-mmacosx-version-min=10.9;-std=c++11;-stdlib=libc++"
export JCC_DEBUG_CFLAGS="-O0;-g;-DDEBUG"
export JCC_JAVAC="javac;-source;1.8;-target;1.8"
export JCC_JAVADOC="javadoc"
else
# GNU/Linux recipe
export JCC_JDK=${PREFIX}
export JCC_ARGSEP=";"
export JCC_LFLAGS="-v;-Wl,-v;-L${PREFIX}/jre/lib/amd64;-ljava;-L${PREFIX}/jre/lib/amd64/server;-ljvm;-lverify;-Wl,-rpath=${PREFIX}/jre/lib/amd64:${PREFIX}/jre/lib/amd64/server"
export JCC_INCLUDES="${PREFIX}/include;${PREFIX}/include/linux"
export JCC_JAVAC=${PREFIX}/bin/javac
export JCC_CFLAGS="-v;-fno-strict-aliasing;-Wno-write-strings;-D__STDC_FORMAT_MACROS"
export JCC_DEBUG_CFLAGS="-O0;-g;-DDEBUG"
export JCC_JAVADOC="javadoc"
fi
printenv
$PYTHON -m jcc \
--use_full_names \
--python orekit \
--version ${PKG_VERSION} \
--jar $SRC_DIR/orekit-10.1.jar \
--jar $SRC_DIR/hipparchus-core-1.6.jar \
--jar $SRC_DIR/hipparchus-filtering-1.6.jar \
--jar $SRC_DIR/hipparchus-fitting-1.6.jar \
--jar $SRC_DIR/hipparchus-geometry-1.6.jar \
--jar $SRC_DIR/hipparchus-ode-1.6.jar \
--jar $SRC_DIR/hipparchus-optim-1.6.jar \
--jar $SRC_DIR/hipparchus-stat-1.6.jar \
--jar $SRC_DIR/rugged-2.1.jar \
--jar $SRC_DIR/orekit-10.3.1.jar \
--jar $SRC_DIR/hipparchus-clustering-1.8.jar \
--jar $SRC_DIR/hipparchus-core-1.8.jar \
--jar $SRC_DIR/hipparchus-fft-1.8.jar \
--jar $SRC_DIR/hipparchus-filtering-1.8.jar \
--jar $SRC_DIR/hipparchus-fitting-1.8.jar \
--jar $SRC_DIR/hipparchus-geometry-1.8.jar \
--jar $SRC_DIR/hipparchus-migration-1.8.jar \
--jar $SRC_DIR/hipparchus-ode-1.8.jar \
--jar $SRC_DIR/hipparchus-optim-1.8.jar \
--jar $SRC_DIR/hipparchus-stat-1.8.jar \
--jar $SRC_DIR/rugged-2.2.jar \
--package java.io \
--package java.util \
--package java.text \
......@@ -47,6 +76,9 @@ java.util.TreeSet \
java.util.stream.Collectors \
java.util.stream.Stream \
java.util.stream.DoubleStream \
java.util.function.LongConsumer \
java.util.function.IntConsumer \
java.util.function.DoubleConsumer \
--module $SRC_DIR/pyhelpers.py \
--reserved INFINITE \
--reserved ERROR \
......@@ -70,4 +102,4 @@ mkdir -p $ACTIVATE_DIR
mkdir -p $DEACTIVATE_DIR
cp $RECIPE_DIR/scripts/activate.sh $ACTIVATE_DIR/orekit-activate.sh
cp $RECIPE_DIR/scripts/deactivate.sh $DEACTIVATE_DIR/orekit-deactivate.sh
\ No newline at end of file
cp $RECIPE_DIR/scripts/deactivate.sh $DEACTIVATE_DIR/orekit-deactivate.sh
{% set name = "orekit" %}
{% set version = "10.1" %}
{% set artifact_filename = "v10_1_5" %}
{% set sha256 = "350781883ced170a2d2d7b4a5d91f8af4010aa942347eb7ff59aad48570aa780" %} # [not osx]
{% set sha256 = "66ebabc895773dff2293e011547a626c9652ffeb74023fc900f3875b55f95de2" %} # [osx]
{% set version = "10.3.1" %}
{% set artifact_filename = "v10_3_1_0" %}
{% set sha256 = "9044ea7bc02e2ead2f2470dff4902f3a5f158adc7d389231313758bd8ee11f05" %} # [not osx] zip file
{% set sha256 = "bb1c7870f5177340f1417004f4f9224d7b6fd3f6f992f06764c518606ce2b310" %} # [osx] tar.gz file
package:
......@@ -12,12 +12,13 @@ package:
source:
fn: {{ artifact_filename }}.zip # [not osx]
url: https://github.com/petrushy/orekit_python_artifacts/archive/{{ artifact_filename }}.zip # [not osx]
fn: {{ artifact_filename }}.tar.gz # [osx]
url: https://github.com/petrushy/orekit_python_artifacts/archive/{{ artifact_filename }}.tar.gz # [osx]
sha256: {{ sha256 }}
build:
number: 0
number: 1
rpaths:
- lib/
......@@ -28,17 +29,17 @@ requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- openjdk 8
host:
- python
- setuptools
- jcc >=3.6
# Force anaconda openjdk
- openjdk 8.0.152
- jcc
- openjdk 8
run:
- python
# Force anaconda openjdk
- openjdk 8.0.152
- openjdk 8
test:
imports:
......@@ -48,13 +49,14 @@ test:
- test/*.py
- test/orekit-data.zip
- test/resources.zip
- test/resources/ccsds/*.txt
about:
home: https://www.orekit.org/forge/projects/orekit-python-wrapper
license: Apache-2.0
license_family: Apache
license_file: LICENSE.txt
summary: 'An accurate and efficient core layer for space flight dynamics applications'
summary: 'An accurate and efficient core layer for space flight dynamics applications '
description:
Orekit aims at providing accurate and efficient low level components for
......
#!/bin/bash
# Store existing env vars and set to this conda env
# so other installs don't pollute the environment.
if [[ -n "JCC_JDK" ]]; then
export _JCC_JDK_CONDA_BACKUP=$JCC_JDK
fi
export _JCC_JDK_CONDA_BACKUP=${JCC_JDK:-}
export JCC_JDK=$CONDA_PREFIX
......@@ -27,7 +27,7 @@ import math
import os
from java.io import File
from orekit import JArray
from org.orekit.data import DataProvidersManager, ZipJarCrawler, DirectoryCrawler
from org.orekit.data import DataProvidersManager, ZipJarCrawler, DirectoryCrawler, DataContext
from org.orekit.time import TimeScalesFactory, AbsoluteDate
from org.orekit.utils import ElevationMask
......@@ -78,7 +78,7 @@ def setup_orekit_curdir(filename='orekit-data.zip'):
DM = DataContext.getDefault().getDataProvidersManager()
datafile = File(filename)
if not datafile.exists():
print('File or folder:', datafile.absolutePath, ' not found')
print('File or folder:', datafile.getAbsolutePath(), ' not found')
print("""
The Orekit library relies on some external data for physical models.
......@@ -94,6 +94,7 @@ def setup_orekit_curdir(filename='orekit-data.zip'):
orekit.pyhelpers.download_orekit_data_curdir()
""")
return
if os.path.isdir(filename):
crawler = DirectoryCrawler(datafile)
......
......@@ -28,7 +28,7 @@ import orekit
orekit.initVM()
from orekit.pyhelpers import setup_orekit_curdir, datetime_to_absolutedate
setup_orekit_curdir()
setup_orekit_curdir(filename="resources.zip")
import unittest
import sys
......
......@@ -46,13 +46,14 @@ from org.orekit.utils import TimeStampedPVCoordinates;
from org.orekit.frames import Transform
from org.orekit.frames import FramesFactory
class TransformTest(unittest.TestCase):
def testPythonTransformType(self):
# Create initial TimeStampedPVCoordinates
pos = Vector3D(10000., 20000., 30000.)
vel = Vector3D(2000., 1000., 1500.)
date = datetime_to_absolutedate(datetime(2019, 3, 13))
date = datetime_to_absolutedate(datetime(2000, 3, 13))
pvt1 = TimeStampedPVCoordinates(date, pos, vel)
print(type(pvt1))
......@@ -124,6 +125,7 @@ class TransformTest(unittest.TestCase):
self.checkVector(rebuiltPV.getAcceleration(), transformedPV.getAcceleration(), 9.0e-11)
dt += 0.01
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TransformTest)
ret = not unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment