]> OCCT Git - occt-wok.git/commitdiff
No comments
authorcas <cas@opencascade.com>
Thu, 19 Jul 2001 13:13:37 +0000 (13:13 +0000)
committercas <cas@opencascade.com>
Thu, 19 Jul 2001 13:13:37 +0000 (13:13 +0000)
src/WOKsite/INSTALL
src/WOKsite/tclshrc_Wok

index e47954a0de1e26d6c33b0d7a3a73023a0dac3a74..0c491cc14bb560f1804245d03a7bf5b4d5ab5670 100755 (executable)
 \r
- Section A) of this paper is the Unix guidelines for installing \r
- WOK on  SunOS, Linux, HP-UX and IRIX systems.\r
-\r
\r
-\r
-\r
 PRE-REQUISITES:\r
 ---------------\r
 \r
- On SunOS and IRIX WOK requires at least Tcl 7.5, Tclx 7.5.1 and Tk 4.1.\r
- On Linux you can use Tcl 8.0 or later.\r
- We suppose that on SunOS and IRIX, tcltk is installed in /usr/tcltk, and in /usr on Linux\r
- If it is not the case, modify the TCLHOME variable in the file /home/me/wok-C40/site/wokcfg.\r
- (We suppose you have downloaded this tarball in /home/me)\r
+ This version of Wok requires at least Tcl 8.0.\r
+ (In the following we assume you have downloaded this tarball in /home/me)\r
+\r
+\r
+ The section A) and B) explain how to install Wok and getting started.\r
+ The section C) explains how you can use this version of Wok to access\r
+ previous version of OpenCascade.\r
 \r
-A) INSTALLATION on Unix like systems.\r
--------------------------------------\r
+A) First installation Unix/Linux systems.\r
+-----------------------------------------\r
 \r
  This section assumes that you have never installed WOK on your system. Performing the\r
  four following steps will install WOK and create a minimal environment for working.\r
 \r
- 1. From the current directory where this README is located, move to the sub-directory\r
+ 1. From the current directory where you have downloaded , move to the sub-directory\r
     site. \r
-    % cd /home/me/wok-C40/site\r
-\r
- 2. Configure WOK so that its administration files will be located in \r
-    </home/me/wokentities>. You do this by typing:\r
-\r
-    % ./wokcfg configure /home/me/wokentities ~/wok\r
-\r
-    This will create the directory /home/me/entities if it does not exist, then create\r
-    a c-shell executable file ~/wok. This file will be your wok launcher. This file is \r
-    used in the next step.\r
-\r
- 3. Insert in your ~/.tclshrc the lines listed in the file /home/me/wok-C40/site/tclshrc_Wok.\r
-    This file is sourced by the tclsh shell at the beginning of a session.\r
-    (See tclsh documentation for more information about the .tclshrc file.)\r
+    % cd /home/me/wok-CXX/site\r
 \r
-    At this point either you want to create WOK entitites or import files from a previously Cascade \r
-    source download. To create new entities from scratch execute step 4., to import files execute \r
-    step 5.\r
+ 2. Copy from this directory the file tclshrc_Wok in your home directory with name\r
+     .tclshrc or .wishrc depending on the shell you want to use.\r
 \r
- 4. Once configured, you can create minimal entities and tell WOK where to\r
-    physically create them. The following command setup WOK environment so that they will be \r
-    implemented under the directory /home/me/workarea. These entities are a factory \r
-    (named  KAS below), a workshop ( say C40 ), and a workbench (ref).\r
-       \r
-    % mkdir /home/me/workarea\r
-    % cd ~\r
-    % ./wok setup /home/me/workarea KAS C40 ref\r
+ 3. Insert in your LD_LIBRARY_PATH the location where the wok shareable have been downloaded\r
+    that is in our case:\r
+    /home/me/wok-CXX/lib/lin if your are on Linux\r
+    /home/me/wok-CXX/lib/sun if your are on SunOS\r
 \r
+ 4. Start tclsh or wish.  You can then create new wok entities.\r
 \r
- 5. You perform this step if you want to use WOK on a previously Cascade source download. \r
 \r
-    % mkdir /home/me/workarea\r
-    % cd ~\r
-    % ./wok import /home/me/workarea KAS C40 ref /somewhere/source/downloaded/CAS3.0\r
-        or if you have the variable CASROOT already pointing to this location :\r
-    % ./wok import /home/me/workarea KAS C40 ref $CASROOT\r
-       \r
-    This will create and populate the workbench KAS:C40:ref with all development units downloaded in\r
-    directory /somewhere/source/downloaded/CAS3.0. You can build them using the WOK commands umake \r
-    and wprocess. See documentation for details.\r
+B) First installation on WindowsNT.\r
+-----------------------------------\r
 \r
