Skip to content

Commit

Permalink
CMake with static realsense and franka
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcToussaint committed Nov 29, 2023
1 parent 9918562 commit 36d9cc1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ This assumes a standard Ubuntu 20.04 (or 18.04) machine.
git clone --recursive https://github.com/MarcToussaint/robotic.git
cd robotic
cp _build_utils/CMakeLists-ubuntu.txt CMakeLists.txt
export PYTHONVERSION=`python3 -c "import sys; print(str(sys.version_info[0])+'.'+str(sys.version_info[1]))"`
cmake -DPYBIND11_PYTHON_VERSION=$PYTHONVERSION -DUSE_REALSENSE=ON -DUSE_LIBFRANKA=ON . -B build
export PY_VERSION=`python3 -c "import sys; print(str(sys.version_info[0])+'.'+str(sys.version_info[1]))"`
cmake -DPY_VERSION=$PY_VERSION -DUSE_REALSENSE=ON -DUSE_LIBFRANKA=ON . -B build
make -C build _robotic install

(Docstrings could be made with `make docstrings`, but this is not yet robust across distributions.)
Expand Down
4 changes: 2 additions & 2 deletions _build_utils/CMakeLists-docker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

## variable default values
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ version selection")
set(PYBIND11_PYTHON_VERSION 3.8 CACHE STRING "python version")
set(PY_VERSION 3.8 CACHE STRING "python version")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "..." FORCE)
endif()
Expand Down Expand Up @@ -139,7 +139,7 @@ endif()
################################################################################

if(USE_PYBIND)
set(PYTHON_EXECUTABLE "python${PYBIND11_PYTHON_VERSION}")
set(PYTHON_EXECUTABLE "python${PY_VERSION}")
message(STATUS "[rai] using python executable " ${PYTHON_EXECUTABLE} )
execute_process(
COMMAND bash "-c" "${PYTHON_EXECUTABLE} -m pybind11 --cmakedir"
Expand Down
9 changes: 4 additions & 5 deletions _build_utils/CMakeLists-ubuntu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

## variable default values
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ version selection")
set(PYBIND11_PYTHON_VERSION 3.8 CACHE STRING "python version")
set(PY_VERSION 3.8 CACHE STRING "python version")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "..." FORCE)
endif()
Expand Down Expand Up @@ -137,7 +137,7 @@ endif()

if(USE_REALSENSE)
add_definitions(-DRAI_REALSENSE)
target_link_libraries(rai realsense2)
target_link_libraries(rai realsense2 realsense-file rsutils fw usb-1.0)
message(STATUS "[rai] using realsense libs")
endif()

Expand All @@ -150,7 +150,7 @@ endif()
################################################################################

if(USE_PYBIND)
set(PYTHON_EXECUTABLE "python${PYBIND11_PYTHON_VERSION}")
set(PYTHON_EXECUTABLE "python${PY_VERSION}")
message(STATUS "[rai] using python executable " ${PYTHON_EXECUTABLE} )
execute_process(
COMMAND bash "-c" "${PYTHON_EXECUTABLE} -m pybind11 --cmakedir"
Expand Down Expand Up @@ -197,8 +197,7 @@ target_link_libraries(bot rai)

################################################################################

set(PYTHON_SITE "lib/python${PYBIND11_PYTHON_VERSION}/site-packages")

set(PYTHON_SITE "lib/python${PY_VERSION}/site-packages")
message(STATUS "[rai] installing python packages in " ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE}/robotic )

install(
Expand Down
2 changes: 1 addition & 1 deletion _build_utils/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export PYTHONPATH=.
### build each version
for ver in 8 9 10 11 6 7; do
echo -e "\n\n======== compiling (python version " $ver ") ========"
cmake -B build_wheel -DPYBIND11_PYTHON_VERSION=3.$ver .
cmake -B build_wheel -DPY_VERSION=3.$ver .
make -C build_wheel _robotic

echo -e "\n\n======== build wheel (python version " $ver ") ========"
Expand Down

0 comments on commit 36d9cc1

Please sign in to comment.