sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.76k stars 921 forks source link

How to build the latest dev version from sources ? An "arch" way :-) #3008

Closed nlebellier closed 2 years ago

nlebellier commented 2 years ago

@nlebellier Yes, you need to build from sources. But it's not necessarily that hard! I use Arch, not Manjaro, and on my computer the instructions in BUILD-LINUX.md worked well.

This is getting off topic for this Issue, but if you'd like to create a new Issue, I would be happy to help you figure this out, and maybe even document the process for other Arch/Manjaro users—in particular, which packages need to be installed. (note that base-devel is the Arch equivalent of Debian's build-essential)

Originally posted by @pashultz in https://github.com/sonic-pi-net/sonic-pi/issues/2994#issuecomment-1034059507

pashultz commented 2 years ago

Thanks for starting this. @nlebellier , are you able to get started by using the instructions in BUILD-LINUX.md?

I will spin up a virtual machine so I can help test the compilation on a "clean" installation.

nlebellier commented 2 years ago

nope as i haven't the manjaro with me right now

but my main question is what is the equivalent packages for all this stuff in Arch

Build Tools (c++ compiler, cmake, git.) Qt + Dev tools (5.15+) Jack (and pulse-audio-module-jack if you are running Raspberry Pi OS) Ruby + Dev tools (2.5+) Elixir + Dev tools (12.0+) SuperCollider + SC3 plugins cheers

ff-rm commented 2 years ago

Hi guys! I use this list of package to compile last versión off SONIC-PI on Manjaro.

1) Install the build-essentials package of Arch/Manjaro

sudo pacman -Sy base-devel

2) Install all the dependencies that Sonic-pi requires. I'm my case y dont need the package Jack because i use pipewire

Qt + Dev tools (5.15+) Jack (and pulse-audio-module-jack if you are running Raspberry Pi OS) Ruby + Dev tools (2.5+) Elixir + Dev tools (12.0+) SuperCollider + SC3 plugins

sudo pacman -S aubio gcc-libs glibc osmid qscintilla-qt5 qt5-base ruby ruby-activesupport ruby-ffi ruby-gettext ruby-i18n ruby-kramdown ruby-locale ruby-minitest ruby-mocha ruby-multi_json ruby-polyglot ruby-rouge ruby-rugged ruby-sys-proctable ruby-text ruby-treetop sox boost cmake erlang-nox gendesk lua qt5-tools ruby-bundler wkhtmltopdf ruby-rake elixir

For sure i'm duplicating packacges in this step.

3) If you need to install jack audio i personally recomend the Package Cadence and carla

sudo pacman -Sy cadence

4) Then go to

`cd /sonic-pi/app

5) Run the script

./linux-build-all

This script do everithing for you when you have all the dependencies and packages that sonic-pi requires. Wait a few minutes.

6) Then go to

cd /sonic-pi/app/build/gui,/qt

and run the app with this command

./sonic-pi

Remember call Jack before run Sonic-pi. I think its necesary.

Sorry for my english

Cheers

`

pashultz commented 2 years ago

@ff-rm Fantastic, thanks so much for this! I don't believe it should be necessary to start JACK before running Sonic Pi, but it's true that some form of it will need to be installed (JACK 2, JACK 1, or the Pipewire implementation) and also the jack-example-tools package.

I tested compiling on a virtual machine from a clean installation of Arch (booted from liveUSB, ran the archinstall command, chose the Desktop profile with PipeWire and XFCE because I thought that might approximate Manjaro), and my list of required packages is pretty similar to yours. Here are my steps:

  1. install packages pacman -S base-devel cmake elixir git qt5-base qt5-tools rtmidi ruby ruby-rexml sc3-plugins supercollider unzip zip for base-devel, press [enter] to choose [all] then for ttf-font, choose [1] (I doubt this makes a difference)
  2. clone the Sonic Pi repository git clone https://github.com/sonic-pi-net/sonic-pi.git
  3. run the build script cd sonic-pi/app; ./linux-build-all.sh
  4. install one of the three implementations of JACK, along with the example tools. I find PipeWire easiest to work with, at least on my setup: pacman -S jack-example-tools pipewire-jack
  5. run Sonic Pi ./build/gui/qt/sonic-pi

Unfortunately my virtual machine kept running out of memory in the last stages of compilation, so I couldn't completely verify that it worked. (And there's no audio device, so even if it had, I wouldn't have been able to test it properly.) But I think the list of packages in step 1 should be sufficient.

Would any other Arch/Manjaro users be interested in testing? Once it seems to be working for people, we can probably add a section 1.2 on Arch to the BUILD-LINUX.md document, with at least the Pacman command and the jack-example-tools advice.

nlebellier commented 2 years ago

@ff-rm so i tried your method :

After installing the packages, i get this error :