-\r
- 6. Then running wok and accessing previously created entities looks like this:\r
-\r
-    % ~/wok\r
-    tclsh> wokcd KAS:C40:ref\r
-    KAS:C40:ref>\r
-\r
-    At this point, you run wok by using the above created command ~/wok. No additional \r
-    operation is required.\r
-    Note that the wok procedure can be placed in any directory listed in your path. \r
-    It can also be published to a set of developers by placing it in a shared location.\r
-\r
-\r
-B) INSTALLATION on WindowsNT.\r
------------------------------\r
-\r
- We suppose that you have doanloaded the zip archive for WOK in directory W:\wok-C31\r
+ We suppose that you have downloaded the zip archive for WOK in directory W:\wok-CXX\r
 \r
     1. Open a MS-DOS command console and set the current directory as follow\r
     \r
-      W:> cd wok-C31\site\r
+      W:> cd wok-CXX\site\r
 \r
-    2. Configure WOK so that its administration files will be located \r
-       in directory W:/home/me/wokentities. (IMPORTANT : You must create the \r
-       directories W:/home/me/entities using the explorer or the command mkdir)\r
-       You can now issue the following command (Note precise usage of / instead of \ below):\r
+    2. Copy from this directory the file tclshrc_Wok in the directory pointed to by the variable \r
+       HOME if any. If this variable is not setted, set it to a location and copy the file tclshrc_Wok \r
+       in there. The final name must be tclshrc.tcl or wishrc.tcl depending on the shell you want to\r
+       use.\r
+       \r
 \r
-       W:\site> wokcfg.bat configure W:/wok-C31 W:/home/me/wokentities w:/home/me/wok.bat\r
+    3. Insert in the PATH variable the location where Wok dll resides that is :\r
+       wok-CXX\lib\wnt\r
 \r
-       This will create the file w:/home/me/wok, your wok launcher.\r
+    4. Start tclsh or wish.\r
 \r
-    3. Tell WOK where to physically create entities. The following command setup WOK so that they will be \r
-       implemented under the directory W:/home/me/wokarea \r
-       (IMPORTANT : Create directory W:/home/me/wokarea before)\r
+C) Accessing previous OpenCascade workbenches.\r
+---------------------------------------------\r
 \r
-       W:\site> wokcfg.bat setup W:/wok-C31 W:/home/me/wokarea\r
-\r
-    4. You can now use the wok.bat launcher to create entities.\r
-       W:\home\me\wok.bat\r
-       tclsh> source $env(WOKHOME)/site/CreateFactory.tcl\r
-       tclsh> CreateFactory W:/home/me/wokarea KAS C30 ref /dev/null\r
+    By default , all the required initialisations are done in the tcl init file. One of them consist to\r
+    set the location where Wok will find or created entities. This location is pointed to by the environment \r
+    variable ( or MS Dos variable ) named WOK_ROOTADMDIR. If you want to address previous Wok workbenches \r
+    (say those created with the C3.1 version) set the variable WOK_ROOTADMDIR to this place. \r
+    Note: The directory pointed to by WOK_ROOTADMDIR contains at least 3 files. ATLIST, DEFAULT.edl, SESSION.edl.\r
+    \r
index 2f8c6d5ac0aec6afec93df95da124bd018cb10ee..696f60cf64698d7b354a13cd754063880f9f4715 100755 (executable)
 ;# In this case you can make up a Tcl proc from this file and invoke it at the moment you 
 ;# choose.
 ;#
