Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] About compiler issue #22695

Closed
JustinHsuNctu opened this issue Jan 29, 2024 · 8 comments
Closed

[Bug] About compiler issue #22695

JustinHsuNctu opened this issue Jan 29, 2024 · 8 comments

Comments

@JustinHsuNctu
Copy link

JustinHsuNctu commented Jan 29, 2024

Describe the bug

Hello! Recently, I want to use PX4-Autopilot to control the UAV in GAZEBO simulator. I tried to compile the repo which version is V1.14.0. when I executed "make px4_sitl," I got an error about protobuf version conflict. The error messages are in "Additional context."
I tried to down grade protobuf to 2.6.1. But the error is still there.
Any one could help me about it?

To Reproduce

The environment that I use is windows subsystem linux, WSL2 Ubuntu 22.04 (jammy). The process that I follow are:

  1. cd ~
  2. git clone https://github.com/PX4/PX4-Autopilot.git --recursive
  3. bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
  4. exit WSL and shutdown WSL
  5. reboot wsl
  6. cd PX4-Autopilot/
  7. make px4_sitl

Expected behavior

Pass the compile and execute GAZEBO

Screenshot / Media

No response

Flight Log

NO.

Software Version

V1.14.0

Flight controller

NO

Vehicle type

Multicopter

How are the different components wired up (including port information)

No response

Additional context

