ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.09k stars 9.69k forks source link

apollo build on TX2 error: "cc_proto_library" is not defined #1843

Closed yanggaolei closed 6 years ago

yanggaolei commented 6 years ago

I want build apollo on TX2, but encounter some compile errors. Here are my steps 1、use jetpack download TX2 flash os only 2、remake kernel On the basis of https://github.com/jetsonhacks/buildJetsonTX2Kernel 3、install cuda 8.0 nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Fri_Jul_15_14:52:12_CDT_2016 Cuda compilation tools, release 8.0, V8.0.33

4、git clone https://github.com/ApolloAuto/apollo.git 5、 bash docker/scripts/install_docker.sh 6、change some scripts as follow: a: ./scripts/apollo_base.sh add export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra function set_lib_path() { if [ "$RELEASE_DOCKER" == 1 ];then source /apollo/ros/setup.bash export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra //add line here export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apollo/lib ……

      b: ./docker/scripts/dev_start.sh add lines as follow

      70     setup_device
      71
      72     local devices=""
      73     devices="${devices} $(find_device nvhost*)" //add line
      74     devices="${devices} $(find_device nvmap)"   //add line
      75     devices="${devices} $(find_device ttyUSB*)"
      76     devices="${devices} $(find_device ttyS*)"
      77     devices="${devices} $(find_device can*)"
      78     devices="${devices} $(find_device ram*)"
      79     devices="${devices} $(find_device loop*)"
      80     devices="${devices} $(find_device nvidia*)"
       ……
      107         -e DOCKER_IMG=$IMG \
      108         -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
      109         -v $APOLLO_ROOT_DIR:/apollo \
       100         -v /media:/media \
       111         -v $HOME/.cache:${DOCKER_HOME}/.cache \
       112         -v /etc/localtime:/etc/localtime:ro \
       113         -v /usr/lib/aarch64-linux-gnu/tegra:/usr/lib/aarch64-linux-gnu/tegra:ro  \    //add line
        114         -v /usr/local/cuda:/usr/local/cuda:ro  \                                                         //add line
        115         -v /usr/local/cuda-8.0:/usr/local/cuda-8.0:ro  \                                             //add line
        116         --net host \

7、sudo bash docker/scripts/devstart.sh /apollo/data/core/core%e.%p Type 'y' or 'Y' to pull docker image from China mirror or any other key from US mirror. y dev-aarch64-20170927_1111: Pulling from apolloauto/apollo Digest: sha256:10fc9daa7699f30650df05b9f3aff9762a236433e089e8755dcb0f6cfb7baab0 Status: Image is up to date for registry.docker-cn.com/apolloauto/apollo:dev-aarch64-20170927_1111 Cannot find device "can0" Cannot find device "can0" modprobe: FATAL: Module nvidia not found in directory /lib/modules/4.4.38-container modprobe: FATAL: Module nvidia-uvm not found in directory /lib/modules/4.4.38-container [ OK ] Found device: /dev/nvhost-ctrl-vi. [ OK ] Found device: /dev/nvhost-vi. [ OK ] Found device: /dev/nvhost-ctrl-nvcsi. [ OK ] Found device: /dev/nvhost-nvcsi. [ OK ] Found device: /dev/nvhost-ctrl-isp. [ OK ] Found device: /dev/nvhost-isp. [ OK ] Found device: /dev/nvhost-sched-gpu. [ OK ] Found device: /dev/nvhost-ctxsw-gpu. [ OK ] Found device: /dev/nvhost-tsg-gpu. [ OK ] Found device: /dev/nvhost-prof-gpu. [ OK ] Found device: /dev/nvhost-dbg-gpu. [ OK ] Found device: /dev/nvhost-ctrl-gpu. [ OK ] Found device: /dev/nvhost-as-gpu. [ OK ] Found device: /dev/nvhost-gpu. [ OK ] Found device: /dev/nvhost-nvjpg. [ OK ] Found device: /dev/nvhost-msenc. [ OK ] Found device: /dev/nvhost-vic. [ OK ] Found device: /dev/nvhost-ctrl-nvdec. [ OK ] Found device: /dev/nvhost-nvdec. [ OK ] Found device: /dev/nvhost-tsecb. [ OK ] Found device: /dev/nvhost-tsec. [ OK ] Found device: /dev/nvhost-ctrl. [ OK ] Found device: /dev/nvmap. [WARNING] Failed to find device with pattern "ttyUSB*" ... [ OK ] Found device: /dev/ttyS0. [ OK ] Found device: /dev/ttyS3. [ OK ] Found device: /dev/ttyS2. [ OK ] Found device: /dev/ttyS1. [ OK ] Found device: /dev/can3. [ OK ] Found device: /dev/can2. [ OK ] Found device: /dev/can1. [ OK ] Found device: /dev/can0. [ OK ] Found device: /dev/ram15. [ OK ] Found device: /dev/ram14. [ OK ] Found device: /dev/ram13. [ OK ] Found device: /dev/ram12. [ OK ] Found device: /dev/ram11. [ OK ] Found device: /dev/ram10. [ OK ] Found device: /dev/ram9. [ OK ] Found device: /dev/ram8. [ OK ] Found device: /dev/ram7. [ OK ] Found device: /dev/ram6. [ OK ] Found device: /dev/ram5. [ OK ] Found device: /dev/ram4. [ OK ] Found device: /dev/ram3. [ OK ] Found device: /dev/ram2. [ OK ] Found device: /dev/ram1. [ OK ] Found device: /dev/ram0. [ OK ] Found device: /dev/loop7. [ OK ] Found device: /dev/loop6. [ OK ] Found device: /dev/loop5. [ OK ] Found device: /dev/loop4. [ OK ] Found device: /dev/loop3. [ OK ] Found device: /dev/loop2. [ OK ] Found device: /dev/loop1. [ OK ] Found device: /dev/loop0. [ OK ] Found device: /dev/loop-control. [ OK ] Found device: /dev/nvidia-uvm-tools. [ OK ] Found device: /dev/nvidia-uvm. [ OK ] Found device: /dev/nvidiactl. [ OK ] Found device: /dev/nvidia0. [ OK ] Found device: /dev/video0.

