Browse Source

compile cython code when build funmap pkg

feature/urdf_base_imu
youliang 1 year ago
committed by Binit Shah
parent
commit
723549a61b
3 changed files with 13 additions and 1 deletions
  1. +8
    -0
      stretch_funmap/CMakeLists.txt
  2. +1
    -0
      stretch_funmap/package.xml
  3. +4
    -1
      stretch_funmap/src/stretch_funmap/compile_cython_code.sh

+ 8
- 0
stretch_funmap/CMakeLists.txt View File

@ -11,6 +11,14 @@ find_package(catkin REQUIRED COMPONENTS
rospy
)
set(cython_code_dir ${CMAKE_CURRENT_SOURCE_DIR}/src/stretch_funmap)
message("Compile cython code within cmake build")
execute_process(
WORKING_DIRECTORY ${cython_code_dir}
COMMAND bash ${cython_code_dir}/compile_cython_code.sh
)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)

+ 1
- 0
stretch_funmap/package.xml View File

@ -49,6 +49,7 @@
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rospy</build_depend>
<build_export_depend>rospy</build_export_depend>
<build_depend>cython</build_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>ros_numpy</exec_depend>

+ 4
- 1
stretch_funmap/src/stretch_funmap/compile_cython_code.sh View File

@ -2,7 +2,10 @@
echo "Building cython_min_cost_path.pyx..."
cython ./cython_min_cost_path.pyx
gcc -shared -pthread -fPIC -fwrapv -ffast-math -O3 -Wall -fno-strict-aliasing -I/usr/include/python2.7 -o cython_min_cost_path.so cython_min_cost_path.c
PY_INCLUDE_PATH=$(python -c 'from sysconfig import get_paths as gp; print(gp()["include"])')
echo "Using python lib: $PY_INCLUDE_PATH"
gcc -shared -pthread -fPIC -fwrapv -ffast-math -O3 -Wall -fno-strict-aliasing -I$PY_INCLUDE_PATH -o cython_min_cost_path.so cython_min_cost_path.c
echo "Done."
echo ""

Loading…
Cancel
Save