You are not logged in.
I have compiled my own OpenCV from the official and unmodified PKGBUILD.
After getting an error:
ImportError: libopencv_imgcodecs.so.4.1: cannot open shared object file: No such file or directory
I've found out that when building on machine gcc doesn't link the libraries and is only generating .a files:
...
opencv /usr/lib/libopencv_imgcodecs.a
opencv /usr/lib/opencv4/3rdparty/libade.a
..
opencv /usr/lib/pkgconfig/
opencv /usr/lib/pkgconfig/opencv4.pc
opencv /usr/lib/python2.7/
opencv /usr/lib/python2.7/site-packages/
opencv /usr/lib/python2.7/site-packages/cv2.so
opencv /usr/lib/python3.7/
opencv /usr/lib/python3.7/site-packages/
opencv /usr/lib/python3.7/site-packages/cv2.cpython-37m-x86_64-linux-gnu.so
...
usr/lib/libopencv_imgcodecs.so
usr/lib/libopencv_imgcodecs.so.4.1
usr/lib/libopencv_imgcodecs.so.4.1.0
...
usr/lib/pkgconfig/
usr/lib/pkgconfig/opencv4.pc
usr/lib/python3.7/
usr/lib/python3.7/site-packages/
usr/lib/python3.7/site-packages/cv2.cpython-37m-x86_64-linux-gnu.so
The difference comes from autodetected python2 and other autodetected libraries.
----
This error is reproducing in both my default environment and in a clean chroot. gcc works perfectly on any other compile job.
Last edited by jinpin (2019-06-01 22:32:02)
Offline
llvm/clang also use cmake and show similar behaviour: if python2 is present, cmake defaults to that.
On archlinux /usr/bin/python points to python3 and cmake can be forced to use that.
Try adding
-D PYTHON_EXECUTABLE=/usr/bin/python \
to the cmake invocation.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline