OCC gcc 3.2.1 build

Did someone built OCC with gcc 3.2.1 ?

Mikael Aronsson's picture

Hi !

I have it installed on my Linux box but I have not tried to compile it yet, are you having problems or just interested to here if it works ?

In case of problems, what ?

Mikael

mcff's picture

With some efforts, I succeded to compile it, but
even with the simplest application, I got a seg
fault when creation a visualization area...

So I do not know if I am guilty (because I missed
something during the long build), or if someone else
has the same problem...

Mikael Aronsson's picture

Hi !

Sounds like an OpenGL problem, does other OpenGL applications work without problems ?

Have you checked so all environment variables are correct, this can cause some nasty problems otherwise, does the DRAW application work ?

Mikael

mcff's picture

Hi,

I can not use the precompiled version : it seems
to be compiled with gccXXX (XXXX<3.2). BUT in 3.2,
the ABI has changed (to be C++ norm compliant) : methods prototypes are not mangled the same way with g++3.2 and g++2.95.3...

Did you try to compile a simple app with you
downloaded binaries ? If yes, what is the compiler
version you are using ?

Thanks,

Frederic.

Mikael Aronsson's picture

Hi again !

I have not had the time to compile it myself, but I tried to installed the precompiled version (the one at www.opencascade.com, same as the on eon the CD), I installed it on a RedHat 8.0 and it works fine, I tested the DRAW application only.

Mikael

hugues's picture

Any feedback on this

I am also stuck with not being able to compile OCC with gcc-3.2(-36) that comes with suse8.1,
and therefore I cannot link my app with OCC. It sucks.

What are we supposed to do ?

Go back to earlier version of gcc ?
Go back to ealier version of redhat or suse ?
Try to change the source code blindly ?
Get a new version of OCC (binaries + libs + source) (or just the libs) that has been compiled with gcc 3.2 (preferred of course)

Hugues -

MCV's picture

Check this out:

Suppose that you install OCC 5.0 right now in /opt/OpenCASCADE5.0 and you are in your local home-directory:

Install:
cd /opt/
tar xvfz gcc-2.95.3.tar.gz
==> this creates a directory /opt/gcc-2.95.3

./configure --prefix=/opt/gcc-2.95.3
If some files cause problems (like loop.c)
==> cd gcc/ch
cp loop.c. loop.old.c
Cut away comments in line 321 in loop.c in a text-editor like VI., save and quit it.

cd /opt/gcc-2.95.3
make
make install

Compile an OCC-File (let us call it text.cc), that uses OpenCASCADE-Libraries via #include <...>

Compile test.cc via the command
/opt/gcc/2.95.3/gcc/g++ -I/opt/OpenCASCADE-50/ros/inc -o test test.cc

Your are done !

Do not forget to adapt your system to OpenCASCADE (if you are using bash):
Therefore, you have to add the following to the file".profile":

Look here:
CASROOT=/opt/OpenCASCADE-50/ros
### Need to export this variable CASROOT for correct functioning of OpenCACADE 5.0 ###
export CASROOT
CASROOTINC=$CASROOT/inc
OS_NAME=`uname`
#if ( $?PATH ) then
# export PATH=$CASROOTINC:$CASROOT/../3rdparty/$OS_NAME/tcltk/bin:$CASROOT/$OS_NAME/bin:$MYPATH
#else
PATH=$CASROOTINC:$CASROOT/../3rdparty/$OS_NAME/tcltk/bin:$CASROOT/$OS_NAME/bin:$PATH
#fi
#if ( $?LD_LIBRARY_PATH ) then
# export LD_LIBRARY_PATH=$CASROOT/../3rdparty/$OS_NAME/tcltk/lib:$CASROOT/$OS_NAME/lib:$LD_LIBRARY_PATH
#else
LD_LIBRARY_PATH=$CASROOT/../3rdparty/$OS_NAME/tcltk/lib:$CASROOT/$OS_NAME/lib:$LD_LIBRARY_PATH
#fi
export CSF_MDTVFontDirectory=$CASROOT/src/FontMFT
export CSF_LANGUAGE=us
export MMGT_CLEAR=1
export CSF_SHMessage=$CASROOT/src/SHMessage
export CSF_XSMessage=$CASROOT/src/XSMessage
export CSF_MDTVTexturesDirectory=$CASROOT/src/Textures
export CSF_StandardDefaults=$CASROOT/src/StdResource
export CSF_PluginDefaults=$CASROOT/src/XCAFResources
export CSF_XCAFDefaults=$CASROOT/src/XCAFResources
export CSF_GraphicShr=$CASROOT/$OS_NAME/lib/libTKOpenGl.so
export CSF_UnitsLexicon=$CASROOT/src/UnitsAPI/Lexi_Expr.dat
export CSF_UnitsDefinition=$CASROOT/src/UnitsAPI/Units.dat
export CSF_EXCEPTION_PROMPT=1
export CSF_IGESDefaults=$CASROOT/src/XSTEPResource
export CSF_STEPDefaults=$CASROOT/src/XSTEPResource
export TCLHOME=$CASROOT/../3rdparty/$OS_NAME/tcltk
export TCLLIBPATH=$TCLHOME/lib
#if ( $OS_NAME == "SunOS" ) then
# export ITK_LIBRARY=$TCLLIBPATH/itk3.2
# export ITCL_LIBRARY=$TCLLIBPATH/itcl3.2
# export TIX_LIBRARY=$TCLLIBPATH/tix8.1
# export TK_LIBRARY=$TCLLIBPATH/tk8.3
# export TCL_LIBRARY=$TCLLIBPATH/tcl8.3
#else if ( $OS_NAME == "Linux" ) then
export ITK_LIBRARY=$TCLLIBPATH/itk3.0
export ITCL_LIBRARY=$TCLLIBPATH/itcl3.0
# if ( $TIX_LIBRARY ) then
unset TIX_LIBRARY
# fi
export TK_LIBRARY=$TCLLIBPATH/tk8.0
export TCL_LIBRARY=$TCLLIBPATH/tcl8.0

export PATH LD_LIBRARY_PATH

Have FUN

MCV