Closed JiananAlvin closed 2 years ago
[build] Found '4' packages in 0.0 seconds.
Starting >>> cv_bridge
Starting >>> image_geometry
Finished <<< image_geometry [ 2.3 seconds ]
Errors << cv_bridge:check /home/bilbo/catkin_ws_cv_bridge/logs/cv_bridge/build.check.000.log
CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1626 (message):
No header defined for python3; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:11 (find_package)
CMake Error at /home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/CMakeLists.txt:16 (find_package): Could not find a configuration file for package "OpenCV" that is compatible with requested version "3".
The following configuration files were considered but not accepted:
/usr/lib/aarch64-linux-gnu/cmake/opencv4/OpenCVConfig.cmake, version: 4.1.1
make: *** [cmake_check_build_system] Error 1 cd /home/bilbo/catkin_ws_cv_bridge/build/cv_bridge; catkin build --get-env cv_bridge | catkin env -si /usr/bin/make cmake_check_build_system; cd -
.........................................................................................................................
Failed << cv_bridge:check [ Exited with code 2 ]
Failed <<< cv_bridge [ 2.4 seconds ]
Abandoned <<< opencv_tests [ Unrelated job failed ]
Abandoned <<< vision_opencv [ Unrelated job failed ]
[build] Summary: 1 of 4 packages succeeded.
[build] Ignored: None.
[build] Warnings: None.
[build] Abandoned: 2 packages were abandoned.
[build] Failed: 1 packages failed.
[build] Runtime: 2.7 seconds total.
Change opencv3 to 4, then the problem is :
[build] Found '4' packages in 0.0 seconds.
Starting >>> cv_bridge
Starting >>> image_geometry
Finished <<< image_geometry [ 2.4 seconds ]
Warnings << cv_bridge:cmake /home/bilbo/catkin_ws_cv_bridge/logs/cv_bridge/build.cmake.003.log
CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1626 (message):
No header defined for python3; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:11 (find_package)
cd /home/bilbo/catkin_ws_cv_bridge/build/cv_bridge; catkin build --get-env cv_bridge | catkin env -si /usr/bin/cmake /home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/bilbo/catkin_ws_cv_bridge/devel/.private/cv_bridge -DCMAKE_INSTALL_PREFIX=/home/bilbo/catkin_ws_cv_bridge/install -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so; cd -
.........................................................................................................................
Errors << cv_bridge:make /home/bilbo/catkin_ws_cv_bridge/logs/cv_bridge/build.make.000.log
make[2]: No rule to make target '/usr/lib/x86_64-linux-gnu/libpython3.6m.so', needed by '/home/bilbo/catkin_ws_cv_bridge/devel/.private/cv_bridge/lib/python3/dist-packages/cv_bridge/boost/cv_bridge_boost.so'. Stop.
make[2]: Waiting for unfinished jobs....
In file included from /home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp:35:0:
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module.hpp: In function ‘int do_numpy_import()’:
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module.hpp:39:5: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
import_array( );
^~~~
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp: At global scope:
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp:151:16: error: cannot declare variable ‘g_numpyAllocator’ to be of abstract type ‘NumpyAllocator’
NumpyAllocator g_numpyAllocator;
^~~~
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp:98:7: note: because the following virtual functions are pure within ‘NumpyAllocator’:
class NumpyAllocator : public cv::MatAllocator
^~~~~~
In file included from /usr/include/opencv4/opencv2/core.hpp:59:0,
from /usr/include/opencv4/opencv2/core/core.hpp:48,
from /home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/include/cv_bridge/cv_bridge.h:43,
from /home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module.hpp:22,
from /home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp:35:
/usr/include/opencv4/opencv2/core/mat.hpp:475:23: note: virtual cv::UMatData cv::MatAllocator::allocate(int, const int, int, void, size_t, cv::AccessFlag, cv::UMatUsageFlags) const
virtual UMatData allocate(int dims, const int sizes, int type,
^~~~
/usr/include/opencv4/opencv2/core/mat.hpp:477:18: note: virtual bool cv::MatAllocator::allocate(cv::UMatData, cv::AccessFlag, cv::UMatUsageFlags) const
virtual bool allocate(UMatData data, AccessFlag accessflags, UMatUsageFlags usageFlags) const = 0;
^~~~
/usr/include/opencv4/opencv2/core/mat.hpp:478:18: note: virtual void cv::MatAllocator::deallocate(cv::UMatData) const
virtual void deallocate(UMatData data) const = 0;
^~~~~~
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp: In function ‘int convert_to_CvMat2(const PyObject, cv::Mat&)’:
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp:233:11: error: ‘class cv::Mat’ has no member named ‘refcount’
m.refcount = refcountFromPyObject(o);
^~~~
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp: In function ‘PyObject pyopencv_from(const cv::Mat&)’:
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp:254:12: error: ‘class cv::Mat’ has no member named ‘refcount’
if(!p->refcount || p->allocator != &g_numpyAllocator)
^~~~
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module_opencv2.cpp:261:36: error: ‘class cv::Mat’ has no member named ‘refcount’
return pyObjectFromRefcount(p->refcount);
^~~~
In file included from /home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module.cpp:35:0:
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module.hpp: In function ‘int do_numpy_import()’:
/home/bilbo/catkin_ws_cv_bridge/src/vision_opencv/cv_bridge/src/module.hpp:39:5: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
import_array( );
^~~~
make[2]: [src/CMakeFiles/cv_bridge_boost.dir/module_opencv2.cpp.o] Error 1
make[1]: [src/CMakeFiles/cv_bridge_boost.dir/all] Error 2
make: *** [all] Error 2
cd /home/bilbo/catkin_ws_cv_bridge/build/cv_bridge; catkin build --get-env cv_bridge | catkin env -si /usr/bin/make --jobserver-fds=3,4 -j; cd -
.........................................................................................................................
Failed << cv_bridge:make [ Exited with code 2 ]
Failed <<< cv_bridge [ 25.7 seconds ]
Abandoned <<< opencv_tests [ Unrelated job failed ]
Abandoned <<< vision_opencv [ Unrelated job failed ]
[build] Summary: 1 of 4 packages succeeded.
[build] Ignored: None.
[build] Warnings: 1 packages succeeded with warnings.
[build] Abandoned: 2 packages were abandoned.
[build] Failed: 1 packages failed.
[build] Runtime: 26.0 seconds total.
In your requirement.txt you install the python-opencv 4, But when building cv_birdge, the CMakelist require opencv3 Should I install the opencv3 again? I tried to modify the CMakeList from opencv3 to opencv4, but it seems to be incompatible.
Yes, using command like pip install opencv_python==3 to replace opencv4 with opencv3.
The requirement.txt maybe generated on newer ros version without cv_bridge.
In your requirement.txt you install the python-opencv 4, But when building cv_birdge, the CMakelist require opencv3 Should I install the opencv3 again? I tried to modify the CMakeList from opencv3 to opencv4, but it seems to be incompatible.