Skip to content
Snippets Groups Projects
Unverified Commit 3450df07 authored by Joris Vaillant's avatar Joris Vaillant Committed by GitHub
Browse files

Merge pull request #375 from jcarpent/devel

Enhance support of Tensor module in external applications
parents 0bdb5051 7a0cad4a
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ jobs:
os: ["ubuntu-latest", "macos-latest"]
cxx_options: ['', '-mavx2']
build_type: [Release, Debug]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.8", "3.12"]
include:
- os: ubuntu-latest
......
......@@ -19,7 +19,7 @@ jobs:
with:
activate-environment: eigenpy
environment-file: .github/workflows/conda/environment.yml
python-version: 3.7
python-version: "3.10"
- name: Build Eigenpy
shell: cmd /C CALL {0}
env:
......@@ -51,11 +51,6 @@ jobs:
cmake --build . --config Release --target install
if errorlevel 1 exit 1
:: Build stubs
git clone https://github.com/jcarpent/pybind11-stubgen.git
python "%CD%\pybind11-stubgen\pybind11_stubgen\__init__.py" -o %CONDA_PREFIX%\Lib\site-packages\eigenpy eigenpy --boost-python --ignore-invalid signature --no-setup-py --root-module-suffix ""
if errorlevel 1 exit 1
:: Testing
ctest --output-on-failure -C Release -V
if errorlevel 1 exit 1
......
......@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- Add new helper functions to check Tensor support
### Fixed
- Fix stub generation on Windows
## [3.1.3] - 2023-11-09
### Fixed
......
......@@ -243,11 +243,11 @@ endif(SUFFIX_SO_VERSION)
if(NOT WIN32)
target_compile_options(
${PROJECT_NAME} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:-bigobj>
${PROJECT_NAME} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:-bigobj -MP>
"-Wno-conversion")
else()
target_compile_options(${PROJECT_NAME}
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:-bigobj>)
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:-bigobj -MP>)
target_compile_definitions(${PROJECT_NAME} PUBLIC "HAVE_SNPRINTF")
endif()
......
......@@ -10,14 +10,14 @@ EigenPy — Versatile and efficient Python bindings between Numpy and Eigen
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"></a>
</p>
**EigenPy** is an open source framework which allows to bind the famous [Eigen](http://eigen.tuxfamily.org) C++ library in Python via Boost.Python.
**EigenPy** is an open-source framework that allows the binding of the famous [Eigen](http://eigen.tuxfamily.org) C++ library in Python via Boost.Python.
**EigenPy** provides:
- full memory sharing between Numpy and Eigen avoiding memory allocation
- full memory sharing between Numpy and Eigen, avoiding memory allocation
- full support Eigen::Ref avoiding memory allocation
- full support of the Eigen::Tensor module
- exposition of the Geometry module of Eigen for easy code prototyping
- standard matrix decomposion routines of Eigen such as the Cholesky decomposition, SVD decomposition, QR decomposition, and etc.
- standard matrix decomposion routines of Eigen such as the Cholesky decomposition, SVD decomposition, QR decomposition, etc.
- full support of SWIG objects
- full support of runtime declaration of Numpy scalar types
- extended API to expose std::vector types
......@@ -25,7 +25,7 @@ EigenPy — Versatile and efficient Python bindings between Numpy and Eigen
## Setup
The installation of **EigenPy** on your computer is made easy for Linux/BSD, Mac OS X and Windows environments.
The installation of **EigenPy** on your computer is made easy for Linux/BSD, Mac OS X, and Windows environments.
### The Conda approach
......@@ -36,7 +36,7 @@ conda install eigenpy -c conda-forge
### Ubuntu
You can easily install **EigenPy** from binairies.
You can easily install **EigenPy** from binaries.
#### Add robotpkg apt repository
1. Add robotpkg as source repository to apt:
......@@ -47,7 +47,7 @@ sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debia
```
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
```
3. You need to run at least once apt update to fetch the package descriptions:
3. You need to run at least one apt update to fetch the package descriptions:
```bash
sudo apt-get update
```
......@@ -58,12 +58,12 @@ sudo apt-get update
```bash
sudo apt install robotpkg-py35-eigenpy
```
where 35 should be replaced by the python 3 you want to work this (e.g. `robotpkg-py36-eigenpy` to work with Python 3.6).
where 35 should be replaced by the Python 3, you want to work this (e.g., `robotpkg-py36-eigenpy` to work with Python 3.6).
### Mac OS X
The installation of **EigenPy** on Mac OS X is made via [HomeBrew](https://brew.sh/).
You just need to register the tap of the sofware repository.
You just need to register the tap of the software repository.
```
brew tap gepetto/homebrew-gepetto
......@@ -83,8 +83,9 @@ The following people have been involved in the development of **EigenPy**:
- [Sean Yen](https://www.linkedin.com/in/seanyentw) (Microsoft): Windows integration
- [Loïc Estève](https://github.com/lesteve) (INRIA): Conda integration
- [Wilson Jallet](https://manifoldfr.github.io/) (INRIA/LAAS-CNRS): core developer
- [Joris Vaillant](https://github.com/jorisv) (Inria): core developer and manager of the project
If you have taken part to the development of **EigenPy**, feel free to add your name and contribution here.
If you have taken part in the development of **EigenPy**, feel free to add your name and contribution here.
## Acknowledgments
......
Subproject commit d769b7c0f0837399c21381c24ab4e8fd9b3b7220
Subproject commit 04687800b78c0058cd1dcdbfeb9f34460611df6b
......@@ -19,6 +19,8 @@ namespace eigenpy {
*/
void EIGENPY_DLLAPI enableEigenPy();
bool EIGENPY_DLLAPI withTensorSupport();
/* Enable the Eigen--Numpy serialization for the templated MatType class.*/
template <typename MatType>
void enableEigenPySpecific();
......
......@@ -15,9 +15,13 @@ include("${JRL_CMAKE_MODULES}/stubs.cmake")
add_custom_target(python)
set_target_properties(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)
add_library(${PYWRAP} SHARED main.cpp)
add_library(${PYWRAP} MODULE main.cpp)
add_dependencies(python ${PYWRAP})
target_link_libraries(${PYWRAP} PUBLIC ${PROJECT_NAME})
python_build_get_target(python_build_target)
add_dependencies(${PYWRAP} ${python_build_target})
# BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS spews conversion warnings from int to
# long unsigned int. Unfortunately, using literals does not work in a macro. As
# such, this turns them off for the entire wrapper:
......@@ -56,8 +60,10 @@ install(TARGETS ${PYWRAP} DESTINATION ${${PYWRAP}_INSTALL_DIR})
if(GENERATE_PYTHON_STUBS)
load_stubgen()
# Set PYWRAP and PROJECT_NAME as stubs dependencies PROJECT_NAME is mandatory
# (even if it's a PYWRAP dependency) to find PROJECT_NAME name DLL on windows
generate_stubs(${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_NAME}
${ABSOLUTE_PYTHON_SITELIB} ${PYWRAP})
${ABSOLUTE_PYTHON_SITELIB} ${PYWRAP} ${PROJECT_NAME})
endif(GENERATE_PYTHON_STUBS)
# --- INSTALL SCRIPTS
......
......@@ -60,4 +60,12 @@ void enableEigenPy() {
exposeNoneType();
}
bool withTensorSupport() {
#ifdef EIGENPY_WITH_TENSOR_SUPPORT
return true;
#else
return false;
#endif
}
} // namespace eigenpy
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