6.5.5 Installation on Mac OS X 10.8.3

Hi,

I have configured and built version 6.5.5 on Mac OSX 10.8.3 with all optional libraries provided by Macports.

There were a couple of issues I've encountered and have overcome, this post is mainly to raise these issues and also to provide my workarounds for anyone else trying to get it to build on 10.8.

I had 2 groups of problems, the first was getting build_configure to work and the second was a conflict with TBB library.

Before running build_configure:

-edit configure.ac and replace AM_CONFIG_HEADER with AC_CONFIG_HEADERS:

#AM_CONFIG_HEADER(config.h)
AC_CONFIG_HEADERS(config.h)

-edit configure.ac and remove AM_C_PROTOTYPES:

#AM_C_PROTOTYPES

-edit build_configure and replace libtoolize with glibtoolize

#libtoolize --force --copy --automake || exit 1
glibtoolize --force --copy --automake || exit 1

-build_configure can be run now, this will complete with the following warning being generated for each instance of Makefile.am:
e.g.
Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Theres talk that support for $(INCLUDES) in Automake version 1.13 wills be removed, however it seems fine for now I guess.

Final configuration that worked:

./configure CPPFLAGS=-I/opt/local/include --prefix=/usr/local --x-libraries=/opt/local/lib --x-includes=/opt/local/include --with-freetype=/opt/local --with-ftgl=/opt/local --with-gl2ps=/opt/local --with-freeimage=/opt/local --with-tbb-include=/opt/local/include/tbb --with-tbb-library=/opt/local/lib --with-qt=/opt/local --enable-debug=no --enable-production=yes

*CPPFLAGS is needed because --x-includes doesn't seem to be accepted by the configure script properly.

Once configured I've run "make" and came across one building problem:

File Standard_MMgrTBBalloc.cxx failed to compile when HAVE_TBB is defined. The root cause is the predefined string named VERSION conflicts with an enumeration declaration of the same name within tbb/scalable_allocator.h file.

The compiler error reported is as follows:

