Building OpenCascade 6.3 on ArchLinux x64 with OpenGL support

185 views
Skip to first unread message

Paul

unread,
Apr 13, 2011, 3:23:36 PM4/13/11
to oce-dev
Hello,

I'm trying to build OCC 6.3 for pythonocc 0.5. I'm using these
configure flags for OCC:
-------------------------------------------------------------------------------------------------------------------
./configure --disable-debug --enable-production \
--with-java-include=${JAVA_HOME}/include --prefix="$pkgdir/opt/
$pkgname" \
--with-gl-include=/usr/include --with-gl-library=/usr/share --
enable-draw=yes
-------------------------------------------------------------------------------------------------------------------

This is the configure output:
http://www.pasteall.org/20800

Both OCC and pythonocc build fine, pythonocc passes all the unit tests
but it fails the
Hello World example with the output:
-------------------------------------------------------------------------------------------------------------------
File "/usr/lib/python2.7/site-packages/OCC/Visualization.py", line
24, in swig_import_helper
_mod = imp.load_module('_Visualization', fp, pathname,
description)
ImportError: /opt/opencascade/lib/libTKNIS.so.0: undefined symbol:
glMultMatrixd
-------------------------------------------------------------------------------------------------------------------

Thomas helped me conclude that this is due to the libs not being
linked to OpenGL.

I've read that pythonocc will support OCE 0.1 in a few weeks but I'm
now in the Easter break (I am
an architecture student) and I hoped that I could get some coding done
before school starts.

Thank you,

Paul

Denis Barbier

unread,
Apr 13, 2011, 4:08:01 PM4/13/11
to oce...@googlegroups.com, Paul

Hello Paul,

This may be due to LDFLAGS, try to remove the -Wl,--as-needed flag.
You do not have to rebuild everything,
rm adm/make/*/lib*.la
make && make install
should work.

Denis

Denis Barbier

unread,
Apr 13, 2011, 5:25:52 PM4/13/11
to oce...@googlegroups.com, Paul

... or maybe not ;)
I just have a look, and it seems that we had to patch TKNIS in Debian
to add this dependency on openGL:
http://git.debian.org/?p=debian-science/packages/opencascade.git;a=blob;f=debian/patches/dep-libs.patch;h=4aec259;hb=492a884
Unfortunately this patch won't apply as is because it depends on other patches.

Denis

Paul

unread,
Apr 15, 2011, 7:57:35 AM4/15/11
to oce-dev
Hello,

In the latest attempt to get OCC/pythonocc on my Arch box I've gone
and repacked the Debian opencascade packages. I've used the following
as source:

"libopencascade-dev_6.3.0.dfsg.1-6_all.deb"
"libopencascade-foundation-6.3.0_6.3.0.dfsg.1-6_amd64.deb"
"libopencascade-foundation-dev_6.3.0.dfsg.1-6_all.deb"
"libopencascade-modeling-6.3.0_6.3.0.dfsg.1-6_amd64.deb"
"libopencascade-modeling-dev_6.3.0.dfsg.1-6_all.deb"
"libopencascade-ocaf-6.3.0_6.3.0.dfsg.1-6_amd64.deb"
"libopencascade-ocaf-dev_6.3.0.dfsg.1-6_all.deb"
"libopencascade-ocaf-lite-6.3.0_6.3.0.dfsg.1-6_amd64.deb"
"libopencascade-ocaf-lite-dev_6.3.0.dfsg.1-6_all.deb"
"libopencascade-visualization-6.3.0_6.3.0.dfsg.1-6_amd64.deb"
"libopencascade-visualization-dev_6.3.0.dfsg.1-6_all.deb"
"opencascade-draw_6.3.0.dfsg.1-6_amd64.deb"
"opencascade-wok_6.3.0.dfsg.1-6_amd64.deb"

The script I've made simply unpacks all the debs and repacks them as
one big Arch package. Pythonocc builds and links against it, it passes
the unit tests but the sample still fails. With another output:

Traceback (most recent call last):
File "/home/paul/ABS/pythonocc-test/src/pythonocc-0.5/src/examples/
Level1/HelloWorld/helloworld.py", line 21, in <module>
display, start_display, add_menu, add_function_to_menu =
init_display()
File "/usr/lib/python2.7/site-packages/OCC/Display/SimpleGui.py",
line 92, in init_display
from wxDisplay import wxViewer3d
File "/usr/lib/python2.7/site-packages/OCC/Display/wxDisplay.py",
line 23, in <module>
import OCCViewer
File "/usr/lib/python2.7/site-packages/OCC/Display/OCCViewer.py",
line 75, in <module>
set_CSF_GraphicShr()
File "/usr/lib/python2.7/site-packages/OCC/Display/OCCViewer.py",
line 70, in set_CSF_GraphicShr
libTkOpenGl_library = output.split(' ')[2]
IndexError: list index out of range

I'm thinking that this error happens because it can't find the lib
because this package I made does not install OCC to /opt/opencascade
but installs the headers and libs to /usr/lib and /usr/include. IMO
they should be available. /usr/lib/libTkOpenGl.so exists and is in the
path.

Have I missed a debian package, or is it a faulty OCC install?

Paul
>  http://git.debian.org/?p=debian-science/packages/opencascade.git;a=bl...

Denis Barbier

unread,
Apr 15, 2011, 8:59:38 AM4/15/11
to oce...@googlegroups.com

Hello,

This issue is different, it seems that your installation mostly works,
IMO this is a pythonocc issue.
Upstream OpenCASCADE requires that one sets the CASROOT environment
variable, and maybe also a bunch of other variables, in order to use
those libs. The Debian package has been modified to install files in
more standard locations, and does not need any environment variables.

Your issue looks very similar to
http://code.google.com/p/pythonocc/issues/detail?id=17

You can edit /usr/lib/python2.7/site-packages/OCC/Display/OCCViewer.py
and comment lines 72-73 so that set_CSF_GraphicShr is not called.
There is another occurrence of CSF_GraphicShr in wxDisplay.py, you may
also need to edit this file. Does everything work fine with these
changes?

Denis

Thomas Paviot

unread,
Apr 15, 2011, 9:01:16 AM4/15/11
to oce...@googlegroups.com
Hi Paul,

You're almost done. Although /usr/lib is in your PATH, you have to setup the CSF_GraphicShr env var.

$export CSF_GraphicShr=/usr/lib/libTkOpenGl.so

Thomas

2011/4/15 Paul <spook...@gmail.com>

Paul

unread,
Apr 16, 2011, 8:36:53 AM4/16/11
to oce-dev
SUCCESS!

The samples I have tested work. (Besides one with some scipy issues)
I've patched OCCViewer.py and wxViewer.py.

When I have time I'll clean up the packaging scripts and post them so
that others may use them. So to conclude, OCC 6.3 and pythonocc 0.5
working on Arch Linux x64.

Thank you!

On Apr 15, 4:01 pm, Thomas Paviot <tpav...@gmail.com> wrote:
> Hi Paul,
>
> You're almost done. Although /usr/lib is in your PATH, you have to setup the
> CSF_GraphicShr env var.
>
> $export CSF_GraphicShr=/usr/lib/libTkOpenGl.so
>
> Thomas
>
> 2011/4/15 Paul <spookte...@gmail.com>

Thomas Paviot

unread,
Apr 19, 2011, 11:42:39 AM4/19/11
to oce...@googlegroups.com
Hi Paul,

Good news that you finally succeeded. And happy to learn that pythonocc supports python2.7!

Regards,

Thomas

2011/4/16 Paul <spook...@gmail.com>
Reply all
Reply to author
Forward
0 new messages