fdb / frequensea

Visualizing the frequency spectrum.
MIT License
169 stars 18 forks source link

Raspbian Jessie build error #9

Open Nodeswitch opened 9 years ago

Nodeswitch commented 9 years ago

I'm getting the below when building Frequensea on Raspbian Jessie. I was initially getting build issues prior to that, but realised that libhackrf-dev wasn't listed as a dependency under the Raspberry Pi section, this allowed me to get this far.

[ 76%] Built target lua
Linking CXX executable frequensea
externals/lua/liblua.a(loslib.c.o): In function `os_tmpname':
/home/pi/frequensea/externals/lua/src/loslib.c:140: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/ld: /usr/local/lib/libglfw3.a(x11_init.c.o): undefined reference to symbol 'XF86VidModeQueryExtension'
//usr/lib/arm-linux-gnueabihf/libXxf86vm.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/frequensea.dir/build.make:350: recipe for target 'frequensea' failed
make[2]: *** [frequensea] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/frequensea.dir/all' failed
make[1]: *** [CMakeFiles/frequensea.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
fdb commented 9 years ago

I've listed libhackrf-dev as a dependency.

As for the issue, I've found this thread which points to a missing linker flag:

Added lib -lXxf86vm to linker flags. Works now.

Could you try adding that? I don't have a RPI with Jessie near me now.

Nodeswitch commented 9 years ago

You'll have to forgive my lack of knowledge on this, so if I've done this wrong, please let me know.

I added the below line to CMakeLists.txt

set (CMAKE_CXX_LINK_FLAGS "-lXxf86vm")

After re-creating the build folder and kicking everything off again, I'm now presented with the below.

Linking CXX executable frequensea
externals/lua/liblua.a(loslib.c.o): In function `os_tmpname':
/home/pi/frequensea/externals/lua/src/loslib.c:140: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/ld: /usr/local/lib/libglfw3.a(x11_init.c.o): undefined reference to symbol 'XIQueryVersion'
//usr/lib/arm-linux-gnueabihf/libXi.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/frequensea.dir/build.make:350: recipe for target 'frequensea' failed
make[2]: *** [frequensea] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/frequensea.dir/all' failed
make[1]: *** [CMakeFiles/frequensea.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

This did appear to resolve the libXxf86vm DSO error.

Searching around for the libglfw3 error, I'm pointed here, then here, which mentions adding X11 into the cmake file, but it looks like that's already done.

if (LINUX)
    find_package(X11 REQUIRED)
    set(PLATFORM_LIBS ${X11_X11_LIB} ${RT_LIBRARY} ${X11_Xrandr_LIB})
endif (LINUX)
fdb commented 9 years ago

You'll have to forgive my lack of knowledge as well :-) I'm absolutely not an expert in those compiler flags. I'll try to look at it tonight when I have my RPI.

On 27 Oct 2015, at 21:16, Nodeswitch notifications@github.com wrote:

You'll have to forgive my lack of knowledge on this, so if I've done this wrong, please let me know.

I added the below line to CMakeLists.txt

set (CMAKE_CXX_LINK_FLAGS "-lXxf86vm") After re-creating the build folder and kicking everything off again, I'm now presented with the below.

Linking CXX executable frequensea externals/lua/liblua.a(loslib.c.o): In function os_tmpname': /home/pi/frequensea/externals/lua/src/loslib.c:140: warning: the use oftmpnam' is dangerous, better use `mkstemp' /usr/bin/ld: /usr/local/lib/libglfw3.a(x11_init.c.o): undefined reference to symbol 'XIQueryVersion' //usr/lib/arm-linux-gnueabihf/libXi.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status CMakeFiles/frequensea.dir/build.make:350: recipe for target 'frequensea' failed make[2]: * [frequensea] Error 1 CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/frequensea.dir/all' failed make[1]: * [CMakeFiles/frequensea.dir/all] Error 2 Makefile:76: recipe for target 'all' failed make: *\ [all] Error 2 This did appear to resolve the libXxf86vm DSO error.

Searching around for the libglfw3 error, I'm pointed here, then here, which mentions adding X11 into the cmake file, but it looks like that's already done.

if (LINUX) find_package(X11 REQUIRED) set(PLATFORM_LIBS ${X11_X11_LIB} ${RT_LIBRARY} ${X11_Xrandr_LIB}) endif (LINUX) — Reply to this email directly or view it on GitHub.

fdb commented 9 years ago

I've pushed some patches that enable compilation on Raspbian Jessie. Everything should now compile without errors. Make sure to install all the packages listed in the README.

That doesn't mean everything works, unfortunately. The only example that currently seems to work is the empty.lua example that just opens an empty window.

This is because, to make things works, I've had to use the Mesa software rasterizer, which doesn't support the newer GL3 features we're using (such as VBOs, or even shaders).

The solution is to make GLFW3 use OpenGL ES. However, so far I haven't had any success with that.

fdb commented 9 years ago

Some other thread for reference:

fdb commented 9 years ago

Note that there is a rpi-support branch that does work -- however, those patches haven't been merged yet and the branch is running behind.

git checkout -b rpi-support
mkdir make
cd make
cmake ..
make
./frequensea ../lua/static.lua

This uses the Broadcom drivers directly, and renders full-screen. You'll have to use Alt-F4 to stop the application (this also closes the terminal, however).