Compiling alsa-utils 1.1.0 on Raspberry Pi - raspberry-pi

I have compiled and installed alsa-lib 1.1.0 and moved on to compiling and installing the new alsa-util. The ./configure works:
./configure --disable-bat --disable-xmlto --disable-alsaconf --with-curses=ncursesw
however the make fails and I have had no luck finding a resolution:
Making all in topology
make[1]: Entering directory '/home/pi/apps/alsa_utils/alsa-utils-1.1.0/topology'
gcc -g -O2 -o alsatplg topology.o -lasound -lasound -lm -ldl -lpthread
topology.o: In function `main':
/home/pi/apps/alsa_utils/alsa-utils-1.1.0/topology/topology.c:99: undefined reference to `snd_tplg_new'
/home/pi/apps/alsa_utils/alsa-utils-1.1.0/topology/topology.c:105: undefined reference to `snd_tplg_verbose'
/home/pi/apps/alsa_utils/alsa-utils-1.1.0/topology/topology.c:107: undefined reference to `snd_tplg_build_file'
/home/pi/apps/alsa_utils/alsa-utils-1.1.0/topology/topology.c:114: undefined reference to `snd_tplg_free'
/home/pi/apps/alsa_utils/alsa-utils-1.1.0/topology/topology.c:110: undefined reference to `snd_tplg_free'
collect2: error: ld returned 1 exit status
Makefile:318: recipe for target 'alsatplg' failed
make[1]: *** [alsatplg] Error 1
make[1]: Leaving directory '/home/pi/apps/alsa_utils/alsa-utils-1.1.0/topology'
Makefile:352: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
I understand that this error means that undefined references exist but I cannot understand why?
Thanks.

Related

Buildroot not compiling

every time I run make
it starts compiling but then stops and tells me this:
tmp-divrem_1.s:130: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
tmp-divrem_1.s:146: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
tmp-divrem_1.s:159: Error: selected processor does not support `mls r1,r4,r8,r11' in ARM mode
tmp-divrem_1.s:176: Error: selected processor does not support `mls r1,r4,r3,r8' in ARM mode
tmp-divrem_1.s:210: Error: selected processor does not support `mls r11,r4,r12,r3' in ARM mode
make[3]: *** [Makefile:768: divrem_1.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_fib2_ui -I/home/pi/buildroot/output/host/include -O2 -I/home/pi/buildroot/output/host/include -c fib2_ui.c -fPIC -DPIC -o .libs/fib2_ui.o
make[3]: Leaving directory '/home/pi/buildroot/output/build/host-gmp-6.2.1/mpn'
make[2]: *** [Makefile:997: all-recursive] Error 1
make[2]: Leaving directory '/home/pi/buildroot/output/build/host-gmp-6.2.1'
make[1]: *** [Makefile:787: all] Error 2
make[1]: Leaving directory '/home/pi/buildroot/output/build/host-gmp-6.2.1'
make: *** [package/pkg-generic.mk:250: /home/pi/buildroot/output/build/host-gmp-6.2.1/.stamp_built] Error 2```
From the config it looks like you're compiling for i586, not arm or aarch64.
If you type make list-defconfigs, then it will show you a list; here's an excerpt:
raspberrypi2_defconfig - Build for raspberrypi2
raspberrypi4_64_defconfig - Build for raspberrypi4_64
raspberrypi4_defconfig - Build for raspberrypi4
sheevaplug_defconfig - Build for sheevaplug
Once you have identified the defconfig you need, then you can do this:
make raspberrypi4_defconfig
and it'll initialize a basic configuration for the selected target. With this configuration, your compilation should run to completion.

using legacy librealsense in qtcreator and cmake

