iainctduncan/csound_max

Is this external relocatable?

shakfu opened this issue · 12 comments

Hi Iain,

Just saw your video. Very cool project / iterations over Victor Lazzarini's previous work. Nicely done!

A quick question, does this external statically link to the csound library? If not, may I make a small feature request to have that as an option, since it would be very nice to include a self-contained csound engine in a standalone or package.

Thanks. Just started enjoying Scheme for Max and the efforts you made to get it working for time-critical use cases. This is another rabbit hole (-:

thanks! I need to look into the linking options, I don't know whether I can do that with the Csound license or not. But I agree, that would be nice to have. Thanks for checking out the stuff!

I think the main issue with that is that the size of the file would increase a lot + add the overhead of having to update the object after every Csound release. I think it is compatible with the Csound license though since that is what often happens when distributing VST/AU/AAX plugins built with Cabbage.
Would also be great to have csound embedded into the object from the start though (at least for releases), would really help move this towards the ideal csound~ object that I was wishing for for years since I started using the other legacy one

In my py-js project, i have a number of build variations possible for the external. In this case, you can have the default to be dynamically linked and a 'relocatable' statically-linked version for standalones and packages.

Yeah that's what I was thinking. I just need to learn more about how the csound library linking works and check out options. Rory does something similar I believe for Cabbage for M1.

I had a quick look at the csound code on github

The build system uses cmake and you can 'optionally' also build csound statically as follows:

mkdir build
cmake -DBUILD_STATIC_LIBRARY=ON ..
make

You'll find libcsnd6.a and libCsoundLib64.a in the build directory

oh great! if anyone wants to submit a PR for improving the CMake files to allow this, you are welcome to. Otherwise I'll get to it in the next week or so. I would really like there to be a one click install available for all windows, intel mac, and M1 mac.

@iainctduncan

Hi I recently found some time to make a relocatable version for macOS with this fork. It's only tested on x86_64 so far.. and not a lot of testing outside of my homebrew-based setup.

Excellent! I am just wrapping up my term and then was actually planning on getting back to this after that. But if you are able to help I would be more than happy to give you commit rights. Is your fork also a universal binary for M1 or intel?

Hi Iain,

Thanks for your feedback. I've only tested it on an intel mac so far, but I don't see any reason why it wouldn't also build on Apple silicon machines. I'm away from my M1 laptop for a while so this is not going to happen soon.

Also note that while there's an option in the root CMakeLists.txt to enable universal binary builds, the dependencies will also have to be universal and I don't think this is the case for Homebrew packages which are typically only built as native. In any case, if it's too much of a pain produce a universal binary, one can just release native builds.

Just wanted to update this thread to add that I have put a universal binary for intel Mac now. (not rellocatable though)

shakfu commented

Hi Iain,

Thanks for the update. Does that mean that the universal binary now works on both intel Macs and apple silicon Macs?