[SOLVED] Compiling under linux (Ubuntu 23.10 Mantic Minautor)

Hi there!

For those like me that wants to have the last version running on your linux box (I run U23.10), you’ll have to read the (excellent) guide BUILD-LINUX.md that’s in the source of sonic-pi

Unfortunately, at the moment, there’s a bug in the reproc library that prevents the linux build to finish.

You may have an error like it can compile reproc, it will ask you to update vcpkg modules or such.

If you have gcc version 13+…

The problem is not in vcpkg, it’s upstream in reproc: a thread about it like some others : Build failure with gcc 13 · Issue #94 · DaanDeMeyer/reproc · GitHub

digging a bit into this, I finaly understood that reproc has to release things from its main branch because this one is fine.

So what I did, is a really dirty way, because I didn’t have much time to do better to be honest.

Here how I have I built my binaries for sonic-pi:

Do as it’s said on the linux README install file, until it stops with errors complaining about reproc compilation

Move to the downloads directory in app/vcpkg/ :
cd /sonic-pi/app/vcpkg/downloads

Clone the reproc.git locally:
git clone GitHub - DaanDeMeyer/reproc: A cross-platform (C99/C++11) process library

rename the previous downloaded tarball:
ls DaanDeMeyer*
mv DaanDeMeyer-reproc-v14.2.4.tar.gz DaanDeMeyer-reproc-v14.2.4.tar.gz.bak
(adapt this to what the “ls” command shows!)

create a new tarball from the reproc/ directory:
tar cvpf DaanDeMeyer-reproc-v14.2.4.tar reproc/
(adapt the name if the previous ls did not show v14.2.4… !!)

gzip it:
gzip DaanDeMeyer-reproc-v14.2.4.tar
(adapt it ok? (final warning))

Now just by security, delete the whole directory you have in reproc/src of the buldtrees in app/vcpkg:
cd sonic-pi/app/vcpkg/buildtrees/reproc/src
ls
rm -rf v14.2.4-2*
(adapt this v14.2.4-2… to match the directory you see when you do the ls!)

Get back to the compilation directory:
cd sonic-pi/app/

… and re-run the linux script installer (linux-build-all.sh in app/)… It should compile !
./linux-build-all.sh

At least it did on my linux box.

The point is just to trick the installer because it sees an already downloaded tarball it was seeking for, so no need to download it, and in that one, we know for sure it’s all fresh “master” branch of reproc.

If the compilation is OK the last lines you see are:

[ 99%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o
[ 99%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_sdl.cpp.o
[100%] Linking CXX executable sonic-pi-imgui
[100%] Built target sonic-pi-imgui

So you have the sonic-pi binary under
/sonic-pi/app/build/gui/qt

you can go on the top directory:
cd /sonic-pi/

and launch sonic-pi thanks to the wrapper in the bin/ directory:
./bin/sonic-pi

I did the compilation because I only run jackd2 and I don’t have anything pulseaudio and didn’t want too, because that deb you can download will have dependencies on it :confused:

Hope this little thing will help someone out there!

Best,

PS: <3 sonic-pi, I use it for 2 days, and fell in love completely.

Forgot to say that when I have time, I’ll propose a better workaround, this one is ugly…

Best,

JPaul

I think this issue is solved by using a later version of the vcpkg source code to build
see Building v4.5.0 on Linux · Issue #3353 · sonic-pi-net/sonic-pi · GitHub
GitHub - microsoft/vcpkg at 2023.12.12