On to getting DRAWEXE running..

In hind site, I don’t think this should have taken this long to have gotten to this point.
Hopefully, I can get this step done without too much pain, but that hasn’t happened up to this point.
My plan is play around with drawexe for a couple of weeks until hardy heron comes out and then redo the whole think on a PC with a bit more horsepower. My plan is to post a on a nice set of summarized instructions as to how to get OCC running on a clean install.
These are the main instructions that I was basically following:
Here’s the link:http://ubuntuforums.org/archive/index.php/t-556314.html
which got the info the french ubuntu site:http://doc.ubuntu-fr.org/opencascade
(1) Install c shell (Done)
sudo apt-get install csh
(2) Install Sun Java 6 (Done, not exactly like this)
sudo apt-get install sun-java6-jdk
(3) Make sure, Sun Java 6 is used:(Done

sudo update-alternatives –config java
Set as default the one entry that contains this string:
java-6-sun
(4) Untar the tar.gz file (I used a gui)
tar xfvz /path/to/file.tar.gz
(5) Run the installer (This where I had a lot of self inflicted pain see @#$%)
sudo java -cp /path/to/untarred/Linux/setup.jar run
6) Getting the test suite to run:
6.1)setting up the enviroment variables
The test suite was meant to be started with two commands:
. /opt/OpenCASCADE6.2.0/ros/env.ksh #set up the environment variables
/opt/OpenCASCADE6.2.0/ros/lin/bin/DRAWEXE
7.1) Linking the tcl and Tk libraries
After this it was searching for tcl and tk libraries, so I had to create some symbolic links:
sudo ln -s /usr/lib/libtk8.4.so.0 /usr/lib/libtk.so
sudo ln -s /usr/lib/libtcl8.4.so.0 /usr/lib/libtcl.so
Adjust the version and the path to which is valid on your system.

@#$% At some point I need to go over my notes and try to figure out why this took so long to get to this point. Anyone, for the moment, I want to look fowards.
Ok… Step 6.1… I need to research this a little bit..
I just freaked myself out. I just did a locate drawexe and nothing popped up. locate DRAWEXE works just fine.
I did a quick search the next step is here:http://www.opencascade.org/org/forum/thread_9436/
Most understandable is this comment:

françois plessier 2007-06-22 14:13
You should have, in your “~/.bashrc”:source blabla/ros/env.ksh(in you case: “blabla” correspond to “/opt/OpenCASCADE6.2.0/” )————–Then check that you have these 2 lines in “blabla/ros/env.ksh”:export CASROOT=blabla/ros
OS_NAME=LinuxIf you have changed the name of your OpenCascade folder after installing it, the CASROOT definition is wrong for sure, because it’s still defined with the old name of the folder (and since it uses this name to look for the libraries…).
The second line is just so that you now can type “DRAWEXE” alone to launch OpenCascade from anywhere (you don’t need to go to the “blabla/ros/Linux/bin” folder). Look at how PATH is defined using $CASROOT and $OS_NAME, in the “blabla/ros/env.ksh” file..

looking for bashrc:

jonas@ubuntu1:~$ locate bashrc
/home/jonas/.bashrc
/usr/share/ubuntu-docs/ubuntu/sample/bash.bashrc_promptbeforeremovaloverwrittenconsole
/usr/share/doc/adduser/examples/adduser.local.conf.examples/skel/dot.bashrc
/usr/share/doc/adduser/examples/adduser.local.conf.examples/bash.bashrc
/usr/share/base-files/dot.bashrc
/root/.bashrc
/etc/skel/.bashrc
/etc/bash.bashrc
jonas@ubuntu1:~$

I just running single session at the moment so I just going to get edit /home/jonas/.bashrc
where I added: source /opt/OpenCASCADE6.2.0/ros/env.ksh
to the end of the file.

Next I need to make sure I have these two lines in the env.ksh file:
export CASROOT= /opt/OpenCASCADE6.2.0/ros
OS_NAME=Linux
What your looking for appears at the third and fourth line of the file.

It turns out that export CASROOT= /opt/OpenCASCADE6.2.0/ros is there from the get go. I suppose if you we’re installing in anything than the default, you’d need to alter this.

