ros-acceleration / acceleration_examples

ROS 2 package examples demonstrating the use of hardware acceleration.
Apache License 2.0
39 stars 19 forks source link

Build fail for vadd_publisher #11

Closed jasvinderkhurana closed 2 years ago

jasvinderkhurana commented 2 years ago

I am following the KRS documentation and facing build issue in kv260 example:

xhdjasvinde41:/scratch/Work/Ros2/krs_ws $ colcon build --build-base=build-kv260 --install-base=install-kv260 --merge-install --mixin kv260 --packages-select ament_vitis vadd_publisher
Starting >>> ament_vitis
Finished <<< ament_vitis [0.21s]
Starting >>> vadd_publisher
--- stderr: vadd_publisher
CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_C_COMPILER:

    /scratch/Work/Ros2/krs_ws/install/../acceleration/firmware/kv260/../vitis/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-gcc

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_CXX_COMPILER:

    /scratch/Work/Ros2/krs_ws/install/../acceleration/firmware/kv260/../vitis/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

---
Failed   <<< vadd_publisher [0.32s, exited with code 1]

Summary: 1 package finished [0.74s]
  1 package failed: vadd_publisher
  1 package had stderr output: vadd_publisher 

cmake is not able to find a compiler. Can you guide what would be causing the issue.

jasvinderkhurana commented 2 years ago

I just figured it out that, I was doing a colcon build from sub-directory, which was messing the things. When I cleaned the workspace and built it from root directory (~/krs_ws). It resolved the problem.

So one thing to learn is, always build from root directory