Building libfluidsynth to include in python package

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Building libfluidsynth to include in python package

Marc Evanstein
Hi all,

I've been building a python framework for algorithmic composition, and
it uses fluidsynth via a slightly tweaked version of the pyfluidsynth
bindings. I'm trying to make it as easy as possible for users to install
my framework (via python's pip package manager) and get it up and
running (on mac, windows, and linux).

I believe the easiest thing for users would be if, especially on windows
and macos, the fluidsynth dll or dylib is contained within and
downloaded alongside the python package. So this means that I would need
a standalone version of libfluidsynth that is bundled along with its
dependencies. (Both a dylib for macos and a dll for windows.)

How would I go about getting / creating these? Am I going about this in
the right way?

Thanks in advance for your help,

Marc


_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building libfluidsynth to include in python package

fluid-dev mailing list
At least for Windows and Mac bundling prebuilt binaries would be a possible way to go. On Linux however you should advise people to install the required packaged via the package manager of their respective distribution.

To get an imagination on how and which libs you need to bundle, see the prebuilt Windows binaries that were released with fluidsynth 2.1.0
 
https://github.com/FluidSynth/fluidsynth/releases/tag/v2.1.0
 
The binaries were compiled from source, for instructions see the wiki:
 
https://github.com/FluidSynth/fluidsynth/wiki/BuildingWithCMake
 
As you'll note, you have to build the binaries for all platforms and architectures that you plan to support. And your python package needs to select the correct binaries depending on the architecture and platform the user is using. Good luck.
 
 
Tom




_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building libfluidsynth to include in python package

fluid-dev mailing list
Marc, please make sure to include the mailing list when replying.

On 3/13/2020 7:43 PM - Marc Evanstein wrote:

>
> Hi Tom -- thanks for your response.
>
> I'm a little unclear: how would I produce something like the prebuilt
> windows binaries that you linked to when building from source? (The
> process of building from source has always been a bit mysterious to me.)
> I followed the instructions at
> https://github.com/FluidSynth/fluidsynth/wiki/BuildingWithCMake, and I
> seem to have done all the steps successfully (installing the
> dependencies, running cmake, running make), but "make install" just
> seems to install it in the system, right? How do I make a standalone
> package?
>
> Thanks,
>
> Marc

The term "standalone" is technically not correct. The binaries that
you build will always have operating system specific dependencies
(e.g. the kernel, the standard C library, socket/networking libs).
That's why I said you need to build fluidsynth on all platforms and
architectures that you plan to support. After each "make" step you put
the libfluidsynth in a zip file (or whatever you plan for
distributing). Additionally, you may include some libraries that
fluidsynth depends on in that zip as well. Most notably: glib. Finding
a good compromise which dependency libraries to bundle and which not
is difficult. To see all the libraries that fluidsynth depends on you
may use the dependency walker on windows. On Linux you may simply
execute ldd libfluidsynth.so

make install installs fluidsynth to the system, yes, so you don't need
that step.

Tom

_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev