ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.12k stars 9.7k forks source link

apollo_r1.0.0: bash apollo.sh build error dreamview not work #8520

Closed qcqcc closed 4 years ago

qcqcc commented 5 years ago

WARNING: Running Bazel server needs to be killed, because the startup options are different. INFO: Found 190 targets... ERROR: /apollo/modules/control/tools/BUILD:19:1: Linking of rule '//modules/control/tools:enter_auto_mode' failed: gcc failed: error executing command /usr/bin/gcc -o bazel-out/local-dbg/bin/modules/control/tools/enter_auto_mode -Lbazel-out/local-dbg/bin/_solib_k8/_U_S_Sthird_Uparty_Sros_Cros_Ucommon_Uthird_Uparty_Sros_Slib ... (remaining 10 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1. modules/control/tools/enter_auto_mode.cc:100: error: undefined reference to 'ros::init(int&, char**, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned int)' third_party/ros/include/ros/publisher.h:107: error: undefined reference to 'ros::console::initializeLogLocation(ros::console::LogLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, ros::console::levels::Level)' third_party/ros/include/ros/publisher.h:107: error: undefined reference to 'ros::console::initializeLogLocation(ros::console::LogLocation, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, ros::console::levels::Level)' third_party/ros/include/ros/publisher.h:107: error: undefined reference to 'ros::console::initializeLogLocation(ros::console::LogLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, ros::console::levels::Level)' third_party/ros/include/ros/publisher.h:113: error: undefined reference to 'ros::console::initializeLogLocation(ros::console::LogLocation, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, ros::console::levels::Level)' modules/common/adapters/adapter_manager.cc:49: error: undefined reference to 'ros::NodeHandle::NodeHandle(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::map<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::less<std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::cxx11::basic_string<char, std::char_traits, std::allocator > const, std::cxx11::basic_string<char, std::char_traits, std::allocator > > > > const&)' collect2: error: ld returned 1 exit status INFO: Elapsed time: 18.971s, Critical Path: 6.72s

[ERROR] Build failed! [INFO] Took 57.017 seconds

++++++++++++++++++++++++env.txt++++++++++++++++++++++++++++ in_dev_docker

natashadsouza commented 5 years ago

@qcqcc could you give us your system config to help debug better?

qcqcc commented 5 years ago

Thank you for your reply. thank you very much.

apollo version:r1.0.0 uname -a: Linux in_dev_docker 4.4.32-apollo-1-NonRT-RT #2 SMP PREEMPT RT Fri May 10 23:07:17 CST 2019 x86_64 x86_64 x86_64 GNU/Linux

apollo-platform ros build succeed

============================ [ OK ] Build ros succeed! ============================`

I added configuration to WORKSPACE:

New_local_repository(

Name = ros,

Build_file = third_party/ros.BUILD,

Path = "/ home / TMP / ros"

) now, apollo.sh build passed.

root@in_dev_docker:/apollo# sudo bash apollo.sh build [WARNING] ESD CAN library supplied by ESD Electronics does not exit. [WARNING] If you need ESD CAN, please refer to third_party/can_card_library/esd_can/README.md . ____Loading package: modules/decision/common ____Loading package: modules/perception/proto ____Loading package: modules/canbus/tools ____Loading package: modules/control/filters ____Loading package: modules/control/common ____Loading package: modules/hmi/utils ____Loading package: modules/localization/proto ____Loading package: modules/common/monitor ____Loading package: third_party/ros_aarch64 ____Loading package: modules/common/monitor/proto ____Loading package: modules/hmi/proto ____Loading package: modules/localization/rtk ____Loading package: modules/control/proto ____Loading package: modules/dreamview/proto ____Loading package: modules/decision/proto ____Loading package: third_party/can_card_library/esd_can ____Loading package: modules/common/adapters/proto ____Loading package: @google_styleguide// ____Loading package: @com_github_google_protobuf// ____Loading package: @curlpp// ____Loading package: @glog// ____Loading package: @gtest// ____Loading package: @com_github_grpc_grpc// ____Loading package: @civetweb// ____Loading package: @websocketpp// ____Loading package: @eigen// Building on x86_64, with targets: //tools/platforms:x86_64 //tools/platforms:aarch64 //modules/prediction:prediction //modules/prediction:prediction_lib //modules/prediction/common:prediction_common //modules/planning/conf:planning_trajectory_adapter_manager_config //modules/planning:planning_testdata //modules/planning:planning //modules/planning:lib_planning //modules/planning/planner:lib_planner //modules/planning/common:lib_planning_common //modules/perception:perception //modules/perception/conf:perception_adapter_manager_config //modules/perception:perception_lib //modules/perception/common:perception_common //modules/monitor/common:platform_common_lib //modules/monitor/common:interface //modules/localization/proto:localization_config_proto_pylib //modules/localization/proto:imu_proto_pylib //modules/localization/proto:gps_proto_pylib //modules/localization/proto:camera_proto_pylib //modules/localization/proto:camera_parameter_proto_pylib //modules/localization:localization //modules/localization/conf:localization_adapter_manager_config //modules/localization:localization_app //modules/localization/rtk:rtk_localization //modules/localization/camera:camera_localization //modules/localization/proto:localization_config_proto //modules/localization/proto:localization_config_proto.pb //modules/localization/proto:camera_parameter_proto //modules/localization/proto:camera_parameter_proto.pb //modules/localization:localization_base //modules/hmi/ros_node:ros_node_service //modules/hmi/proto:runtime_status_proto_pylib //modules/hmi/proto:ros_node_proto_pylib //modules/hmi/proto:ros_node_proto //modules/hmi/proto:ros_node_proto.pb //modules/hmi/proto:config_proto_pylib //modules/dreamview/proto:simulation_world_proto_pylib //modules/planning/proto:planning_proto_pylib //modules/localization/proto:localization_proto_pylib //modules/localization/proto:pose_proto_pylib //modules/dreamview/conf:dreamview_adapter_manager_config //modules/dreamview:dreamview //modules/dreamview/backend:backend //modules/dreamview/backend:websocket //modules/dreamview/backend:simulation_world_service //modules/dreamview/backend:trajectory_point_collector //modules/dreamview/proto:simulation_world_proto //modules/dreamview/proto:simulation_world_proto.pb //modules/dreamview:frontend //modules/decision/proto:decision_proto_pylib //modules/prediction/proto:prediction_proto_pylib //modules/perception/proto:perception_proto_pylib //modules/decision/conf:localization_adapter_manager_config //modules/decision:decision //modules/decision:lib_decision //modules/decision/common:decision_common //modules/control/tools:pad_terminal //modules/control/tools:enter_auto_mode //modules/control/tools:control_tester //modules/control/proto:control_proto_pylib //modules/control/integration_tests:control_test_base //modules/control/filters:filters //modules/control:lib_pad_terminal //modules/control:control_testdata //modules/control:control //modules/control:lib_control //modules/control/controller:controller //modules/control/controller:controller_agent //modules/control/controller:lon_controller //modules/control/controller:lat_controller //modules/control/filters:mean_filter //modules/control/filters:digital_filter //modules/control/filters:digital_filter_coefficients //modules/control/controller:controller_interface //modules/control/common:common //modules/control/common:trajectory_analyzer //modules/control/common:pid_controller //modules/control/common:interpolation_2d //modules/control/common:hysteresis_filter //modules/control/common:control_gflags //modules/control/common:base_types //modules/control/common:definitions //modules/localization:localization_testdata //modules/common/vehicle_state:vehicle_state //modules/localization/common:localization_common //modules/common/util/testing:simple_proto //modules/common/util/testing:simple_proto.pb //modules/common/proto:gnss_status_proto //modules/common/proto:gnss_status_proto.pb //modules/common/monitor/proto:monitor_proto_pylib //modules/common/configs/proto:vehicle_config_proto_pylib //modules/common/configs:vehicle_config_helper //modules/common/data:vehicle_config_data //modules/common/configs/proto:vehicle_config_proto //modules/common/configs/proto:vehicle_config_proto.pb //modules/common/configs:config_gflags //modules/common/adapters/proto:adapter_config_proto_pylib //modules/canbus/tools:teleop //modules/canbus/tools:canbus_tester //modules/canbus/proto:canbus_proto_pylib //modules/common/proto:common_proto_pylib //modules/canbus/can_client:can_client_tool //modules/canbus:canbus_testdata //modules/canbus:canbus //modules/canbus:canbus_lib //modules/common/monitor:monitor //modules/common/adapters:adapter_manager //modules/common/adapters/proto:adapter_config_proto //modules/common/adapters/proto:adapter_config_proto.pb //modules/common/adapters:message_adapters //modules/planning/proto:planning_proto //modules/planning/proto:planning_proto.pb //modules/localization/proto:localization_proto //modules/localization/proto:localization_proto.pb //modules/localization/proto:imu_proto //modules/localization/proto:imu_proto.pb //modules/localization/proto:gps_proto //modules/localization/proto:gps_proto.pb //modules/localization/proto:camera_proto //modules/localization/proto:pose_proto //modules/localization/proto:pose_proto.pb //modules/localization/proto:camera_proto.pb //modules/decision/proto:decision_proto //modules/prediction/proto:prediction_proto //modules/prediction/proto:prediction_proto.pb //modules/perception/proto:perception_proto //modules/perception/proto:perception_proto.pb //modules/decision/proto:decision_proto.pb //modules/common/monitor/proto:monitor_proto //modules/common/monitor/proto:monitor_proto.pb //modules/common/adapters:adapter //modules/common/adapters:adapter_gflags //modules/common:apollo_app //modules/hmi/utils:hmi_status_helper //modules/hmi/utils:restful_client //modules/hmi/proto:runtime_status_proto //modules/hmi/proto:runtime_status_proto.pb //modules/common/status:status //modules/canbus/vehicle:vehicle_factory //modules/canbus/vehicle:lincoln_vehicle_factory //modules/canbus/vehicle/lincoln:lincoln_controller //modules/canbus/vehicle/lincoln:lincoln_message_manager //modules/canbus/vehicle/lincoln/protocol:canbus_lincoln_protocol //modules/canbus/vehicle:abstract_vehicle_factory //modules/canbus/vehicle:vehicle_controller_base //modules/canbus/can_comm:can_sender //modules/canbus/can_comm:can_receiver //modules/canbus/vehicle:message_manager_base //modules/control/proto:control_proto //modules/control/proto:control_proto.pb //modules/canbus/can_client:can_client_factory //modules/common/util:factory //modules/canbus/can_client/fake:fake_can_client //modules/canbus/can_client:can_client //modules/common/util:util //modules/common/time:time //modules/common/math:math //modules/common/math:search //modules/common/math:quaternion //modules/common/math:lqr //modules/common/math:linear_interpolation //modules/common/math:kalman_filter //modules/common/math:matrix_operations //modules/common/math:integral //modules/common/math:euler_angles_zxy //modules/common/math:box2d //modules/common/math:polygon2d //modules/common/math:line_segment2d //modules/common/math:angle //modules/common/math:sin_table //modules/common/math:aaboxkdtree2d //modules/common/math:aabox2d //modules/common/math:math_utils //modules/common/math:vec2d //modules/canbus/common:canbus_common //modules/canbus/proto:canbus_proto //modules/common/proto:common_proto //modules/common/proto:header_proto //modules/common/proto:header_proto.pb //modules/common/proto:error_code_proto //modules/common/proto:error_code_proto.pb //modules/common/proto:common_proto.pb //modules/common:common //modules/common:macro //modules/common:log //modules/canbus/proto:canbus_proto.pb //:x86_64 //:arm64 ===================hualidefengexian==================================== WARNING: Running Bazel server needs to be killed, because the startup options are different. INFO: Found 190 targets... INFO: Elapsed time: 366.306s, Critical Path: 250.55s ============================install/ros_x86_64 [ OK ] Build passed! [INFO] Took 404.839 seconds

But dreamview doesn't work properly

root@in_dev_docker:/apollo# sudo bash scripts/dreamview.sh start_fe /apollo/bazel-bin/modules/dreamview/dreamview: symbol lookup error: /apollo/third_party/ros/lib/librosconsole_log4cxx.so: undefined symbol: _ZN7log4cxx16AppenderSkeleton9setOptionERKSsS2_ root@in_dev_docker:/apollo# sudo bash scripts/bootstrap.sh Start roscore... Started supervisord with dev conf Dreamview is running at http://localhost:8888 root@in_dev_docker:/apollo# sudo bash scripts/hmi.sh Start roscore... HMI ros node service running at localhost:8887 HMI running at http://localhost:8887

symbol lookup error: /apollo/third_party/ros/lib/librosconsole_log4cxx.so: undefined symbol: ZN7log4cxx16AppenderSkeleton9setOptionERKSsS2

In response to this error, I reinstalled apr-1.5.1, apr-unit-1.5.3, log4cxx-0.10.0, but it was still unresolved.

find .|xargs grep -ri "ZN7log4cxx16AppenderSkeleton9setOptionERKSsS2" Binary file. / liblog4cxx. so.10.0.0 matches can be found in apollo_release, but liblog4cxx. so.10.0.0 matches cannot be found in apollo_dev.

help me!

natashadsouza commented 5 years ago

@qcqcc When you say dreamview does not work correctly, are you seeing an issue in your terminal or in your browser? Also, we do have a guide to debug the dreamview issue

qcqcc commented 5 years ago

Thank you for your help.

When running this command: sudo bash scripts/bootstrap.sh

Output at the terminal: Start roscore... Started supervisord with dev conf Dreamview is running at http://localhost:8888

Output at the data/log/dreamview.out: /apollo/bazel-bin/modules/dreamview/dreamview: error while loading shared libraries: libfastcdr.so: cannot open shared object file: No such file or directory

ldd /apollo/bazel-bin/modules/dreamview/dreamview

linux-vdso.so.1 => (0x00007ffd245b3000) libcpp_common.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/libcpp_common.so (0x00007f55da345000) **libfastcdr.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/libfastcdr.so (0x00007f55da135000)** libfastrtps.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/libfastrtps.so (0x00007f55d9da4000) librosconsole.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/librosconsole.so (0x00007f55d9b75000) librosconsole_backend_interface.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/librosconsole_backend_interface.so (0x00007f55d9973000) librosconsole_log4cxx.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/librosconsole_log4cxx.so (0x00007f55d975e000) librosconsole_print.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/librosconsole_print.so (0x00007f55d955b000) libroscpp.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/libroscpp.so (0x00007f55d9139000) libroscpp_serialization.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/libroscpp_serialization.so (0x00007f55d8f35000) librostime.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/librostime.so (0x00007f55d8d09000) libxmlrpcpp.so => /apollo/apollo-platform/ros/install/ros_x86_64/lib/libxmlrpcpp.so (0x00007f55d8ae7000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f55d88c3000) libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007f55d86bf000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f55d84a2000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f55d829d000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f55d7f1b000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f55d7c12000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f55d79fb000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f55d7631000) /lib64/ld-linux-x86-64.so.2 (0x00005613e0636000) libconsole_bridge.so.0.2 => /usr/lib/x86_64-linux-gnu/libconsole_bridge.so.0.2 (0x00007f55d742c000) liblog4cxx.so.10 => /usr/local/lib/liblog4cxx.so.10 (0x00007f55d7048000) libboost_regex.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.58.0 (0x00007f55d6d40000) libboost_thread.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 (0x00007f55d6b19000) libboost_filesystem.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0 (0x00007f55d6901000) libyaml-cpp.so.0.5 => /usr/lib/x86_64-linux-gnu/libyaml-cpp.so.0.5 (0x00007f55d6684000) libaprutil-1.so.0 => /usr/local/apr-util/lib/libaprutil-1.so.0 (0x00007f55d645d000) libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0 (0x00007f55d622a000) libicui18n.so.55 => /usr/lib/x86_64-linux-gnu/libicui18n.so.55 (0x00007f55d5dc7000) libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f55d5a33000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f55d5808000) libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f55d55d0000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f55d53cb000) libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f55d3913000)

ll /apollo/apollo-platform/ros/install/ros_x86_64/lib/libfastcdr.so -rw-r--r-- 1 root root 81468 May 29 17:56 /apollo/apollo-platform/ros/install/ros_x86_64/lib/libfastcdr.so

This file exists.

I try to use GDB gdb --args /apollo/bazel-bin/modules/dreamview/dreamview --flagfile=/apollo/modules/dreamview/conf/dreamview.conf

Once gdb is launched, press r and enter key to run, if dreamview crashes, then get the backtrace with bt.

` Starting program: /root/.cache/bazel/_bazel_root/540135163923dd7d5820f3ee4b306b32/execroot/apollo/bazel-out/local-dbg/bin/modules/dreamview/dreamview --flagfile=/apollo/modules/dreamview/conf/.conf warning: Error disabling address space randomization: Operation not permitted /root/.cache/bazel/_bazel_root/540135163923dd7d5820f3ee4b306b32/execroot/apollo/bazel-out/local-dbg/bin/modules/dreamview/dreamview: symbol lookup error: /apollo/third_party/ros/lib/librosconsxx.so: undefined symbol: ZN7log4cxx16AppenderSkeleton9setOptionERKSsS2 During startup program exited with code 127.

`

Is there any problem with my operation?

@natashadsouza thank you!

qcqcc commented 5 years ago

Has no friend ever encountered this problem?

help me

thanks

luqiang21 commented 5 years ago

@qcqcc I am just guessing. You should not use sudo to run bootstrap.sh. If you cannot run it without sudo. Then probably you ran dev_start.sh using sudo which is incorrect. If that is the case, you should follow instructions on docker website to add your user group.

ycool commented 4 years ago

You can try it again in the latest master code. Thanks.