Closed cgpadwick closed 2 days ago
Try using the ninja generator instead (-G Ninja). We no longer CI build with normal make.
ah ok. Mind if I submit a PR on README-CMAKE.md to clarify that?
That would be great, thanks!
hmmm, I still seem to be having an issue:
cpadwick@photonvision:~/code/allwpilib$ cmake -B build -G "Ninja" -DWITH_JAVA=OFF
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- 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
-- 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
-- Platform version:
-- Found LIBSSH: /usr/include (found suitable version "0.9.6", minimum required is "0.7.1")
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (found version "3.12.4")
-- Found Python: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter
-- Found Threads: TRUE
-- Found libatomic: /usr/lib/x86_64-linux-gnu/libatomic.so.1
-- Found libatomic: /usr/lib/x86_64-linux-gnu/libatomic.so.1
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Including X11 support
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found Python: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed
Downloading /home/cpadwick/code/allwpilib/build/_deps/gl3w-build/include/GL/glcorearb.h...
Downloading /home/cpadwick/code/allwpilib/build/_deps/gl3w-build/include/KHR/khrplatform.h...
Parsing glcorearb.h header...
Generating /home/cpadwick/code/allwpilib/build/_deps/gl3w-build/include/GL/gl3w.h...
Generating /home/cpadwick/code/allwpilib/build/_deps/gl3w-build/src/gl3w.c...
-- Found OpenCV: /usr/local (found version "4.9.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cpadwick/code/allwpilib/build
cpadwick@photonvision:~/code/allwpilib$ cmake --build build
ninja: error: 'wpimath/protobuf::protoc', needed by 'wpimath/protobuf/controller.pb.cc', missing and no known rule to make it
Yeah, I wasn't reproduce your issue, and this seems to confirm it's a protobuf issue. Try running ccmake, toggle on advanced mode, go to the protobuf variables, and see if CMake has found a protoc executable. If it hasn't found a protoc executable, enter the path to a protoc executable, and try rebuilding.
Thanks for the info @Gold856 - that was indeed the issue. Also thanks for the tip on ccmake - I'd never seen that before and it is very useful! For future people who run into this issue, the fix on debian based systems was sudo apt install protobuf-compiler
closing
It would be better if the cmake build detected the lack of a protobuf compiler and failed during configuration stage.
@PeterJohnson here is a patch. I can't push to the repo otherwise I'd open a PR.
cpadwick@photonvision:~/code/allwpilib$ git diff main
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 095165276..b123d12d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -207,6 +207,7 @@ find_package(LIBSSH 0.7.1)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "" FORCE)
find_package(Protobuf REQUIRED)
+find_program(PROTOC_COMPILER protoc REQUIRED)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG OFF)
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
Typically the way to open a PR on GitHub is to fork the repo to your personal account, create a branch there, and then open a PR across repos.
ah got it, thanks! just submitted https://github.com/wpilibsuite/allwpilib/pull/6792
Closing as fixed by #6792
Describe the bug When using cmake to build the wpilib code on version 2024.1.1, encounter the following error:
If you back up to version 2023.4.3 the compile proceeds without issue.
To Reproduce Steps to reproduce the behavior:
mkdir ~/code; cd code; git clone https://github.com/wpilibsuite/allwpilib.git
cd allwpilib; git checkout tag/2024.1.1
cd allwpilig; mkdir build; cmake -B build -DJAVA_OFF; cd build; cmake --build . --target wpimath
observe error
Expected behavior I expected version 2024.x would build seamlessly with cmake.
Screenshots No screenshot, error message posted above
Desktop (please complete the following information):
Additional context I tried other versions of 2024.x and had the same issue. I backed up to 2023.4.3 and it worked fine.