RoboStack / ros-humble

Recipes for ROS 2 Humble Hawksbill
81 stars 32 forks source link

Various Fixes for January Rebuild on Windows #137

Closed traversaro closed 3 months ago

traversaro commented 3 months ago

Fix part of https://github.com/RoboStack/ros-humble/issues/136 backporting part of https://github.com/PickNikRobotics/RSL/pull/116 .

Tobias-Fischer commented 3 months ago

Thanks a lot for looking into this @traversaro! I deleted the previous build of yaml-cpp-vendor. Unfortunately our patch does not seem to apply at the moment.

traversaro commented 3 months ago

We need a few fixes for shared library support on Windows for ros2_controllers, I will do that.

Tobias-Fischer commented 3 months ago

It would be great if you could also check my hack in https://github.com/RoboStack/ros-humble/pull/137/commits/b0ea3c3696076f9a7acae6653609da9c9cda6f88

traversaro commented 3 months ago

It would be great if you could also check my hack in b0ea3c3

Thanks, that seems ok, the problem of ros2_controllers instead is that visibility headers are presents, but they are not used properly.

traversaro commented 3 months ago

We need a few fixes for shared library support on Windows for ros2_controllers, I will do that.

Done in https://github.com/ros-controls/ros2_controllers/pull/1039, let me transform this in patches for each package.

Tobias-Fischer commented 3 months ago

