- Edited
https://github.com/BelaPlatform/Bela/wiki/Compiling-Faust-code-for-Bela
It looks like I got distcc working!
However, the linker step fails. I suspect something amiss with the Faust http library.
gary@audio-workstation:~/faust/examples/bela$ faust2bela -tobela -gui simpleFX_Analog.dsp
Send to bela
/home/gary/faust/examples/bela/simpleFX_Analog
Start communication with bela
/home/gary/faust/examples/bela/simpleFX_Analog
simpleFX_Analog
Checking the board is up and running at root@192.168.7.2...done
Stop running process...
Run bela now
uploadBuildRun START
Copying new source files to BeagleBone...Using rsync...
render.cpp
Automatically detected PROJECT_TYPE: cpp
Running on __stretch__ with Xenomai __3__
systemctl stop bela_startup || true
PID=`grep bela-audio /proc/xenomai/sched/stat | cut -d " " -f 5 | sed s/\s//g`; if [ -z $PID ]; then [ true = true ] || echo "No process to kill"; else [ true = true ] || echo "Killing old Bela process $PID"; kill -2 $PID; sleep 0.2; kill -9 $PID 2> /dev/null; fi; screen -X -S Bela quit > /dev/null; exit 0;
killall scsynth 2>/dev/null& killall sclang 2>/dev/null& true
echo 'Building render.cpp...'
Building render.cpp...
/usr/bin/clang++ -I/root/Bela/projects/simpleFX_Analog -I./include -I./build/pru/ -I/usr/xenomai/include/cobalt -I/usr/xenomai/include -march=armv7-a -mfpu=vfp3 -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__COBALT__ -D__COBALT_WRAP__ -DXENOMAI_SKIN_posix -DXENOMAI_MAJOR=3 -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -DNDEBUG -DBELA_USE_RTDM -I/root/Bela/resources/stretch/include -std=c++11 -Wno-varargs -DNDEBUG -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"/root/Bela/projects/simpleFX_Analog/build/render.d" -o "/root/Bela/projects/simpleFX_Analog/build/render.o" "/root/Bela/projects/simpleFX_Analog/render.cpp"
echo ' ...done'
...done
echo ' '
echo 'Linking...'
Linking...
/usr/bin/clang++ -Llib/ -pthread -o "/root/Bela/projects/simpleFX_Analog/simpleFX_Analog" build/core/FormatConvert.o build/core/OscillatorBank_routines.o build/core/math_runfast.o build/core/Gpio.o build/core/I2c_Codec.o build/core/PulseIn.o build/core/scope_ws.o build/core/RTAudio.o build/core/UdpClient.o build/core/WriteFile.o build/core/RTAudioCommandLine.o build/core/OSCClient.o build/core/WriteFile_c.o build/core/AuxTaskRT.o build/core/board_detect.o build/core/AuxTaskNonRT.o build/core/Midi.o build/core/AuxiliaryTasks.o build/core/I2c_TouchKey.o build/core/Midi_c.o build/core/Scope.o build/core/PruBinary.o build/core/PRU.o build/core/UdpServer.o build/core/OSCServer.o build/core/GPIOcontrol.o build/core/Spi_Codec.o build/core/JSONValue.o build/core/DigitalChannelManager.o build/core/JSON.o ./build/core/default_main.o /root/Bela/projects/simpleFX_Analog/build/render.o -lHTTPDFaust -Wl,--no-as-needed -L/usr/xenomai/lib -lcobalt -lmodechk -lpthread -lrt -lprussdrv -lstdc++ -Wl,--no-as-needed -L/usr/xenomai/lib -lcobalt -lmodechk -lpthread -lrt -lasound -lseasocks -lNE10 -lmathneon -lsndfile
//usr/local/lib/libHTTPDFaust.a(HTTPDSetup.cpp.o): In function `httpdfaust::HTTPDSetup::~HTTPDSetup()':
/tmp/distcc/distccd_430b6057.ii:(.text+0x34): undefined reference to `MHD_stop_daemon'
//usr/local/lib/libHTTPDFaust.a(HTTPDSetup.cpp.o): In function `httpdfaust::HTTPDSetup::stop()':
/tmp/distcc/distccd_430b6057.ii:(.text+0xa4): undefined reference to `MHD_stop_daemon'
//usr/local/lib/libHTTPDFaust.a(HTTPDSetup.cpp.o): In function `httpdfaust::HTTPDSetup::~HTTPDSetup()':
/tmp/distcc/distccd_430b6057.ii:(.text+0x118): undefined reference to `MHD_stop_daemon'
//usr/local/lib/libHTTPDFaust.a(HTTPDServer.cpp.o): In function `httpdfaust::HTTPDServer::~HTTPDServer()':
/tmp/distcc/distccd_502b6055.ii:(.text+0x48): undefined reference to `MHD_stop_daemon'
//usr/local/lib/libHTTPDFaust.a(HTTPDServer.cpp.o): In function `httpdfaust::HTTPDServer::~HTTPDServer()':
/tmp/distcc/distccd_502b6055.ii:(.text+0x8c): undefined reference to `MHD_stop_daemon'
//usr/local/lib/libHTTPDFaust.a(HTTPDServer.cpp.o): In function `httpdfaust::HTTPDServer::start(int)':
/tmp/distcc/distccd_502b6055.ii:(.text+0xd8): undefined reference to `MHD_start_daemon'
//usr/local/lib/libHTTPDFaust.a(HTTPDServer.cpp.o): In function `httpdfaust::HTTPDServer::send(MHD_Connection*, char const*, char const*, int)':
/tmp/distcc/distccd_502b6055.ii:(.text+0x130): undefined reference to `MHD_create_response_from_buffer'
/tmp/distcc/distccd_502b6055.ii:(.text+0x15c): undefined reference to `MHD_add_response_header'
/tmp/distcc/distccd_502b6055.ii:(.text+0x174): undefined reference to `MHD_add_response_header'
/tmp/distcc/distccd_502b6055.ii:(.text+0x184): undefined reference to `MHD_queue_response'
/tmp/distcc/distccd_502b6055.ii:(.text+0x190): undefined reference to `MHD_destroy_response'
//usr/local/lib/libHTTPDFaust.a(HTTPDServer.cpp.o): In function `httpdfaust::HTTPDServer::page(MHD_Connection*, char const*)':
/tmp/distcc/distccd_502b6055.ii:(.text+0x3e8): undefined reference to `MHD_create_response_from_fd'
/tmp/distcc/distccd_502b6055.ii:(.text+0x414): undefined reference to `MHD_add_response_header'
/tmp/distcc/distccd_502b6055.ii:(.text+0x42c): undefined reference to `MHD_add_response_header'
/tmp/distcc/distccd_502b6055.ii:(.text+0x43c): undefined reference to `MHD_queue_response'
/tmp/distcc/distccd_502b6055.ii:(.text+0x448): undefined reference to `MHD_destroy_response'
//usr/local/lib/libHTTPDFaust.a(HTTPDServer.cpp.o): In function `httpdfaust::HTTPDServer::answer(MHD_Connection*, char const*, char const*, char const*, char const*, unsigned int*, void**)':
/tmp/distcc/distccd_502b6055.ii:(.text+0xc30): undefined reference to `MHD_get_connection_values'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:479: recipe for target '/root/Bela/projects/simpleFX_Analog/simpleFX_Analog' failed
make: *** [/root/Bela/projects/simpleFX_Analog/simpleFX_Analog] Error 1
Connection to 192.168.7.2 closed.
gary@audio-workstation:~/faust/examples/bela$
#================================
The ZIP file contains only one file:
gary@audio-workstation:~/faust/examples/bela$ unzip libHTTPDFaust.zip
Archive: libHTTPDFaust.zip
inflating: libHTTPDFaust.a
gary@audio-workstation:~/faust/examples/bela$
This does not agree with the directions given. They hint that there should be some .so* files also:
libHTTPDFaust.so*
The libHTTPDFaust.a file is in the /usr/local/lib folder on Bela.
root@bela:~/Bela/resources/network# ls -l /usr/local/lib
total 6476
drwxr-xr-x 3 root root 4096 Oct 15 2018 SuperCollider
-rw-r--r-- 1 root root 657816 May 26 20:37 libHTTPDFaust.a
-rwxr-xr-x 1 root root 95796 Oct 15 2018 libfdt-1.4.4.so
-rw-r--r-- 1 root root 129020 Oct 15 2018 libfdt.a
lrwxrwxrwx 1 root root 11 Oct 15 2018 libfdt.so -> libfdt.so.1
lrwxrwxrwx 1 root root 15 Oct 15 2018 libfdt.so.1 -> libfdt-1.4.4.so
lrwxrwxrwx 1 root root 10 Oct 9 2018 libpd.so -> libpd.so.1
-rwxr-xr-x 1 root root 599912 Oct 9 2018 libpd.so.1
-rw-r--r-- 1 root staff 11550 Oct 15 2018 libprussdrv.a
-rw-r--r-- 1 root staff 14696 Oct 15 2018 libprussdrv.so
-rw-r--r-- 1 root staff 28866 Oct 15 2018 libprussdrvd.a
-rw-r--r-- 1 root staff 29800 Oct 15 2018 libprussdrvd.so
-rw-r--r-- 1 root staff 3777630 Oct 15 2018 libseasocks.a
lrwxrwxrwx 1 root staff 20 Oct 15 2018 libseasocks.so -> libseasocks.so.1.3.2
-rw-r--r-- 1 root staff 1249404 Oct 15 2018 libseasocks.so.1.3.2
drwxrwsr-x 4 root staff 4096 Sep 27 2018 python2.7
drwxrwsr-x 3 root staff 4096 Oct 15 2018 python3.5
root@bela:~/Bela/resources/network#
#==================
I tried again without the -gui
option and the program appears to be running on Bela.
root@bela:/usr/local/lib# ps ax | grep -i simple
15634 pts/2 Ss+ 0:00 make --no-print-directory QUIET=true -C /root/Bela PROJECT=simpleFX_Analog CL= LDLIBS= CPPFLAGS= AT= run
15670 pts/2 S+ 0:00 /bin/sh -c sync& cd /root/Bela/projects/simpleFX_Analog && /root/Bela/projects/simpleFX_Analog/simpleFX_Analog
15672 pts/2 SLl+ 0:00 /root/Bela/projects/simpleFX_Analog/simpleFX_Analog
15684 pts/0 S+ 0:00 grep --color=auto -i simple
root@bela:/usr/local/lib#
#==================================
Sorry I don't have any audio plugged in at the moment to actually try it out 8((
I am highly motivated to help solve this issue as using something like Faust is the only way I am going write effects code. I can't operate at the C++ level. Not that I don't understand C++ but it is so far below the conceptual level that Faust allows it's not worth spending time on it.
==============
ok I see many references to MHD_stop_daemon for example, what is that I wonder, well I found this, next question is how do I integrate it with this project?
https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html
=========
installing libmicrohttpd directly on Bela.
wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-latest.tar.gz
tar xvzf libmicrohttpd-latest.tar.gz
cd libmicrohttpd-0.9.63/
./configure
make
sudo make install
ls -l /usr/local/lib | grep http
root@bela:~/Downloads/libmicrohttpd-0.9.63# ls -l /usr/local/lib | grep http
-rw-r--r-- 1 root root 639692 May 29 05:21 libmicrohttpd.a
-rwxr-xr-x 1 root root 997 May 29 05:21 libmicrohttpd.la
lrwxrwxrwx 1 root root 24 May 29 05:21 libmicrohttpd.so -> libmicrohttpd.so.12.50.0
lrwxrwxrwx 1 root root 24 May 29 05:21 libmicrohttpd.so.12 -> libmicrohttpd.so.12.50.0
-rwxr-xr-x 1 root root 389772 May 29 05:21 libmicrohttpd.so.12.50.0
root@bela:~/Downloads/libmicrohttpd-0.9.63#
Build still fails with lots of this kind of thing:
/tmp/distcc/distccd_502b6055.ii:(.text+0x3e8): undefined reference to `MHD_create_response_from_fd'
/tmp/distcc/distccd_502b6055.ii:(.text+0x414): undefined reference to `MHD_add_response_header'
/tmp/distcc/distccd_502b6055.ii:(.text+0x42c): undefined reference to `MHD_add_response_header'
/tmp/distcc/distccd_502b6055.ii:(.text+0x43c): undefined reference to `MHD_queue_response'
/tmp/distcc/distccd_502b6055.ii:(.text+0x448): undefined reference to `MHD_destroy_response'
Now I just need to try to figure out how to link that library in...