[GEM-dev] Re: [PD] PD on Mac-Intel

Cefn Hoile lists.puredata.info at cefn.com
Mon Mar 27 15:15:09 CEST 2006


Thanks IOhannes.

Sounds like gem-dev's a more relevant list for these harder gem  
issues. I'm now subscribed to gem-dev too. I'm still wondering  
whether GCC can be called with a more generous interpretation of the  
C code so it doesn't raise these spurious errors on a codebase which  
is demonstrated to work for GCC3.3.

Anyway I've attached the latest useful looking build files for you to  
look at. This is from the first build attempt described below with  
nil swapped for null64, not the second, abortive one with MMX disabled.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: configDarwin.h
Type: application/octet-stream
Size: 454 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20060327/12357e37/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Make.config
Type: application/octet-stream
Size: 705 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20060327/12357e37/attachment-0001.obj>
-------------- next part --------------

To carry out the first build attempt I executed the global code  
changes you mentioned to check if the nil value is causing the problem.

So I used
perl -pi -e 's/nil/null64/g' `find Pixes/ -type f -name '*.cpp'`
for a global find replace of all files in place switching lowercase  
'nil' for 'null64'.

<BTW>
Can I not just change it at the following line...
Pixes/pix_chroma_key.cpp:277:  const __m64 nil=_mm_setzero_si64();
</BTW>

Then I get as far as...

g++ -c -fPIC -I/Users/cefn/Documents/curiosity/pdplay/pd-intel/ 
pd-0.39-2/src/   -I..   pix_filmQT.cpp -o pix_filmQT.o
pix_filmDarwin.cpp: In member function 'virtual void  
pix_filmDarwin::closeMess()':
pix_filmDarwin.cpp:63: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwin.cpp:63: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwin.cpp:69: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwin.cpp:69: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwin.cpp:75: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwin.cpp:75: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwin.cpp: In member function 'virtual void  
pix_filmDarwin::realOpen(char*)':
pix_filmDarwin.cpp:205: warning: 'OffsetRect' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/Quickdraw.h:2422)
pix_filmDarwin.cpp:205: warning: 'OffsetRect' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/Quickdraw.h:2422)
pix_filmDarwin.cpp:278: warning: 'SetRect' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/Quickdraw.h:2401)
pix_filmDarwin.cpp:278: warning: 'SetRect' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/Quickdraw.h:2401)
pix_filmDarwin.cpp:326: error: 'null64' was not declared in this scope
pix_filmDarwin.cpp:330: warning: 'GetGWorldDevice' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:416)
pix_filmDarwin.cpp:330: warning: 'GetGWorldDevice' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:416)
pix_filmDarwin.cpp: In member function 'virtual void  
pix_filmDarwin::getFrame()':
pix_filmDarwin.cpp:413: error: 'null64' was not declared in this scope
pix_filmDarwin.cpp:424: error: 'null64' was not declared in this scope
make[1]: *** [pix_filmDarwin.o] Error 1
make[1]: *** Waiting for unfinished jobs....
pix_filmYUV.h:150: error: ISO C++ forbids declaration of 'pixStruct'  
with no type
pix_filmYUV.h:150: error: expected ';' before '*' token
pix_filmDarwinYUV.cpp: In member function 'virtual void  
pix_filmDarwinYUV::closeMess()':
pix_filmDarwinYUV.cpp:56: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwinYUV.cpp:56: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwinYUV.cpp:64: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwinYUV.cpp:64: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwinYUV.cpp:72: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwinYUV.cpp:72: warning: 'DisposeGWorld' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmDarwinYUV.cpp: In member function 'virtual void  
pix_filmDarwinYUV::realOpen(char*)':
pix_filmDarwinYUV.cpp:174: warning: 'OffsetRect' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/Quickdraw.h:2422)
pix_filmDarwinYUV.cpp:174: warning: 'OffsetRect' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/Quickdraw.h:2422)
pix_filmDarwinYUV.cpp:207: warning: 'GetGWorldDevice' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:416)
pix_filmDarwinYUV.cpp:207: warning: 'GetGWorldDevice' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:416)
make[1]: *** [pix_filmDarwinYUV.o] Error 1
pix_filmQT.cpp: In member function 'virtual void pix_filmQT::closeMess 
()':
pix_filmQT.cpp:103: warning: 'DisposeGWorld' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmQT.cpp:103: warning: 'DisposeGWorld' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmQT.cpp:109: warning: 'DisposeGWorld' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmQT.cpp:109: warning: 'DisposeGWorld' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmQT.cpp:115: warning: 'DisposeGWorld' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmQT.cpp:115: warning: 'DisposeGWorld' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:226)
pix_filmQT.cpp: In member function 'virtual void pix_filmQT::realOpen 
(char*)':
pix_filmQT.cpp:177: warning: 'CopyCStringToPascal' is deprecated  
(declared at /System/Library/Frameworks/CoreServices.framework/ 
Frameworks/CarbonCore.framework/Headers/TextUtils.h:619)
pix_filmQT.cpp:177: warning: 'CopyCStringToPascal' is deprecated  
(declared at /System/Library/Frameworks/CoreServices.framework/ 
Frameworks/CarbonCore.framework/Headers/TextUtils.h:619)
pix_filmQT.cpp:179: warning: 'FSMakeFSSpec' is deprecated (declared  
at /System/Library/Frameworks/CoreServices.framework/Frameworks/ 
CarbonCore.framework/Headers/Files.h:8967)
pix_filmQT.cpp:179: warning: 'FSMakeFSSpec' is deprecated (declared  
at /System/Library/Frameworks/CoreServices.framework/Frameworks/ 
CarbonCore.framework/Headers/Files.h:8967)
pix_filmQT.cpp:226: warning: 'OffsetRect' is deprecated (declared at / 
System/Library/Frameworks/ApplicationServices.framework/Frameworks/ 
QD.framework/Headers/Quickdraw.h:2422)
pix_filmQT.cpp:226: warning: 'OffsetRect' is deprecated (declared at / 
System/Library/Frameworks/ApplicationServices.framework/Frameworks/ 
QD.framework/Headers/Quickdraw.h:2422)
pix_filmQT.cpp:268: warning: 'GetGWorldDevice' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:416)
pix_filmQT.cpp:268: warning: 'GetGWorldDevice' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:416)
pix_filmQT.cpp: In member function 'virtual void pix_filmQT::getFrame 
()':
pix_filmQT.cpp:316: warning: 'GetGWorld' is deprecated (declared at / 
System/Library/Frameworks/ApplicationServices.framework/Frameworks/ 
QD.framework/Headers/QDOffscreen.h:240)
pix_filmQT.cpp:316: warning: 'GetGWorld' is deprecated (declared at / 
System/Library/Frameworks/ApplicationServices.framework/Frameworks/ 
QD.framework/Headers/QDOffscreen.h:240)
pix_filmQT.cpp:317: warning: 'SetGWorld' is deprecated (declared at / 
System/Library/Frameworks/ApplicationServices.framework/Frameworks/ 
QD.framework/Headers/QDOffscreen.h:254)
pix_filmQT.cpp:317: warning: 'SetGWorld' is deprecated (declared at / 
System/Library/Frameworks/ApplicationServices.framework/Frameworks/ 
QD.framework/Headers/QDOffscreen.h:254)
pix_filmQT.cpp:320: warning: 'GetGWorldPixMap' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:480)
pix_filmQT.cpp:320: warning: 'GetGWorldPixMap' is deprecated  
(declared at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:480)
pix_filmQT.cpp:321: warning: 'GetPixBaseAddr' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:364)
pix_filmQT.cpp:321: warning: 'GetPixBaseAddr' is deprecated (declared  
at /System/Library/Frameworks/ApplicationServices.framework/ 
Frameworks/QD.framework/Headers/QDOffscreen.h:364)
make: *** [Pixes] Error 2


