build projectM from source
#1
Sorry for cross posting, my original thread is:

2165557 (post)

In brief, I managed to build visualization.projectm from the github sources, the addon is now properly listed in the visualizer selection list, but at runtime, when kodi tries to start it, I have the following error:

Code:
ERROR: Unable to load /home/pbureau/.kodi/addons/visualization.projectm/visualization.projectm.so.1.0.17, reason: /home/pbureau/.kodi/addons/visualization.projectm/visualization.projectm.so.1.0.17: undefined symbol: _ZN13PresetFactory20IDLE_PRESET_PROTOCOLE

So I also built libprojectM from the github sources, replacing the orignal librairies provided by Ubuntu, but I still have the same results. Some more information from ldd:
Code:
$ldd -d ../xbmc/addons/visualization.projectm/visualization.projectm.so
    linux-gate.so.1 =>  (0xb7701000)
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb7527000)
    libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb74e3000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb74c6000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7312000)
    /lib/ld-linux.so.2 (0xb7702000)
undefined symbol: __glewDeleteFramebuffersEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewBindFramebufferEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewGenFramebuffersEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewCheckFramebufferStatusEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewRenderbufferStorageEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewFramebufferTexture2DEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: _ZN13PresetFactory20IDLE_PRESET_PROTOCOLE    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewDeleteRenderbuffersEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewGenRenderbuffersEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewBindRenderbufferEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)
undefined symbol: __glewFramebufferRenderbufferEXT    (../xbmc/addons/visualization.projectm/visualization.projectm.so)

And from ldconfig:
Code:
$ldconfig -p | grep project
    libprojectM.so.2 (libc6) => /usr/local/lib/libprojectM.so.2
    libprojectM.so (libc6) => /usr/local/lib/libprojectM.so
    libprojectM-qt.so.1 (libc6) => /usr/local/lib/libprojectM-qt.so.1
    libprojectM-qt.so (libc6) => /usr/local/lib/libprojectM-qt.so

I know this is problably more related with my system rather than the visualizer itself, but could it be something wrong with the makefiles of visualization.projectm ??
Reply
#2
get rid of your system wide projectm and try again.
Reply
#3
it builds fine against the ubuntu libs though so you should just use those. and don't build the dependency at all.

0) remove all other projectm's.
1) install system libprojectm-dev
1) build and install kodi
2) build and install addon as any other piece of cmake-driven software (cmake . -DCMAKE_BUILD_TYPE=Release; make; make install). no fuzz.
Reply
#4
I just tried, and it didn't solve the problem. It seems the build scripts stubornly refuse to link the libs staticaly, as I guess it is intended.

I tried to change the Makeflles, but I am completely lost in the multitude of input files for cmake. My idea is to replace the -lprojectM -lMilkdropPresetFactory -lNativePresetFactory -lRenderer switch with pointers to the local .a files.

Which file would be the right one to edit for this?
Reply
#5
information is passed through the pc file of libprojectm. but really, if you do what i say you can avoid all the mess. the depends build is only intended for platforms which need it.
Reply
#6
Hi,

Thank you very much for the support. That is what I tried first (and I just tried again), but... a couple of thing:

1. I believe the FindProjectM.cmake file is not working as intended on my Ubuntu machine. It goes through the if(APPLE) test (on line 25), and sets variables which may not be suitable for a Linux build

2. On Ubuntu, there is a libprojectm in the distro, but I am missing libRenderer, libNativePresetFactory and libMilkdropPresetFactory

I don't know if there is a standard way to force static linking, I am going to hack the cmake files and post the result here.
Reply
#7
ok I managed to make it work. Here is my FindProjectM.cmake:
Code:
# - Try to find ASS
# Once done this will define
#
# ASS_FOUND - system has libass
# ASS_INCLUDE_DIRS - the libass include directory
# ASS_LIBRARIES - The libass libraries

find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
    pkg_check_modules (PROJECTM libprojectM)
    list(APPEND PROJECTM_INCLUDE_DIRS ${PROJECTM_INCLUDEDIR})
endif()

#if(NOT PROJECTM_FOUND)
#  find_path(PROJECTM_INCLUDE_DIRS libprojectM/projectM.hpp)
#  find_library(PROJECTM_LIBRARIES projectM)
#endif()

include(FindPackageHandleStandardArgs)

# this var is not set when using system libs on linux
#if(PROJECTM_LIBRARY_DIRS)
#find_package_handle_standard_args(ProjectM DEFAULT_MSG PROJECTM_INCLUDE_DIRS PROJECTM_LIBRARIES PROJECTM_LIBRARY_DIRS)
#
#if(APPLE)
#set(EXTRA_LDFLAGS "-framework CoreFoundation")
#else()
#set(EXTRA_LDFLAGS -Wl,-rpath='$ORIGIN')
#endif()
#
#set(PROJECTM_LIBS ${EXTRA_LDFLAGS} -L${PROJECTM_LIBRARY_DIRS} ${PROJECTM_LIBRARIES})
#
#file(GLOB PROJECTM_SOLIB  ${PROJECTM_LIBRARY_DIRS}/lib${PROJECTM_LIBRARIES}.so*)
#set(COPY_SOLIB true)
#else()
  find_package_handle_standard_args(ProjectM DEFAULT_MSG PROJECTM_INCLUDE_DIRS PROJECTM_LIBRARIES)
  set(EXTRA_LDFLAGS ${PROJECTM_LIBRARY_DIRS}/libRenderer.a ${PROJECTM_LIBRARY_DIRS}/libMilkdropPresetFactory.a ${PROJECTM_LIBRARY_DIRS}/libNativePresetFactory.a)
  set(PROJECTM_LIBS ${PROJECTM_LIBRARIES} ${EXTRA_LDFLAGS})
#endif()

mark_as_advanced(PROJECTM_INCLUDE_DIRS PROJECTM_LIBRARIES)

I know this is a hugly hack, the purpose is to staticaly link libMilkdropPresetFactory.a, libRenderer.a, libNativePresetFactory.a... but it works for me.
Reply
#8
something must be very wrong on your end if APPLE is true on your linux box.
Reply

Logout Mark Read Team Forum Stats Members Help
build projectM from source0