In file included from ../../../src/Standard/Standard_MMgrTBBalloc.cxx:31:
/opt/local/include/tbb/scalable_allocator.h:115: error: expected identifier before string constant
/opt/local/include/tbb/scalable_allocator.h:115: error: expected `}' before string constant
… etc …
make[3]: *** [Standard_MMgrTBBalloc.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I have overcome this problem by editing the file Standard_MMgrTBBalloc.cxx to un-define the string VERSION just before the inclusion of the tbb header.

Undefine VERSION before the inclusion of tbb/scalable_allocator.h file in src/Standard/Standard_MMgrTBBalloc.cxx:

// paralleling with Intel TBB
#ifdef HAVE_TBB

// Un-defining VERSION to overcome the tbb header conflict
#ifdef VERSION
#undef VERSION
#endif

#include
using namespace tbb;
#else
#define scalable_malloc malloc
#define scalable_calloc calloc
#define scalable_realloc realloc
#define scalable_free free
#endif

This is hack to get it working, however it compiles without a problem, so I'm guessing the original un-defined string "VERSION" is not used anywhere after the TBB header inclusion.

I read the thread talking about the availability of version 6.5.6 beta, which provides more support for Mac OSX, but I can't seem to find it in the Download Center.

Deniz Eren's picture

I Posted before the long compile had completed, I've got more errors:

../../../src/Draw/Draw_Window.cxx: In destructor 'virtual Draw_Window::~Draw_Window()':
../../../src/Draw/Draw_Window.cxx:317: error: 'XFreePixmap' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::Init(Standard_Integer, Standard_Integer, Standard_Integer, Standard_Integer)':
../../../src/Draw/Draw_Window.cxx:361: error: 'XCreateWindow' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:363: error: 'XSelectInput' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:375: error: 'XCreateGC' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:377: error: 'XSetPlaneMask' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:379: error: 'XSetForeground' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:381: error: 'XSetBackground' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:386: error: 'XChangeWindowAttributes' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:389: error: 'XSetLineAttributes' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::InitBuffer()':
../../../src/Draw/Draw_Window.cxx:400: error: 'XFreePixmap' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:403: error: 'XGetWindowAttributes' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:404: error: 'XCreatePixmap' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:408: error: 'XFreePixmap' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::StopWinManager()':
../../../src/Draw/Draw_Window.cxx:421: error: 'XGetWindowAttributes' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:442: error: 'XCreateWindow' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:449: error: 'XSelectInput' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::SetPosition(Standard_Integer, Standard_Integer)':
../../../src/Draw/Draw_Window.cxx:463: error: 'XMoveWindow' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::SetDimension(Standard_Integer, Standard_Integer)':
../../../src/Draw/Draw_Window.cxx:474: error: 'XResizeWindow' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::GetPosition(Standard_Integer&, Standard_Integer&)':
../../../src/Draw/Draw_Window.cxx:485: error: 'XGetWindowAttributes' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'Standard_Integer Draw_Window::HeightWin() const':
../../../src/Draw/Draw_Window.cxx:499: error: 'XGetWindowAttributes' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'Standard_Integer Draw_Window::WidthWin() const':
../../../src/Draw/Draw_Window.cxx:513: error: 'XGetWindowAttributes' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::SetTitle(const char*)':
../../../src/Draw/Draw_Window.cxx:525: error: 'XStoreName' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'char* Draw_Window::GetTitle()':
../../../src/Draw/Draw_Window.cxx:535: error: 'XFetchName' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In static member function 'static Standard_Boolean Draw_Window::DefineColor(Standard_Integer, const char*)':
../../../src/Draw/Draw_Window.cxx:556: error: 'XParseColor' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:558: error: 'XAllocColor' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::DisplayWindow()':
../../../src/Draw/Draw_Window.cxx:576: error: 'XMapRaised' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:578: error: 'XFlush' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::Hide()':
../../../src/Draw/Draw_Window.cxx:587: error: 'XUnmapWindow' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::Destroy()':
../../../src/Draw/Draw_Window.cxx:596: error: 'XDestroyWindow' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:600: error: 'XFreePixmap' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::Clear()':
../../../src/Draw/Draw_Window.cxx:615: error: 'XGetGCValues' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:616: error: 'XSetForeground' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:617: error: 'XFillRectangle' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:622: error: 'XClearArea' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In static member function 'static void Draw_Window::Flush()':

../../../src/Draw/Draw_Window.cxx:632: error: 'XFlush' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::DrawString(int, int, char*)':
../../../src/Draw/Draw_Window.cxx:641: error: 'XDrawString' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::DrawSegments(Segment*, int)':
../../../src/Draw/Draw_Window.cxx:650: error: 'XDrawSegments' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::Redraw()':
../../../src/Draw/Draw_Window.cxx:665: error: 'XCopyArea' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::SetColor(Standard_Integer)':
../../../src/Draw/Draw_Window.cxx:675: error: 'XSetForeground' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::SetMode(int)':
../../../src/Draw/Draw_Window.cxx:684: error: 'XSetFunction' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'Standard_Boolean Draw_Window::Save(const char*) const':
../../../src/Draw/Draw_Window.cxx:694: error: 'XSync' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:698: error: 'XGetWindowAttributes' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:704: error: 'XRootWindowOfScreen' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:710: error: 'XTranslateCoordinates' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:739: error: 'XCreateImage' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:743: error: 'XGetSubImage' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In member function 'void Draw_Window::Wait(Standard_Boolean)':
../../../src/Draw/Draw_Window.cxx:897: error: 'XSelectInput' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:901: error: 'XSelectInput' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In function 'void ProcessEvents(void*, int)':
../../../src/Draw/Draw_Window.cxx:924: error: 'XPending' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:929: error: 'XNextEvent' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In function 'Standard_Boolean Init_Appli()':
../../../src/Draw/Draw_Window.cxx:1071: error: 'XDisplayName' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:1078: error: 'XSynchronize' was not declared in this scope
../../../src/Draw/Draw_Window.cxx:1082: error: 'XSetInputFocus' was not declared in this scope
../../../src/Draw/Draw_Window.cxx: In function 'void GetNextEvent(Event&)':
../../../src/Draw/Draw_Window.cxx:1109: error: 'XNextEvent' was not declared in this scope
make[3]: *** [Draw_Window.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Roman Lygin's picture

Hi Deniz,

Thank you for sharing your experience.
As for TBB's VERSION clash - I reported issue to my colleagues in the Intel TBB team a while ago and it has already been fixed in the recent Intel TBB 4.0 Update3 (available for download at http://threadingbuildingblocks.org/). The VERSION macro leaked into late TBB3.0.x versions. Open CASCADE has been officially claiming support for version 3.0, that's why it has not been encountered so far.

The easiest way would be to upgrade to 4.0.3 and above.

Hope this helps.
Roman