Install sonic pi 3.2 dev on ubuntu 18.04 LTS

I have this error

In file included from mainwindow.cpp:50:0:
visualizer/scope.h:25:10: fatal error: kiss_fft/kiss_fft.h: No such file or directory
 #include "kiss_fft/kiss_fft.h"

in the last step in the build script. But I didn’t run the whole script, I ran all the bits except building supercollider+sc3-plugins, as I have those already

There is a kiss_fft.h in sonic-pi/app/gui/qt/external/kiss_fft/

The latest installation for linux now uses cmake scripts. Still under development, but it works OK on my Pi4 under Raspbian Buster.
The cmake scripts includes the new kiss_fft/kiss_fft stuff which is used for the new scope spectrum trace
Have a look at the unix_prebuild.sh and unix_setup.sh scripts. At present MacOS is handled a little differently. On Raspbian I had also to build and install osmid binaries to app/server/native/osmid, to build the two erlang beam files from osc.elr and pi_server.erl using erlc, to add a soft link to ruby in /app/server/native/ruby/bin and to gem install aubio. Otherwise these two scripts prepared the whole build which was executed in the build folder they set up with cmake --build . --config All

You will notice that Sam Aaron has now moved many of other build scripts in Sonic Pi to an archive folder. The intention is to produce a unified scheme using cmake to build either for Windows Mac or Linux.

Things are still evolving and change fairly frequently, but looking along these lines above should get you on the way.

Thanks for that. It certainly built some stuff before errorring out this time. Which feels like progress. I’ll keep chipping away at it.

Ah, OK, so I osmid in app/gui/qt/external/, moved it to app/server/native/ as you wrote (and I skipped over!) and it has built and is working. That’s great! Thanks for the help

Hi @robin.newman

Would you give us some tips to use this new method ? Which files to we have to use to build under Linux…

is that all to do ?

A bit more than that. I’ll try and put some more details together for you. Things are still a bit fluid and changing at present.
EDIT
I haven’t forgotten, but there are quite a few changes taking place at present, and I prefer to wait until the dust has settled. For example I have just added a PR to allow RPi to utilise the latest scope change, as I was getting compile errors.

1 Like

@robin.newman don’t worry i know you haven’t forgotten. Good luck !

Basically you have to make sure you have all the supporting packages loaded via apt-get, build osmid as before, and install the binaries m2o and o2m to native/osmid, have erlang installed (I used erlang-base on the Pi) and build the osc.erl and pi_server.erl files to their equivalent beam files in the erlang folder. As far as scsynth and the plugins go these were picked up automatically by installing supercollider-server and sc3-plugins.
for the rest, create a short cut to the ruby binary in server/native/ruby/bin
I used (from the qt folder):

 ln -s `which ruby` ../../server/native/ruby/bin

to do this.
run

../../server/ruby/bin/compile-extension/is.rb

#now for some stuff using cmake
#I think I had to `gem install aubio` first on RPi too

./unix-prebuild.sh #builds the documentation

./unix-config.sh #sets up the build folder

cd build
cmake --build .

when this has finished you should have the new sonic-pi binary in the newly created build folder
You can run it from there, or from <SONIC-PI_SRC>/bin/sonic-pi

