Install sonic pi 3.2 dev on ubuntu 18.04 LTS

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.

Been trying compiling on Ubuntu 19.10 for last few days, challange so far. Anyone had a luck? I be happy to start looking into PPA repo? There must be easy way to get this on Linux distro.

P

Hi @cerw - things on the building-front have been in a pretty hectic state of flux these last few weeks.

Now that v3.2.0 is tagged, and once I’ve taken a bit of a break I’ll be able to start putting some polish into the build process (unless someone beats me to it). Currently the Windows build is incredibly easy, so the Linux build can’t be far behind :slight_smile:

hi @samaaron,

I had it build in January from master, but after I did pull I am having trouble with ruby_help files. I think its’ 90% using one of the script from forum here, I did tried to boot into Windows and Sonic PI runs great, but not my NodeJS Scripts. Thank you answering to me :slight_smile:

Will try play with it later tonight.

P

Hi,

as I am mainly a Linux user and intend to work with Sonic Pi installed on Linux I am very much interested in a way to compile 3.2 on my machine.

(I made a quick attempt with the script from this thread which worked a few weeks ago, but I did not really expect this to work anymore, which was a correct assuption :wink: .

I do not really have specific knowledge in building and compiling but some general experience with Linux. So I am willing to help with testing and feedback.

Right now I am not sure how to start and would appreciate some hints.

have you seen my post ?

But i’m pretty certain, a procedure to install under linux the latest is coming soon. I have tried but for the moment got stuck with osc but Robin (as usual) would certainly help us.

1 Like

Hi @nlb,

thanks for the hint! Looks promising. The erlang/osc issue seems solvable (I did this before). Anyhow, I am also sure that there will be a solution. I just wanted to say, I am very interested and will be available for testing.

Once the dust has settled from the 3.2 release I think that it will be time to look at Linux building again. There have been a large number of changes over the last few weeks which will have affected “current” scripts, so much so that Sam Aaron has moved them to an old folder. There has been a lot of work to move the builds to cmake scripts. On the Raspberry Pi for example the whole process is quick and easy, and it should be possible to streamline it even further. I have also done Ubuntu builds on a virtual machine. (But the sound output on the virtual machine is not up to using it although the build works)

2 Likes

yes @robin.newman we are too impatient :slight_smile:
as @Martin said, we are opened to test !

1 Like

I spent the morning working with Ubuntu 18.04 and I now have a fully working install of Sonic Pi 3.2 running on it.
Recent moves to change to a cmake based build system, gave rise to some problemsl on this LTS distro which is now over 2 years old, and after quite a lot of faffing around I came to the conclusion that it was easiest to upgrade both the installed ruby and the installed cmake from those supplied by the distribution packages.
Accordingly I first installed rvm (following the instructions for rvm install on ubuntu on https://github.com/rvm/ubuntu_rvm
I then installed ruby-2.6.3 with this.
When I came to try the cmake scripts I had an objection that the cmake was too old.
Accordingly I removed the installed cmake with sudo apt remove cmake, and instead downloadedit using
wget https://github.com/Kitware/CMake/releases/download/v3.16.4/cmake-3.16.4-Linux-x86_64.sh
This is installed in /opt using sudo sh cmake-3.16.4-Linux-x86_64.sh --prefix= /opt/cmake
acknowledge the licence and say Y to the subdirectory to install in
/opt/cmake/cmake-3.16.4-Linux-x*6_64
and you then link it in using
sudo ln -s /opt/cmake/cmake-3.16.4-Linux-x*6_64/bin/cmake /usr/local/bin/cmake

Alternatively you can build from source and install but this takes a bit longer. You will have to do this if you are using a non x86_64 processor.

With these two changes to ruby and cmake, we are in business.

There is one pending commit to sonic pi on github which make the process of the build even quicker.

While I was at it I also built SuperCollider 3.10.4 and sc3-plugins 3.10.0 to gp with it.

Now to sort out a writeup of how to do it…

thanks @robin.newman for all your work. The ubuntu 18.04 version is a Long Term Support version until 2023. So your work is very useful for people with little configuration.
At the end of April, the next 20.04 LTS version will be launched.
Good luck !

Yes the versions of ruby and cmake installed in Ubuntu 18.04 by apt seems to be lagging the needed ones for building sonic-pi now.
I found an alternative way of installing using asdf that you may try. I followed the docs here.

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.7
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc

After this you need to start a new shell to get asdf into the PATH. You may have to install some plugin dependencied too.
Then you can add the needed plugins and install the new versions of cmake and ruby.

asdf update  # Just to make sure we run the latest asdf
asdf plugin-add cmake https://github.com/srivathsanmurali/asdf-cmake.git
asdf install cmake 3.17.0
asdf plugin add ruby
asdf install ruby 2.6.3  # Or latest which is 2.7.0

You will need a some patience since the install procedure involves building the installs. After installation you have to start a new shell again. If you install several different versions of ruby/cmake you can check the asdf documentation for adding a .tool-versions file to your project root.
I was able to build sonic-pi after this, the unix scripts in app/gui/qt seem to work just fine.

cd app/gui/qt/
./unix-prebuild.sh
./unix-config.sh
cd build/
make
./sonic-pi

asdf supports installation of different erlang versions too, if one installs that plugin, but I think the one shipping with Ubuntu works fine and saves the compiling time. You may also find latest versions of Erlang packages both for Ubuntu and raspbian here.

@mrkarlsson - which version of Ruby ships by default with Ubuntu 18.04?