...and in a second build attempt after following your suggestion to  
add the undef to the gcc flags like...

src (501) : export CFLAGS="$CFLAGS -U__MMX__"
src (502) : export CPPFLAGS="$CPPFLAGS -U__MMX__"
src (503) : export CXXFLAGS="$CXXFLAGS -U__MMX__"

I get
make -C Base -f ..//Makefile.subdir -j4
In file included from /usr/lib/gcc/i686-apple-darwin8/4.0.1/include/ 
xmmintrin.h:39,
                  from /usr/lib/gcc/i686-apple-darwin8/4.0.1/include/ 
emmintrin.h:35,
                  from GemSIMD.h:40,
                  from GemSIMD.cpp:1:
/usr/lib/gcc/i686-apple-darwin8/4.0.1/include/mmintrin.h:35:3: error:  
#error "MMX instruction set not enabled"
make[1]: *** [GemSIMD.d] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/lib/gcc/i686-apple-darwin8/4.0.1/include/ 
xmmintrin.h:39,
                  from /System/Library/Frameworks/ 
CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ 
MachineExceptions.h:29,
                  from /System/Library/Frameworks/ 
CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ 
DriverServices.h:32,
                  from /System/Library/Frameworks/ 
CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ 
CarbonCore.h:125,
                  from /System/Library/Frameworks/ 
CoreServices.framework/Headers/CoreServices.h:21,
                  from /System/Library/Frameworks/Carbon.framework/ 
Headers/Carbon.h:20,
                  from GemWinCreateMac.cpp:17:
/usr/lib/gcc/i686-apple-darwin8/4.0.1/include/mmintrin.h:35:3: error:  
#error "MMX instruction set not enabled"
In file included from /usr/lib/gcc/i686-apple-darwin8/4.0.1/include/ 
xmmintrin.h:39,
                  from /System/Library/Frameworks/ 
CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ 
MachineExceptions.h:29,
                  from /System/Library/Frameworks/ 
CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ 
DriverServices.h:32,
                  from /System/Library/Frameworks/ 
CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ 
CarbonCore.h:125,
                  from /System/Library/Frameworks/ 
CoreServices.framework/Headers/CoreServices.h:21,
                  from /System/Library/Frameworks/Carbon.framework/ 
Headers/Carbon.h:20,
                  from GemMan.h:23,
                  from GemSetup.cpp:20:
/usr/lib/gcc/i686-apple-darwin8/4.0.1/include/mmintrin.h:35:3: error:  
#error "MMX instruction set not enabled"
make[1]: *** [GemSetup.d] Error 1
make: *** [Base] Error

Cefn
http://cefn.com

On 27 Mar 2006, at 13:30, IOhannes m zmoelnig wrote:

> hi
>
> i moved this to gem-dev.
>
> Cefn Hoile wrote:
>> Thanks, IOhannes
>>
>> Now building from latest cvs source of the Gem module from
>> cvs.gem.iem.at:/cvsroot/pd-gem
>>
>> Have to change both CFLAGS, CPPFLAGS and CXXFLAGS to include the
>> pd-39_2 source folder, else you get...
>>
>> configure: WARNING: m_pd.h: accepted by the compiler, rejected by the
>> preprocessor!
>>
>> ...or...
>>
>> error: m_pd.h: No such file or directory
>
> configure expects m_pd.h to be in the default search paths.
> this should probably be handled by the "-with-pd" flag to configure  
> (but
> it is not).
>
> it might work if you set the INCLUDES when running configure:
>
> %> INCLUDES="-I/Users/cefn/Documents/curiosity/pdplay/pd-intel/"
> ./configure ...
>
> (this is one line!)
>
> this should save you from the following:
>
>>
>> So for me it was
>> export CFLAGS=-I/Users/cefn/Documents/curiosity/pdplay/pd-intel/
>> pd-0.39-2/src/
>> export CPPFLAGS=-I/Users/cefn/Documents/curiosity/pdplay/pd-intel/
>> pd-0.39-2/src/
>> export CXXFLAGS=-I/Users/cefn/Documents/curiosity/pdplay/pd-intel/
>> pd-0.39-2/src/
>>
>
>> But I run into exactly the same error as before, even with the CVS
>> version.
>>
>> If I run ./configure --disable-SIMD
>> I get the same
>
> what is the output of configure?
> how do Make.config and Base/configDarwin.h look like? (that is: after
> configure)
>
> is there any mention of "mmx" somewhere?
>
>
>>
>> I am now building the latest source from the Gem CVS repository.   
>> Anyone
>> any ideas what options I could throw at GCC version 4 to make  it  
>> more
>> forgiving of these errors, or alternatively, what the error  means  
>> (I'm
>> not an experienced C coder)...
>>
>> g++ -c -fPIC -I/Users/cefn/Documents/curiosity/pdplay/pd-intel/
>> pd-0.39-2/src/   -I..   pix_coloralpha.cpp -o pix_coloralpha.o
>> pix_chroma_key.cpp: In member function 'virtual void
>> pix_chroma_key::processRGBA_MMX(imageStruct&, imageStruct&)':
>> pix_chroma_key.cpp:277: error: expected unqualified-id before numeric
>> constant
>> pix_chroma_key.cpp:288: error: cannot convert 'int' to 'int   
>> __vector__'
>> for argument '2' to 'int __vector__ _mm_cmpeq_pi32(int   
>> __vector__, int
>> __vector__)'
>
> it seems to be a problem with MMX.
>
> however, looking at the code again, it might be that there is a  
> problem
> with variable name "nil" (as defined in line277 of pix_chroma_key.cpp)
> you could try to replace all occurences of "nil" with "null64".
> probably that's all. (if so, you might have to change it in a  
> couple of
> other files too)
>
> if you still get the same errors, then there IS an issue with MMX.
> you might try to add "-U__MMX__" to the gcc-flags.
> or add a a "#undef __MMX__" somewhere at the beginning of Base/ 
> GemSIMD.h
> (line 30 seems to be fine)
>
>
> mfg.ads
> IOhannes



More information about the GEM-dev mailing list