Bug 438444 - plasma-framework master fails to compile with cmake v3.20.2
Summary: plasma-framework master fails to compile with cmake v3.20.2
Status: RESOLVED FIXED
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: components (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-11 02:29 UTC by bluescreenavenger
Modified: 2021-07-10 17:54 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Cmake output (8.25 KB, text/plain)
2021-06-11 02:29 UTC, bluescreenavenger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bluescreenavenger 2021-06-11 02:29:39 UTC
Created attachment 139215 [details]
Cmake output

SUMMARY
It fails late due to a linker error

[100%] Linking CXX shared library ../../../bin/libcorebindingsplugin.so
/usr/bin/ld: cannot find -lOpenGL::EGL
collect2: error: ld returned 1 exit status
make[2]: *** [src/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/build.make:357: bin/libcorebindingsplugin.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:1678: src/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/all] Error 2
make: *** [Makefile:146: all] Error 2



Below is the CMAKE output
Comment 1 bluescreenavenger 2021-06-11 02:31:11 UTC
I have built this successfully multiple times in the past, I am seeing a70957d96c29aa6059753cbfe23d0615ea688b36 as a possible cause
Comment 2 archetech 2021-06-14 14:13:00 UTC
Some additional info on this bug is at LFS mail list:

https://lists.linuxfromscratch.org/sympa/arc/blfs-dev/2021-06/msg00025.html

It's also broke on cmake 3.20.3.  The one possible fix in the mail was used to complete my build of all kf5 5.83.0.
Comment 3 Nate Graham 2021-06-15 21:23:39 UTC
I don't see this problem compiling plasma-framework's latest git master version with CMake 3.20.3 on Fedora 34. Can you try again after clearing out the build dir?
Comment 4 bluescreenavenger 2021-06-15 23:28:07 UTC
Odd, I still get it
cmake -Wno-dev .. -DCMAKE_INSTALL_PREFIX=$INSTALLDIR -DCMAKE_PREFIX_PATH=$INSTALLDIR  -DCMAKE_BUILD_TYPE=Release  

my script already starts off with a clean repo
Comment 5 Andreas Cord-Landwehr 2021-06-19 15:00:44 UTC
While looking in pretty much the same problem in a Yocto setup, I discovered some (at least in my impression) surprising condition checking in FindOpenGL.cmake.
The logic is that the EGL target is only created, if the OpenGL target could be created, which looks for the libOpenGL.so library.
Can you check that libglvnd-dev is installed on your system?
Comment 6 bluescreenavenger 2021-06-20 02:34:38 UTC
Installing libglvnd-dev seems to allow the build to succeed. Dang, it seems to pull in libglx though....
Comment 7 Bug Janitor Service 2021-06-22 11:38:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/286
Comment 8 Andreas Cord-Landwehr 2021-06-24 20:13:37 UTC
Git commit 8953e77ec26b90da0e79e3cf3ecb727034768d58 by Andreas Cord-Landwehr.
Committed on 24/06/2021 at 20:11.
Pushed by cordlandwehr into branch 'master'.

Add compatibility code when GLVND is not available

CMake's FindOpenGL internally handles EGL only correctly when GLVND is
available. This might not the case on embedded systems and actually it
is not necessary when EGL::EGL is found.

M  +14   -1    CMakeLists.txt
M  +3    -1    src/declarativeimports/core/CMakeLists.txt

https://invent.kde.org/frameworks/plasma-framework/commit/8953e77ec26b90da0e79e3cf3ecb727034768d58
Comment 9 Bart Ribbers 2021-07-10 17:54:01 UTC
The linked MR seems to have resolved most issues I had due to https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/256, but I still get linking errors related to OpenGL at the very end.

[100%] Linking CXX shared library ../../../bin/libcorebindingsplugin.so
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: CMakeFiles/corebindingsplugin.dir/windowthumbnail.cpp.o: in function `Plasma::WindowThumbnail::xcbWindowToTextureEGL(Plasma::WindowTextureNode*)':
windowthumbnail.cpp:(.text+0xb9d): undefined reference to `glGetString'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: windowthumbnail.cpp:(.text+0xccc): undefined reference to `glGenTextures'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: CMakeFiles/corebindingsplugin.dir/windowthumbnail.cpp.o: in function `Plasma::DiscardEglPixmapRunnable::run()':
windowthumbnail.cpp:(.text+0x30): undefined reference to `glDeleteTextures'
collect2: error: ld returned 1 exit status

This system doesn't have glvnd available at all (Alpine Linux) so "just installing it" is not an option.