How can I switch GCC and G++ versions when using CMake to build openpose?

65 Views Asked by At

I'm trying to build OpenPose using the latest code on github. I'm working on Ubuntu 22.04. I'm following this guide: https://amir-yazdani.github.io/post/openpose/ . So far, when I try to build openpose using make -j5 (after running CMake), I get an error

make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:7024: src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:376: src/caffe/CMakeFiles/caffe.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/openpose_lib.dir/build.make:86: caffe/src/openpose_lib-stamp/openpose_lib-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/openpose_lib.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I see a lot of errors that look like

/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
435 | function(_Functor&& __f)

My guess is that this is related to the GCC version, since this looks like a use of variadic arguments, and that I'm using a too-modern version of C++. I have tried running sudo apt-add repository ppa:ubuntu-toolchain-r/test to install old versions of GCC and G++, but no version number I try seems to return an error that they have no installation candidates.

I have also tried CC='gcc-8' CXX='g++-8' make j7, and passing the same arguments when running cmake-gui.

Does this seem like I'm looking at the right reason for this error, and what might I be able to do to fix it?

0

There are 0 best solutions below