monome / serialosc

multi-device, bonjour-capable monome OSC server
http://monome.org/docs/serialosc/osc
Other
145 stars 31 forks source link

Build instructions for Raspberry Pi #58

Closed samaaron closed 2 years ago

samaaron commented 2 years ago

Hiya,

I just managed to get things to build on my Pi - but it took quite a bit of googling around to figure out how to get it to compile properly.

Would there be any interest in me writing a PR with a short set of build instructions?

Ultimately it would be a breakdown of the following:

#!/bin/bash

WORKING_DIR="$(pwd)"

echo "Fetching dependencies via apt"
sudo apt-get install libudev-dev liblo-dev libavahi-compat-libdnssd-dev

echo "Fetching and building libmonome"
git clone https://github.com/monome/libmonome
cd libmonome/
./waf configure
sudo ./waf install

cd "${WORKING_DIR}"

echo "Fetching and building serialosc"
git clone https://github.com/monome/serialosc
cd serialosc/
git submodule init && git submodule update
CFLAGS=-Wno-error=sign-compare ./waf configure
./waf
sudo ./waf install

cd "${WORKING_DIR}"
artfwo commented 2 years ago

@samaaron we have a similar set of instructions here: https://monome.org/docs/serialosc/raspbian/

you can open a PR against https://github.com/monome/docs to update them. it looks like you additionally had to set CFLAGS=-Wno-error=sign-compare when building serialosc. if there's a problem with building something like libuv that requires changing CFLAGS, I'd suggest fixing the underlying issue though. could you remember what exactly was the problem?

samaaron commented 2 years ago

Oh cool - it's just that I guess I expected build instructions to be in this repo not somewhere else. Perhaps a link to the docs on monome.org in this repo would be handy.

With respect to the error - I totally agree, although I think the issue was within the thirdparty dir, so other than updating the upstream repo, I wasn't sure what could be done. I'm also not in any way in the slightest a c/c++ whizz so I'm aware that any "fixes" I might produce would likely introduce double the number of errors.

samaaron commented 2 years ago

On inspection I can see the libuv version you're symlinking to in the repo is 1.35 when the latest is v1.42.0. I can try updating to that to see if things are fixed. Do you see any issues in that approach?

samaaron commented 2 years ago

OK, so when I tried that I got errors as it seems the build system requires a file called libuv.gyp which appears to refer to a now-deprecated build system. v1.42.0 no longer includes this gyp file so both the submodule checker and the compilation fail.

artfwo commented 2 years ago

On inspection I can see the libuv version you're symlinking to in the repo is 1.35 when the latest is v1.42.0. I can try updating to that to see if things are fixed. Do you see any issues in that approach?

It's fine, we only need to make sure to test any libuv upgrades on win and mac platforms too. Note, that on Linux it's also possible to build serialosc against system libuv, see https://github.com/monome/serialosc/pull/32 .

OK, so when I tried that I got errors as it seems the build system requires a file called libuv.gyp which appears to refer to a now-deprecated build system. v1.42.0 no longer includes this gyp file so both the submodule checker and the compilation fail.

Right, unfortunately libuv only supports autotools and cmake right now, so the solution is to either write a cmake->waf converter (similar to what we currently do with gyp) or do a slightly more major build system overhaul, maybe upgrade it from waf to meson which also supports cmake subprojects.

samaaron commented 2 years ago

Ace, I think this is the way forward then.

I just managed to build serialosc just fine on my Pi by first pulling in libuv with:

sudo apt-get install libuv1-dev

and then changing the configure step to:

./waf configure --enable-system-libuv

This feels like it should be in the RP build instructions and also linked to from this repo.

samaaron commented 2 years ago

monome docs PR: https://github.com/monome/docs/pull/330

tehn commented 2 years ago

i'll add a readme link