The fourth line has:OS_NAME=uname
I changed this to Linux
Hmmm.. I think at this point I just need to close the terminal and reopen it and type in DRAWEXE Lets give it a try:
Hah… didn’t work but I’ve experienced this pain before:
bash: Linux: command not found
bash: [: =: unary operator expected
bash: [: =: unary operator expected
jonas@ubuntu1:~$
I believe one shell likes spaces and another doesn’t
So…. I think
OS_NAME=Linux needs to be changed to OS_NAME = Linux
See if that works:
bash: Linux: command not found
bash: OS_NAME: command not found
bash: [: =: unary operator expected
bash: [: =: unary operator expected
jonas@ubuntu1:~$

Hmm…. I looks like no space is the way to go.. So put that back and put OS_NAME=hello_world to see what happens:
bash: hello_world: command not found
bash: [: =: unary operator expected
bash: [: =: unary operator expected
jonas@ubuntu1:~$
Problem seems to be with OS_NAME=Linux in env.ksh
Lets try OS_NAME=”Linux”
That would be the problem
……Now is the time for the big moment……..
Hot Darn…… Something appears to have appeared.
This shows up in the terminal:
jonas@ubuntu1:~$ DRAWEXE
Draw[1]> Draw[2]>
And there is a small window that pops up in the upper right hand corner…..
(I did a screen shot and saved it to desktop, I guess I should add another thing to learn on lifes to do list)

Now what to do??
I noticed there is a help html file on the system after the install. I bookmarked this in my browser: file:///opt/OpenCASCADE6.2.0/doc/index.htm#Open_CASCADE_documentation.htm
Fire up the page, in the upper right hand corner is a command box. If it says show, click the box so it says hide. You should see a muli-tabbed box. Click on “Gettting Started” this gives you instructions on how to use DRAWEXE.

The first instructions you’re supposed to put in is:pload ALL
Ok…. now, based on my experience to date, would you expect that this should run ok? Of course not….
Here’s what popped up:
jonas@ubuntu1:~$ DRAWEXE
Draw[1]> Draw[2]>
Draw[3]> pload ALL
Cannot load Debug Browser library. DFBrowser command is not attached
1
Draw[4]>
“Bother” as Sir Topham Hat(would say) although it’s not what I’m thinking….
More research:
Googling”pload ALL
Cannot load Debug Browser library. DFBrowser command is not attached
” produces nothing.

Nothing there….

Hmm..Doh… I think I forgot to do the final step:
7.1) Linking the tcl and Tk libraries
After this it was searching for tcl and tk libraries, so I had to create some symbolic links:
sudo ln -s /usr/lib/libtk8.4.so.0 /usr/lib/libtk.so
sudo ln -s /usr/lib/libtcl8.4.so.0 /usr/lib/libtcl.so
Adjust the version and the path to which is valid on your system.I guess I should check to make sure I got what I need:
jonas@ubuntu1:~$ locate libtk8.4.so.0
jonas@ubuntu1:~$ locate libtcl8.4.so.0
jonas@ubuntu1:~$
It doesn’t appear to be there. So…. I need to load it up and symlink it.
jonas@ubuntu1:~$ sudo apt-get install libtk8.4.so.0
[sudo] password for jonas:
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Couldn’t find package libtk8.4.so.0
jonas@ubuntu1:~$
Bother, so much for the command line, let me try that with synaptic:
libtk8.4.so.0 and libtcl8.4.so.0 doesn’t appear in synaptic…
Hmmm. Going to try a search for libtk and libtcl:
jonas@ubuntu1:~$ locate libtk
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtkx8.3.so
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtk8.4.so
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtkx.so
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtk.so
/usr/lib/openoffice/program/libtk680li.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtkx8.3.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtk8.4.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtkx.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtk.so
jonas@ubuntu1:~$ locate libtcl
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtcl.so
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtclx8.3.so
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtclx.so
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtcl8.4.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtcl.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtclx8.3.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtclx.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtcl8.4.so
jonas@ubuntu1:~$

So close and yet so very far….:(
I wonder what the difference between .so and .so.0 formats?
Here a link to research:http://wiki.linuxquestions.org/wiki/Library-related_Commands_and_Files

I’m thinking this might be worth a try:

sudo ln -s /opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtk8.4.so /usr/lib/libtk.so
sudo ln -s /home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtcl8.4.so /usr/lib/libtcl.so

This results in:
jonas@ubuntu1:~$ sudo ln -s /opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtk8.4.so /usr/lib/libtk.so
[sudo] password for jonas:
jonas@ubuntu1:~$ sudo ln -s /home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtcl8.4.so /usr/lib/libtcl.so
jonas@ubuntu1:~$ sudo updatedb
jonas@ubuntu1:~$ locate libtk.so
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtk.so
/usr/lib/libtk.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtk.so
jonas@ubuntu1:~$ locate libtcl.so
/home/jonas/OCC_library_download/Linux/3rdparty/Linux/tcltk/lib/libtcl.so
/usr/lib/libtcl.so
/opt/OpenCASCADE6.2.0/3rdparty/Linux/tcltk/lib/libtcl.so
jonas@ubuntu1:~$

Ok… lets try this again:
Nope….
jonas@ubuntu1:~$ DRAWEXE
Draw[1]> Draw[2]> pload all
Pload : Resource = all is not found
Draw[3]> pload ALL
Cannot load Debug Browser library. DFBrowser command is not attached
1
Draw[4]>
Time to cook dinner before da wife kills me for screwing around on the computer for so long……

Ok… The meat-loaf and potatoes are in the oven and da’wife and kid be watching Harry Potter… So I’m good here.
I found this in ” file:///opt/OpenCASCADE6.2.0/doc/index.htm#Open_CASCADE_documentation.htm”:

Remarks:

  • Available on all supported platforms

  • Integrated to the MFC OCAF sample

  • Can be loaded in Draw by “DFBrowser DocName” command. This command is added only if PATH environment variable on Windows platform (or LD_LIBRARY_PATH on SUN or Linux) contains a path to DFBrowser.dll library (DFBrowser.so on SUN or Linux). This variable should also contain a path to FLTK or QT graphic library, whose graphic library should be used depending on the version of DebugBrowser (FLTK or QT accordingly).

I also found something interesting at:www.opencascade.com/pub/doc/Release_Notes_5.2.4.pdf

C A S C A D E
Test Harness
New DRAW command DFBrowser has been added to OCAF commands.
OCAF Browser is a separate tool and can be accessed from Open CASCADE through the
DebugBrowser.hxx include file and DFBrowser library.
If this tool is installed during OCCT installation, it will be located in the \tools\ocafbrowser folder.
The command is added only if the PATH environment variable on Windows platform (or
LD_LIBRARY_PATH on SUN or Linux) contains a path to DFBrowser.dll
(libDFBrowser.so on SUN or Linux). This variable should also contain a path to
FLTK or QT graphic library, and the choice of library to use depends on the version of
OCAF Browser (FLTK or QT accordingly).
If DFBrowser.dll (libDFBrowser.so) or any dependant library cannot be found,
a message “Cannot load Debug Browser library. DFBrowser command is not attached”
appears in the console.
Example of launching the OCAF Browser:
NewDocument Doc MDTV-Standard

DFBrowser Doc

If I understand this correctly, the problem is that DRAWEXEC can’t find the library… They’re talking about adding paths, but I wonder why I can’t just symlink it to the user library? What the heck…. here goes:

jonas@ubuntu1:~$ man file
jonas@ubuntu1:~$ locate DFBrowser
/home/jonas/OCC_library_download/Linux/tools/ocafbrowser/Linux/qt/lib/libDFBrowser.so
/home/jonas/OCC_library_download/Linux/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so
/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/qt/lib/libDFBrowser.so
/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so
jonas@ubuntu1:~$ cd /opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/
jonas@ubuntu1:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib$ ls
libDFBrowser.so
jonas@ubuntu1:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib$ cd /opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/
jonas@ubuntu1:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib$ ls
libDFBrowser.so
jonas@ubuntu1:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib$ file libDFBrowser.so
libDFBrowser.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
jonas@ubuntu1:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib$
jonas@ubuntu1:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib$ cd /
jonas@ubuntu1:/$ sudo ln -s /opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so /usr/lib/libDFBrowser.so
[sudo] password for jonas:
jonas@ubuntu1:/$ draw
bash: draw: command not found
jonas@ubuntu1:/$ DRAWEXEC
bash: DRAWEXEC: command not found
jonas@ubuntu1:/$ DRAWEXE
Draw[1]> Draw[2]> pload ALL
Cannot load Debug Browser library. DFBrowser command is not attached
1
Draw[3]> jonas@ubuntu1:/$ sudo updatedb
jonas@ubuntu1:/$ locate libDFBrowser.so
/home/jonas/OCC_library_download/Linux/tools/ocafbrowser/Linux/qt/lib/libDFBrowser.so
/home/jonas/OCC_library_download/Linux/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so
/usr/lib/libDFBrowser.so
/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/qt/lib/libDFBrowser.so
/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so
jonas@ubuntu1:/$

Now, I really thought that would work….. I’m wonder if I need a new terminal session:
That doesn’t seem to matter out it goes:
jonas@ubuntu1:~$ DRAWEXE
Draw[1]> Draw[2]> pload ALL
Cannot load Debug Browser library. DFBrowser command is not attached
1
Draw[3]>
Draw[4]> jonas@ubuntu1:~$
jonas@ubuntu1:~$ sudo rm /usr/lib/libDFBrowser.so
[sudo] password for jonas:
jonas@ubuntu1:~$

I just found an interesting link:http://linuxmafia.com/faq/Admin/ld-lib-path.html The article says its bad practice to set the LD_LIBRARY_PATH. I do understand why “sudo ln -s /opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so /usr/lib/libDFBrowser.so” didn’t work.
At this point I don’t think I have a choice so:
jonas@ubuntu1:~$ locate bashrc
/home/jonas/.bashrc~
/home/jonas/.bashrc
/usr/share/ubuntu-docs/ubuntu/sample/bash.bashrc_promptbeforeremovaloverwrittenconsole
/usr/share/doc/adduser/examples/adduser.local.conf.examples/skel/dot.bashrc
/usr/share/doc/adduser/examples/adduser.local.conf.examples/bash.bashrc
/usr/share/base-files/dot.bashrc
/root/.bashrc
/etc/bash.bashrc~
/etc/skel/.bashrc
/etc/bash.bashrc
jonas@ubuntu1:~$ sudo gedit /home/jonas/.bashrc
[sudo] password for jonas:
This got added:
export LD_LIBRARY_PATH=/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so

so I closed the terminal and I retarted it and this pops up:
jonas@ubuntu1:~$ DRAWEXE
DRAWEXE: error while loading shared libraries: libTKDraw.so: cannot open shared object file: No such file or directory
jonas@ubuntu1:~$

This is interesting someone in gentoo working in open cascade:http://bugs.gentoo.org/show_bug.cgi?format=multiple&id=118656
I was just reviewing my blog libTKDraw.so it looks like this is where I had trouble the last time.
Strange It seems like I have the library:
jonas@ubuntu1:~$ locate libTKDraw.so
/home/jonas/OCC_library_download/Linux/ros/lin/lib/libTKDraw.so
/opt/OpenCASCADE6.2.0/ros/lin/lib/libTKDraw.so
jonas@ubuntu1:~$
I suspect my answer is here: http://www.opencascade.org/org/forum/thread_9436/
I think I just figured out what I did. By exporting LD_LIBRARY_PATH, I overwrote the existing path which caused an earlier error. The code section which got overwritten is:
if [ -z “LD_LIBRARY_PATH” ];
then LD_LIBRARY_PATH=$CASROOT/../3rdparty/$OS_NAME/tcltk/lib:$CASROOT/$OS_NAME/lib;
else LD_LIBRARY_PATH=$CASROOT/../3rdparty/$OS_NAME/tcltk/lib:$CASROOT/$OS_NAME/lib:$LD_LIBRARY_PATH;
fi
export LD_LIBRARY_PATH
This syntax is new to me but I think its saying if the existing path is empty , just add this else append it.

I want to fiddle with env.ksh as little as possible.
I’m going to modify my /.bashrc as follows to see what happens:
echo “path before any messing around”
printenv LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so
echo “adding LD_LIBRARY PATH IN BASHRC”
printenv LD_LIBRARY_PATH
source /opt/OpenCASCADE6.2.0/ros/env.ksh
echo “LD_LIBRARY PATH after source /opt/OpenCASCADE6.2.0/ros/env.ksh”
printenv LD_LIBRARY_PATH

This results in:
path before any messing around
adding LD_LIBRARY PATH IN BASHRC
/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so
LD_LIBRARY PATH after source /opt/OpenCASCADE6.2.0/ros/env.ksh
/opt/OpenCASCADE6.2.0/ros/../3rdparty/Linux/tcltk/lib:/opt/OpenCASCADE6.2.0/ros/Linux/lib:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so
jonas@ubuntu1:~$ DRAWEXE
Draw[1]> Draw[2]> pload ALL
Cannot load Debug Browser library. DFBrowser command is not attached
1
Draw[3]>

I think i need to modify export LD_LIBRARY_PATH=/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/libDFBrowser.so to
export LD_LIBRARY_PATH=/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/

The effect:
path before any messing around
adding LD_LIBRARY PATH IN BASHRC
/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/
LD_LIBRARY PATH after source /opt/OpenCASCADE6.2.0/ros/env.ksh
/opt/OpenCASCADE6.2.0/ros/../3rdparty/Linux/tcltk/lib:/opt/OpenCASCADE6.2.0/ros/Linux/lib:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/
jonas
@ubuntu1:~$ DRAWEXE
Draw[1]> Draw[2]> pload ALL
Cannot load Debug Browser library. DFBrowser command is not attached
1
Draw[3]> jonas@ub cd /opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/
jonas@ubuntu1:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib$ ls
libDFBrowser.so
jonas@ubuntu1:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib$

This error message is still generating, I wonder what pload does..
/opt/OpenCASCADE6.2.0/ros/../3rdparty/Linux/tcltk/lib:/opt/OpenCASCADE6.2.0/ros/Linux/lib:/opt/OpenCASCADE6.2.0/tools/ocafbrowser/Linux/fl/lib/
jonas@ubuntu1:~$ DRAWEXE
Draw[1]> Draw[2]> help pload
pload : pload [-PluginFilename] [[Key1] [Key2] …]: Loads Draw plugins
Draw[3]> pload all
Pload : Resource = all is not found
Draw[4]> pload ALL
Cannot load Debug Browser library. DFBrowser command is not attached
1
Draw[
5]>
Tme to pack it in.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *