Build instruction for OC5.1 on Mac OS X

Instructions for porting opencascade to OS X (10.3). The intructions to follow are relative to our own testing and environment. The computer used is a dual G5 running OS X.3.

- install fink

- install required packages through fink including tcl, tk, tix, fltk

- uncompress the opencascade source for Intel Linux. We couldn't get the graphical installer to unpackage things on OS X. so we had to switch to Intel Linux to unpack the source code. This is for OpenCascade 5.1. Copy the tarball to OS X and unpack using the command: tar -xvf.

- Use the provided diff file to make modifications in a few source files. NB: I ran the diff between the working OC5 folder and the uncompressed sources. So please make sure that your modify yours considering your own environment and file paths. The left arrow is the modification the right is the original source. Make sure that your put the full path ending with OpenCASCADE5.1/ros as CASROOT in the env.csh file.

- run configure using the installed tcl/tk, the mac java and the X11 gl libraries, as follows:
./configure --with-tcl=/sw/lib --with-tk=/sw/lib --with-gl-include=/usr/X11R6/include --with-gl-library=/usr/X11R6/lib --with-java-include=/System/Library/Frameworks/JavaVM.framework/Headers --prefix=/where/you/want/to/install/
Using the "--prefix" is optional. if not used then the executable by default will be installed in /usr/local/

-upon successful configuration, if you are running csh and want to output to a file, run make as follows:
make |& tee filename

-upon successful make, run a make install
make install |& tee filename

-if everything is done successfully, now you are ready to run the env.csh file to set the environment variables: run "source env.csh" in the Opencascade directory and you are ready to run TTOPOLOGY...

NB: From here there are two major bugs we are trying to fix.
1) memory allocation problem when running extended draw
2) running OC5 from X11 on a remote computer. This only runs locally.

----------------------------------
diff log:
---------

diff -rB ../OpenCASCADE5.1/env.csh ./TEST/OpenCASCADE5.1/env.csh
3c3
---
> setenv CASROOT /disk1/ngamboje/OpenCASCADE5.1/ros
5d4
16d14
32,33c30
---
> setenv TCLHOME $CASROOT/../3rdparty/$OS_NAME/tcltk
35,47c32
---
> if ( $OS_NAME == "SunOS" ) then

diff -rB ../OpenCASCADE5.1/env.ksh ./TEST/OpenCASCADE5.1/env.ksh
32,38c32
---
> if [ $OS_NAME = "SunOS" ] ; then

****************************************************************************
comment: in the following we changed $CC into g++ because for
some reason we were having trouble linking the libraries with libtool
****************************************************************************

diff -rB ../OpenCASCADE5.1/ros/configure ./TEST/OpenCASCADE5.1/ros/configure
6046c6046
---
> archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
6481c6481
---
> shlibpath_var=LD_LIBRARY_PATH
13756,13757c13756
---
> if test -f "$CSF_OpenGlLibs_LIB/libGL.so" ; then

****************************************************************************
comment: in the following we are setting the variable to
$JAVA_INCLUDE because the initial regular expression shell call
does not seem to compile successfully.
****************************************************************************
13790,13798c13789
---
> JAVA_INCLUDE_PLAT=`(find ${with_java_include} -name jni_md.h | sed 's/\.\///' | sed 's/\/jni_md.h//')`
13800,13803d13790
13812,13814d13798

diff -rB ../OpenCASCADE5.1/ros/inc/IncludeLibrary_status.h ./TEST/OpenCASCADE5.1/ros/inc/IncludeLibrary_status.h
4,9d3

diff -rB ../OpenCASCADE5.1/ros/inc/Plugin_Macro.hxx ./TEST/OpenCASCADE5.1/ros/inc/Plugin_Macro.hxx
10c10
---
> #if defined (__hpux) || defined (HPUX)
16,31c16,24
---
>
> #else
> #define PLUGIN(name) \
> extern "C" {Standard_EXPORT Handle(Standard_Transient) PLUGINFACTORY(const Standard_GUID&);} \
> Handle(Standard_Transient) PLUGINFACTORY(const Standard_GUID& aGUID) { \
> return name##::Factory(aGUID);}\
> \
>
> #endif

diff -rB ../OpenCASCADE5.1/ros/inc/Standard_SStream.hxx ./TEST/OpenCASCADE5.1/ros/inc/Standard_SStream.hxx
3d2
6,7c5
-- jules mar 5

---
> #include

diff -rB ../OpenCASCADE5.1/ros/inc/Standard_values.h ./TEST/OpenCASCADE5.1/ros/inc/Standard_values.h
21,23d20
25,28c22,23


---
> # include
> #else

diff -rB ../OpenCASCADE5.1/ros/src/Draw/Draw_Window.cxx ./TEST/OpenCASCADE5.1/ros/src/Draw/Draw_Window.cxx
19d18

diff -rB ../OpenCASCADE5.1/ros/src/FWOSDriver/FWOSDriver.cxx ./TEST/OpenCASCADE5.1/ros/src/FWOSDriver/FWOSDriver.cxx
14,19d13

diff -rB ../OpenCASCADE5.1/ros/src/OSD/OSD_Path.cxx ./TEST/OpenCASCADE5.1/ros/src/OSD/OSD_Path.cxx
15,16c15

---
> //# include

diff -rB ../OpenCASCADE5.1/ros/src/Standard/Standard.cxx ./TEST/OpenCASCADE5.1/ros/src/Standard/Standard.cxx
7,8d6
235,237c233
---
> #if defined(IRIX) || defined(__sgi) || defined(SOLARIS) || defined(__sun) || defined(LIN) || defined(linux)
239,240d234
245,247d238
483,484d473

diff -rB ../OpenCASCADE5.1/ros/src/WOKUnix/WOKUnix_Signal.cxx ./TEST/OpenCASCADE5.1/ros/src/WOKUnix/WOKUnix_Signal.cxx
83,88d82
90c84,87
---
> act.sa_mask.__bits[0] = 0;
> act.sa_mask.__bits[1] = 0;
> act.sa_mask.__bits[2] = 0;
> act.sa_mask.__bits[3] = 0;

Ian Cheong's picture

Jules, does this procedure work with Open Cascade 5.2 on OS X?

Jules's picture

Ian,

This procedure work with Open Cascade 5.1
I have not tested Open Cascade 5.2

Jules