Closed mihawk90 closed 3 years ago
I have the same problem CMakeError.log CMakeOutput.log
Based on the logs, looks like you two are missing the pthreads library (which is needed by glfw3 to get it to build). This library should be bundled with glibc. Can you check that you both have the glibc-devel package? (assuming you're using redhat) or the equivalent in your distro?
I've updated the repository to mention glut and glew in the README.md as I completely forgot about them.
EDIT: Also, please make sure you cloned the repository and the submodules, otherwise the compilation won't work properly.
I clone glfw repo to lib/glfw and cmake work, but when i build with make, its finished with error FreeImage installed
This library should be bundled with glibc. Can you check that you both have the glibc-devel package?
Mh I would say it would be odd if this was missing, but I added it to the spec anyway for testing, same result unfortunately.
[tarulia@localhost result]$ pwd && cat installed_pkgs.log | grep glibc-devel
/var/lib/mock/fedora-33-x86_64/result
glibc-devel-2.32-10.fc33.x86_64 1626175419 1251998 715b5d7a0cd585d2857f4e35178b9e49 installed
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_05b92/fast && /usr/bin/gmake -f CMakeFiles/cmTC_05b92.dir/build.make CMakeFiles/cmTC_05b92.dir/build
gmake[1]: Entering directory '/builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_05b92.dir/src.c.o
/usr/bin/gcc -DCMAKE_HAVE_LIBC_PTHREAD -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -o CMakeFiles/cmTC_05b92.dir/src.c.o -c /builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_05b92
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_05b92.dir/link.txt --verbose=1
/usr/bin/gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -rdynamic CMakeFiles/cmTC_05b92.dir/src.c.o -o cmTC_05b92
/usr/bin/ld: /tmp/cmTC_05b92.HBlZWJ.ltrans0.ltrans.o: in function `main':
/builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp/src.c:11: undefined reference to `pthread_create'
/usr/bin/ld: /builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp/src.c:12: undefined reference to `pthread_detach'
/usr/bin/ld: /builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp/src.c:13: undefined reference to `pthread_cancel'
/usr/bin/ld: /builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp/src.c:14: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_05b92.dir/build.make:106: cmTC_05b92] Error 1
gmake[1]: Leaving directory '/builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_05b92/fast] Error 2
Source file was:
#include <pthread.h>
static void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_3cdb2/fast && /usr/bin/gmake -f CMakeFiles/cmTC_3cdb2.dir/build.make CMakeFiles/cmTC_3cdb2.dir/build
gmake[1]: Entering directory '/builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3cdb2.dir/CheckFunctionExists.c.o
/usr/bin/gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_3cdb2.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_3cdb2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3cdb2.dir/link.txt --verbose=1
/usr/bin/gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DCHECK_FUNCTION_EXISTS=pthread_create -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -rdynamic CMakeFiles/cmTC_3cdb2.dir/CheckFunctionExists.c.o -o cmTC_3cdb2 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_3cdb2.dir/build.make:106: cmTC_3cdb2] Error 1
gmake[1]: Leaving directory '/builddir/build/BUILD/linux-wallpaperengine-58be46460b2ac3a41ce13bc315ccadb450a4d002/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_3cdb2/fast] Error 2
Also, please make sure you cloned the repository and the submodules, otherwise the compilation won't work properly.
Ah dammit, I hate that GitHub can still not manage to package sub-modules in source-tarballs, at least optionally... thanks for that though, I'll try
edit: found more unlisted dependencies:
CMake Error at lib/glfw/CMakeLists.txt:182 (message):
Xinerama headers not found; install libxinerama development package
CMake Error at lib/glfw/CMakeLists.txt:192 (message):
Xcursor headers not found; install libxcursor development package
CMake Error at lib/glfw/CMakeLists.txt:197 (message):
XInput headers not found; install libxi development package
After installing all of those, I'm only left with this:
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
X11_Xxf86vm_LIB (ADVANCED)
linked by target "wallengine" in directory /builddir/build/BUILD/linux-wallpaperengine
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE
CMAKE_Fortran_FLAGS_RELEASE
CMAKE_INSTALL_DO_STRIP
INCLUDE_INSTALL_DIR
LIB_INSTALL_DIR
LIB_SUFFIX
SHARE_INSTALL_PREFIX
SYSCONF_INSTALL_DIR
CMake Generate step failed. Build files cannot be regenerated correctly.
The pthread error is still in the CMakeError.log, but it doesn't seem to abort on it, so maybe it silently ignores this and just assumes it's going to be passed to the compiler later? I'm not sure what's happening there.
edit 2: looking further up in the log for pthread:
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
The pthread error is still in the CMakeError.log, but it doesn't seem to abort on it, so maybe it silently ignores this and just assumes it's going to be passed to the compiler later? I'm not sure what's happening there.
edit 2: looking further up in the log for pthread:
-- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
CMake tries a couple different functions to find the correct threading library on your OS, that's expected. Looks like it found pthreads just right, so that shouldn't be an issue.
edit: found more unlisted dependencies:
CMake Error at lib/glfw/CMakeLists.txt:182 (message): Xinerama headers not found; install libxinerama development package CMake Error at lib/glfw/CMakeLists.txt:192 (message): Xcursor headers not found; install libxcursor development package CMake Error at lib/glfw/CMakeLists.txt:197 (message): XInput headers not found; install libxi development package
Technically those are required for glfw, I have not mentioned them in linux-wallpaperengine because those won't be needed once glfw supports drawing to other windows out of the box, but for now we're left with building a custom version.
After installing all of those, I'm only left with this:
-- Configuring done CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: X11_Xxf86vm_LIB (ADVANCED) linked by target "wallengine" in directory /builddir/build/BUILD/linux-wallpaperengine -- Generating done CMake Warning: Manually-specified variables were not used by the project: CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE CMAKE_Fortran_FLAGS_RELEASE CMAKE_INSTALL_DO_STRIP INCLUDE_INSTALL_DIR LIB_INSTALL_DIR LIB_SUFFIX SHARE_INSTALL_PREFIX SYSCONF_INSTALL_DIR CMake Generate step failed. Build files cannot be regenerated correctly.
Looks like you're missing another library. libxxf86vm-devel should be the package in your case. It's a X11 library required for interfacing with x11 (which should be part of a basic X11 installation). I've added that one to the list so It's a bit more clear in case anyone runs into it again.
EDIT: I've also added mention of the custom GLFW3 custom version being built as part of the process to the README.md and the list of dependencies needed for it.
CMake tries a couple different functions to find the correct threading library on your OS, that's expected. Looks like it found pthreads just right, so that shouldn't be an issue.
Yeah that was my guess, just weird that it's still logging it as an error, but shouldn't matter.
libxxf86vm-devel should be the package in your case
indeed it was, now I'm getting through CMake at least.
But I'm running into compile errors because it still seems to reference Irrlicht somewhere:
% git rev-parse HEAD
fc442ef29de4201d25d0ebfbcf88bfc800c354bb
% git submodule status
f4d5f760fdd69731c39d20c41a80945d61299778 lib/glfw (3.3-481-gf4d5f760)
[...]
/usr/bin/g++ -DDEBUG=0 -I/usr/include/X11/extensions -I/usr/include/SDL -I/usr/include/ffmpeg -I/builddir/build/BUILD/li
nux-wallpaperengine/src -I/builddir/build/BUILD/linux-wallpaperengine/include -I/builddir/build/BUILD/linux-wallpapereng
ine/lib/glfw/include -fpermissive -std=gnu++17 -o CMakeFiles/wallengine.dir/src/WallpaperEngine/Render/CContext.cpp.o -c
/builddir/build/BUILD/linux-wallpaperengine/src/WallpaperEngine/Render/CContext.cpp
In file included from /builddir/build/BUILD/linux-wallpaperengine/src/WallpaperEngine/Render/Shaders/Compiler.cpp:7:
/builddir/build/BUILD/linux-wallpaperengine/src/WallpaperEngine/FileSystem/FileSystem.h:8:10: fatal error: irrlicht/path.h: No such file or directory
8 | #include <irrlicht/path.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/wallengine.dir/build.make:254: CMakeFiles/wallengine.dir/src/WallpaperEngine/Render/Shaders/Compiler.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/builddir/build/BUILD/linux-wallpaperengine/x86_64-redhat-linux-gnu'
gmake[1]: *** [CMakeFiles/Makefile2:138: CMakeFiles/wallengine.dir/all] Error 2
gmake[1]: Leaving directory '/builddir/build/BUILD/linux-wallpaperengine/x86_64-redhat-linux-gnu'
gmake: *** [Makefile:152: all] Error 2
When searching the repo I also still find a handful of references to Irrlicht: https://github.com/Almamu/linux-wallpaperengine/search?q=irrlicht.h
After removing the reference to the Irrlicht/path.h
manually it seems to get through the compile, but fails at linking? I'm not a C++ guy so I'm not entirely sure what this all means :sweat_smile:
Anyway, build log attached. The warnings begin at line 335
build.log
I've uploaded a fix for the irrlicht references that should have been removed already. About the error you're getting.
Can you try commenting out the line 5 of CMakeLists.txt and re-running cmake again?
#set(CMAKE_CXX_FLAGS "-fpermissive")
It could be that the project is removing some CXX flags required, but we don't really need to set custom C++ options anymore.
Can you try commenting out the line 5 of CMakeLists.txt and re-running cmake again?
#set(CMAKE_CXX_FLAGS "-fpermissive")
Yes, that seems to have worked.
[100%] Built target wallengine
:+1:
Perfect, I've updated the repository to remove that flag. Compilation seems to work just fine from my side too, so It doesn't affect anything actually. I guess that this issue can be closed now as the issue is solver.
This is continuing from #16, as requested.
I'm currently on 58be464 and I'm getting some CMake errors after preparing all the dependencies. For reference, this is what I currently have:
As noted the bottom two I had to add after getting some CMake errors still, and it resolved those.
However, now I'm stuck at another error:
I googled around a little and found this on StackOverflow, which sounds like the same situation: https://stackoverflow.com/questions/63985373/cmake-error-undefined-reference-to-pthread-create
But I'm not familiar enough with any of this to make the required changes :D