I want to setup qt-creator for developing legacy librealsense in ubuntu16.04. I want to use CMake. I have librealsense installed on my system and the header files are in the "/usr/local/include" and the "librealsense.so" file is in the "/usr/local/lib". so I've created a simple CPP project with CMakeLists.txt and main.cpp files. my files are as follow:
main.cpp file:
#include <iostream>
#include <librealsense/rs.hpp>
int main()
{
rs::context ctx;
std::cout << "Hello World!" << std::endl;
return 0;
}
CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8)
project(realsense_r200)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
find_library(librealsense REQUIRED)
add_executable(${PROJECT_NAME} "main.cpp")
target_link_libraries(${PROJECT_NAME} ${librealsense_LIBRARY})
target_include_directories(${PROJECT_NAME} PRIVATE ${librealsense_INCLUDE_DIR})
there are two problems:
find_library(), can't find the librealsense and in the CMake cache list, in front of librealsense, I get NOT_FOUND.
to solve the first problem I added the "librealsense.so" path manually in the cache list. so I have no errors in the generation of make files. but how can I set it up to find the path automatically?
when I try to build my project I have undefined reference errors to some methods as below:
CMakeFiles/realsense_r200.dir/main.cpp.o: In function `rs_apply_depth_control_preset(rs_device*, int)':
main.cpp:(.text+0x61d): undefined reference to `rs_set_device_options'
CMakeFiles/realsense_r200.dir/main.cpp.o: In function `rs_apply_ivcam_preset(rs_device*, rs_ivcam_preset)':
main.cpp:(.text+0x734): undefined reference to `rs_reset_device_options_to_default'
main.cpp:(.text+0x7d1): undefined reference to `rs_set_device_options'
main.cpp:(.text+0x869): undefined reference to `rs_set_device_options'
main.cpp:(.text+0x8ba): undefined reference to `rs_set_device_options'
CMakeFiles/realsense_r200.dir/main.cpp.o: In function `rs::error::error(rs_error*)':
main.cpp:(.text._ZN2rs5errorC2EP8rs_error[_ZN2rs5errorC5EP8rs_error]+0x2a): undefined reference to `rs_get_error_message'
main.cpp:(.text._ZN2rs5errorC2EP8rs_error[_ZN2rs5errorC5EP8rs_error]+0x74): undefined reference to `rs_get_failed_function'
main.cpp:(.text._ZN2rs5errorC2EP8rs_error[_ZN2rs5errorC5EP8rs_error]+0x9b): undefined reference to `rs_get_failed_function'
main.cpp:(.text._ZN2rs5errorC2EP8rs_error[_ZN2rs5errorC5EP8rs_error]+0x102): undefined reference to `rs_get_failed_args'
main.cpp:(.text._ZN2rs5errorC2EP8rs_error[_ZN2rs5errorC5EP8rs_error]+0x129): undefined reference to `rs_get_failed_args'
main.cpp:(.text._ZN2rs5errorC2EP8rs_error[_ZN2rs5errorC5EP8rs_error]+0x190): undefined reference to `rs_free_error'
CMakeFiles/realsense_r200.dir/main.cpp.o: In function `rs::context::context()':
main.cpp:(.text._ZN2rs7contextC2Ev[_ZN2rs7contextC5Ev]+0x30): undefined reference to `rs_create_context'
CMakeFiles/realsense_r200.dir/main.cpp.o: In function `rs::context::~context()':
main.cpp:(.text._ZN2rs7contextD2Ev[_ZN2rs7contextD5Ev]+0x1c): undefined reference to `rs_delete_context'
CMakeFiles/realsense_r200.dir/build.make:94: recipe for target 'realsense_r200' failed
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/realsense_r200.dir/all' failed
Makefile:83: recipe for target 'all' failed
collect2: error: ld returned 1 exit status
make[2]: *** [realsense_r200] Error 1
make[1]: *** [CMakeFiles/realsense_r200.dir/all] Error 2
make: *** [all] Error 2
18:32:02: The process "/usr/bin/cmake" exited with code 2.
Error while building/deploying project realsense_r200 (kit: Desktop)
When executing step "CMake Build"
as you see in the CMakeLists.txt file I've linked the "librealsense.so" file to the executable, why I get these errors and how can I solve it?
thanks for your help!!!
#
Edited Part
I changed my cmake file as below:
new CMake file:
cmake_minimum_required(VERSION 2.8)
project(realsense_r200)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
find_library(REALSENSE librealsense)
find_package(Threads)
add_executable(${PROJECT_NAME} "main.cpp")
target_link_libraries(${PROJECT_NAME} ${REALSENSE} ${CMAKE_THREAD_LIBS_INIT})
the undefined errors have gone, but I have new errors as below:
/usr/local/lib/librealsense.so: undefined reference to `std::thread::_State::~_State()#GLIBCXX_3.4.22'
/usr/local/lib/librealsense.so: undefined reference to `typeinfo for std::thread::_State#GLIBCXX_3.4.22'CMakeFiles/realsense_r200.dir/build.make:95: recipe for target 'realsense_r200' failed
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/realsense_r200.dir/all' failed
Makefile:83: recipe for target 'all' failed
/usr/local/lib/librealsense.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())#GLIBCXX_3.4.22'
collect2: error: ld returned 1 exit status
make[2]: *** [realsense_r200] Error 1
make[1]: *** [CMakeFiles/realsense_r200.dir/all] Error 2
make: *** [all] Error 2
23:35:55: The process "/usr/bin/cmake" exited with code 2.
Error while building/deploying project realsense_r200 (kit: Desktop)
When executing step "CMake Build"

