[vtkusers] VTK 5.0.2, Mac OS 10.4.8, xlc

Peter Stihl stihl at cats.rwth-aachen.de
Fri Jan 19 10:20:33 EST 2007


Hi,
I try to build the latest CVS-version of VTK on a PowerPC-cpu with  
IBM xlc.
Unfortunately the following error occurs during building  
vtkMultiThreader.o for vtkCommon (same with gcc works):

[  4%] Building CXX object Common/CMakeFiles/vtkCommon.dir/ 
vtkMultiThreader.o
"/System/Library/Frameworks/CoreFoundation.framework/Headers/ 
CFByteOrder.h", line 39.29: 1540-0064 (S) Syntax error:  ")" was  
expected but ":" was found.
"/System/Library/Frameworks/CoreFoundation.framework/Headers/ 
CFByteOrder.h", line 54.29: 1540-0064 (S) Syntax error:  ")" was  
expected but ":" was found.
make[2]: *** [Common/CMakeFiles/vtkCommon.dir/vtkMultiThreader.o]  
Error 1
make[1]: *** [Common/CMakeFiles/vtkCommon.dir/all] Error 2
make: *** [all] Error 2

My (changed) cmake options are:
BUILD_SHARED_LIBS OFF
CMAKE_CXX_COMPILER /opt/ibmcmp/vacpp/6.0/bin/xlc++
CMAKE_C_COMPILER /opt/ibmcmp/vacpp/6.0/bin/xlc
VTK_OSX_ARCHITECTURES ppc
VTK_USE_CARBON ON

CC and CXX environment variables are set to the xlc bin before  
running cmake.

The mentioned lines of CFByteOrder.h are:

CF_INLINE uint16_t CFSwapInt16(uint16_t arg) {
#if defined(__i386__) && defined(__GNUC__)
     __asm__("xchgb %b0, %h0" : "+q" (arg));
     return arg;
#elif defined(__ppc__) && defined(__GNUC__)
     uint16_t result;
     __asm__("lhbrx %0,0,%1" : "=r" (result) : "r" (&arg),  
"m" (arg));         <------------------------- line 39
     return result;
#else
     uint16_t result;
     result = ((arg << 8) & 0xFF00) | ((arg >> 8) & 0xFF);
     return result;
#endif
}

I'm not familiar with the inline-assembler syntax and the IBM doc  
doesn't give me a clue. When I remove the elif-block there is no  
error at this point, but the build process breaks again the next time  
the __GNUC__ macro is used. Do I have to make sure the __GNUC__ is  
not defined when using xlc? And if so, how? Adding cmake options  
CMAKE_C(XX)_FLAGS -U__GNUC__ doesn't work and I don't want to make  
changes to the gcc limits-file.

Ideas or hints to manage this situation would be great!

Bests,
Peter






More information about the vtkusers mailing list