Csound Csound-dev Csound-tekno Search About

[Cs-dev] defining floating-point type in installed headers

Date2010-07-28 16:13
FromVictor Lazzarini
Subject[Cs-dev] defining floating-point type in installed headers
I have a system to help API and plugin developers to build binaries  
for either floats or doubles csound. It goes like this:


1. in sysdep.h  I include the header  "float-version.h"

2. float-version.h is a minimal header that can define USE_DOUBLE or not

3. The installation for doubles version of csound will install float- 
version.h with USE_DOUBLE defined

4. The installation for floats will have a blank float-version.h

5. I have placed a file called float-version-double.h  with USE_DOUBLE  
defined in H/ which can be used by installers to be installed as float- 
version.h

I am testing this in OSX with SConstruct copying float-version- 
double.h as float-version.h to the CsoundLib64.framework. It works  
well for building Loris opcodes, just by selecting the different set  
of headers from the different frameworks.

On other systems, installers can be implemented to do a similar  
operation.

If everyone agrees to this, I can commit it.

Victor



------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-28 19:08
FromSteven Yi
SubjectRe: [Cs-dev] defining floating-point type in installed headers
Hi Victor,

Won't doing this mean one will not be able to compile both a float and
a double lib on the same system? I see how this will set a default for
an installation but I don't see exactly where it allows overriding.

Thanks!
steven



On Wed, Jul 28, 2010 at 11:13 AM, Victor Lazzarini
 wrote:
> I have a system to help API and plugin developers to build binaries
> for either floats or doubles csound. It goes like this:
>
>
> 1. in sysdep.h  I include the header  "float-version.h"
>
> 2. float-version.h is a minimal header that can define USE_DOUBLE or not
>
> 3. The installation for doubles version of csound will install float-
> version.h with USE_DOUBLE defined
>
> 4. The installation for floats will have a blank float-version.h
>
> 5. I have placed a file called float-version-double.h  with USE_DOUBLE
> defined in H/ which can be used by installers to be installed as float-
> version.h
>
> I am testing this in OSX with SConstruct copying float-version-
> double.h as float-version.h to the CsoundLib64.framework. It works
> well for building Loris opcodes, just by selecting the different set
> of headers from the different frameworks.
>
> On other systems, installers can be implemented to do a similar
> operation.
>
> If everyone agrees to this, I can commit it.
>
> Victor
>
>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-28 19:37
FromVictor Lazzarini
SubjectRe: [Cs-dev] defining floating-point type in installed headers
If you install the headers in two different locations (as in OSX),  
then both versions can coexist peacefully. Note that this is for  
installation purposes only and not for Csound core development.
Also, if it does not suit an install system, it can be left alone. For  
OSX, it just works very well.

In linux if headers are installed in

/usr/local/include/csound

we could envisage the double being installed in

/usr/local/include/csound64

or something like that.

Victor

On 28 Jul 2010, at 19:08, Steven Yi wrote:

> Hi Victor,
>
> Won't doing this mean one will not be able to compile both a float and
> a double lib on the same system? I see how this will set a default for
> an installation but I don't see exactly where it allows overriding.
>
> Thanks!
> steven
>
>
>
> On Wed, Jul 28, 2010 at 11:13 AM, Victor Lazzarini
>  wrote:
>> I have a system to help API and plugin developers to build binaries
>> for either floats or doubles csound. It goes like this:
>>
>>
>> 1. in sysdep.h  I include the header  "float-version.h"
>>
>> 2. float-version.h is a minimal header that can define USE_DOUBLE  
>> or not
>>
>> 3. The installation for doubles version of csound will install float-
>> version.h with USE_DOUBLE defined
>>
>> 4. The installation for floats will have a blank float-version.h
>>
>> 5. I have placed a file called float-version-double.h  with  
>> USE_DOUBLE
>> defined in H/ which can be used by installers to be installed as  
>> float-
>> version.h
>>
>> I am testing this in OSX with SConstruct copying float-version-
>> double.h as float-version.h to the CsoundLib64.framework. It works
>> well for building Loris opcodes, just by selecting the different set
>> of headers from the different frameworks.
>>
>> On other systems, installers can be implemented to do a similar
>> operation.
>>
>> If everyone agrees to this, I can commit it.
>>
>> Victor
>>
>>
>>
>> ------------------------------------------------------------------------------
>> The Palm PDK Hot Apps Program offers developers who use the
>> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
>> of $1 Million in cash or HP Products. Visit us here for more details:
>> http://p.sf.net/sfu/dev2dev-palm
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-28 19:46
FromSteven Yi
SubjectRe: [Cs-dev] defining floating-point type in installed headers
Well I think I'd like to see a solution that works across the various
OS's. I wouldn't want to have a program that is compiling against OSX
have to do something different than on Linux or OSX. Currently with
use_double we can use that in the same way across the board.

