csound_max icon indicating copy to clipboard operation
csound_max copied to clipboard

Is this external relocatable?

Open shakfu opened this issue 3 years ago • 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 (-:

shakfu avatar Mar 21 '22 10:03 shakfu

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!

iainctduncan avatar Mar 22 '22 00:03 iainctduncan

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

Leofltt avatar Mar 22 '22 23:03 Leofltt

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.

shakfu avatar Mar 23 '22 09:03 shakfu

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.

iainctduncan avatar Mar 23 '22 15:03 iainctduncan

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

shakfu avatar Mar 23 '22 15:03 shakfu

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 avatar Mar 23 '22 18:03 iainctduncan

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

shakfu avatar Apr 22 '23 22:04 shakfu

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?

iainctduncan avatar Apr 24 '23 15:04 iainctduncan

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.

shakfu avatar Apr 24 '23 16:04 shakfu

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

iainctduncan avatar Oct 24 '23 02:10 iainctduncan

Hi Iain,

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

shakfu avatar Oct 24 '23 03:10 shakfu

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

iainctduncan avatar Oct 24 '23 03:10 iainctduncan