If you want to skip the compilation process of both OpenCASCADE, GEOM, SMESH and pythonOCC, here are a few precompiled binaries.
Download and install the four following files:
- OpenCASCADE-MacOSX-SL-64.zip (105.5Mb) : extract the content to /Library. After that, you should have the folder /Library/OpenCASCADE/6.3.0/*
- GEOM-5.1.2.7-MacOsx-SL-64.zip (1.5Mb) : extract to /usr/local/lib. Check that the path /usr/local/lib/GEOM-5.1.2.7 contains libraries
- SMESH-5.1.2.2-MacOSX-SL-64.zip (1.2Mb) : extract to /usr/local/lib. Check that the path /usr/local/lib/SMESH-5.1.2.2 contains libraries
- pythonOCC-0.4-MacOSX-SL-64.zip (47.6Mb) : extract to /Library/Python/2.6/site-packages. Check that the path /Library/Python/2.6/site-packages/OCC/* exist
Before you can run pythonOCC, you have to care that a few env variables are defined. Add the following lines to your .bash_profile script :
# OpenCASCADE
export CASROOT=/Library/OpenCASCADE/6.3.0
export OCC_SOURCE_ROOT=${CASROOT}
export DYLD_LIBRARY_PATH=${CASROOT}/lib:$DYLD_LIBRARY_PATH
# needed to get the visualization going…
export CSF_GraphicShr=${CASROOT}/lib/libTKOpenGl.dylib
export CSF_EXCEPTION_PROMPT=1
# OCC required variables
export CSF_IGESDefaults=${OCC_SOURCE_ROOT}/src/XSTEPResource
export CSF_LANGUAGE=us
export CSF_MDTVFontDirectory=${OCC_SOURCE_ROOT}/src/FontMFT
export CSF_MDTVTexturesDirectory=${OCC_SOURCE_ROOT}/src/Textures
export CSF_PluginDefaults=${OCC_SOURCE_ROOT}/src/StdResource
export CSF_SHMessage=${OCC_SOURCE_ROOT}/src/SHMessage
export CSF_StandardDefaults=${OCC_SOURCE_ROOT}/src/StdResource
export CSF_StandardLiteDefaults=${OCC_SOURCE_ROOT}/src/StdResource
export CSF_STEPDefaults=${OCC_SOURCE_ROOT}/src/XSTEPResource
export CSF_UnitsDefinition=${OCC_SOURCE_ROOT}/src/UnitsAPI/Units.dat
# GEOM shared libraries
export DYLD_LIBRARY_PATH=/usr/local/lib/GEOM-5.1.2.7:$DYLD_LIBRARY_PATH
# SMESH shared libraries
export DYLD_LIBRARY_PATH=/usr/local/lib/SMESH-5.1.2.2:$DYLD_LIBRARY_PATH
Then, from a python console, just check the installation is ok (i.e. no linkage errors):
Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from OCC.Standard import *
>>>
Under MacOSX, unless you properly installed PyQt4-X11, you’ll need the python-xlib (0.15rc1 or higher) package in order to use the 3D viewer. You can now run the samples.
The links on this page are broken.
Thanks for your feedback. Links fixed.
Hello,
I tried to follow these instructions and install pythonooc with python-xlib.
The simplest test
from OCC.Standard import * works.
all the other examples fail with
terminate called after throwing an instance of ‘Aspect_GraphicDeviceDefinitionError’
my own script fails with
could not open: FWOSPlugin ; reason: dlopen(libFWOSPlugin.dylib, 1): image not found
MSG:/Users/thomas/Devel/Salome/salomegeometry/tags/5.1.2_v7/src/GEOMImpl/GEOMImpl_IShapesOperations.cpp [142] : GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations
Have you heard of this one before? I’ve followed the OpenCascade forum instructions on the Aspect_GraphicDeviceDefinitionError error, but to no avail.