On 7/28/10, Victor Lazzarini  wrote:
> If you install the headers in two different locations (as in OSX),
> then both versions can coexist peacefully. Note that this is for
> installation purposes only and not for Csound core development.
> Also, if it does not suit an install system, it can be left alone. For
> OSX, it just works very well.
>
> In linux if headers are installed in
>
> /usr/local/include/csound
>
> we could envisage the double being installed in
>
> /usr/local/include/csound64
>
> or something like that.
>
> Victor
>
> On 28 Jul 2010, at 19:08, Steven Yi wrote:
>
>> Hi Victor,
>>
>> Won't doing this mean one will not be able to compile both a float and
>> a double lib on the same system? I see how this will set a default for
>> an installation but I don't see exactly where it allows overriding.
>>
>> Thanks!
>> steven
>>
>>
>>
>> On Wed, Jul 28, 2010 at 11:13 AM, Victor Lazzarini
>>  wrote:
>>> I have a system to help API and plugin developers to build binaries
>>> for either floats or doubles csound. It goes like this:
>>>
>>>
>>> 1. in sysdep.h  I include the header  "float-version.h"
>>>
>>> 2. float-version.h is a minimal header that can define USE_DOUBLE
>>> or not
>>>
>>> 3. The installation for doubles version of csound will install float-
>>> version.h with USE_DOUBLE defined
>>>
>>> 4. The installation for floats will have a blank float-version.h
>>>
>>> 5. I have placed a file called float-version-double.h  with
>>> USE_DOUBLE
>>> defined in H/ which can be used by installers to be installed as
>>> float-
>>> version.h
>>>
>>> I am testing this in OSX with SConstruct copying float-version-
>>> double.h as float-version.h to the CsoundLib64.framework. It works
>>> well for building Loris opcodes, just by selecting the different set
>>> of headers from the different frameworks.
>>>
>>> On other systems, installers can be implemented to do a similar
>>> operation.
>>>
>>> If everyone agrees to this, I can commit it.
>>>
>>> Victor
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> The Palm PDK Hot Apps Program offers developers who use the
>>> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
>>> of $1 Million in cash or HP Products. Visit us here for more details:
>>> http://p.sf.net/sfu/dev2dev-palm
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> The Palm PDK Hot Apps Program offers developers who use the
>> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
>> of $1 Million in cash or HP Products. Visit us here for more details:
>> http://p.sf.net/sfu/dev2dev-palm
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

-- 
Sent from my mobile device

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-28 20:17
FromVictor Lazzarini
SubjectRe: [Cs-dev] defining floating-point type in installed headers
This is a solution that works across all platforms. It depends on the  
packaging and the installers implementing it. Currently I don't even  
know whether the Linux distros support doubles (Fedora does not). In  
fact, OSX is the only platform that allows for both versions to exist  
concomitantly (and for this reason it's important to have a solution).

The current problem is that it is very easy for a front-end or plugin  
developer to link to doubles and forget to add -DUSE_DOUBLE and end up  
with code that does not work with weird error messages. It's very  
unsatisfactory. By implementing this solution, you can keep on  
defining USE_DOUBLE, but if you don't define it, the doubles version  
will also compile because the float-version.h will contain

#ifndef USE_DOUBLE
#define USE_DOUBLE
#endif


Victor

On 28 Jul 2010, at 19:46, Steven Yi wrote:

> Well I think I'd like to see a solution that works across the various
> OS's. I wouldn't want to have a program that is compiling against OSX
> have to do something different than on Linux or OSX. Currently with
> use_double we can use that in the same way across the board.
>
> On 7/28/10, Victor Lazzarini  wrote:
>> If you install the headers in two different locations (as in OSX),
>> then both versions can coexist peacefully. Note that this is for
>> installation purposes only and not for Csound core development.
>> Also, if it does not suit an install system, it can be left alone.  
>> For
>> OSX, it just works very well.
>>
>> In linux if headers are installed in
>>
>> /usr/local/include/csound
>>
>> we could envisage the double being installed in
>>
>> /usr/local/include/csound64
>>
>> or something like that.
>>
>> Victor
>>
>> On 28 Jul 2010, at 19:08, Steven Yi wrote:
>>
>>> Hi Victor,
>>>
>>> Won't doing this mean one will not be able to compile both a float  
>>> and
>>> a double lib on the same system? I see how this will set a default  
>>> for
>>> an installation but I don't see exactly where it allows overriding.
>>>
>>> Thanks!
>>> steven
>>>
>>>
>>>
>>> On Wed, Jul 28, 2010 at 11:13 AM, Victor Lazzarini
>>>  wrote:
>>>> I have a system to help API and plugin developers to build binaries
>>>> for either floats or doubles csound. It goes like this:
>>>>
>>>>
>>>> 1. in sysdep.h  I include the header  "float-version.h"
>>>>
>>>> 2. float-version.h is a minimal header that can define USE_DOUBLE
>>>> or not
>>>>
>>>> 3. The installation for doubles version of csound will install  
>>>> float-
>>>> version.h with USE_DOUBLE defined
>>>>
>>>> 4. The installation for floats will have a blank float-version.h
>>>>
>>>> 5. I have placed a file called float-version-double.h  with
>>>> USE_DOUBLE
>>>> defined in H/ which can be used by installers to be installed as
>>>> float-
>>>> version.h
>>>>
>>>> I am testing this in OSX with SConstruct copying float-version-
>>>> double.h as float-version.h to the CsoundLib64.framework. It works
>>>> well for building Loris opcodes, just by selecting the different  
>>>> set
>>>> of headers from the different frameworks.
>>>>
>>>> On other systems, installers can be implemented to do a similar
>>>> operation.
>>>>
>>>> If everyone agrees to this, I can commit it.
>>>>
>>>> Victor
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> The Palm PDK Hot Apps Program offers developers who use the
>>>> Plug-In Development Kit to bring their C/C++ apps to Palm for a  
>>>> share
>>>> of $1 Million in cash or HP Products. Visit us here for more  
>>>> details:
>>>> http://p.sf.net/sfu/dev2dev-palm
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> The Palm PDK Hot Apps Program offers developers who use the
>>> Plug-In Development Kit to bring their C/C++ apps to Palm for a  
>>> share
>>> of $1 Million in cash or HP Products. Visit us here for more  
>>> details:
>>> http://p.sf.net/sfu/dev2dev-palm
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>> ------------------------------------------------------------------------------
>> The Palm PDK Hot Apps Program offers developers who use the
>> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
>> of $1 Million in cash or HP Products. Visit us here for more details:
>> http://p.sf.net/sfu/dev2dev-palm
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
> -- 
> Sent from my mobile device
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-29 17:26
FromFelipe Sateler
SubjectRe: [Cs-dev] defining floating-point type in installed headers
Attachmentssignature.asc  None  None  
On 28/07/10 15:17, Victor Lazzarini wrote:
> This is a solution that works across all platforms. It depends on the  
> packaging and the installers implementing it. Currently I don't even  
> know whether the Linux distros support doubles (Fedora does not).

Debian has doubles only.

> In  
> fact, OSX is the only platform that allows for both versions to exist  
> concomitantly (and for this reason it's important to have a solution).

I asked a while ago if I should provide both in the debian version, but
the discussion seemed to revolve around wether it was really useful to
have both doubles and floats (in upstream csound, not the debian
packaging) instead of the few technical issues I had detected.
Also, it was not clear that the pain of building both systems was offset
by the benefits of having both.


-- 
Saludos,
Felipe Sateler


Date2010-07-29 18:45
FromVictor Lazzarini
SubjectRe: [Cs-dev] defining floating-point type in installed headers
That is absolutely fine. In this case, you should just install H/float- 
version-double.h as float-version.h, when you prepare the next release.

Victor
On 29 Jul 2010, at 17:26, Felipe Sateler wrote:

> On 28/07/10 15:17, Victor Lazzarini wrote:
>> This is a solution that works across all platforms. It depends on the
>> packaging and the installers implementing it. Currently I don't even
>> know whether the Linux distros support doubles (Fedora does not).
>
> Debian has doubles only.
>
>> In
>> fact, OSX is the only platform that allows for both versions to exist
>> concomitantly (and for this reason it's important to have a  
>> solution).
>
> I asked a while ago if I should provide both in the debian version,  
> but
> the discussion seemed to revolve around wether it was really useful to
> have both doubles and floats (in upstream csound, not the debian
> packaging) instead of the few technical issues I had detected.
> Also, it was not clear that the pain of building both systems was  
> offset
> by the benefits of having both.
>
>
> -- 
> Saludos,
> Felipe Sateler
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net