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

opencv-devel will not compile with the latest ocl.hpp from opencv-devel #10

Open
Poikilos opened this issue Aug 10, 2021 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Poikilos
Copy link
Collaborator

Poikilos commented Aug 10, 2021

opencv-devel

NOTE: as of Fedora 29, opencv-devel is opencv 3.4.1
where ocl.hpp is totally DIFFERENT according to https://stackoverflow.com/questions/34422276/opencv-3-0-error-include-ocl-hpp
not in readme, but if missing, prevents pip install https://github.com/dthpham/butterflow/archive/master.zip:

   /tmp/pip-req-build-m6c87h1b/butterflow/avinfo.c:5:10: fatal error: libavcodec/avcodec.h: No such file or directory
    #include <libavcodec/avcodec.h>
             ^~~~~~~~~~~~~~~~~~~~~~
   compilation terminated.
   error: command 'gcc' failed with exit status 1

could be solved by ffmpeg-compat-devel as per https://ask.fedoraproject.org/en/question/31642/how-to-install-libav-devel-packages-properly/

  • but I installed ffmpeg-devel
    • but error still occurs since ffmpeg has the h in ffmpeg/libavcodec/avcodec.h so edited butterflow/butterflow/avinfo.c to use that path still had error:
   In file included from /tmp/pip-req-build-uquwiwd3/butterflow/avinfo.c:5:
   /usr/include/ffmpeg/libavcodec/avcodec.h:31:10: fatal error: libavutil/samplefmt.h: No such file or directory
    #include "libavutil/samplefmt.h"
             ^~~~~~~~~~~~~~~~~~~~~~~
   compilation terminated.
   error: command 'gcc' failed with exit status 1

so changed the two libavutil lines to use ffmpeg/libavutil as the path new error:

   In file included from /tmp/pip-req-build-webiqhd6/butterflow/avinfo.c:5:
   /usr/include/ffmpeg/libavcodec/avcodec.h:31:10: fatal error: libavutil/samplefmt.h: No such file or directory
    #include "libavutil/samplefmt.h"
             ^~~~~~~~~~~~~~~~~~~~~~~
   compilation terminated.
   error: command 'gcc' failed with exit status 1

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-webiqhd6/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-zettjosz/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-webiqhd6/

   /tmp/pip-req-build-gRg1yS/butterflow/ocl.cpp:10:10: fatal error: opencv2/ocl/ocl.hpp: No such file or directory
    #include <opencv2/ocl/ocl.hpp>
             ^~~~~~~~~~~~~~~~~~~~~
   compilation terminated.
   error: command 'gcc' failed with exit status 1

   ----------------------------------------

Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-gRg1yS/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-RA_EcH/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-gRg1yS/

dnf -y install libav
# dnf -y copr enable thofmann/opencv2
# allowerasing will remove opencv (such as 3.0) if installed
# dnf -y --allowerasing install opencv2
# but install fails:
# Failed to synchronize cache for repo 'thofmann-opencv2', ignoring this repo.
# No match for argument: opencv2
# Error: Unable to find a match
#      * changing releasever to 26 doesn't work either (last build of thofmann-opencv2 <https://copr-be.cloud.fedoraproject.org/results/thofmann/opencv2/fedora-26-x86_64/repodata/>)
# No match for argument: opencv2
# Error: Unable to find a match
  • tried installing python2-opencv, but as expected that did not help.
  • so try including modules/ocl/include manually (see install-as-user)
@Poikilos Poikilos added the bug Something isn't working label Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant