Cross Compilation Causes protoc Missing Error
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start with the generated checks in ola.m4 and the configure command for the x86_64-to-aarch64 build, then inspect the Makefile target reported at line 19184. Trace how the protoc plugin is selected and built in the --with-ola-protoc-plugin case. Done means cross-compilation completes the header and libprotoc checks and make all can execute the plugin to generate the protocol files.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello!
I am able to compile fine for x86_64 on this system. When I try to cross-compile for aarch64, Autoconf is refusing to use the header files for protoc that are definitely present:
./configure --build x86_64-linux-gnu --host aarch64-linux-gnu CPPFLAGS=-Wno-deprecated-declarations
checking for libprotobuf... yes
checking for protoc... /usr/bin/protoc
checking protoc version... 3.12.4
checking google/protobuf/compiler/command_line_interface.h usability... no
checking google/protobuf/compiler/command_line_interface.h presence... yes
configure: WARNING: google/protobuf/compiler/command_line_interface.h: present but cannot be compiled
configure: WARNING: google/protobuf/compiler/command_line_interface.h: check for missing prerequisite headers?
configure: WARNING: google/protobuf/compiler/command_line_interface.h: see the Autoconf documentation
configure: WARNING: google/protobuf/compiler/command_line_interface.h: section "Present But Cannot Be Compiled"
configure: WARNING: google/protobuf/compiler/command_line_interface.h: proceeding with the compiler's result
configure: WARNING: ## --------------------------------------------- ##
configure: WARNING: ## Report this to [email protected] ##
configure: WARNING: ## --------------------------------------------- ##
checking for google/protobuf/compiler/command_line_interface.h... no
configure: error: Cannot find the protoc header files
This appears to be coming from this auto-generated bit in ola.m4:
if test "$with_ola_protoc_plugin" != "no"; then
OLA_PROTOC="$PROTOC --plugin=protoc-gen-cppservice=${with_ola_protoc_plugin}";
echo "set ola_protoc to $OLA_PROTOC"
else
OLA_PROTOC="$PROTOC --plugin=protoc-gen-cppservice=\$(top_builddir)/protoc/ola_protoc_plugin${EXEEXT}";
AC_CHECK_HEADER(
[google/protobuf/compiler/command_line_interface.h],
[],
AC_MSG_ERROR([Cannot find the protoc header files]))
SAVED_LIBS=$LIBS
LIBS="$LIBS -lprotoc"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <google/protobuf/compiler/command_line_interface.h>],
[google::protobuf::compiler::CommandLineInterface cli])],
[TEST_LIBS="$TEST_LIBS -lprotoc"] [],
[AC_MSG_ERROR([cannot find libprotoc])])
LIBS=$SAVED_LIBS
fi
AC_SUBST([OLA_PROTOC])
AM_CONDITIONAL(BUILD_OLA_PROTOC_PLUGIN, test "${with_ola_protoc_plugin}" = "no")
])
I also tried this, but make all then fails because the protoc/ola_protoc_plugin executable doesn't actually get compiled:
./configure --build x86_64-linux-gnu --host aarch64-linux-gnu --with-protoc=/usr/bin/protoc --with-ola-protoc-plugin=protoc/ola_protoc_plugin CPPFLAGS=-Wno-deprecated-declarations
$ make all -j2
/usr/bin/protoc --plugin=protoc-gen-cppservice=protoc/ola_protoc_plugin --cppservice_out ./common/protocol --proto_path ./common/protocol ./common/protocol/Ola.proto
/usr/bin/protoc --plugin=protoc-gen-cppservice=protoc/ola_protoc_plugin --cppservice_out ./common/protocol --proto_path ./common/protocol ./common/protocol/Ola.proto
[libprotobuf WARNING google/protobuf/compiler/parser.cc:648] No syntax specified for the proto file: Ola.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
[libprotobuf WARNING google/protobuf/compiler/parser.cc:648] No syntax specified for the proto file: Ola.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
protoc/ola_protoc_plugin: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--cppservice_out: protoc-gen-cppservice: Plugin failed with status code 1.
make: *** [Makefile:19184: common/protocol/OlaService.pb.h] Error 1
make: *** Waiting for unfinished jobs....
protoc/ola_protoc_plugin: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--cppservice_out: protoc-gen-cppservice: Plugin failed with status code 1.
make: *** [Makefile:19184: common/protocol/OlaService.pb.cpp] Error 1
- Ngôn ngữ chính
- C++
- Star
- 773
- Fork
- 233
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenLightingProject/ola
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenLightingProject/ola#2075 ·
-
Digital Enlightenment / FX5 not recognizedCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởquestion Type-DeviceSupport
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
OpenLightingProject/ola#2056 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
OpenLightingProject/ola#2055 ·
-
Difficulty-Medium Language-C++ Maintainability OpSys-All
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
OpenLightingProject/ola#2053 · 1 bình luận ·
-
v0.11.0Có thể làm lại được @peternewman đã nhận 227 ngày trước và không có pull request nào đang mở. Đang mở
OpenLightingProject/ola#2038 · 18 bình luận · 2 người được giao ·
Tất cả issue của OpenLightingProject/ola
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
antlr/grammars-v4#5219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[内容勘误] STL常用模式章节实战演练中代码有问题Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#335 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
deepseek-ai/DeepEP#830 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
google-ai-edge/LiteRT-LM#4701 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PX4/PX4-Autopilot#29898 ·
Maintainer thường phản hồi trong vòng 1 ngày