Csound Csound-dev Csound-tekno Search About

[Cs-dev] bundled supportlibs on OS X

Date2008-11-03 20:32
FromJonatan Liljedahl
Subject[Cs-dev] bundled supportlibs on OS X
I still think it's ugly that the csound installer spreads support-libs
outside the framework, overwriting any existing files, etc...

It should be possible to put them in CsoundLib.framework/Resources/lib
and fix the csound lib and binary to look there instead. This can be
done after build, with dylib bundler:
http://macdylibbundler.sourceforge.net/
(which uses install_name_tool if one wants to use that directly)

Regarding the JACK lib, I think you should drop it. There's no point in
having jack output if the user doesn't have JackOSX installed.
You can use weak linking so that csound still starts without jack beeing
installed: -weak_ljack instead of -ljack

It will crash if one tries to use jack even if it's not installed (of
course), but even this could be avoided by something like this:

void *has_jack = dlsym(RTLD_DEFAULT,"jack_client_open");

if(!has_jack) ...

-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-11-04 12:11
FromVictor Lazzarini
SubjectRe: [Cs-dev] bundled supportlibs on OS X
I see that the Csound command-line frontend (and the other programs)
is linked to a whole bunch of libs in /usr/local/lib. There will be 
trouble there.
SConstruct needs to be fixed so that these are not linked against (except for
libsndfile which is required). Also to make changes to -weak_l.

Right now I don't have the time to chase all these SConstruct issues,
and (more importantly) make sure that the installer works. The major
problem I see is these changes will need extensive testing, which
will require time.

Regarding an UB, how do you solve the plugin issue? Would the Csound
code recognise the different architecture of each dylib and load the 
right one without
any changes to it?

Regards

Victor

At 20:32 03/11/2008, you wrote:
>I still think it's ugly that the csound installer spreads support-libs
>outside the framework, overwriting any existing files, etc...
>
>It should be possible to put them in CsoundLib.framework/Resources/lib
>and fix the csound lib and binary to look there instead. This can be
>done after build, with dylib bundler:
>http://macdylibbundler.sourceforge.net/
>(which uses install_name_tool if one wants to use that directly)
>
>Regarding the JACK lib, I think you should drop it. There's no point in
>having jack output if the user doesn't have JackOSX installed.
>You can use weak linking so that csound still starts without jack beeing
>installed: -weak_ljack instead of -ljack
>
>It will crash if one tries to use jack even if it's not installed (of
>course), but even this could be avoided by something like this:
>
>void *has_jack = dlsym(RTLD_DEFAULT,"jack_client_open");
>
>if(!has_jack) ...
>
>--
>/Jonatan         [ http://kymatica.com ]
>
>-------------------------------------------------------------------------
>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>Build the coolest Linux based applications with Moblin SDK & win great prizes
>Grand prize is a trip for two to an Open Source event anywhere in the world
>http://moblin-contest.org/redirect.php?banner_id=100&url=/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-11-05 08:47
FromJonatan Liljedahl
SubjectRe: [Cs-dev] bundled supportlibs on OS X
Victor Lazzarini wrote:
> I see that the Csound command-line frontend (and the other programs)
> is linked to a whole bunch of libs in /usr/local/lib. There will be 
> trouble there.
> SConstruct needs to be fixed so that these are not linked against (except for
> libsndfile which is required). Also to make changes to -weak_l.

No, you should still link to them and bundle them with
CsoundLib.framework (except libjack since there is a Jackmp.framework,
IMHO), and then use install_name_tool to fix the binaries (and
CsoundLib) to look in /Library/Frameworks/CsoundLib/Contents/lib instead.

> Right now I don't have the time to chase all these SConstruct issues,
> and (more importantly) make sure that the installer works. The major
> problem I see is these changes will need extensive testing, which
> will require time.

I don't know how you make the OS X packages, but if you're using a
separate script to create it then it's just a matter of inserting the
install_name_tool stuff and changing the destination of where the
supportlibs go (liblo, libsndfile, libfltk, libportaudio, libportmidi).

Regarding Jack, it's just a change from "-ljack" to "-weak_framework
Jackmp".

> Regarding an UB, how do you solve the plugin issue? Would the Csound
> code recognise the different architecture of each dylib and load the 
> right one without
> any changes to it?

Yes, I don't think this is a problem. I think the dynamic linker will
load the right one if it exists. And the plugins don't need to be UB for
them to load, as long as they're the right arch. (In the same way as my
app which is linked to an UB CsoundLib will work on systems with
single-arch CsoundLib installed).

> Regards
> 
> Victor
> 
> At 20:32 03/11/2008, you wrote:
>> I still think it's ugly that the csound installer spreads support-libs
>> outside the framework, overwriting any existing files, etc...
>>
>> It should be possible to put them in CsoundLib.framework/Resources/lib
>> and fix the csound lib and binary to look there instead. This can be
>> done after build, with dylib bundler:
>> http://macdylibbundler.sourceforge.net/
>> (which uses install_name_tool if one wants to use that directly)
>>
>> Regarding the JACK lib, I think you should drop it. There's no point in
>> having jack output if the user doesn't have JackOSX installed.
>> You can use weak linking so that csound still starts without jack beeing
>> installed: -weak_ljack instead of -ljack
>>
>> It will crash if one tries to use jack even if it's not installed (of
>> course), but even this could be avoided by something like this:
>>
>> void *has_jack = dlsym(RTLD_DEFAULT,"jack_client_open");
>>
>> if(!has_jack) ...
>>
>> --
>> /Jonatan         [ http://kymatica.com ]
>>

-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-11-05 08:53
FromAnthony Kozar
SubjectRe: [Cs-dev] bundled supportlibs on OS X
I am hoping to look into the possibility myself of making each library in
the supportlibs package an individual installation option.  I would also
consider a system of renaming the Csound-provided libraries and using
symlinks to choose between them and user-installed libraries.

Regarding plugins (and other libraries really), I think that the executable
code of all architectures is merged into one file when you build a universal
binary.

Anthony

Victor Lazzarini wrote on 11/4/08 7:11 AM:

> I see that the Csound command-line frontend (and the other programs)
> is linked to a whole bunch of libs in /usr/local/lib. There will be
> trouble there.
> SConstruct needs to be fixed so that these are not linked against (except for
> libsndfile which is required). Also to make changes to -weak_l.
> 
> Right now I don't have the time to chase all these SConstruct issues,
> and (more importantly) make sure that the installer works. The major
> problem I see is these changes will need extensive testing, which
> will require time.
> 
> Regarding an UB, how do you solve the plugin issue? Would the Csound
> code recognise the different architecture of each dylib and load the
> right one without
> any changes to it?
> 
> Regards
> 
> Victor
> 
> At 20:32 03/11/2008, you wrote:
>> I still think it's ugly that the csound installer spreads support-libs
>> outside the framework, overwriting any existing files, etc...
>> 
>> It should be possible to put them in CsoundLib.framework/Resources/lib
>> and fix the csound lib and binary to look there instead. This can be
>> done after build, with dylib bundler:
>> http://macdylibbundler.sourceforge.net/
>> (which uses install_name_tool if one wants to use that directly)
>> 
>> Regarding the JACK lib, I think you should drop it. There's no point in
>> having jack output if the user doesn't have JackOSX installed.
>> You can use weak linking so that csound still starts without jack beeing
>> installed: -weak_ljack instead of -ljack
>> 
>> It will crash if one tries to use jack even if it's not installed (of
>> course), but even this could be avoided by something like this:
>> 
>> void *has_jack = dlsym(RTLD_DEFAULT,"jack_client_open");
>> 
>> if(!has_jack) ...
>> 
>> --
>> /Jonatan         [ http://kymatica.com ]
>> 
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> Victor Lazzarini
> Music Technology Laboratory
> Music Department
> National University of Ireland, Maynooth
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-12-17 14:58
FromVictor Lazzarini
Subject[Cs-dev] weak linking of Jack
It was suggested that Jack could be weak-linked (see below) and that
Csound would be able to start without the Jack framework being in place.

However, that does not seem to be the case. I have tested it, by
weak linking to the jack framework (-weak_framework Jack) and
then removing the framework and trying to run csound (without
using jack as the IO module). This just crashes straight away.

So for this release I am not changing anything. By the way,
-weak_ljack does not seem to be acceptable by gcc.

Victor

>Regarding the JACK lib, I think you should drop it. There's no point in
>having jack output if the user doesn't have JackOSX installed.
>You can use weak linking so that csound still starts without jack beeing
>installed: -weak_ljack instead of -ljack
>
>It will crash if one tries to use jack even if it's not installed (of
>course), but even this could be avoided by something like this:
>
>void *has_jack = dlsym(RTLD_DEFAULT,"jack_client_open");
>
>if(!has_jack) ...
>
>--
>/Jonatan         [ http://kymatica.com ]
>
>-------------------------------------------------------------------------
>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>Build the coolest Linux based applications with Moblin SDK & win great prizes
>Grand prize is a trip for two to an Open Source event anywhere in the world
>http://moblin-contest.org/redirect.php?banner_id=100&url=/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-12-17 16:21
FromFelipe Sateler
SubjectRe: [Cs-dev] weak linking of Jack
AttachmentsNone  None  None