but met a fatal module error: modprobe: FATAL: Module nvidia not found in directory /lib/modules/4.4.38-container modprobe: FATAL: Module nvidia-uvm not found in directory /lib/modules/4.4.38-container

8、bash docker/scripts/dev_into.sh ok 9、bash apollo.sh build has cc_proto_library is not defined error as follow sudo bash apollo.sh build [sudo] password for nvidia: System check passed. Build continue ... [WARNING] ESD CAN library supplied by ESD Electronics does not exist. If you need ESD CAN, please refer to third_party/can_card_library/esd_can/README.md. [INFO] Start building, please wait ... INFO: Reading 'startup' options from /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/tools/bazel.rc: --batch_cpu_scheduling Loading package: Loading package: third_party/can_card_library/esd_can ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/third_party/can_card_library/esd_can/BUILD:5:1: //third_party/can_card_library/esd_can:esd_can: no such attribute 'include_prefix' in 'cc_library' rule. Loading package: modules/map ERROR: package contains errors: third_party/can_card_library/esd_can. Loading package: tools/platforms ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/drivers/gnss/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/drivers/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/drivers/proto. Loading package: modules/common/transform_listener ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/data/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/data/proto/BUILD:18:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/drivers/gnss/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/proto/BUILD:17:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/proto/BUILD:34:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/proto/BUILD:48:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/proto/BUILD:66:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/proto/BUILD:84:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/proto/BUILD:98:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/proto/BUILD:116:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/common/proto. ERROR: package contains errors: modules/canbus/proto. Loading package: modules/tools/manual_traffic_light ERROR: package contains errors: modules/data/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/canbus/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/configs/proto/BUILD:3:1: name 'cc_proto_library' is not defined. Loading package: modules/map/proto ERROR: package contains errors: modules/common/configs/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/drivers/conti_radar/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/drivers/conti_radar/proto. Loading package: modules/drivers/canbus/common Loading package: modules/calibration/lidar_ex_checker/common Loading package: modules/prediction/evaluator ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/monitor/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/common/monitor/proto. Loading package: modules/prediction/proto ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/dreamview/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/dreamview/proto/BUILD:19:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/dreamview/proto/BUILD:31:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/map/proto/BUILD:5:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/map/proto. Loading package: modules/drivers/canbus/proto ERROR: package contains errors: modules/dreamview/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/prediction/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/prediction/proto/BUILD:21:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/prediction/proto/BUILD:42:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/prediction/proto/BUILD:59:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/prediction/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/prediction/proto/BUILD:77:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/prediction/proto/BUILD:93:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/prediction/proto/BUILD:110:1: name 'cc_proto_library' is not defined. Loading package: modules/monitor/conf Loading package: modules/localization/common ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/routing/proto/BUILD:3:1: name 'cc_proto_library' is not defined. Loading package: modules/calibration/republish_msg/proto Loading package: modules/dreamview/backend/testdata Loading package: modules/dreamview/backend/handlers ERROR: package contains errors: modules/drivers/canbus/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/drivers/canbus/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/third_party_perception/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/localization/proto. ERROR: package contains errors: modules/third_party_perception/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/adapters/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/monitor/hardware/BUILD:5:1: name 'cc_inc_library' is not defined. ERROR: package contains errors: modules/common/adapters/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/localization/proto/BUILD:5:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/localization/proto/BUILD:20:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/localization/proto/BUILD:35:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/localization/proto/BUILD:52:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/localization/proto/BUILD:69:1: name 'cc_proto_library' is not defined. Loading package: modules/prediction/predictor/lane_sequence ERROR: package contains errors: modules/routing/proto. ERROR: package contains errors: modules/monitor/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/monitor/proto/BUILD:5:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/monitor/proto/BUILD:20:1: name 'cc_proto_library' is not defined. Loading package: modules/routing/common ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/calibration/republish_msg/proto/BUILD:3:1: name 'cc_proto_library' is not defined. Loading package: modules/control/tools Loading package: modules/perception/traffic_light/preprocessor ERROR: package contains errors: modules/calibration/republish_msg/proto. ____Loading package: modules/perception/traffic_light/projection ERROR: package contains errors: modules/perception/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/perception/proto/BUILD:3:1: name 'cc_proto_library' is not defined. Loading package: modules/perception/obstacle/radar/interface ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/control/proto/BUILD:3:1: name 'cc_proto_library' is not defined. Loading package: modules/perception/traffic_light/base/test ERROR: package contains errors: modules/control/proto. Loading package: modules/perception/onboard/proto ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/perception/onboard/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/common/util/testdata/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/common/util/testdata. Loading package: modules/perception/obstacle/radar/dummy ERROR: package contains errors: modules/perception/onboard/proto. ____Loading package: modules/monitor/hardware/can/esdcan/esdcan_tools Loading package: modules/planning/math ERROR: package contains errors: modules/monitor/hardware. Loading package: modules/planning/integration_tests Loading package: modules/planning/common Loading package: modules/planning/planner/rtk ____Loading package: modules/planning/math/frame_conversion ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/perception/obstacle/lidar/segmentation/cnnseg/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: package contains errors: modules/perception/obstacle/lidar/segmentation/cnnseg/proto. ERROR: package contains errors: modules/perception/lib/config_manager/proto. ERROR: package contains errors: modules/planning/proto. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/perception/lib/config_manager/proto/BUILD:3:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/planning/proto/BUILD:5:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/planning/proto/BUILD:42:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/planning/proto/BUILD:56:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/planning/proto/BUILD:70:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/planning/proto/BUILD:85:1: name 'cc_proto_library' is not defined. ERROR: /media/nvidia/90631270-18b7-4ea7-a54d-347871aebc2b/apollo/apollo/modules/planning/proto/BUILD:106:1: name 'cc_proto_library' is not defined. Loading package: modules/planning/tasks/traffic_decider __Loading package: modules/planning/tasks/st_graph __Loading package: modules/planning/common/trajectory ERROR: no such package 'modules/calibration/republish_msg/proto': Package 'modules/calibration/republish_msg/proto' contains errors.

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

startcode commented 6 years ago

This platform is not officially supported. I suggest you compile and install everything from docker file, https://github.com/ApolloAuto/apollo/blob/r1.5.0/docker/dev.aarch64.dockerfile rather than using docker.

Some libraries could be missing in the dockerfile, you many need to figure it out.

natashadsouza commented 6 years ago

Closing this issue as there has been no response in a while. Feel free to open it if your issue persists.