[PD-dev] building fluid~ on Linux (was: [PD] fluid~ for Pd-Vanilla - test version)

Roman Haefeli reduzent at gmail.com
Fri Jan 8 10:16:45 CET 2021


I took the liberty to move this over to pd-dev

On Fri, 2021-01-08 at 03:48 -0300, Alexandre Torres Porres wrote:
> Em qui., 7 de jan. de 2021 às 20:07, Roman Haefeli <
> reduzent at gmail.com> escreveu:
> > On Thu, 2021-01-07 at 00:14 -0300, Alexandre Torres Porres wrote:
> > 
> > > we still need to sort this for linux,
> > 
> > Since you seem you got it sorted (and I figured out how to compile
> > fluidsynth with no additional deps)
> 
> how did that go?

I just updated pd-fluidsynth repo to get your and Lucas' most recent
changes. I didn't have to modify anything for the build process to
work.

~~~sh
cd pd-fluidsynth
make pkglibdir=$HOME/pd-src/workspace/Linux-arm7-32
make pkglibdir=$HOME/pd-src/workspace/Linux-arm7-32 install
cd $HOME/pd-src/workspace/Linux-arm7-32/fluid~
sh linuxdep32.sh
rm linuxdep32
~~~ 

However, the crucial part is that the included libfluidsynth.so should
not be "tainted" with support for all kinds of things. This means, you
can't take the one shipped by the distro.

>  Can you describe the steps and put it in our readme (with a PR)?

You mean what steps were necessary to compile fluidsynth? I didn't have
to do anything suprising or special. I just had  to figure out how to
disable everything by reading the docs about building. This is what I
came up with (I hope it is correct and complete):

~~~sh
git clone https://github.com/FluidSynth/fluidsynth/
cd fluidsynth
mkdir build
cd build
cmake -Denable-libsndfile=off -Denable-jack=off -Denable-alsa=off -Denable-oss=off -Denable-pulseaudio=off -Denable-ladspa=off -Denable-aufile=off  -Denable-network=off  -Denable-ipv6=off -Denable-getopt=off -Denable-sdl2=off ..
make
sudo make install
~~~

After this, I compiled fluid~ with steps from above.

Regarding the makefile of pd-fluidsynth, I don't understand the purpose
of this section:

---
define forLinux

ifeq ($(firstword $(subst -, ,$(shell $(CC) -dumpmachine))), i686)
        datafiles += scripts/linuxdep32.sh
        else
        datafiles += scripts/linuxdep64.sh
endif

endef
---

Depending on which arch is detected, it'll add one or the other script
in the build result. I think what this is meant to do is to _execute_
the arch specific script, so that libraries get included. I'm not yet
familiar with makefiles to tell you just right away how this is done,
but according to the snippet, I'd suppose something like this:

---
define forLinux

ifeq ($(firstword $(subst -, ,$(shell $(CC) -dumpmachine))), i686)
        $(shell /bin/sh scripts/linuxdep32.sh)
        else
        $(shell /bin/sh scripts/linuxdep32.sh)
endif

endef
--- 

In order to include the additional dynamic libraries, you'd add
'libfluidsynth.so*' to 'datafiles'.

However, the above detection fails for arm7 and it'll wrongly executes
scripts/linuxdep64.sh. I think instead of an if-else, it could detect
the arch and execute the appropriate script with arch in the name. If
the scripts for several archs turn out to be the same, they could be
symlinked. Just an idea. 

Another thing about scripts/linuxdep*.sh script. I think they should
call cp with the -d flag. Without it, it creates three full copies of
the same .so file. With -d symlinks are preserved.

I realize it's a lot of suggestions. Sorry for that. So maybe a PR
would be easier for you to digest. Thing is I don't feel yet
sufficiently confident with these matters, but am happy to learn.

Roman





-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20210108/61e1c5cb/attachment.sig>


More information about the Pd-dev mailing list