projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.33k stars 372 forks source link

Does not compile on R-Pi #635

Closed howdood closed 2 years ago

howdood commented 2 years ago

Hi - trying to build this on a Pi 3B+ running RaspiOS legacy. I've successfully built and run the latest release, but need a version with cmake included to build the qt frontend so am trying to build the latest projectM from the repo.

Running cmake as per documentation gives the following error (repeated about five times for different targets):

CMake Error at src/libprojectM/libprojectM_shared.cmake:1 (add_library): Target "projectM_shared" links to target "OpenGL::OpenGL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

Given that the 'release' version compiles correctly and projectMSDK runs, I think this is probably not a dependency issue (unless the dependencies have changes since last release version).

Help! h

howdood commented 2 years ago

So - found a way round: on Pi cmake must be run as

cmake -D "ENABLE_GLES=1" ..

Have put in a pull request to add that info to building.md

kblaschke commented 2 years ago

Yes, RPi can only use the embedded profile. I'll have a look at the PR, thanks!

kblaschke commented 2 years ago

There's issue #640 opened recently with a GLES incompatibility, which possibly affects RPi as well. This issue seems to be solved, so I'm closing it for now.

matiasw commented 1 year ago

Hi, cmake -D "ENABLE_GLES=1" .. did not enable GL ES in my build. This issue suggested the actual switch might be -DENABLE_GLES=ON, but that did not enable GL ES, either.

How do I actually get projectM to compile on Raspbian? If enabling OpenGL ES is the way, how do I do that? I am using the 62cecb36d6c796771f84511347a5772b48162960 version, by the way.

matiasw commented 1 year ago

Ok, I found out that the actual switch to enable GL ES is -DENABLE_GLES=ON, after all. Don't know why it did not work first time I tried it.

Now, I have another problem: with cmake --build . -- -j, the build starts, but then gets stuck at [56%] Building CXX object src/libprojectM/MilkdropPresetFactory/CMakeFiles/MilkdropPresetFactory.dir/CustomShape.cpp.o.

matiasw commented 1 year ago

Here is the log from the build. Cmake version is 3.16.3. cmake.log

matiasw commented 1 year ago

I got it to compile with

cmake .. -D BUILD_SDL_TESTUI=OFF -D ENABLE_GLES=ON
make
kblaschke commented 1 year ago

Great!

Also noting here that CMake 3.20 is now the minimum version supported for new builds. Didn't bump the version yet, but will do in one of the next PRs.