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

CEC headers/lib not found when building on Vero4K OSMC #1702

Open
1 task done
hissingshark opened this issue Feb 18, 2024 · 3 comments
Open
1 task done

CEC headers/lib not found when building on Vero4K OSMC #1702

hissingshark opened this issue Feb 18, 2024 · 3 comments

Comments

@hissingshark
Copy link
Contributor

  • I confirm that this is an issue rather than a question.

Bug report

I have been asked to include the CEC support in my builds/installer.
The includes and library are installed at /usr/osmc/include/ and /usr/osmc/lib respectively. This fails the CMake checks.

They seem to be expected at /usr/include and /usr/lib/ so I've specified them myself using the CMake methods. Then the CMake checks succeed, but the build fails as they aren't passed to the compiler.
CFLAGS have to be used to get past the build.
But then at runtime it fails to find libCEC, so I guess that information is being lost as well.
Is there something wrong with the CMake unit?

Steps to reproduce

Add the paths in advance with export CMAKE_PREFIX_PATH=/usr/osmc/.
Or alternatively the flags -DCEC_INCLUDE_DIRS=/usr/osmc/include and -DCEC_LIBRARIES=/usr/osmc/lib.
Both seem to work as cmake reports:

-- Found CEC: /usr/osmc/include

What is expected?

My CEC headers and library are not in a default location, so I must specify that during build configuration.
cmake finds the headers with my config help, so they should be found by the compiler for #include
The same methods are used to point to libCEC, so it should be found at runtime.

What is actually happening?

The CMake checks are successful.
But when building I get:

In file included from /home/osmc/hyperion.ng/build/libsrc/cec/cechandler_autogen/O2CIRRR27P/moc_CECHandler.cpp:10,
from /home/osmc/hyperion.ng/build/libsrc/cec/cechandler_autogen/mocs_compilation.cpp:2:
/home/osmc/hyperion.ng/build/libsrc/cec/cechandler_autogen/O2CIRRR27P/../../../../../include/cec/CECHandler.h:9:10: fatal error: libcec/cec.h: No such file or directory
9 | #include <libcec/cec.h>
| ^~~~~~~~~~~~~~
compilation terminated.

To get a successful build I also need to add the paths to my CFLAGS:
export CFLAGS="-I/opt/vero3/include -L/opt/vero3/lib -I/usr/osmc/include -L/usr/osmc/lib -O3 -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -ftree-vectorize -funsafe-math-optimizations"; export CPPFLAGS=$CFLAGS; export CXXFLAGS=$CFLAGS

But then libCEC isn't found at runtime...

The only true workaround is for me to symlink the headers and library on the user's system, but that shouldn't be necessary.

System

Hyperion Server:

  • Build: master (Paulchen-Panther-5709d89e/bb40778a-1708095831)
  • Build time: Feb 17 2024 21:12:56
  • Git Remote: git@github.com:hyperion-project/hyperion.ng.git
  • Version: 2.0.17-beta.1
  • UI Lang: en (BrowserLang: en-GB)
  • UI Access: default
  • Avail Screen Cap.: framebuffer,amlogic
  • Avail Video Cap.: v4l2
  • Avail Audio Cap.:
  • Avail Services: boblight,cec,effectengine,forwarder,flatbuffer,protobuffer,mDNS,SSDP,borderdetection
  • Config path: /home/osmc/.hyperion
  • Database: read/write
  • Mode: Non-GUI

Hyperion Server OS:

  • Distribution: Open Source Media Center
  • Architecture: arm64
  • CPU Hardware: OSMC Vero 4K / Vero 4K +
  • Kernel: linux (4.9.269-44-osmc (WS: 32))
  • Root/Admin: false
  • Qt Version: 5.15.2
  • Python Version: 3.9.2
  • Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
@Paulchen-Panther
Copy link
Member

Unfortunately, no team member has a Vero4k box to recreate the whole thing. As I see it, you have already localized the problem. Apparently it helps to address a few CMake variables. Maybe you could create a PR?

Greetings Paulchen

@hissingshark
Copy link
Contributor Author

Thank you for reviewing. I fully appreciate you not having access to the platform.
I would gladly have submitted a PR as previously, but I don't have a fix as yet.
This seemed to be a CMake issue. Even if i set the flags the libCEC runtime isn't found.
Is there more I can do when configuring? Or are the flags not working fully because of a fault?

@Lord-Grey
Copy link
Collaborator

You could have a try to pass the lib name and location when loading the lib, as in

https://github.com/KewaiiGamer/hyperion.ng/blob/364b298e19b3b35c52c6dc4a3e2aeeee9369053e/libsrc/cec/CECHandler.cpp#L40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants