From 046ad0ee35ec88bc49d94c099628ff9999ad37f6 Mon Sep 17 00:00:00 2001 From: petrush <petrus.hyvonen@sscspace.com> Date: Wed, 17 Oct 2018 19:47:14 +0200 Subject: [PATCH] Updated to latest conda recipe --- ...arthObservation_-_Attitude_Sequence.ipynb} | 0 ...rop.ipynb => Example_numerical_prop.ipynb} | 0 ...ropagation.ipynb => TLE_Propagation.ipynb} | 0 .../{The Basics.ipynb => The_Basics.ipynb} | 0 .../{orekit map.ipynb => orekit_map.ipynb} | 0 orekit-conda-recipe/bld.bat | 70 ++++++++++++---- orekit-conda-recipe/build.sh | 80 +++++++++++++------ orekit-conda-recipe/meta.yaml | 75 +++++++++-------- orekit-conda-recipe/run_test.bat | 24 +++--- orekit-conda-recipe/run_test.sh | 12 +++ orekit-conda-recipe/scripts/activate.bat | 10 +++ orekit-conda-recipe/scripts/activate.sh | 10 +++ orekit-conda-recipe/scripts/deactivate.bat | 12 +++ orekit-conda-recipe/scripts/deactivate.sh | 8 ++ 14 files changed, 214 insertions(+), 87 deletions(-) rename examples/{Example EarthObservation - Attitude Sequence.ipynb => Example_EarthObservation_-_Attitude_Sequence.ipynb} (100%) rename examples/{Example numerical prop.ipynb => Example_numerical_prop.ipynb} (100%) rename examples/{TLE Propagation.ipynb => TLE_Propagation.ipynb} (100%) rename examples/{The Basics.ipynb => The_Basics.ipynb} (100%) rename examples/{orekit map.ipynb => orekit_map.ipynb} (100%) create mode 100644 orekit-conda-recipe/run_test.sh create mode 100644 orekit-conda-recipe/scripts/activate.bat create mode 100644 orekit-conda-recipe/scripts/activate.sh create mode 100644 orekit-conda-recipe/scripts/deactivate.bat create mode 100644 orekit-conda-recipe/scripts/deactivate.sh diff --git a/examples/Example EarthObservation - Attitude Sequence.ipynb b/examples/Example_EarthObservation_-_Attitude_Sequence.ipynb similarity index 100% rename from examples/Example EarthObservation - Attitude Sequence.ipynb rename to examples/Example_EarthObservation_-_Attitude_Sequence.ipynb diff --git a/examples/Example numerical prop.ipynb b/examples/Example_numerical_prop.ipynb similarity index 100% rename from examples/Example numerical prop.ipynb rename to examples/Example_numerical_prop.ipynb diff --git a/examples/TLE Propagation.ipynb b/examples/TLE_Propagation.ipynb similarity index 100% rename from examples/TLE Propagation.ipynb rename to examples/TLE_Propagation.ipynb diff --git a/examples/The Basics.ipynb b/examples/The_Basics.ipynb similarity index 100% rename from examples/The Basics.ipynb rename to examples/The_Basics.ipynb diff --git a/examples/orekit map.ipynb b/examples/orekit_map.ipynb similarity index 100% rename from examples/orekit map.ipynb rename to examples/orekit_map.ipynb diff --git a/orekit-conda-recipe/bld.bat b/orekit-conda-recipe/bld.bat index f61ca0b..0a432af 100644 --- a/orekit-conda-recipe/bld.bat +++ b/orekit-conda-recipe/bld.bat @@ -1,15 +1,55 @@ -:: Paths assume openjdk installed by conda -set JCC_JDK=%JAVA_HOME% - -:: JCC needs to have libraries in PATH -set PATH=%JCC_JDK%\jre\bin\server;%JCC_JDK%;%JCC_JDK%\jre\bin;%JCC_JDK%\jre\lib;%PATH% - -set JCC_INCLUDES=%JCC_JDK%\include;%JCC_JDK%\include\win32 -set JCC_LFLAGS=/DLL;/LIBPATH:%JCC_JDK%\lib;Ws2_32.lib;jvm.lib - -set - -"%PYTHON%" setup.py install --single-version-externally-managed --record record.txt +"%PYTHON%" -m jcc ^ +--use_full_names ^ +--python orekit ^ +--version %PKG_VERSION% ^ +--jar %SRC_DIR%\orekit-9.2.jar ^ +--jar %SRC_DIR%\hipparchus-core-1.3.jar ^ +--jar %SRC_DIR%\hipparchus-filtering-1.3.jar ^ +--jar %SRC_DIR%\hipparchus-fitting-1.3.jar ^ +--jar %SRC_DIR%\hipparchus-geometry-1.3.jar ^ +--jar %SRC_DIR%\hipparchus-ode-1.3.jar ^ +--jar %SRC_DIR%\hipparchus-optim-1.3.jar ^ +--jar %SRC_DIR%\hipparchus-stat-1.3.jar ^ +--package java.io ^ +--package java.util ^ +--package java.text ^ +--package org.orekit ^ +java.io.BufferedReader ^ +java.io.FileInputStream ^ +java.io.FileOutputStream ^ +java.io.InputStream ^ +java.io.InputStreamReader ^ +java.io.ObjectInputStream ^ +java.io.ObjectOutputStream ^ +java.io.PrintStream ^ +java.io.StringReader ^ +java.io.StringWriter ^ +java.lang.System ^ +java.text.DecimalFormat ^ +java.text.DecimalFormatSymbols ^ +java.util.ArrayList ^ +java.util.Arrays ^ +java.util.Collection ^ +java.util.Collections ^ +java.util.Date ^ +java.util.HashMap ^ +java.util.HashSet ^ +java.util.List ^ +java.util.Locale ^ +java.util.Map ^ +java.util.Set ^ +java.util.TreeSet ^ +--module %SRC_DIR%\pyhelpers.py ^ +--reserved INFINITE ^ +--reserved ERROR ^ +--reserved NAN ^ +--reserved OVERFLOW ^ +--reserved NO_DATA ^ +--reserved min ^ +--reserved max ^ +--reserved mean ^ +--build ^ +--install if errorlevel 1 exit 1 :: ensure that JCC_JDK is set correctly by invoking an activate script @@ -18,8 +58,8 @@ set DEACTIVATE_DIR=%PREFIX%\etc\conda\deactivate.d mkdir %ACTIVATE_DIR% mkdir %DEACTIVATE_DIR% -copy %RECIPE_DIR%\scripts\activate.bat %ACTIVATE_DIR%\jcc-activate.bat +copy %RECIPE_DIR%\scripts\activate.bat %ACTIVATE_DIR%\orekit-activate.bat if errorlevel 1 exit 1 -copy %RECIPE_DIR%\scripts\deactivate.bat %DEACTIVATE_DIR%\jcc-deactivate.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 diff --git a/orekit-conda-recipe/build.sh b/orekit-conda-recipe/build.sh index 8654fd5..77af63d 100644 --- a/orekit-conda-recipe/build.sh +++ b/orekit-conda-recipe/build.sh @@ -1,30 +1,58 @@ #!/bin/bash -export JCC_JDK=$JAVA_HOME +$PYTHON -m jcc \ +--use_full_names \ +--python orekit \ +--version ${PKG_VERSION} \ +--jar $SRC_DIR/orekit-9.2.jar \ +--jar $SRC_DIR/hipparchus-core-1.3.jar \ +--jar $SRC_DIR/hipparchus-filtering-1.3.jar \ +--jar $SRC_DIR/hipparchus-fitting-1.3.jar \ +--jar $SRC_DIR/hipparchus-geometry-1.3.jar \ +--jar $SRC_DIR/hipparchus-ode-1.3.jar \ +--jar $SRC_DIR/hipparchus-optim-1.3.jar \ +--jar $SRC_DIR/hipparchus-stat-1.3.jar \ +--package java.io \ +--package java.util \ +--package java.text \ +--package org.orekit \ +java.io.BufferedReader \ +java.io.FileInputStream \ +java.io.FileOutputStream \ +java.io.InputStream \ +java.io.InputStreamReader \ +java.io.ObjectInputStream \ +java.io.ObjectOutputStream \ +java.io.PrintStream \ +java.io.StringReader \ +java.io.StringWriter \ +java.lang.System \ +java.text.DecimalFormat \ +java.text.DecimalFormatSymbols \ +java.util.ArrayList \ +java.util.Arrays \ +java.util.Collection \ +java.util.Collections \ +java.util.Date \ +java.util.HashMap \ +java.util.HashSet \ +java.util.List \ +java.util.Locale \ +java.util.Map \ +java.util.Set \ +java.util.TreeSet \ +--module $SRC_DIR/pyhelpers.py \ +--reserved INFINITE \ +--reserved ERROR \ +--reserved OVERFLOW \ +--reserved NO_DATA \ +--reserved NAN \ +--reserved min \ +--reserved max \ +--reserved mean \ +--build \ +--install -if [ "$(uname)" == "Darwin" ] -then - 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=$MACOSX_DEPLOYMENT_TARGET;-std=c++11;-stdlib=libc++" - export NO_SHARED=1 - printenv - - $PYTHON setup.py install --single-version-externally-managed --record record.txt - -else - # GNU/Linux recipe - 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_JAVAC=$PREFIX/bin/javac - export JCC_CFLAGS="-v;-fno-strict-aliasing;-Wno-write-strings;-D__STDC_FORMAT_MACROS" - - printenv - - $PYTHON setup.py install --single-version-externally-managed --record record.txt - -fi # ensure that JCC_JDK is set correctly by invoking an activate script ACTIVATE_DIR=$PREFIX/etc/conda/activate.d @@ -32,5 +60,5 @@ DEACTIVATE_DIR=$PREFIX/etc/conda/deactivate.d mkdir -p $ACTIVATE_DIR mkdir -p $DEACTIVATE_DIR -cp $RECIPE_DIR/scripts/activate.sh $ACTIVATE_DIR/jcc-activate.sh -cp $RECIPE_DIR/scripts/deactivate.sh $DEACTIVATE_DIR/jcc-deactivate.sh \ No newline at end of file +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 diff --git a/orekit-conda-recipe/meta.yaml b/orekit-conda-recipe/meta.yaml index 3e66fc0..85fc359 100644 --- a/orekit-conda-recipe/meta.yaml +++ b/orekit-conda-recipe/meta.yaml @@ -1,29 +1,27 @@ -{% set name = "jcc" %} -{% set version = "3.3.dev2" %} -{% set sha256 = "025382e6610fb08a00480ea5f0f460d4b8680511c4f6687510323d628775782c" %} +{% set name = "orekit" %} +{% set version = "9.2" %} +{% set filename = "v9_2" %} +{% set sha256 = "7a25f7f7482751793ea89624e54e68ffff8cd5de619fcfde61aadedc52784671" %} package: name: {{ name|lower }} version: {{ version }} source: - fn: {{ name }}-{{ version }}.zip - url: https://github.com/petrushy/jcc_svn_import/raw/master/{{ name }}-{{ version }}.zip + fn: {{ filename }}.zip + url: https://github.com/petrushy/orekit_python_artifacts/archive/{{ filename }}.zip sha256: {{ sha256 }} build: skip: true # [win32 or linux32] - number: 0 + number: 3 - rpaths: # only valid for linux - - lib + rpaths: + - lib/ - jre/lib/amd64/ - jre/lib/amd64/server/ - has_prefix_files: - - {{SP_DIR}}/jcc/config.py # [linux or osx] - requirements: build: - {{ compiler('c') }} @@ -31,37 +29,48 @@ requirements: host: - python - setuptools - - openjdk 8.0.152 # Force anaconda openjdk + - jcc 3.3.dev2 + # Force anaconda openjdk + - openjdk 8.0.152 run: - python - - openjdk 8.0.152 # Force anaconda openjdk + # Force anaconda openjdk + - openjdk 8.0.152 test: imports: - - jcc - - requires: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - files: - - test/*.py - - test/java-example/build_and_wrap.bat - - test/java-example/build_and_wrap.sh - - test/java-example/test1class.java + - orekit + + source_files: + - test/AltitudeDetectorTest.py + - test/BackAndForthDetectorTest.py + - test/EventDetectorTest.py + - test/EventHandlerTest.py + - test/GroundFieldOfViewDetectorTest.py + - test/ImpulseManeuverTest.py + - test/KeplerianConverterTest.py + - test/NodeDetectorTest.py + - test/orekit-data.zip + - test/SmallManeuverAnalyticalModelTest.py + - test/TestAbstractDetector.py about: - home: http://lucene.apache.org/pylucene/jcc/index.html - + home: https://www.orekit.org/forge/projects/orekit-python-wrapper license: Apache-2.0 - license_file: LICENSE - - summary: 'a C++ code generator for calling Java from C++/Python' - description: | - JCC is a C++ code generator for producing the code necessary to call into Java classes from CPython via Java’s Native Invocation Interface (JNI). - - doc_url: http://lucene.apache.org/pylucene/jcc/index.html + license_family: Apache + license_file: LICENSE.txt + summary: 'An accurate and efficient core layer for space flight dynamics applications' + + description: + Orekit aims at providing accurate and efficient low level components for + the development of flight dynamics applications. It is designed to be + easily used in very different contexts, from quick studies up to critical operations. + As a library, Orekit provides basic elements (orbits, dates, attitude, frames, ...) and + various algorithms to handle them (conversions, propagations, pointing, ....). + + The Orekit library is written in java. This package provides a python wrapper to that library. + doc_url: https://www.orekit.org/static/apidocs/ extra: recipe-maintainers: diff --git a/orekit-conda-recipe/run_test.bat b/orekit-conda-recipe/run_test.bat index e548bc0..c6fcfd7 100644 --- a/orekit-conda-recipe/run_test.bat +++ b/orekit-conda-recipe/run_test.bat @@ -1,13 +1,11 @@ -"%PYTHON%" test/myrun_test.py -if errorlevel 1 exit 1 - -pushd test\java-example - call "build_and_wrap.bat" - if errorlevel 1 exit 1 -popd - -"%PYTHON%" test/test_test1.py -if errorlevel 1 exit 1 - -"%PYTHON%" test/test_double_array.py -if errorlevel 1 exit 1 \ No newline at end of file +cd test +python AltitudeDetectorTest.py +python BackAndForthDetectorTest.py +python EventDetectorTest.py +python EventHandlerTest.py +python GroundFieldOfViewDetectorTest.py +python ImpulseManeuverTest.py +python KeplerianConverterTest.py +python NodeDetectorTest.py +python SmallManeuverAnalyticalModelTest.py +python TestAbstractDetector.py diff --git a/orekit-conda-recipe/run_test.sh b/orekit-conda-recipe/run_test.sh new file mode 100644 index 0000000..7b1396c --- /dev/null +++ b/orekit-conda-recipe/run_test.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +cd test +python AltitudeDetectorTest.py +python BackAndForthDetectorTest.py +python EventDetectorTest.py +python EventHandlerTest.py +python GroundFieldOfViewDetectorTest.py +python ImpulseManeuverTest.py +python KeplerianConverterTest.py +python NodeDetectorTest.py +python SmallManeuverAnalyticalModelTest.py +python TestAbstractDetector.py diff --git a/orekit-conda-recipe/scripts/activate.bat b/orekit-conda-recipe/scripts/activate.bat new file mode 100644 index 0000000..7649cae --- /dev/null +++ b/orekit-conda-recipe/scripts/activate.bat @@ -0,0 +1,10 @@ +:: Store existing env vars and set to this conda env +:: so other installs don't pollute the environment. + +@if defined JCC_JDK ( + @set "_JCC_JDK_CONDA_BACKUP=%JCC_JDK%" +) +@set "JCC_JDK=%CONDA_PREFIX%\Library" + +@set "_JCC_PATH_CONDA_BACKUP=%PATH%" +@set "PATH=%JCC_JDK%\jre\bin\server;%JCC_JDK%;%JCC_JDK%\jre\bin;%PATH%" diff --git a/orekit-conda-recipe/scripts/activate.sh b/orekit-conda-recipe/scripts/activate.sh new file mode 100644 index 0000000..5d0fa03 --- /dev/null +++ b/orekit-conda-recipe/scripts/activate.sh @@ -0,0 +1,10 @@ +#!/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_PREFIX diff --git a/orekit-conda-recipe/scripts/deactivate.bat b/orekit-conda-recipe/scripts/deactivate.bat new file mode 100644 index 0000000..5fdca4c --- /dev/null +++ b/orekit-conda-recipe/scripts/deactivate.bat @@ -0,0 +1,12 @@ +:: Restore previous JCC_JDK and PATH env vars if they were set. + +@set "JCC_JDK=" +@if defined _JCC_JDK_CONDA_BACKUP ( + @set "JCC_JDK=%_JCC_JDK_CONDA_BACKUP%" + @set "_JCC_JDK_CONDA_BACKUP=" +) + +@if defined _JCC_PATH_CONDA_BACKUP ( + @set "PATH =%_JCC_PATH_CONDA_BACKUP%" + @set "_JCC_PATH_CONDA_BACKUP=" +) diff --git a/orekit-conda-recipe/scripts/deactivate.sh b/orekit-conda-recipe/scripts/deactivate.sh new file mode 100644 index 0000000..98c7306 --- /dev/null +++ b/orekit-conda-recipe/scripts/deactivate.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Restore previous env vars if they were set. +unset JCC_JDK +if [[ -n "$_JCC_JDK_CONDA_BACKUP" ]]; then + export JCC_JDK=$_JCC_JDK_CONDA_BACKUP + unset _JCC_JDK_CONDA_BACKUP +fi -- GitLab