Porting Sonic Pi to OpenBSD

Hey there!

Over the past week I’ve been working on porting Sonic Pi to OpenBSD.

The first part was getting SuperCollider run on OpenBSD. That was not too hard actually, just a few changes here and there…

Then vcpkg… This one was a mess, as it took me a while to even understand how it works (building vcpkg actually downloads another repository - vcpkg-tools - that I had to modify as well, and then I had to tell vcpkg to fetch the modified copy) but it seems to work now.

I’ll prepare the necessary patches and contribute back to these projects, so they should build smoothly in the future.

Now Sonic Pi, I would have expected it to be easier, but the whole build system is very hairy… I think I am quite close, but I also feel like I am stuck.

The issue I am currently facing is…

Consolidate compiler generated dependencies of target sonic-pi
[ 74%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/mainwindow.cpp.o
[ 75%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/utils/sonicpi_i18n.cpp.o
[ 75%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/sonic-pi_autogen/EWIEGA46WW/qrc_help_files.cpp.o
[ 76%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/sonic-pi_autogen/EWIEGA46WW/qrc_info_files.cpp.o
[ 76%] Linking CXX executable sonic-pi
ld: error: unable to find library -lrt
c++: error: linker command failed with exit code 1 (use -v to see invocation)

So it is trying to link to librt which does not exist on OpenBSD. I’ve been trying for hours to find where this dependency comes from, but I can’t seem to find it. I tried removing the dependency on flac from within aubio, but it doesn’t help.

Somehow the build system thinks it should tell the linker to link to this librt thing. I searched for this flag all over the place, but honestly, it is also hard to grep (grepping for “-lrt” or “lrt” is not enough, since the linked libraries are sometimes passed without the -l flag, so I should grep for “rt” - but good luck with that in stch a huge repo…)

The build/gui/qt/CMakeFiles/sonic-pi.dir/link.txt file is auto-generated and contains this dependency indeed. I try editing this link.txt file, but it gets regenerated on every new build, so my change gets lost.

The question is - where does this dependency really come from so I can remove it?

Any hints are welcome, this is driving me crazy…

Hi @ibz - this is amazing effort, thank-you so much. All the projects you end up contributing back to will be grateful - I’m sure.

With respect to Sonic Pi - would it be possible to take this discussion over to GitHub so we can keep dev related conversation separate from more general user help and support?

We’ve been working hard to make our build less hairy (it was a lot more gnarly) but as you can see we still have some way to go and your support here will be very much welcome.

True, GitHub is probably better, just didn’t want to open an issue just to ask a question, but I think it makes sense to have all the history there.

1 Like