Redis build fails on new RaspberryPi 4 using Raspbian Buster

I am getting a linker error when trying to build redis-stable (should be 5.0.5) on raspbian buster running on the latest Raspberry Pi 4
make goes through the motions and then fails with the following
LINK redis-server
/usr/bin/ld: networking.o: in function `createClient':
/home/pi/redis-stable/src/networking.c:109: undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:219: redis-server] Error 1
make[1]: Leaving directory '/home/pi/redis-stable/src'
make: *** [Makefile:6: all] Error 2
Am I missing a setting somewhere?
I was able to get all the tests to run successfully by adding the compiler flag -latomic only to the redis-server
# redis-server
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
$(REDIS_LD) -o $# $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS) -latomic
EDIT: This is with Redis 5.0.5
I was able to run by adding the compiler flag -latomic only to the haproxy
[error]
/home/pi/CQ/LB/haproxy-1.8.21/src/proto_http.c:12152: undefined reference to `__atomic_fetch_add_8'
..........................................
..........................................
/usr/bin/ld: src/proto_http.o:/home/pi/CQ/LB/haproxy-1.8.21/src/proto_http.c:4200: more undefined references to `__atomic_fetch_add_8' follow
/usr/bin/ld: src/time.o: in function `tv_update_date':
/home/pi/CQ/LB/haproxy-1.8.21/src/time.c:229: undefined reference to `__atomic_compare_exchange_8'
collect2: error: ld returned 1 exit status
make: *** [Makefile:914: haproxy] error 1
[adding]
913 haproxy: $(OPTIONS_OBJS) $(EBTREE_OBJS) $(OBJS)
914 $(LD) $(LDFLAGS) -o $# $^ $(LDOPTS) -latomic

How to build Stanford Dune OS?

I am trying to build the Standford Dune OS with:
git clone http://dune.scs.stanford.edu/dune.git
make -C kern
but I get the following errors:
make[1]: Entering directory `/home/think/Desktop/build/dune/kern'
mkdir -p /home/think/Desktop/build/dune/kern/tmp/.tmp_versions
make -C /lib/modules/3.11.0-12-generic/build M=/home/think/Desktop/build/dune/kern MODVERDIR=/home/think/Desktop/build/dune/kern/tmp/.tmp_versions modules
make[2]: Entering directory `/usr/src/linux-headers-3.11.0-12-generic'
CC [M] /home/think/Desktop/build/dune/kern/vmx.o
/home/think/Desktop/build/dune/kern/vmx.c: In function ‘vmx_setup_initial_guest_state’:
/home/think/Desktop/build/dune/kern/vmx.c:793:10: error: ‘X86_CR4_RDWRGSFS’ undeclared (first use in this function)
cr4 |= X86_CR4_RDWRGSFS;
^
/home/think/Desktop/build/dune/kern/vmx.c:793:10: note: each undeclared identifier is reported only once for each function it appears in
/home/think/Desktop/build/dune/kern/vmx.c: In function ‘vmx_enable’:
/home/think/Desktop/build/dune/kern/vmx.c:1631:2: error: implicit declaration of function ‘store_gdt’ [-Werror=implicit-function-declaration]
store_gdt(&__get_cpu_var(host_gdt));
^
cc1: some warnings being treated as errors
make[3]: *** [/home/think/Desktop/build/dune/kern/vmx.o] Error 1
make[2]: *** [_module_/home/think/Desktop/build/dune/kern] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-3.11.0-12-generic'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/think/Desktop/build/dune/kern'
make: *** [kern] Error 2
How can I fix this?
downgrade your kernel! I am using 3.2.0. wanted to port dune to 3.14.0 but just didn't have time..

Gtk3 installation

I'm trying to install gtk+-3.2.3 on Ubuntu natty. This is a fresh Ubuntu install with security updates only. I have not installed any new versions of gtk. I just have gtk2, that Ubuntu comes with. First I installed the following:
sudo apt-get install libffi-dev zlib1g-dev fam libdbus-1-dev libdbus-glib-1-dev gobject-introspection libxext-dev libxrender1-dbg colordiff libcairo2-dev libtiff4-dev libpng12-dev libxft-dev libxi-devel
I have the following folders in: /home/mike/gtk
atk-2.1.5
gdk-pixbuf-2.24.1
glib-2.30.1
gtk+-3.2.3
pango-1.29.1
Then:
cd /home/mike/gtk/glib-2.30.1
./configure && make
rm -rf /home/mike/gtk/include/glib.h /home/mike/gtk/include/gmodule.h (glib INSTALL instructions)
repeat for the other folders except without the rm, in the following order:
atk-2.1.5
gdk-pixbuf-2.24.1
pango-1.29.1
gtk+-3.2.3
Before running ./configure for gtk+-3.2.3 enter this in the terminal:
CPPFLAGS="-I/home/mike/gtk/include"
LDFLAGS="-L/home/mike/gtk/lib"
PKG_CONFIG_PATH="/home/mike/gtk/lib/pkgconfig"
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH
LD_LIBRARY_PATH="/home/mike/gtk/lib"
PATH="/home/mike/gtk/bin:$PATH"
export LD_LIBRARY_PATH PATH
export PKG_CONFIG_PATH="/home/mike/gtk/lib/pkgconfig:$PKG_CONFIG_PATH"
I get the these errors when I run make on gtk+-3.2.3:
gdkwindow-x11.c: In function '_gdk_x11_moveresize_handle_event':
gdkwindow-x11.c:4301:9: error: 'XIEvent' undeclared (first use in this function)
gdkwindow-x11.c:4301:9: note: each undeclared identifier is reported only once for each function it appears in
gdkwindow-x11.c:4301:18: error: 'ev' undeclared (first use in this function)
gdkwindow-x11.c:4301:33: error: expected expression before ')' token
gdkwindow-x11.c:4302:9: error: 'XIDeviceEvent' undeclared (first use in this function)
gdkwindow-x11.c:4302:24: error: 'xev' undeclared (first use in this function)
gdkwindow-x11.c:4302:46: error: expected expression before ')' token
gdkwindow-x11.c:4306:16: error: 'XI_Motion' undeclared (first use in this function)
gdkwindow-x11.c:4308:13: warning: implicit declaration of function '_gdk_x11_device_xi2_translate_state'
gdkwindow-x11.c:4313:16: error: 'XI_ButtonRelease' undeclared (first use in this function)
make[4]: *** [gdkwindow-x11.lo] Error 1
make[4]: Leaving directory `/home/mike/gtk/gtk+-3.2.3/gdk/x11'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/mike/gtk/gtk+-3.2.3/gdk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/mike/gtk/gtk+-3.2.3/gdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mike/gtk/gtk+-3.2.3'
make: *** [all] Error 2
You place GTK3's source code in an arbitrary directory (into which you have write permissions). And you run ./configure from there.
You may want to pass the configure scripts (of each package) a common --prefix to override the default of /usr/local/ (this is needed, e.g. with --prefix $HOME/pub, if you cannot write under /usr/ because you don't have root access).