[nlb@manjaro-pi audio]$ cd sonic-pi/app
[nlb@manjaro-pi app]$ ./linux-build-all.sh 
Cloning vcpkg
Clonage dans 'vcpkg'...
remote: Enumerating objects: 10368, done.
remote: Counting objects: 100% (10368/10368), done.
remote: Compressing objects: 100% (8838/8838), done.
remote: Total 10368 (delta 2254), reused 7682 (delta 1477), pack-reused 0
Réception d'objets: 100% (10368/10368), 4.48 Mio | 4.28 Mio/s, fait.
Résolution des deltas: 100% (2254/2254), fait.
Note : basculement sur '1085a57da0725c19e19586025438e8c16f34c890'.

Vous êtes dans l'état « HEAD détachée ». Vous pouvez visiter, faire des modifications
expérimentales et les valider. Il vous suffit de faire un autre basculement pour
abandonner les commits que vous faites dans cet état sans impacter les autres branches

Si vous voulez créer une nouvelle branche pour conserver les commits que vous créez,
il vous suffit d'utiliser l'option -c de la commande switch comme ceci :

  git switch -c <nom-de-la-nouvelle-branche>

Ou annuler cette opération avec :

  git switch -

Désactivez ce conseil en renseignant la variable de configuration advice.detachedHead à false

Mise à jour des fichiers: 100% (8466/8466), fait.
Building vcpkg
Unable to determine a binary release of vcpkg; attempting to build from source.
Downloading vcpkg tool sources
Building vcpkg-tool...
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/nlb/audio/sonic-pi/app/vcpkg/buildtrees/_vcpkg/build/CMakeFiles/CMakeOutput.log".
nlebellier commented 2 years ago

i confirm that i get this error

[nlb@manjaro-pi app]$ ./linux-build-all.sh 
Building vcpkg
Unable to determine a binary release of vcpkg; attempting to build from source.
Building vcpkg-tool...
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/nlb/audio/sonic-pi/app/vcpkg/buildtrees/_vcpkg/build/CMakeFiles/CMakeOutput.log".
ff-rm commented 2 years ago

it's seems that you need Ninja package or something like that

maybe @pashultz pashultz know somenthing about

nlebellier commented 2 years ago

yep !

So ninja package has to be added to the package list :-)

but now i get

Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm, s390x, and ppc64le platforms.

how-to ?

EDIT : export VCPKG_FORCE_SYSTEM_BINARIES=ARM

nlebellier commented 2 years ago

so after about 30 minutes i finally got this

[ 99%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o [100%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_sdl.cpp.o [100%] Linking CXX executable sonic-pi-imgui /usr/bin/ld : ne peut trouver -lbcm_host collect2: erreur: ld a retourné le statut de sortie 1 make[2]: *** [gui/imgui/CMakeFiles/sonic-pi-imgui.dir/build.make:334 : gui/imgui/sonic-pi-imgui] Erreur 1 make[1]: *** [CMakeFiles/Makefile2:345 : gui/imgui/CMakeFiles/sonic-pi-imgui.dir/all] Erreur 2 make: *** [Makefile:91 : all] Erreur 2 [nlb@manjaro-pi app]$ But Sonic pi is launching ;-)

At this moment, no sound but see tomorrow to fix that point

thanks again for your help

rbnpi commented 2 years ago

In the latest state of the dev branch you probably want to disable the imgui build which is not needed. If you look at the pi-prebuild.sh script you will see how the environment variable VCPKG_FORCE_SYSTEM_BINARIES is set there. It is needed for arm based platforms. Also this script and other subsequent ones are called with the -n parameter which disables build of imgui which is just for an example of a different front end for the guy. (see the pi-build-all.sh script for how these are called. Finally, the latest dev builds on Mac and Windows now utilise Qt6 to enable the experimental phoenix live view, which is not necessary for sonic-pi to work. build using Qt6 is enabled in the CMakeLists.txt file in the app folder in the line option(WITH_QT_GUI_WEBENGINE "Include experimental webengine functionality" OFF) By default this is turned off. You would need to build Qt6 to be able to use this. Hope these comments help.

pashultz commented 2 years ago

@nlebellier congratulations! I hope you're able to get the sound working tomorrow. Since you seem to be working on a Raspberry Pi, it's not too surprising that your requirements will be different from mine on x86_64. I wonder how the documentation might best address this. Perhaps we could include different pacman -S lines for each CPU architecture?

@rbnpi Would it make sense for @nlebellier to use the pi-build-all.sh script, rather than linux-build-all.sh? Thanks for your help! It's so good to hear from someone who really understands the build process.

nlebellier commented 2 years ago

hi !

good news : i have now sound :-) and midi and osc ! in sonic pi on Manjaro. image

and via pulseaudio i can easily switch between hdmi, bluetooth device and internal card audio.

It's pretty cool so i close this issue.

How to include this thread into the doc, it's a good question and i'm not feeling legitime to do a pr as i only applied what you say folks !

nlebellier commented 2 years ago

sorry not to have closed this issue @samaaron

samaaron commented 2 years ago

Oh, no worries at all! :-)