Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Installation and building / OCC 6.2 on Mac OSX patches and build scripts

OCC 6.2 on Mac OSX patches and build scripts

OCC 6.2 on Mac OSX patches and build scripts
Torsten Sadowski 2007/05/15 16:12
Hi,

I updated my patches to OpenCASCADE 6.2. As usual you need a Linux install first from which you can copy.

I came across 2 special problems:

In the file Standard_ErrorHandler.cxx I had to use a C type cast:

return (Standard_Integer)pthread_self();

The return value is a pointer to a struct so casting might or might not be dangerous. So far I did not try multithreading.

MMGT_OPT is disabled for __APPLE__ in Standard.cxx. I reenabled it and it seems that mmap()ed memory management is working.

Cheers, Torsten
jacob 2007/09/15 10:06
Hi,

is there a universal build for Mac OX version for opencacade.


Jacob.
Torsten Sadowski 2007/09/17 20:49
Hi Jacob,

why do you need a universal build for a source package?

Cheers, Torsten
Sylvain Marie 2007/09/25 23:58
Hi,

I also need the universal build of OCC 6.2 :-) Some of our clients are still PPC based and other switched on I386 already.

BTW Torsten thank you for the patches ! :-) They work well if the exotic Comp build from OCC is used (but create only i386 binaries).

I tried to use "configure" on the patched src tree, with the parameters mentioned on the apple tech note (http://developer.apple.com/technotes/tn2005/tn2137.html) to create universal binaries, but for some reason only the i386 architecture is created.

Any hint ?

Thank you in advance.
Sylvain
Torsten Sadowski 2007/09/26 20:03
Hello Sylvain,

which binary is created depends on the build machine. But, could you try to add " -arch i386 -arch ppc" to the sed lines in OpenCASCADE_darwin.sh and try out what happens?

Cheers, Torsten

P.S. What are you doing with OCC?
Sylvain Marie 2007/10/02 14:00
Hi Torsten,

[ Sorry for the late answer. It seems that the automatic notification system didn't work :-/ ]

Thanks for the tip, I now get fat binaries ! :-)

However, I now must find a way to set their "install_name" property to something like @executable_path/../Frameworks/... instead of the current /var/tmp//cc7IslRW.out

As my last experience with sed and reg exps was a long time ago, I need to refresh my skills before sending you the updated OpenCASCADE_darwin.sh with proper install names :-)

OCC 6.2 is used to port the HumanCAD software on Macs (http://www.nexgenergo.com/ergonomics/humancad.html)

Sylvain
Torsten Sadowski 2007/10/09 20:47
Hello Sylvain,

do you get this strange install_name when you run my scripts? If this is the case you need to run the install_name_tool right after linking the libraries. The later libraries take the install names from the libraries they are linked against. To make this a bit more clear:

g++ -o libTKernel.dylib .....
install_name_tool -id @executable_path/../Frameworks/libTKernel.dylib
g++ -o libTKMath.dylib ... -lTKernel ...
install_name_tool -id ...

Cheers, Torsten

P.S. sed is tough but its the only tool I know to do the job
Sylvain Marie 2007/10/16 21:35
Hi Torsten,

After quite a few trials, I got sed to patch the makefile to set the install_path :-)

The modified file is OpenCASCADE_darwin.sh.
I can't find a way to attach a file on this forum, so I'm pasting the modified file here.
Please feel free to update your distribution on your webpage (if you're pleased with the touch up, of course)

----------------------------------------------------------------------------------------------------------------
#!/bin/sh

mkdir -p $CASROOT/adm/`uname`/

mkdir -p $CASROOT/Darwin/lib
ln -s $CASROOT/Darwin/lib/ $CASROOT/Darwin/Frameworks

cd $CASROOT/adm/Linux/

for text_file in *
do
     echo "Editing file $text_file"
     sed -e 's/Linux/Darwin/g' -e 's/COMP/XCOMP/g' \
          -e 's/-DLININTEL/-gdwarf-2 -arch i386 -arch ppc/g' \
          -e 's/-DLIN//g' \
          -e 's?-I${JAVAHOME}/include/linux?-I${JAVAHOME}/Headers -I${X11_INCLUDE} ?g' \
          -e 's/-shared/-dynamiclib -Wl,-single_module -arch i386 -arch ppc/g' \
          -e 's/\.so /\.dylib /g' \
          -e 's?-L/usr/X11R6/lib?-L/usr/X11R6/lib -lX11?g' \
          -e 's/-MD//g' \
          -e 's/[a-zA-Z0-9]*\.dylib/& -install_name @executable_path\/\.\.\/Frameworks\/& -Wl,-executable_path \${CASROOT}\/Darwin\/lib/g' \
          $text_file > ../`uname`/$text_file
#     mv -f temp $text_file
done

cd ../Darwin

sed -e 's/-ldl/-ldl -L${X11_LIB} -lX11/g' TKDraw.lnk > temp
mv temp TKDraw.lnk
sed -e 's/-ldl/-ldl -L${X11_LIB} -lX11/g' DRAWEXE.lnk > temp
mv temp DRAWEXE.lnk

cd ../../..

----------------------------------------------------------------------------------------------------------------
Michael Rice 2007/12/08 20:26
Hi Torsten -

Could you please let me know where I can download your patches for Mac? I'd like to get OCC 6.2 built on Leopard.

Thanks.
Michael
Torsten Sadowski 2007/12/15 15:54
Hi Michael,

sorry for the late reply.

The patches are found here:

http://keepcool.kup.tu-berlin.de/public/mitarbeiter/sadowski/OCC62_Mac_Install.tar.gz

I have not yet had time to add the universal build changes.

Cheers, Torsten
 
 
Latest news
  • Open CASCADE Technology 6.7.0 is available for download!
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map