Unfortunately there are still quite a few more visibility related issues:

     Creating library C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707692495805/work/build/Release/ackermann_steering_controller.lib and object C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707692495805/work/build/Release/ackermann_steering_controller.exp
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: bool __cdecl steering_odometry::SteeringOdometry::update_from_position(double,double,double,double,double)" (?update_from_position@SteeringOdometry@steering_odometry@@QEAA_NNNNNN@Z) referenced in function "public: virtual bool __cdecl ackermann_steering_controller::AckermannSteeringController::update_odometry(class rclcpp::Duration const &)" (?update_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA_NAEBVDuration@rclcpp@@@Z) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: bool __cdecl steering_odometry::SteeringOdometry::update_from_velocity(double,double,double,double,double)" (?update_from_velocity@SteeringOdometry@steering_odometry@@QEAA_NNNNNN@Z) referenced in function "public: virtual bool __cdecl ackermann_steering_controller::AckermannSteeringController::update_odometry(class rclcpp::Duration const &)" (?update_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA_NAEBVDuration@rclcpp@@@Z) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: void __cdecl steering_odometry::SteeringOdometry::update_open_loop(double,double,double)" (?update_open_loop@SteeringOdometry@steering_odometry@@QEAAXNNN@Z) referenced in function "public: virtual bool __cdecl ackermann_steering_controller::AckermannSteeringController::update_odometry(class rclcpp::Duration const &)" (?update_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA_NAEBVDuration@rclcpp@@@Z) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: void __cdecl steering_odometry::SteeringOdometry::set_odometry_type(unsigned int)" (?set_odometry_type@SteeringOdometry@steering_odometry@@QEAAXI@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl ackermann_steering_controller::AckermannSteeringController::configure_odometry(void)" (?configure_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@XZ) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: void __cdecl steering_odometry::SteeringOdometry::set_wheel_params(double,double,double)" (?set_wheel_params@SteeringOdometry@steering_odometry@@QEAAXNNN@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl ackermann_steering_controller::AckermannSteeringController::configure_odometry(void)" (?configure_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@XZ) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "protected: enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl steering_controllers_library::SteeringControllersLibrary::set_interface_numbers(unsigned __int64,unsigned __int64,unsigned __int64)" (?set_interface_numbers@SteeringControllersLibrary@steering_controllers_library@@IEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@_K00@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl ackermann_steering_controller::AckermannSteeringController::configure_odometry(void)" (?configure_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@XZ) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2001: unresolved external symbol "protected: virtual class std::vector<class hardware_interface::CommandInterface,class std::allocator<class hardware_interface::CommandInterface> > __cdecl steering_controllers_library::SteeringControllersLibrary::on_export_reference_interfaces(void)" (?on_export_reference_interfaces@SteeringControllersLibrary@steering_controllers_library@@MEAA?AV?$vector@VCommandInterface@hardware_interface@@V?$allocator@VCommandInterface@hardware_interface@@@std@@@std@@XZ) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl steering_controllers_library::SteeringControllersLibrary::on_set_chained_mode(bool)" (?on_set_chained_mode@SteeringControllersLibrary@steering_controllers_library@@MEAA_N_N@Z) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
%SRC_DIR%\build\Release\ackermann_steering_controller.dll : fatal error LNK1120: 8 unresolved externals [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
traversaro commented 3 months ago

Unfortunately there are still quite a few more visibility related issues:

     Creating library C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707692495805/work/build/Release/ackermann_steering_controller.lib and object C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707692495805/work/build/Release/ackermann_steering_controller.exp
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: bool __cdecl steering_odometry::SteeringOdometry::update_from_position(double,double,double,double,double)" (?update_from_position@SteeringOdometry@steering_odometry@@QEAA_NNNNNN@Z) referenced in function "public: virtual bool __cdecl ackermann_steering_controller::AckermannSteeringController::update_odometry(class rclcpp::Duration const &)" (?update_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA_NAEBVDuration@rclcpp@@@Z) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: bool __cdecl steering_odometry::SteeringOdometry::update_from_velocity(double,double,double,double,double)" (?update_from_velocity@SteeringOdometry@steering_odometry@@QEAA_NNNNNN@Z) referenced in function "public: virtual bool __cdecl ackermann_steering_controller::AckermannSteeringController::update_odometry(class rclcpp::Duration const &)" (?update_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA_NAEBVDuration@rclcpp@@@Z) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: void __cdecl steering_odometry::SteeringOdometry::update_open_loop(double,double,double)" (?update_open_loop@SteeringOdometry@steering_odometry@@QEAAXNNN@Z) referenced in function "public: virtual bool __cdecl ackermann_steering_controller::AckermannSteeringController::update_odometry(class rclcpp::Duration const &)" (?update_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA_NAEBVDuration@rclcpp@@@Z) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: void __cdecl steering_odometry::SteeringOdometry::set_odometry_type(unsigned int)" (?set_odometry_type@SteeringOdometry@steering_odometry@@QEAAXI@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl ackermann_steering_controller::AckermannSteeringController::configure_odometry(void)" (?configure_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@XZ) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "public: void __cdecl steering_odometry::SteeringOdometry::set_wheel_params(double,double,double)" (?set_wheel_params@SteeringOdometry@steering_odometry@@QEAAXNNN@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl ackermann_steering_controller::AckermannSteeringController::configure_odometry(void)" (?configure_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@XZ) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2019: unresolved external symbol "protected: enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl steering_controllers_library::SteeringControllersLibrary::set_interface_numbers(unsigned __int64,unsigned __int64,unsigned __int64)" (?set_interface_numbers@SteeringControllersLibrary@steering_controllers_library@@IEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@_K00@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl ackermann_steering_controller::AckermannSteeringController::configure_odometry(void)" (?configure_odometry@AckermannSteeringController@ackermann_steering_controller@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@XZ) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2001: unresolved external symbol "protected: virtual class std::vector<class hardware_interface::CommandInterface,class std::allocator<class hardware_interface::CommandInterface> > __cdecl steering_controllers_library::SteeringControllersLibrary::on_export_reference_interfaces(void)" (?on_export_reference_interfaces@SteeringControllersLibrary@steering_controllers_library@@MEAA?AV?$vector@VCommandInterface@hardware_interface@@V?$allocator@VCommandInterface@hardware_interface@@@std@@@std@@XZ) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
ackermann_steering_controller.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl steering_controllers_library::SteeringControllersLibrary::on_set_chained_mode(bool)" (?on_set_chained_mode@SteeringControllersLibrary@steering_controllers_library@@MEAA_N_N@Z) [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]
%SRC_DIR%\build\Release\ackermann_steering_controller.dll : fatal error LNK1120: 8 unresolved externals [%SRC_DIR%\build\ackermann_steering_controller.vcxproj]

I tried to fix this in https://github.com/RoboStack/ros-humble/pull/137/commits/05aaac5ee16ce15410b5bc1fa9da453e8cf1a2b5 (see https://github.com/ros-controls/ros2_controllers/compare/master...traversaro:ros2_controllers:steeringexport). However, I suspect all these ros2_controllers code was never compiled on Windows, so it may be easier for me to set the compilation locally to be able to iterate faster.

traversaro commented 3 months ago

However, I suspect all these ros2_controllers code was never compiled on Windows, so it may be easier for me to set the compilation locally to be able to iterate faster.

As expected, we have a new failure exactly for the following package:

2024-02-12T11:32:50.9768184Z   Running `C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/_h_env/Library/bin/generate_parameter_library_cpp.exe C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/build/admittance_controller_parameters/include//admittance_controller_parameters.hpp C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/ros-humble-admittance-controller/src/work/src/admittance_controller_parameters.yaml `
2024-02-12T11:32:50.9771963Z   Building Custom Rule C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/ros-humble-admittance-controller/src/work/CMakeLists.txt
2024-02-12T11:32:50.9773205Z   Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
2024-02-12T11:32:50.9774312Z   Building Custom Rule C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/ros-humble-admittance-controller/src/work/CMakeLists.txt
2024-02-12T11:32:50.9775380Z   Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
2024-02-12T11:32:50.9775934Z   admittance_controller.cpp
2024-02-12T11:32:50.9777259Z      Creating library C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/build/Release/admittance_controller.lib and object C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/build/Release/admittance_controller.exp
2024-02-12T11:32:50.9779818Z admittance_controller.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl controller_interface::ChainableControllerInterface::on_set_chained_mode(bool)" (?on_set_chained_mode@ChainableControllerInterface@controller_interface@@MEAA_N_N@Z) [%SRC_DIR%\build\admittance_controller.vcxproj]
2024-02-12T11:32:50.9781666Z %SRC_DIR%\build\Release\admittance_controller.dll : fatal error LNK1120: 1 unresolved externals [%SRC_DIR%\build\admittance_controller.vcxproj]
traversaro commented 3 months ago

However, I suspect all these ros2_controllers code was never compiled on Windows, so it may be easier for me to set the compilation locally to be able to iterate faster.

As expected, we have a new failure exactly for the following package:

2024-02-12T11:32:50.9768184Z   Running `C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/_h_env/Library/bin/generate_parameter_library_cpp.exe C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/build/admittance_controller_parameters/include//admittance_controller_parameters.hpp C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/ros-humble-admittance-controller/src/work/src/admittance_controller_parameters.yaml `
2024-02-12T11:32:50.9771963Z   Building Custom Rule C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/ros-humble-admittance-controller/src/work/CMakeLists.txt
2024-02-12T11:32:50.9773205Z   Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
2024-02-12T11:32:50.9774312Z   Building Custom Rule C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/ros-humble-admittance-controller/src/work/CMakeLists.txt
2024-02-12T11:32:50.9775380Z   Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
2024-02-12T11:32:50.9775934Z   admittance_controller.cpp
2024-02-12T11:32:50.9777259Z      Creating library C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/build/Release/admittance_controller.lib and object C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707731398549/work/build/Release/admittance_controller.exp
2024-02-12T11:32:50.9779818Z admittance_controller.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl controller_interface::ChainableControllerInterface::on_set_chained_mode(bool)" (?on_set_chained_mode@ChainableControllerInterface@controller_interface@@MEAA_N_N@Z) [%SRC_DIR%\build\admittance_controller.vcxproj]
2024-02-12T11:32:50.9781666Z %SRC_DIR%\build\Release\admittance_controller.dll : fatal error LNK1120: 1 unresolved externals [%SRC_DIR%\build\admittance_controller.vcxproj]

Fix https://github.com/ros-controls/ros2_control/compare/master...traversaro:ros2_control:patch-2 .

traversaro commented 3 months ago

@Tobias-Fischer Green CI!

Tobias-Fischer commented 3 months ago

Thanks so much @traversaro for all the fixes :)!!!

Tobias-Fischer commented 3 months ago

Hopefully there won't be many more patches needed for the remaining packages - I'll trigger another PR as soon as these packages are built.