-proc RUNWOK { } {
-    global env tcl_platform
-    if { "$tcl_platform(platform)" == "unix" && ![info exists env(LD_LIBRARY_PATH)] } {
-       puts stderr "You must set LD_LIBRARY_PATH to point where you have installed Wok"
-       exit
-    }
-    
-    if { "$tcl_platform(platform)" == "windows" && ![info exists env(PATH)] } {
-       puts stderr "You must set PATH to point where you have installed Wok"
-       exit
-    }
-    if [info exists wm] {
-       wm withdraw .
-    }
-    if { "$tcl_platform(platform)" == "unix" } {
-       set wrk [split $env(LD_LIBRARY_PATH) :]
-       set fmtshr "lib%s.so"
-       if { $tcl_platform(os) == "HP-UX" } { set fmtshr "lib%s.sl" }
-    } 
-    if { "$tcl_platform(platform)" == "windows" } {
-       set wrk [split $env(PATH) ";"]
-       set fmtshr "%s.dll"
+global env tcl_platform
+if { "$tcl_platform(platform)" == "unix" && ![info exists env(LD_LIBRARY_PATH)] } {
+    puts stderr "You must set LD_LIBRARY_PATH to point where you have installed Wok"
+    exit
+}
+
+if { "$tcl_platform(platform)" == "windows" && ![info exists env(PATH)] } {
+    puts stderr "You must set PATH to point where you have installed Wok"
+    exit
+}
+if [info exists wm] {
+    wm withdraw .
+}
+if { "$tcl_platform(platform)" == "unix" } {
+    set sprtor ":"
+    set fmtshr "lib%s.so"
+    set wrk [split $env(LD_LIBRARY_PATH) $sprtor]
+    if { $tcl_platform(os) == "HP-UX" } { set fmtshr "lib%s.sl" }
+    set msgnotfound "Please check your variable LD_LIBRARY_PATH"
+} 
+if { "$tcl_platform(platform)" == "windows" } {
+    set sprtor ";"
+    set fmtshr "%s.dll"
+    set wrk [split $env(PATH) $sprtor]
+    set msgnotfound "Please check your variable PATH"
+}
+;#
+;# Find out in wrk where wok resides. That is : where the file libTKWOK resides. 
+;# 
+set wokso [format $fmtshr TKWOK]
+foreach d $wrk {
+    if { [file exists [file join $d $wokso]] && ![info exists wokfound] } {
+       set wokfound $d
     }
-    ;#
-    ;# Find out in wrk where wok resides. That is : where the file libTKWOK resides. 
-    ;# 
-    set wokso [format $fmtshr TKWOK]
-    foreach d $wrk {
-       if { [file exists [file join $d $wokso]] && ![info exists wokfound] } {
-           set wokfound $d
+}
+if ![info exists wokfound] {
+    puts stderr "Wok (actually $wokso) was not found in the directory(ies) $d"
+    puts stderr "$msgnotfound or check that the above directory are readable."
+    return
+}
+;#
+;# Wok's here we can set up our niche.
+;#
+set wok_library [file dirname $wokfound]
+set wok_ptfm    [file tail    $wokfound]
+;#
+;#
+lappend auto_path $wok_library 
+package require Wok
+package require Ms
+;#
+;# Where tcl and edl file of wok reside.
+;#
+set env(WOK_LIBRARY) $wok_library
+set env(WOK_LIBPATH) "${wok_library}${sprtor}[file join $wok_library $wok_ptfm]"
+set env(WOKSTATION)  $wok_ptfm
+set env(WOKHOME)     [file dirname $wok_library]
+set woksite          [file join $env(WOKHOME) site]
+;#
+;# Where the files ATLIST , DEFAULT.edl and SESSION.edl reside
+;#
+if {![info exists env(WOK_ROOTADMDIR)] } { 
+    set env(WOK_ROOTADMDIR) $env(WOKHOME)/wok_entities
+    if ![file exists $env(WOK_ROOTADMDIR)] {
+       if [file writable $env(WOKHOME)] {
+           puts stderr "Creating directory $env(WOK_ROOTADMDIR) for wok entities..."
+           if [catch { wokUtils:FILES:mkdir $env(WOK_ROOTADMDIR) } status] {
+               puts stderr "Error : $status"
+               return
+           }
+           if ![file exists $env(WOK_ROOTADMDIR)] {
+               return
+           }
+       } else {
+           puts stderr "The directory $env(WOK_ROOTADMDIR) cannot be created because $env(WOKHOME) is not writable."
+           puts stderr "Please give write access to this directory."
+           return
        }
+    } else {
+       puts stderr "Using $env(WOKHOME)/wok_entities for working entities."
     }
-    if ![info exists wokfound] {
-       puts stderr "Wok (actually $wokso) was not found in the directory(ies) $d"
-       puts stderr "Please check your variable LD_LIBRARY_PATH(Unix) or PATH (windows)"
-       return
-    }
-    ;#
-    ;# Wok's here we can set up our niche.
-    ;#
-    set wok_library [file dirname $wokfound]
-    set wok_ptfm    [file tail    $wokfound]
-    ;#
-    ;#
-    lappend auto_path $wok_library 
-    package require Wok
-    package require Ms
-    ;#
-    ;# Where tcl and edl file of wok reside.
-    ;#
-    set env(WOK_LIBRARY) $wok_library
-    set env(WOK_LIBPATH) $wok_library:[file join $wok_library $wok_ptfm]
-    set env(WOKSTATION)  $wok_ptfm
-    set env(WOKHOME)     [file dirname $wok_library]
-    set env(WOKSITE)     [file join $env(WOKHOME) site]
-    ;#
-    ;# Where the files ATLIST , DEFAULT.edl and SESSION.edl reside
-    ;#
-    if {![info exists env(WOK_ROOTADMDIR)] } { 
-       set env(WOK_ROOTADMDIR) $env(WOKHOME)/wok_entities
-    }
+} else {
     if ![file exists $env(WOK_ROOTADMDIR)] {
-       puts stderr "Creating directory $env(WOK_ROOTADMDIR) for wok entities..."
-       if [catch { wokUtils:FILES:mkdir $env(WOK_ROOTADMDIR) } status] {
-           puts stderr "Error : $status"
-           exit
-       }
-       if ![file exists $env(WOK_ROOTADMDIR)] {
-           exit
-       }
+       puts stderr "The directory $env(WOK_ROOTADMDIR) can not be found"
+       return
     }
-    ;#
-    ;# Check if  Wok stuff is correct. If not set it up silently.
-    ;#
-    if ![file exists  [set woksession [file join $env(WOK_ROOTADMDIR) WOKSESSION.edl]]] {
-       set str1 [wokUtils:FILES:FileToString [file join $env(WOKSITE) WOKSESSION.edl]]
-       regsub -all -- {TOSUBSTITUTE} "$str1" "$env(WOK_ROOTADMDIR)" result1
-       wokUtils:FILES:StringToFile $result1 $woksession
-       if [file exists $woksession] {
-           puts stderr "File $session has been created. "
-       }
+    puts stderr "Using variable WOK_ROOTADMDIR = $env(WOK_ROOTADMDIR) for working entities."    
+}
+
+;#
+;# Check if  Wok stuff is correct. If not set it up silently.
+;#
+if ![file exists  [set woksession [file join $env(WOK_ROOTADMDIR) WOKSESSION.edl]]] {
+    set str1 [wokUtils:FILES:FileToString [file join $woksite WOKSESSION.edl]]
+    regsub -all -- {TOSUBSTITUTE} "$str1" "$env(WOK_ROOTADMDIR)" result1
+    wokUtils:FILES:StringToFile $result1 $woksession
+    if [file exists $woksession] {
+       puts stderr "File $woksession has been created. "
     }
-    ;#
-    ;#
-    ;#
-    if ![file exists [set default [file join $env(WOK_ROOTADMDIR) DEFAULT.edl]]] {
-       set str2 [wokUtils:FILES:FileToString [file join $env(WOKSITE) DEFAULT.edl]]
-       regsub -all -- {dp_xx} "$str2" "$env(WOK_ROOTADMDIR)" result2
-       wokUtils:FILES:StringToFile $result2 $default
-       if [file exists $default] {
-           puts stderr "File $default has been created. "
-       }
+}
+;#
+;#
+;#
+if ![file exists [set default [file join $env(WOK_ROOTADMDIR) DEFAULT.edl]]] {
+    set str2 [wokUtils:FILES:FileToString [file join $woksite DEFAULT.edl]]
+    regsub -all -- {/dp_xx} "$str2" "$env(WOK_ROOTADMDIR)" result2
+    wokUtils:FILES:StringToFile $result2 $default
+    if [file exists $default] {
+       puts stderr "File $default has been created. "
     }
-    ;#
-    ;# Where to read/write the current working entity
-    ;#
-    set env(WOK_SESSIONID)  $env(HOME)/.wok
-    ;#
-    ;# Every thing seems OK. Display a nice prompt:
-    ;#
-    set tcl_prompt1 {if {[info commands wokcd] != ""}  then \
-           {puts -nonewline stdout "[wokcd]> "} else \
-           {puts -nonewline stdout "tclsh> "}}
-    
 }
-RUNWOK
+;#
+;# Where to read/write the current working entity
+;#
+set env(WOK_SESSIONID)  $env(HOME)/.wok
+;#
+;# Every thing seems OK. Display a nice prompt:
+;#
+set tcl_prompt1 {if {[info commands wokcd] != ""}  then \
+       {puts -nonewline stdout "[wokcd]> "} else \
+       {puts -nonewline stdout "tclsh> "}}