iainctduncan / csound_max

csound6~ object for Max/MSP
29 stars 2 forks source link

Is this external relocatable? #2

Open shakfu opened 2 years ago

shakfu commented 2 years ago

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 (-:

iainctduncan commented 2 years ago

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!

Leofltt commented 2 years ago

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

shakfu commented 2 years ago

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.

iainctduncan commented 2 years ago

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.

shakfu commented 2 years ago

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

iainctduncan commented 2 years ago

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.

shakfu commented 1 year ago

@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.

iainctduncan commented 1 year ago

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?

shakfu commented 1 year ago

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.

iainctduncan commented 10 months ago

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

shakfu commented 10 months ago

Hi Iain,

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

iainctduncan commented 10 months ago

Yes, it should. And if it doesn't, please let me know!

Iain

On Mon., Oct. 23, 2023, 8:00 p.m. Shakeeb Alireza, @.***> wrote:

Hi Iain,

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

— Reply to this email directly, view it on GitHub https://github.com/iainctduncan/csound_max/issues/2#issuecomment-1776423072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2OPAKUD7GQ6EOXIF2UU3YA4VNRAVCNFSM5RHIO4HKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZXGY2DEMZQG4ZA . You are receiving this because you were mentioned.Message ID: @.***>