From d354accf476fc7d4734a42ca8af32415b27d0568 Mon Sep 17 00:00:00 2001 From: Marc Toussaint Date: Tue, 27 Feb 2024 10:37:51 +0100 Subject: [PATCH] v1.8 --- README.md | 3 +++ _build_utils/CMakeLists-docker.txt | 27 +++++++++++++++++------- _build_utils/CMakeLists-ubuntu.txt | 34 +++++++++++++++++++----------- _build_utils/Dockerfile | 5 +---- _build_utils/build-wheels.sh | 2 +- botop | 2 +- rai | 2 +- robotic/version.py | 2 +- setup.py | 3 ++- 9 files changed, 51 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 22de0c56e..81be109d2 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,9 @@ pip install robotic ``` * Tests: ``` +ry-info +``` +``` python3 -c 'import robotic as ry; print("ry version:", ry.__version__, ry.compiled());' ``` ``` diff --git a/_build_utils/CMakeLists-docker.txt b/_build_utils/CMakeLists-docker.txt index 6f76139c9..601563856 100644 --- a/_build_utils/CMakeLists-docker.txt +++ b/_build_utils/CMakeLists-docker.txt @@ -27,6 +27,7 @@ option(USE_OPENCV "link to opencv" OFF) option(USE_REALSENSE "link to realsense2 driver library" OFF) option(USE_LIBFRANKA "link to libfranka" OFF) option(USE_PCL "link to pcl library" OFF) +option(USE_H5 "link to h5 library" ON) ## compile options add_compile_options( @@ -41,7 +42,7 @@ add_definitions( -DRAI_ROOT_PATH=\"${CMAKE_SOURCE_DIR}/rai\" -DRAI_X11 -DRAI_LAPACK -DRAI_EIGEN -DRAI_PTHREAD -DRAI_GL - -DRAI_GLFW -DRAI_ANN -DRAI_QHULL8 -DRAI_ASSIMP -DNO_CYCLE_DETECTION -DRAI_PNG -DRAI_PLY -DRAI_H5 + -DRAI_GLFW -DRAI_ANN -DRAI_QHULL8 -DRAI_ASSIMP -DNO_CYCLE_DETECTION -DRAI_PNG -DRAI_PLY -DRAI_GJK -DRAI_CCD -DRAI_FCL -DRAI_Lewiner -DRAI_NO_STB_IMPL -DRAI_BotOp @@ -104,26 +105,32 @@ add_library(rai SHARED ${SRC_Audio} ) + +################################################################################ +# +# rai include/link + target_link_libraries(rai PRIVATE # ORDER MATTERS! test with -no-undefined linker flag (above) - libjsoncpp.a lapack pthread rt X11 libatlas.a - libassimp.a libglfw3.a libGLEW.a glut GLU GL libpng16.a libzlibstatic.a libqhull.a libANN.a libccd.a libfcl.a + libjsoncpp.a lapack libatlas.a + libassimp.a libglfw3.a libGLEW.a glut GLU GL libpng16.a libzlibstatic.a libqhull.a libANN.a libfcl.a libccd.a libhdf5_cpp.a libhdf5.a #${BULLET_LIBRARIES} libBullet2FileLoader.a libBullet3Common.a libBullet3Geometry.a libBulletCollision.a libBulletInverseDynamics.a libBullet3Collision.a libBullet3Dynamics.a libBullet3OpenCL_clew.a libBulletDynamics.a libBulletSoftBody.a libLinearMath.a - dl ) -################################################################################ -# -# include external libraries - #find_package (FindEigen3 REQUIRED) #target_link_libraries (rai FindEigen3::Eigen) #target_link_libraries (rai eigen) +if(USE_H5) + add_definitions(-DRAI_H5) + target_link_libraries(rai PRIVATE libhdf5_cpp.a libhdf5.a libzlibstatic.a) + message(STATUS "[rai] using H5 libs: hdf5 hdf5_cpp in " ${HDF5_INCLUDE_DIRS}) +endif() + if(USE_BULLET) find_package(Bullet REQUIRED) add_definitions(-DRAI_BULLET) @@ -157,6 +164,10 @@ if(USE_LIBFRANKA) message(STATUS "[rai] using libfranka") endif() +target_link_libraries(rai PRIVATE + pthread rt X11 dl + ) + ################################################################################ if(USE_PYBIND) diff --git a/_build_utils/CMakeLists-ubuntu.txt b/_build_utils/CMakeLists-ubuntu.txt index e094aff3b..b5b76b1a8 100644 --- a/_build_utils/CMakeLists-ubuntu.txt +++ b/_build_utils/CMakeLists-ubuntu.txt @@ -53,8 +53,8 @@ add_definitions( include_directories( rai/src botop/src - /usr/include/eigen3 $ENV{HOME}/.local/include + /usr/include/eigen3 ) link_directories( @@ -64,6 +64,9 @@ link_directories( if(USE_PHYSX) link_directories($ENV{HOME}/.local/lib/PhysX) endif() +if(USE_H5) + link_directories(/usr/lib/x86_64-linux-gnu/hdf5/serial) +endif() file(GLOB SRC_GeoGJK rai/src/Geo/GJK/*.c) file(GLOB SRC_GeoPly rai/src/Geo/ply/*.c) @@ -103,32 +106,35 @@ add_library(rai SHARED ${SRC_Audio} ) +################################################################################ +# +# rai include/link + +# default/required dependencies target_link_libraries(rai PRIVATE # ORDER MATTERS! test with -no-undefined linker flag (above) - jsoncpp lapack blas pthread rt X11 - assimp ccd fcl qhull ann glfw GLEW glut GLU GL png - boost_system + jsoncpp lapack blas + assimp fcl ccd ann qhull + glfw GLEW glut GLU GL png ) -################################################################################ -# -# include external libraries - #find_package (Eigen3 3.3 REQUIRED NO_MODULE) #target_link_libraries (rai Eigen3::Eigen) find_package(PkgConfig REQUIRED) if(USE_H5) + find_package(HDF5 REQUIRED) add_definitions(-DRAI_H5) - target_link_libraries(rai PRIVATE hdf5_cpp hdf5) - message(STATUS "[rai] using H5 libs: hdf5 hdf5_cpp") + include_directories(${HDF5_INCLUDE_DIRS}) + target_link_libraries(rai PRIVATE hdf5_cpp hdf5 z) + message(STATUS "[rai] using H5 libs: hdf5 hdf5_cpp in " ${HDF5_INCLUDE_DIRS}) endif() if(USE_BULLET) find_package(Bullet REQUIRED) add_definitions(-DRAI_BULLET) include_directories(${BULLET_INCLUDE_DIRS}) - target_link_libraries(rai ${BULLET_LIBRARIES}) + target_link_libraries(rai PRIVATE ${BULLET_LIBRARIES}) message(STATUS "[rai] using bullet libs:" ${BULLET_LIBRARIES}) endif() @@ -141,7 +147,7 @@ endif() if(USE_OPENCV) find_package(OpenCV REQUIRED) add_definitions(-DRAI_OPENCV) - target_link_libraries(rai ${OpenCV_LIBS}) + target_link_libraries(rai PRIVATE ${OpenCV_LIBS}) message(STATUS "[rai] using OpenCV libs:" ${OpenCV_LIBS}) endif() @@ -164,6 +170,10 @@ if(USE_LIBFRANKA) message(STATUS "[rai] using libfranka") endif() +target_link_libraries(rai PRIVATE + pthread rt X11 boost_system + ) + ################################################################################ if(USE_PYBIND) diff --git a/_build_utils/Dockerfile b/_build_utils/Dockerfile index 532cb6bb2..daa7cc2fb 100644 --- a/_build_utils/Dockerfile +++ b/_build_utils/Dockerfile @@ -31,11 +31,8 @@ RUN ./install.sh -gc fcl RUN ./install.sh -gc assimp RUN ./install.sh -gc bullet -RUN rm install.sh -RUN wget https://github.com/MarcToussaint/rai-extern/raw/main/install.sh; chmod a+x install.sh RUN ./install.sh -gc physx -#RUN wget https://github.com/MarcToussaint/rai-extern/raw/main/install.sh; chmod a+x install.sh #RUN yum -y install openssl-devel poco-devel libusbx-devel #RUN ./install.sh -g librealsense #RUN ./install.sh -g libfranka @@ -51,4 +48,4 @@ RUN python3.11 -m pip install pybind11 pybind11-stubgen==0.16.2 numpy WORKDIR /root -RUN printf "\necho '*** Welcome to the manylinux docker! ***'\n" >> $HOME/.bashrc +RUN printf "\necho '*** Robotic Python Lib - docker for wheel build ***'\n" >> $HOME/.bashrc diff --git a/_build_utils/build-wheels.sh b/_build_utils/build-wheels.sh index cec441d57..e0c4489c3 100755 --- a/_build_utils/build-wheels.sh +++ b/_build_utils/build-wheels.sh @@ -46,7 +46,7 @@ for ver in 8 9 10 11 6 7; do strip --strip-unneeded robotic/librai.so echo -e "\n\n======== build wheel (python version " $ver ") ========" - python3.$ver setup.py bdist_wheel + python3.$ver setup.py --quiet bdist_wheel #break done diff --git a/botop b/botop index 59f138bc5..7e1282da7 160000 --- a/botop +++ b/botop @@ -1 +1 @@ -Subproject commit 59f138bc544cf9dd4fb30398358241e14e22a3d3 +Subproject commit 7e1282da7a894bdb48f0b4dbfb9f3bc2f60f051f diff --git a/rai b/rai index 2df173b69..51df82f41 160000 --- a/rai +++ b/rai @@ -1 +1 @@ -Subproject commit 2df173b69e396ab69ce155be52549125448d98a6 +Subproject commit 51df82f415d0aee769af87568822cd19462816bc diff --git a/robotic/version.py b/robotic/version.py index 124e46203..c3bb2961b 100644 --- a/robotic/version.py +++ b/robotic/version.py @@ -1 +1 @@ -__version__ = '0.1.7' +__version__ = '0.1.8' diff --git a/setup.py b/setup.py index e8814fa6f..3313c8cf3 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,8 @@ def has_ext_modules(foo): setup( name='robotic', - packages=['robotic'], + #packages=['robotic'], + packages=setuptools.find_namespace_packages(), package_data={ 'robotic': ['_robotic.so', 'librai.so', '_robotic.pyi', 'version.py', 'render.py', 'rai-robotModels/*/*', 'rai-robotModels/*/*/*', 'rai-robotModels/*/*/*/*', 'rai-robotModels/*/*/*/*/*', 'rai-robotModels/*/*/*/*/*/*',