From a302aa708cf0a0271aefe4484f6e32f376f75b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Br=C3=A9mond?= Date: Fri, 17 Aug 2018 12:55:23 -0700 Subject: [PATCH 1/3] [misc] Fix headers --- CMakeLists.txt | 2 +- share/python/src/LibraryMathematicsPy.cxx | 2 +- share/python/src/LibraryMathematicsPy/Geometry.cpp | 2 +- share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp | 2 +- .../src/LibraryMathematicsPy/Geometry/Transformations.cpp | 2 +- .../Geometry/Transformations/Rotations.cpp | 2 +- .../Geometry/Transformations/Rotations/Quaternion.cpp | 2 +- .../Geometry/Transformations/Rotations/RotationMatrix.cpp | 2 +- .../Geometry/Transformations/Rotations/RotationVector.cpp | 3 ++- share/python/src/LibraryMathematicsPy/Objects.cpp | 2 +- share/python/src/LibraryMathematicsPy/Objects/Vector.cpp | 2 +- 11 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 861ad151..08ad3541 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,7 +252,7 @@ ELSE () MESSAGE (SEND_ERROR "[Eigen 3] not found.") ENDIF () -### Library :: Core [master] +### Library :: Core [0.1] FIND_PACKAGE ("LibraryCore" "0.1" REQUIRED) diff --git a/share/python/src/LibraryMathematicsPy.cxx b/share/python/src/LibraryMathematicsPy.cxx index cd9bb799..cb46f73d 100755 --- a/share/python/src/LibraryMathematicsPy.cxx +++ b/share/python/src/LibraryMathematicsPy.cxx @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy.hpp +/// @file LibraryMathematicsPy.cxx /// @author Lucas Brémond /// @license TBD diff --git a/share/python/src/LibraryMathematicsPy/Geometry.cpp b/share/python/src/LibraryMathematicsPy/Geometry.cpp index 925710be..e1c5f6f0 100755 --- a/share/python/src/LibraryMathematicsPy/Geometry.cpp +++ b/share/python/src/LibraryMathematicsPy/Geometry.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy/Geometry.hpp +/// @file LibraryMathematicsPy/Geometry.cpp /// @author Lucas Brémond /// @license TBD diff --git a/share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp b/share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp index 6eff424a..ef6268c9 100755 --- a/share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp +++ b/share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy/Geometry/Angle.hpp +/// @file LibraryMathematicsPy/Geometry/Angle.cpp /// @author Lucas Brémond /// @license TBD diff --git a/share/python/src/LibraryMathematicsPy/Geometry/Transformations.cpp b/share/python/src/LibraryMathematicsPy/Geometry/Transformations.cpp index 7b6db337..76fc7c13 100755 --- a/share/python/src/LibraryMathematicsPy/Geometry/Transformations.cpp +++ b/share/python/src/LibraryMathematicsPy/Geometry/Transformations.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy/Geometry/Transformations.hpp +/// @file LibraryMathematicsPy/Geometry/Transformations.cpp /// @author Lucas Brémond /// @license TBD diff --git a/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations.cpp b/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations.cpp index a256bbbf..9c84f37b 100755 --- a/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations.cpp +++ b/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy/Geometry/Transformations/Rotations.hpp +/// @file LibraryMathematicsPy/Geometry/Transformations/Rotations.cpp /// @author Lucas Brémond /// @license TBD diff --git a/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/Quaternion.cpp b/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/Quaternion.cpp index 561763dc..7766f581 100755 --- a/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/Quaternion.cpp +++ b/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/Quaternion.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy/Geometry/Transformations/Rotations/Quaternion.hpp +/// @file LibraryMathematicsPy/Geometry/Transformations/Rotations/Quaternion.cpp /// @author Lucas Brémond /// @license TBD diff --git a/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationMatrix.cpp b/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationMatrix.cpp index 1db16ac7..b19c2c7c 100755 --- a/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationMatrix.cpp +++ b/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationMatrix.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationMatrix.hpp +/// @file LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationMatrix.cpp /// @author Lucas Brémond /// @license TBD diff --git a/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationVector.cpp b/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationVector.cpp index 9dbc5f21..2ff9dfda 100755 --- a/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationVector.cpp +++ b/share/python/src/LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationVector.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationVector.hpp +/// @file LibraryMathematicsPy/Geometry/Transformations/Rotations/RotationVector.cpp /// @author Lucas Brémond /// @license TBD @@ -33,6 +33,7 @@ inline void LibraryMathematicsPy_Geometry_Transformations_Ro .def(self_ns::str(self_ns::self)) .def("isDefined", &RotationVector::isDefined) + .def("getAxis", &RotationVector::getAxis) .def("getAngle", &RotationVector::getAngle) .def("Undefined", &RotationVector::Undefined) diff --git a/share/python/src/LibraryMathematicsPy/Objects.cpp b/share/python/src/LibraryMathematicsPy/Objects.cpp index d004b72c..f3fa9ea6 100755 --- a/share/python/src/LibraryMathematicsPy/Objects.cpp +++ b/share/python/src/LibraryMathematicsPy/Objects.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file LibraryMathematicsPy/Objects.hpp +/// @file LibraryMathematicsPy/Objects.cpp /// @author Lucas Brémond /// @license TBD diff --git a/share/python/src/LibraryMathematicsPy/Objects/Vector.cpp b/share/python/src/LibraryMathematicsPy/Objects/Vector.cpp index 870d9a37..eb6f55fb 100755 --- a/share/python/src/LibraryMathematicsPy/Objects/Vector.cpp +++ b/share/python/src/LibraryMathematicsPy/Objects/Vector.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @project Library/Mathematics -/// @file Library/Mathematics/LibraryMathematicsPy/Objects/Vector.hpp +/// @file LibraryMathematicsPy/Objects/Vector.cpp /// @author Lucas Brémond /// @license TBD From 7fd7239b4caa73254299fb689a633f385abd8c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Br=C3=A9mond?= Date: Mon, 20 Aug 2018 00:37:42 -0700 Subject: [PATCH 2/3] [feature] Add Boost.Python shared library support --- share/python/CMakeLists.txt | 3 ++- .../python/src/LibraryMathematicsPy/Geometry/Angle.cpp | 3 --- share/python/tools/python/setup.py.in | 2 +- tools/.env | 2 +- tools/development/docker/Dockerfile | 10 +++++----- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/share/python/CMakeLists.txt b/share/python/CMakeLists.txt index b7691d49..186c1ed2 100755 --- a/share/python/CMakeLists.txt +++ b/share/python/CMakeLists.txt @@ -47,7 +47,7 @@ PROJECT (${PROJECT_NAME} VERSION ${PROJECT_VERSION_STRING} LANGUAGES "C" "CXX") ### Boost [1.67.0] -SET (Boost_USE_STATIC_LIBS ON) +SET (Boost_USE_STATIC_LIBS OFF) SET (Boost_USE_MULTITHREADED ON) UNSET (Boost_INCLUDE_DIR CACHE) @@ -138,6 +138,7 @@ ADD_CUSTOM_COMMAND (OUTPUT ${OUTPUT} COMMAND mkdir -p "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}" COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/tools/python/Library/__init__.py" "${CMAKE_CURRENT_BINARY_DIR}/Library/__init__.py" COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/tools/python/${PROJECT_PATH}/__init__.py" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/__init__.py" + COMMAND cp "/usr/local/lib/libboost_python36.so.1.68.0" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/libboost_python36.so.1.68.0" COMMAND cp "${CMAKE_SOURCE_DIR}/lib/${SHARED_LIBRARY_TARGET}" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/liblibrary-mathematics.so.0" COMMAND cp "${CMAKE_SOURCE_DIR}/lib/${LIBRARY_TARGET}" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/LibraryMathematicsPy.so" COMMAND ${PYTHON} ${SETUP_PY} bdist_wheel diff --git a/share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp b/share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp index ef6268c9..095ef97e 100755 --- a/share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp +++ b/share/python/src/LibraryMathematicsPy/Geometry/Angle.cpp @@ -47,9 +47,6 @@ inline void LibraryMathematicsPy_Geometry_Angle ( ) .def("inDegrees", +[] (const Angle& anAngle) -> Real { return anAngle.inDegrees() ; }) .def("inArcminutes", +[] (const Angle& anAngle) -> Real { return anAngle.inArcminutes() ; }) .def("inArcseconds", +[] (const Angle& anAngle) -> Real { return anAngle.inArcseconds() ; }) - // .def("inDegrees", &Angle::inDegrees) - // .def("inArcminutes", &Angle::inArcminutes) - // .def("inArcseconds", &Angle::inArcseconds) .def("inRevolutions", &Angle::inRevolutions) .def("toString", &Angle::toString) diff --git a/share/python/tools/python/setup.py.in b/share/python/tools/python/setup.py.in index 1ffe8608..e0325468 100644 --- a/share/python/tools/python/setup.py.in +++ b/share/python/tools/python/setup.py.in @@ -20,5 +20,5 @@ setuptools.setup( ), keywords="open-space-collective mathematics", packages=setuptools.find_packages(), - package_data={"": ["${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/LibraryMathematicsPy.so", "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/liblibrary-mathematics.so.0"]} + package_data={"": ["${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/LibraryMathematicsPy.so", "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/liblibrary-mathematics.so.0", "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_PATH}/libboost_python36.so.1.68.0"]} ) \ No newline at end of file diff --git a/tools/.env b/tools/.env index 858b1e71..1aba95a6 100644 --- a/tools/.env +++ b/tools/.env @@ -38,7 +38,7 @@ fi repository_name="openspacecollective" # image_version="$(echo ${version} | head -c 5)" -image_version="0.1.3" +image_version="0.1.4" image_name="${repository_name}/${project_name}:${image_version}" diff --git a/tools/development/docker/Dockerfile b/tools/development/docker/Dockerfile index aeea015a..a2e67af9 100644 --- a/tools/development/docker/Dockerfile +++ b/tools/development/docker/Dockerfile @@ -7,7 +7,7 @@ ################################################################################################################################################################ -FROM openspacecollective/library-core:0.1.5 +FROM openspacecollective/library-core:0.1.6 LABEL maintainer="lucas@loftorbital.com" @@ -34,13 +34,13 @@ RUN mkdir /tmp/eigen \ && make install \ && rm -rf /tmp/eigen -## Library :: Core [0.1.7] +## Library :: Core [0.1.8] RUN mkdir -p /tmp/library-core \ && pushd /tmp/library-core > /dev/null \ - && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.7/library-core-0.1.7-1.x86_64-runtime.rpm \ - && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.7/library-core-0.1.7-1.x86_64-devel.rpm \ - && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.7/library-core-0.1.7-1.x86_64-python.rpm \ + && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.8/library-core-0.1.8-1.x86_64-runtime.rpm \ + && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.8/library-core-0.1.8-1.x86_64-devel.rpm \ + && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.8/library-core-0.1.8-1.x86_64-python.rpm \ && dnf install -y ./*.rpm \ && rm -rf /tmp/library-core \ && popd > /dev/null From 477bf0a54842405c6aa9920cde793387da010d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Br=C3=A9mond?= Date: Mon, 20 Aug 2018 00:43:31 -0700 Subject: [PATCH 3/3] [misc] Remove library-core-python from Dockerfile --- tools/development/docker/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/development/docker/Dockerfile b/tools/development/docker/Dockerfile index a2e67af9..b6eeb67d 100644 --- a/tools/development/docker/Dockerfile +++ b/tools/development/docker/Dockerfile @@ -40,7 +40,6 @@ RUN mkdir -p /tmp/library-core \ && pushd /tmp/library-core > /dev/null \ && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.8/library-core-0.1.8-1.x86_64-runtime.rpm \ && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.8/library-core-0.1.8-1.x86_64-devel.rpm \ - && wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.8/library-core-0.1.8-1.x86_64-python.rpm \ && dnf install -y ./*.rpm \ && rm -rf /tmp/library-core \ && popd > /dev/null