Unverified Commit 9d6eea66 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #1428 from jcarpent/topic/pypy

Skip embeded Python for PyPy compiler
parents 2f53ccd8 de216492
Pipeline #13997 passed with stage
in 120 minutes and 20 seconds
......@@ -85,7 +85,7 @@ jobs:
set PATH=%PATH%;%CONDA_PREFIX%\Library\bin
.\unittest\Release\test-cpp-urdf.exe
.\examples\Release\example-cpp-geometry-models.exe
ctest --output-on-failure -C Release -V --repeat until-pass:2
ctest --output-on-failure -C Release -V --repeat until-pass:5
# :: Test Python import
# cd ..
......
......@@ -144,6 +144,18 @@ IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON(REQUIRED)
SEARCH_FOR_BOOST_PYTHON(REQUIRED)
ADD_PROJECT_DEPENDENCY(eigenpy 2.6.2 REQUIRED)
# Check wether this a PyPy Python
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import platform; print(platform.python_implementation())"
OUTPUT_VARIABLE _python_implementation_value
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
MESSAGE(STATUS "Python compiler: ${_python_implementation_value}")
IF(_python_implementation_value MATCHES "PyPy")
SET(BUILD_PYTHON_INTERFACE_WITH_PYPY TRUE)
ENDIF()
ELSE(BUILD_PYTHON_INTERFACE)
MESSAGE(STATUS "Pinocchio won't be compiled with its Python bindings. If you want to enable this feature, please set the option BUILD_PYTHON_INTERFACE to ON.")
ENDIF(BUILD_PYTHON_INTERFACE)
......
......@@ -48,21 +48,24 @@ FILE(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
# Parser for Python model
LIST(APPEND ${PROJECT_NAME}_PYTHON_HEADERS
parsers/python.hpp
)
SET(${PROJECT_NAME}_PARSER_PYTHON_HEADERS
parsers/python.hpp
)
LIST(APPEND ${PROJECT_NAME}_PYTHON_SOURCES
parsers/python/model.cpp
)
REMOVE_PATH_FROM_LIST("${${PROJECT_NAME}_PYTHON_HEADERS}" "${CMAKE_CURRENT_SOURCE_DIR}/" ${PROJECT_NAME}_PYTHON_HEADERS)
REMOVE_PATH_FROM_LIST("${${PROJECT_NAME}_PYTHON_SOURCES}" "${CMAKE_CURRENT_SOURCE_DIR}/" ${PROJECT_NAME}_PYTHON_SOURCES)
# Parser for Python model
IF(BUILD_PYTHON_INTERFACE_WITH_PYPY)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_HEADERS
parsers/python.hpp
)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_SOURCES
parsers/python/model.cpp
)
ELSE(BUILD_PYTHON_INTERFACE_WITH_PYPY)
SET(${PROJECT_NAME}_PARSER_PYTHON_HEADERS
parsers/python.hpp
)
ENDIF(BUILD_PYTHON_INTERFACE_WITH_PYPY)
# Python exposition of FCL
IF(NOT BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_HEADERS
......@@ -112,8 +115,10 @@ MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/
SYMLINK_AND_INSTALL_HEADERS("${${PROJECT_NAME}_PYTHON_HEADERS}" "bindings/python")
# Headers of the Python parser
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers/python")
SYMLINK_AND_INSTALL_HEADERS("${${PROJECT_NAME}_PARSER_PYTHON_HEADERS}" "")
IF(NOT BUILD_PYTHON_INTERFACE_WITH_PYPY)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers/python")
SYMLINK_AND_INSTALL_HEADERS("${${PROJECT_NAME}_PARSER_PYTHON_HEADERS}" "")
ENDIF(NOT BUILD_PYTHON_INTERFACE_WITH_PYPY)
# --- COMPILE WRAPPER
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/bindings/python/${PROJECT_NAME}")
......
......@@ -95,7 +95,7 @@ IF(urdfdom_FOUND)
ENDIF(hpp-fcl_FOUND)
ENDIF(urdfdom_FOUND)
IF(BUILD_PYTHON_INTERFACE)
IF(BUILD_PYTHON_INTERFACE AND NOT BUILD_PYTHON_INTERFACE_WITH_PYPY)
ADD_PINOCCHIO_UNIT_TEST(python_parser PACKAGES eigenpy)
TARGET_INCLUDE_DIRECTORIES(test-cpp-python_parser SYSTEM PUBLIC ${PYTHON_INCLUDE_DIRS})
......@@ -113,7 +113,7 @@ IF(BUILD_PYTHON_INTERFACE)
ENDIF(APPLE)
SET_PROPERTY(TEST test-cpp-python_parser PROPERTY ENVIRONMENT ${ENV_VARIABLES})
ADD_SUBDIRECTORY(python)
ENDIF(BUILD_PYTHON_INTERFACE)
ENDIF(BUILD_PYTHON_INTERFACE AND NOT BUILD_PYTHON_INTERFACE_WITH_PYPY)
# Test over the joints
ADD_PINOCCHIO_UNIT_TEST(all-joints)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment