Install sonic pi 3.2 dev on ubuntu 18.04 LTS

2.5.1
https://packages.ubuntu.com/bionic/ruby

Yes
/usr/bin/ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]

Cool, and why is that too old to build with?

well i can’ remember but the build process fails as @Robin told us.

I assume we should be able to fix the build then.

As far as I’m concerned, Sonic Pi should work on Ruby 2.4.9 and later.

OK. “It is not working” may be a bit vague, I can agree. I removed the later versions of ruby and tried again with ruby 2.5.1 which “stopped working” “some time ago” :slight_smile: .

app/server/ruby$ ./bin/compile-extensions.rb 
Clearing ./bin/../rb-native/2.5.0
Creating ./bin/../rb-native/2.5.0
Compiling native extension in /home/mikael/work/sonic-pi/app/server/ruby/vendor/fast_osc-1.2.1
/usr/lib/ruby/vendor_ruby/rake/application.rb:680: warning: conflicting chdir during another chdir block
/usr/lib/ruby/vendor_ruby/rake/application.rb:701: warning: conflicting chdir during another chdir block
(in /home/mikael/work/sonic-pi/app/server/ruby/vendor/fast_osc-1.2.1)
rake aborted!
LoadError: cannot load such file -- bundler/gem_tasks
/home/mikael/work/sonic-pi/app/server/ruby/vendor/fast_osc-1.2.1/Rakefile:1:in `<top (required)>'
./bin/compile-extensions.rb:84:in `block (2 levels) in <main>'
./bin/compile-extensions.rb:80:in `chdir'
./bin/compile-extensions.rb:80:in `block in <main>'
./bin/compile-extensions.rb:70:in `each'
./bin/compile-extensions.rb:70:in `<main>'
(See full trace by running task with --trace)

So now noting LoadError: cannot load such file -- bundler/gem_tasks I did to the best of my understanding on the ruby gem
sudo gem install bundler
And then it works. So I guess that there is a dpendency to “bundler” which wasn’t needed before?
When I install ruby 2.6.3 with asdf ibundler is in the installed package.

So checking cmake it is on version 3.10 on Ubuntu 18.04. And lately there are some guards in the CMakeLists.txt that are on a higher version

app/gui/qt$ egrep -r "cmake_minimum_required\(VERSION 3\.[1][1-5]"
external/flac_1_3_3/src/plugin_common/CMakeLists.txt:cmake_minimum_required(VERSION 3.12)
external/flac_1_3_3/src/share/utf8/CMakeLists.txt:cmake_minimum_required(VERSION 3.12)
external/flac_1_3_3/src/CMakeLists.txt:cmake_minimum_required(VERSION 3.11)
external/aubio/CMakeLists.txt:cmake_minimum_required(VERSION 3.12)
external/CMakeLists.txt:cmake_minimum_required(VERSION 3.12)

If I change the versions in those files to 3.10 I can compile with the standard cmake installed on Ubuntu 18,04 but I guess the version numbers are there for a reason. If they could be set to 3.10 or lower it would would work.

I think this dependency on bundler was added by Xavier for building the fast_osc gem. I’m really unsure it’s fully necessary and I’ll look into reverting its requirement. On the other hand, it might actually make sense to require bundler and then use it to manage all the gem dependencies.

Good work. I can confirm that it builds fine with the system ruby now. so you need
ruby ruby-dev and bundler to be installed with apt-get for the ruby side of the build. previously I think there were problems with compile-ruby-extensions with this version, but now that it had changed a bit as have some of the gems to be built it works OK. Bundler is required to build the fast_osc-1.2.1 gem, and is a recent addition to the requirements.
Iteresting that it builds on the system cmake if you alter the required minimum version. I wonder if the earlier version works OK on other platforms.
EDIT
the peculiar thing I found with 19.10 was that you required a much larger size of RAM to build the qrc_help_files.cpp file. It is a large fileI changed the ram allocation to 8Gb. A large swap file would probably have worked too. (You have to bung this up if building on a 1Gb Pi)

OK,
I double checked the cmake changes. It seems it is enough to change the top file ( app/gui/qt/external/CMakeLists.txt ) to get it working:

git diff
diff --git a/app/gui/qt/external/CMakeLists.txt b/app/gui/qt/external/CMakeLists.txt
index a356e5ba9..5dff3c623 100644
--- a/app/gui/qt/external/CMakeLists.txt
+++ b/app/gui/qt/external/CMakeLists.txt
@@ -1,5 +1,5 @@
 # This CMakeLists builds all the external libraries required for a Sonic Pi
-cmake_minimum_required(VERSION 3.12)
+cmake_minimum_required(VERSION 3.10)
 
 message(STATUS " Aubio Builder"

Found the appveyor.yml in the project root. It looks as if can give some directions for needed dependencies and build procedure on Ubuntu 18.04.

1 Like

Hi,

After @robin.newman great work to propose 3.2.1. for rasperry pi, a question is coming : has the way to install the official latest version aka 3.2.1. on an ubuntu 18.04.04 system radically changed or not since the 3.2. dev version ?
Yes @robin.newman, we again need your science :slight_smile:
Cheers

3 Likes