Forums > Dev

z_altivec.h error on Leopard


January 1, 2008 | 2:17 pm

I’m using Faust (http://faust.grame.fr/) to make a Max/MSP external. On pre-Mac OS 10.5 systems, everything works fine. However on 10.5 (10.5.1 exactly), and with version 0.9.8.7 of Faust, I get the following error in the Faust compilation steps of even the most simple Faust tutorial-supplied examples:

/usr/local/include/c74support/msp-includes/z_altivec.h:13: error: ISO C++ forbids declaration of ‘vector’ with no type
/usr/local/include/c74support/msp-includes/z_altivec.h:13: error: expected ‘;’ before ‘float’

Any ideas?

Thanks and Happy New Year to all,
Dan

January 1, 2008 | 3:49 pm

Quote: Dan Nigrin wrote on Tue, 01 January 2008 07:17
—————————————————-
> I get the following error in the Faust compilation steps of even the most simple Faust tutorial-supplied examples:
>
> /usr/local/include/c74support/msp-includes/z_altivec.h:13: error: ISO C++ forbids declaration of ‘vector’ with no type
> /usr/local/include/c74support/msp-includes/z_altivec.h:13: error: expected ‘;’ before ‘float’
>
> Any ideas?

There maybe some who know better, but I reckon changing the offending:

vector float

to a more contemporary accelerate framework friendly:

vFloat

may fix your problem. I’m not on Leopard myself so I can’t confirm, but for Altivec/SSE stuff I use exclusively vFloat as it’ll compiles for both intel and ppc correctly in XCode.

Regards,

Alex

January 2, 2008 | 3:29 pm

Thanks Alex, I will try that (not on my 10.5 machine at the moment).

But what puzzles me is why I only get the error on 10.5 – is the compiler used by 10.5 different than that on 10.4? I compile just fine on both PPC and Intel 10.4.11 machines…

Thanks,
Dan

January 7, 2008 | 1:05 pm

Unfortunately this didn’t work – I changed this line:

vector float vFlt;

to

vFloat vFlt;

…but I still got a bunch of errors when compiling. Is this what you meant I should do Alex, or something else? I’m a complete noob when it comes to C, so pardon my ignorance.

Thanks,
Dan

January 7, 2008 | 1:36 pm

Quote: Dan Nigrin wrote on Mon, 07 January 2008 06:05
—————————————————-
> Unfortunately this didn’t work – I changed this line:
>
> vector float vFlt;
>
> to
>
> vFloat vFlt;

Hmmm. Yes – it is. Same errors – or different?

I looked into this a bit more and it seems vFloat may just get replaced with vector float under altivec by the precompiler anyway. There’s some stuff you can find by googling C++ and the error you were getting relating to the vector C++ array – mostly for windows platform, but if you follow the advice about declarations and includes you may sort this. I would guess that some setting or header file is different under Leopard, but no idea what exactly. How are you compiling – in XCode – or otherwise? Also – your compiling exactly the same project from the same files on both platforms?

Alex

January 7, 2008 | 1:50 pm

At 6:36 AM -0700 1/7/08, Alex Harker wrote:
>Quote: Dan Nigrin wrote on Mon, 07 January 2008 06:05
>—————————————————-
>> Unfortunately this didn’t work – I changed this line:
>>
>> vector float vFlt;
>>
>> to
>>
>> vFloat vFlt;
>
>Hmmm. Yes – it is. Same errors – or different?

Different, although I’ve forgotten exactly what they were, and it was
late last night and now I’m at work away from my Leopard machine… I
will post back with them.

>I looked into this a bit more and it seems vFloat may just get
>replaced with vector float under altivec by the precompiler anyway.
>There’s some stuff you can find by googling C++ and the error you
>were getting relating to the vector C++ array – mostly for windows
>platform, but if you follow the advice about declarations and
>includes you may sort this. I would guess that some setting or
>header file is different under Leopard, but no idea what exactly.
>How are you compiling – in XCode – or otherwise?

Otherwise – this is where it gets convoluted. I’m compiling the Max
external using Faust (http://faust.grame.fr), with Max as the target
platform. I believe behind the scenes Faust just uses gcc or
something like that.

>Also – your compiling exactly the same project from the same files
>on both platforms?

Yes.

Thanks for your help thus far,
Dan

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com
http://www.jackosx.com

January 8, 2008 | 1:34 pm

Quote: AlexHarker wrote on Mon, 07 January 2008 08:36
—————————————————-
> Quote: Dan Nigrin wrote on Mon, 07 January 2008 06:05
> —————————————————-
> > Unfortunately this didn’t work – I changed this line:
> >
> > vector float vFlt;
> >
> > to
> >
> > vFloat vFlt;
>
> Hmmm. Yes – it is. Same errors – or different?

Here’s the errors I get with the vFloat approach:

/usr/local/include/c74support/msp-includes/z_altivec.h:13: error: ‘vFloat’ does not name a type
make[1]: *** [mspdir/bandfilter~.mxo] Error 1
make: *** [msp] Error 2

Thanks,
Dan

January 8, 2008 | 1:50 pm

Quote: Dan Nigrin wrote on Tue, 08 January 2008 06:34
—————————————————-

> Here’s the errors I get with the vFloat approach:
>
> /usr/local/include/c74support/msp-includes/z_altivec.h:13: error: ‘vFloat’ does not name a type

Yes – this makes perfect sense – as you won’t be including the accelerate framework with faust – sorry for my intial misunderstanding, I didn’t realise faust was doing the compilation also – I thought it might just be generating code.

Here’s my thoughts:

1 – the header file is probably not broken – looking at faust online it’s including a lot of headers that are probably messing something up on leopard (not sure what exactly)

2 – For faust at least you really don’t need this code to compile correctly – I’m 99.99999% sure it’s never going to be called – it’s a c74 utility function for altivec stuff – given that faust is cross-platform and multi environment there is little chance it’ll be trying to produce any altivec code – nevermind call a max sdk only function.

3 – as you’re not writing your own c++ code I think the simplest (not necessarily best) way is to comment out the whole relevant function and struct definition on your leopard machine (all the way from the line starting typedef union in z_altivec.h to the end of the vec_splat_float definition). You will most likely never need it, and if you do you could copy the code into the relevant external and do it that way. However, this would only ever be necessary if you compile an altivec-based external on a leopard machine that calls the vec_splat_float function, which I think by the sounds of it is pretty unlikely.

I don’t necessarily like this approach, but it’s probably a lot of messing about otherwise to compile code that is not going to be used at all.

Hope this sorts it,

Alex

January 9, 2008 | 3:17 am

>3 – as you’re not writing your own c++ code I think the simplest
>(not necessarily best) way is to comment out the whole relevant
>function and struct definition on your leopard machine (all the way
>from the line starting typedef union in z_altivec.h to the end of
>the vec_splat_float definition). You will most likely never need it,
>and if you do you could copy the code into the relevant external and
>do it that way. However, this would only ever be necessary if you
>compile an altivec-based external on a leopard machine that calls
>the vec_splat_float function, which I think by the sounds of it is
>pretty unlikely.

Thanks Alex, I gave it a try, and now the Faust example objects are
compiling without errors. I’ll need to test ‘em a bit more, but
looks good!

Thanks for your detailed answer and help!

Dan

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com
http://www.jackosx.com

Viewing 9 posts - 1 through 9 (of 9 total)

Forums > Dev