You may have problems with the prebuild script. It deletes an existing ruby-aubio-prerelease gem from the vendor folder. (subsequent runs will show an error which you ignore. However I found I needed the gem aubio install (It was version 0.3.3). You also need as part of the initial packages installed libaubio5 (on debian)

NB at time of writing the latest commit to Sonic Pi is #3e587fc. There is a bug in the earlier commit Merge pull request #2234 from cmaughan/feature/threaded_analyzer
I have submitted a PR Update scope.h syntax #2237 to cure this, but you will have to carry out the changes yourself manually if you build right now.

Hope these rough notes are helpful.

1 Like

do you mean that all your first paragraph operations are done by the ./unix-prebuild.sh and so on ?

to get to the commit mentionned by Robin

nlb@devbox:~/audio/testRepo/sonic-pi$ git reset --hard 3e587fc
HEAD is now at 3e587fc5f Translated using Weblate (Polish)

from the qt folder, the path seems to be

ln -s `which ruby` ../../server/ruby/bin/

Well too hard for me. don’t lose time to try explaining… I will wait.

OK. Are you building on a Pi4 or on ubuntu 18.04 LTS? If the latter, I tried this on a virtual machine today, and there are a significant number of problems there, particularly with rugged and aubio, which I haven’t solved. I think a later ubuntu version may be OK, and hope to try that.
If you are building on a Pi then it builds OK. Yes the prebuild does all the documentation stuff, and the config script builds the gui, so things are much simpler.

ah sorry as the subject is “on ubuntu 18.04” i was thinking it waf for ubuntu. so yes i try under 18.04.04. I will try tomorrow under pi buster.

I actually managed to build the latest 3.2dev on ubuntu 18.04 today. It required a bit fiddling to get going. I needed to change the rugged gem to an early version to that used in the Sonic Pi repro, and also to build SuperCollider and the sc3plugins for version 3.9.1. I was able to use the new cmake install process to do the build.
I won’t write anything up yet until 3.2 is released, as there are still changes taking place which may affect things. I built it on a virtual Ubuntu 18.04, and although everything including the new scope displays worked fine, I couldn’t check the audio properly as the virtual sound card is not up to handling it with copious Xruns from the jackd supercollider link.

Thanks. I also had to add
#include <mutex>
to scope.h to compile it for some reason.

I found out that if I modified the unix-prebuild.sh not to remove the ruby-aubio-prerelease gem and also to use the installed ruby directly I did not need to create the symlink and did not get any errors, but maybe there is a reason for deleting the gem. Anyway this unix-prebuild.sh works for me:

#!/bin/bash
set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

echo "Translating tutorial..."
/usr/bin/env ruby "${SCRIPT_DIR}/../../server/ruby/bin/i18n-tool.rb" -t

echo "Generating docs for the Qt GUI..."
cp "${SCRIPT_DIR}/utils/ruby_help.tmpl" "${SCRIPT_DIR}/utils/ruby_help.h"
/usr/bin/env ruby "${SCRIPT_DIR}/../../server/ruby/bin/qt-doc.rb" -o "${SCRIPT_DIR}/utils/ruby_help.h"

echo "Updating GUI translation files..."
lrelease "${SCRIPT_DIR}"/lang/*.ts

i have tried today to install the latest commit version.
Can’t get the midi works.

Failed to load the fast_osc c-extension, falling back to pure Ruby version
Overriding fast_osc c-extension FastOsc::decode_single_message, falling back to pure Ruby version
/home/nlb/sonic-pi/app/server/ruby/vendor/sys-proctable-1.1.3/lib/linux/sys/proctable.rb:112: warning: constant ::Fixnum is deprecated
/home/nlb/sonic-pi/app/server/ruby/vendor/sys-proctable-1.1.3/lib/linux/sys/proctable.rb:112: warning: constant ::Fixnum is deprecated
/home/nlb/sonic-pi/app/server/ruby/vendor/sys-proctable-1.1.3/lib/linux/sys/proctable.rb:112: warning: constant ::Fixnum is deprecated
/home/nlb/sonic-pi/app/server/ruby/vendor/sys-proctable-1.1.3/lib/linux/sys/proctable.rb:112: warning: constant ::Fixnum is deprecated
OSC handler exception for address: /cue-port-external
Connection refused - send(2)
["/home/nlb/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:30:in `send'", "/home/nlb/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:30:in `send'", "/$
OSC handler exception for address: /cue-port-external
Connection refused - send(2)
["/home/nlb/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:30:in `send'", "/home/nlb/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:30:in `send'", "/$
/home/nlb/sonic-pi/app/server/ruby/vendor/sys-proctable-1.1.3/lib/linux/sys/proctable.rb:112: warning: constant ::Fixnum is deprecated
/home/nlb/sonic-pi/app/server/ruby/vendor/sys-proctable-1.1.3/lib/linux/sys/proctable.rb:112: warning: constant ::Fixnum is deprecated
/home/nlb/sonic-pi/app/server/ruby/vendor/sys-proctable-1.1.3/lib/linux/sys/proctable.rb:112: warning: constant ::Fixnum is deprecated
/home/nlb/sonic-pi/app/server/ruby/vendor/sys-proctable-1.1.3/lib/linux/sys/proctable.rb:112: warning: constant ::Fixnum is deprecated
OSC handler exception for address: /exit
Connection refused - send(2)
["/home/nlb/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:30:in `send'", "/home/nlb/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:30:in `send'", "/$
/home/nlb/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:30:in `send': Connection refused - send(2) (Errno::ECONNREFUSED)
        from /home/nlb/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:30:in `send'
        from /home/nlb/sonic-pi/app/gui/qt/build/../../../../app/server/ruby/bin/sonic-pi-server.rb:328:in `block in <main>'

if someone has an idea. I guess it’s something with osmid.

You are right about the changes to the prebuild script. I have already submitted a pr about this. The removal of the ruby-aubio-prerelease was to benefit the windows install, and it copied over to the unix script in error.

As regards midi have you built the erlang files? osc.erl to osc.beam and pi_server.erl to pi_server.beam? What do your log files show. Does the erlang log show it has started? Can you see o2m and m2o started in the server output log?

that’s the problem i didn’t and really don’t know how to proceed. if you could show me the way i would try but i can wait for the official release.

On RPi I installed (erlang-server) EDIT APOLIGIES THAT SHOULD BE erlang-base package. Then cd to erlang folder holding the two .erl files and do

erlc osc.erl
erlc pi_server.erl

This produces the two .beam files you need.

Hi, just to be clear, there will be no official v3.2 release for Linux. I don’t have the resources to support all platforms and without volunteer support (i.e. someone maintaining a release for their preferred distribution) I will have to wait until my financial income from Patreon is sufficient enough that I can pay both my own salary and the salary of someone else to do this work. I’m sadly quite a long way from achieving this.