ubuntu@DESKTOP-129CA14:~/PX4-Autopilot$ make px4_sitl
-- PX4 version: v1.15.0-alpha1-457-gf40ede6087 (1.15.0)
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3")
-- PX4 config file: /home/ubuntu/PX4-Autopilot/boards/px4/sitl/default.px4board
-- PLATFORM posix
-- ROMFSROOT px4fmu_common
-- ROOTFSDIR .
-- TESTING y
-- ETHERNET y
-- PX4 config: px4_sitl_default
-- PX4 platform: posix
-- PX4 lockstep: enabled
-- The CXX compiler identification is GNU 11.4.0
-- The C compiler identification is GNU 11.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- cmake build type: RelWithDebInfo
/usr/bin/python3: Error while finding module specification for 'symforce.symbolic' (ModuleNotFoundError: No module named 'symforce')
-- Could NOT find gz-transport (missing: gz-transport_DIR)
-- Looking for gz-transport12 -- found version 12.2.1
-- Searching for dependencies of gz-transport12
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Checking for module 'uuid'
-- Found uuid, version 2.37.2
-- Found UUID: TRUE
-- Looking for gz-utils2 -- found version 2.2.0
-- Searching for dependencies of gz-utils2
-- Searching for component [cli]
-- Looking for gz-utils2-cli -- found version 2.2.0
-- Searching for dependencies of gz-utils2-cli
-- Looking for gz-msgs9 -- found version 9.5.0
-- Searching for dependencies of gz-msgs9
-- Looking for gz-math7 -- found version 7.3.0
-- Searching for dependencies of gz-math7
-- Looking for gz-utils2 -- found version 2.2.0
-- Checking for module 'tinyxml2'
-- Found tinyxml2, version 9.0.0
-- Found Java: /usr/bin/java (found version "11.0.21")
-- ROMFS: ROMFS/px4fmu_common
Architecture: amd64
==> CPACK_INSTALL_PREFIX = @DEB_INSTALL_PREFIX@
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/PX4-Autopilot/build/px4_sitl_default
[0/967] git submodule src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client
[1/967] git submodule src/drivers/gps/devices
[6/967] git submodule src/modules/mavlink/mavlink
[671/967] Building CXX object src/modules/simulation/gz_br...akeFiles/modules__simulation__gz_bridge.dir/GZBridge.cpp.o
FAILED: src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZBridge.cpp.o
/usr/bin/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME="gz_bridge" -DPROTOBUF_USE_DLLS -DPX4_MAIN=gz_bridge_app_main -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="attribute((noreturn))" -I/home/ubuntu/PX4-Autopilot/boards/px4/sitl/src -I/home/ubuntu/PX4-Autopilot/platforms/posix/src/px4/common/include -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default/src/lib -I/home/ubuntu/PX4-Autopilot/platforms/posix/src/px4/generic/generic/include -I/home/ubuntu/PX4-Autopilot/platforms/common -I/home/ubuntu/PX4-Autopilot/platforms/common/include -I/home/ubuntu/PX4-Autopilot/src -I/home/ubuntu/PX4-Autopilot/src/include -I/home/ubuntu/PX4-Autopilot/src/lib -I/home/ubuntu/PX4-Autopilot/src/lib/matrix -I/home/ubuntu/PX4-Autopilot/src/modules -I/home/ubuntu/PX4-Autopilot/platforms/posix/include -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default/external/Install/include -isystem /usr/include/gz/transport12 -isystem /mnt/c/ProgramData/anaconda3/Library/include -isystem /usr/include/gz/utils2 -isystem /usr/include/gz/msgs9 -isystem /usr/include/gz/math7 -isystem /usr/include/uuid -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -frtti -fexceptions -O2 -I/usr/include/uuid -std=gnu++17 -MD -MT src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZBridge.cpp.o -MF src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZBridge.cpp.o.d -o src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZBridge.cpp.o -c /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZBridge.cpp
In file included from /usr/include/gz/msgs9/gz/msgs/pointcloud_packed.pb.h:17,
from /usr/include/gz/msgs9/gz/msgs/detail/PointCloudPackedUtils.hh:24,
from /usr/include/gz/msgs9/gz/msgs.hh:23,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceESC.hpp:38,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZBridge.hpp:36,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZBridge.cpp:34:
/usr/include/gz/msgs9/gz/msgs/details/pointcloud_packed.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
compilation terminated due to -Wfatal-errors.
[672/967] Building CXX object src/modules/simulation/gz_br...ules__simulation__gz_bridge.dir/GZMixingInterfaceESC.cpp.o
FAILED: src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceESC.cpp.o
/usr/bin/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME="gz_bridge" -DPROTOBUF_USE_DLLS -DPX4_MAIN=gz_bridge_app_main -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="attribute((noreturn))" -I/home/ubuntu/PX4-Autopilot/boards/px4/sitl/src -I/home/ubuntu/PX4-Autopilot/platforms/posix/src/px4/common/include -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default/src/lib -I/home/ubuntu/PX4-Autopilot/platforms/posix/src/px4/generic/generic/include -I/home/ubuntu/PX4-Autopilot/platforms/common -I/home/ubuntu/PX4-Autopilot/platforms/common/include -I/home/ubuntu/PX4-Autopilot/src -I/home/ubuntu/PX4-Autopilot/src/include -I/home/ubuntu/PX4-Autopilot/src/lib -I/home/ubuntu/PX4-Autopilot/src/lib/matrix -I/home/ubuntu/PX4-Autopilot/src/modules -I/home/ubuntu/PX4-Autopilot/platforms/posix/include -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default/external/Install/include -isystem /usr/include/gz/transport12 -isystem /mnt/c/ProgramData/anaconda3/Library/include -isystem /usr/include/gz/utils2 -isystem /usr/include/gz/msgs9 -isystem /usr/include/gz/math7 -isystem /usr/include/uuid -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -frtti -fexceptions -O2 -I/usr/include/uuid -std=gnu++17 -MD -MT src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceESC.cpp.o -MF src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceESC.cpp.o.d -o src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceESC.cpp.o -c /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceESC.cpp
In file included from /usr/include/gz/msgs9/gz/msgs/pointcloud_packed.pb.h:17,
from /usr/include/gz/msgs9/gz/msgs/detail/PointCloudPackedUtils.hh:24,
from /usr/include/gz/msgs9/gz/msgs.hh:23,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceESC.hpp:38,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceESC.cpp:34:
/usr/include/gz/msgs9/gz/msgs/details/pointcloud_packed.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
compilation terminated due to -Wfatal-errors.
[673/967] Building CXX object src/modules/simulation/gz_br...es__simulation__gz_bridge.dir/GZMixingInterfaceWheel.cpp.o
FAILED: src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceWheel.cpp.o
/usr/bin/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME="gz_bridge" -DPROTOBUF_USE_DLLS -DPX4_MAIN=gz_bridge_app_main -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="attribute((noreturn))" -I/home/ubuntu/PX4-Autopilot/boards/px4/sitl/src -I/home/ubuntu/PX4-Autopilot/platforms/posix/src/px4/common/include -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default/src/lib -I/home/ubuntu/PX4-Autopilot/platforms/posix/src/px4/generic/generic/include -I/home/ubuntu/PX4-Autopilot/platforms/common -I/home/ubuntu/PX4-Autopilot/platforms/common/include -I/home/ubuntu/PX4-Autopilot/src -I/home/ubuntu/PX4-Autopilot/src/include -I/home/ubuntu/PX4-Autopilot/src/lib -I/home/ubuntu/PX4-Autopilot/src/lib/matrix -I/home/ubuntu/PX4-Autopilot/src/modules -I/home/ubuntu/PX4-Autopilot/platforms/posix/include -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default/external/Install/include -isystem /usr/include/gz/transport12 -isystem /mnt/c/ProgramData/anaconda3/Library/include -isystem /usr/include/gz/utils2 -isystem /usr/include/gz/msgs9 -isystem /usr/include/gz/math7 -isystem /usr/include/uuid -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -frtti -fexceptions -O2 -I/usr/include/uuid -std=gnu++17 -MD -MT src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceWheel.cpp.o -MF src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceWheel.cpp.o.d -o src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceWheel.cpp.o -c /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceWheel.cpp
In file included from /usr/include/gz/msgs9/gz/msgs/pointcloud_packed.pb.h:17,
from /usr/include/gz/msgs9/gz/msgs/detail/PointCloudPackedUtils.hh:24,
from /usr/include/gz/msgs9/gz/msgs.hh:23,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceWheel.hpp:38,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceWheel.cpp:34:
/usr/include/gz/msgs9/gz/msgs/details/pointcloud_packed.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
compilation terminated due to -Wfatal-errors.
[683/967] Building CXX object src/modules/simulation/gz_br...es__simulation__gz_bridge.dir/GZMixingInterfaceServo.cpp.o
FAILED: src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceServo.cpp.o
/usr/bin/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME="gz_bridge" -DPROTOBUF_USE_DLLS -DPX4_MAIN=gz_bridge_app_main -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="attribute((noreturn))" -I/home/ubuntu/PX4-Autopilot/boards/px4/sitl/src -I/home/ubuntu/PX4-Autopilot/platforms/posix/src/px4/common/include -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default/src/lib -I/home/ubuntu/PX4-Autopilot/platforms/posix/src/px4/generic/generic/include -I/home/ubuntu/PX4-Autopilot/platforms/common -I/home/ubuntu/PX4-Autopilot/platforms/common/include -I/home/ubuntu/PX4-Autopilot/src -I/home/ubuntu/PX4-Autopilot/src/include -I/home/ubuntu/PX4-Autopilot/src/lib -I/home/ubuntu/PX4-Autopilot/src/lib/matrix -I/home/ubuntu/PX4-Autopilot/src/modules -I/home/ubuntu/PX4-Autopilot/platforms/posix/include -I/home/ubuntu/PX4-Autopilot/build/px4_sitl_default/external/Install/include -isystem /usr/include/gz/transport12 -isystem /mnt/c/ProgramData/anaconda3/Library/include -isystem /usr/include/gz/utils2 -isystem /usr/include/gz/msgs9 -isystem /usr/include/gz/math7 -isystem /usr/include/uuid -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -frtti -fexceptions -O2 -I/usr/include/uuid -std=gnu++17 -MD -MT src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceServo.cpp.o -MF src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceServo.cpp.o.d -o src/modules/simulation/gz_bridge/CMakeFiles/modules__simulation__gz_bridge.dir/GZMixingInterfaceServo.cpp.o -c /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceServo.cpp
In file included from /usr/include/gz/msgs9/gz/msgs/discovery.pb.h:17,
from /usr/include/gz/transport12/gz/transport/Discovery.hh:59,
from /usr/include/gz/transport12/gz/transport.hh:26,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceServo.hpp:38,
from /home/ubuntu/PX4-Autopilot/src/modules/simulation/gz_bridge/GZMixingInterfaceServo.cpp:34:
/usr/include/gz/msgs9/gz/msgs/details/discovery.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
compilation terminated due to -Wfatal-errors.
[684/967] Building CXX object src/modules/replay/CMakeFiles/modules__replay.dir/Replay.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:232: px4_sitl] Error 1

@JustinHsuNctu
Copy link
Author

I found the solution! In WSL2, all commands should execute in Windows PowerShell environment.
It is described on PX4 official website.
"All operations to install and build PX4 must be done within a WSL Shell (you can use the same shell that was used to install WSL2 or open a new one)."
from "https://docs.px4.io/main/en/dev_setup/dev_env_windows_wsl.html"

@Igor-Misic
Copy link
Member

Thanks for sharing the solution!

@xianxian437
Copy link

I found the solution! In WSL2, all commands should execute in Windows PowerShell environment. It is described on PX4 official website. "All operations to install and build PX4 must be done within a WSL Shell (you can use the same shell that was used to install WSL2 or open a new one)." from "https://docs.px4.io/main/en/dev_setup/dev_env_windows_wsl.html"

I have encountered the same problem, but I cannot solve it through your method. Can you provide more detailed suggestions?

@JiazeCai
Copy link

I am currently still getting the exact same issue. Is this somehow fixed?

@JustinHsuNctu
Copy link
Author

I am currently still getting the exact same issue. Is this somehow fixed?

I suggest you use PURE Ubuntu 22.04 version to build this environment. DO NOT USE WSL! I had built it in WSL successfully, but it is too slow! I suggest you find a whole new Hard disk to build the whole environment.

@JiazeCai
Copy link

Yeah, I turns out to install Ubuntu 22.04 system to get everything work out. Thanks for your suggestion!

@Strevino100
Copy link

I have ubuntu 22.04 and still have this error. Any ideas?

@maik-basso-isi
Copy link

The same happens here. Is there any workaround to solve the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants