Hi, everyone,
when running SAD with tcl/tk 8.3.2 on Soalris 2.8 machine, I got memorry fault.
w=KBMainFrame["aaa",f]; Could anyone give me some suggestions? Thanks a lot, Lei Ge
Comment by Noboru Yamamoto
Hi, I could build SAD with Tkinter included.Here is a very brief example of SAD session yamamoto [bwg2]% pwd To build SAD with Tkinter on SunOS: yamamoto [xxxx]% uname -a I needed the following tewaks. 1) When you apply tk.patch to Tk source as described in oldsad/src/README.TclTk-Linux, 2) After applying the patch, you need to modify oldsad/src/tk8.3.2/unix/tkUnixEvent.c as follwos. 3)Change oldsad/src/Makefie.SunOS Replace the definition of LTK in oldsad/src/Makefiel.SunOS. 4) When you execte sad1.exe, you need to define DISPLA and LD_LIBRARY_PATH environment variables. Regards, Noboru
Comment by noboru.yamamoto_at_kek.jp
In the previous post, #if defined(__sun__) should be #if !defined(__sun__)
*** SAD/Tkinter Version 1.0.8.14.4b 8/19/2002 ***
???Tkinter::tclerror: Error in Tcl: -1 in Tcl["return $tk_version",String]
???General::wrongtype: Argument must be Character-string in StringReplace[Tcl["return $tk_version",String],("."->",")]
???Tkinter::tclerror: Error in Tcl: -1 in Tcl["return $tk_version",String]
???General::wrongtype: Argument must be Character-string in StringReplace[Tcl["return $tk_version",String],("."->",")]
???Tkinter::tclerror: Error in Tcl: -1 in Tcl["bind Entry
sel.last } else {%W delete [expr [%W index insert] - 1] insert}}"]
???Tkinter::tclerror: Error in Tcl: -1 in Tcl["bind Text
sel.first sel.last } else {%W delete {insert -1 chars} insert}}"]
Memory Full, request: 204360873 166887989 Infinity
Segmentation Fault (core dumped)
( Date: Tuesday, November 19, 2002 21:10:17)
using Tkinter and Tcl[] function.
/g2home/yamamoto/oldsad
yamamoto [bwg2]% cd obj/SunOS/
yamamoto [bwg2]% setenv LD_LIBRARY_PATH ~/oldsad/tcltk/lib
yamamoto [bwg2]% ./sad1.exe
*** Welcome to SAD1.0.8.16.3b 11/14/2002 16:00:00 ***
20:34:15 Tuesday 11/19/2002 ***
cpu time= 3.0000E-02(sec) dt= 30.000(msec) free area:: 16147
ffs;
expnln 15096 1024
*** SADScript Initialization: /g2home/yamamoto/oldsad/Packages/init.n ***
*** SADScript Version 1.0.8.15.5b 11/5/2001 ***
RFSW RADCOD RAD FLUC INTRA POL COD DAPER EMIOU CMPLO FOURI SMEAR
F F F T F F T F F F F T
Design orbit length = 1.
In[1]:= w=Window[]
*** SAD/Tkinter Version 1.0.8.14.4b 8/19/2002 ***
Out[1]:= DefineWidgetSpecific[Window,w,Epilog]
In[2]:= Tcl["expr 1 + 2", String]
Out[2]:= "3"
In[3]:=
SunOS xxx 5.7 Generic_106541-19 sun4us sparc FJSV,GPUS
you have to use "patch" command from FSF, i.e. GNU-patch rather than "patch" command
come with SunOS, ie. /usr/bin/patch.
In the definition of TkpOpenDisplay(display_name)
===========================================================
#if !defined(__linux__) && !defined(__APPLE__)
{
#include
#include
#include
int on = 1;
int keepidle = 600;
int keepintvl = 30;
int keepcnt = 4;
setsockopt(ConnectionNumber(display), SOL_SOCKET, SO_KEEPALIVE,
(char *)&on, sizeof(on));
#if defined(__sun__)
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPIDLE,
(char *)&keepidle, sizeof(keepidle));
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPINTVL,
(char *)&keepintvl, sizeof(keepintvl));
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPCNT,
(char *)&keepcnt, sizeof(keepcnt));
#endif
}
#endif /* !defined(__linux__) && !defined(__APPLE__) */
================================================================
If you don't use gcc, i.e. use cc from Sun, you might need to define __sun__ in COPTS.
=================================================================
LTK= $(EPICSLIBDIR) -L$(TCLINSTALLDIR)/lib -L$(OPENWINHOME)/lib ¥
-dynamic -lX11 ¥
-ltk$(TCL_VERSION) -ltcl$(TCL_VERSION)
=================================================================
add "-DBSD_COMP " to FOPT and COPT.
DISPLAY points X-window display and LD_LIBRARY_PATH should points the path where you installed
a patched version of tcl/tk libraries, ie. oldsad/tcltk/lib.
( Date: Tuesday, November 26, 2002 18:20:01)
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPIDLE,
(char *)&keepidle, sizeof(keepidle));
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPINTVL,
(char *)&keepintvl, sizeof(keepintvl));
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPCNT,
(char *)&keepcnt, sizeof(keepcnt));
#endif
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPIDLE,
(char *)&keepidle, sizeof(keepidle));
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPINTVL,
(char *)&keepintvl, sizeof(keepintvl));
setsockopt(ConnectionNumber(display), IPPROTO_TCP, TCP_KEEPCNT,
(char *)&keepcnt, sizeof(keepcnt));
#endif
assuming __sun__ is defined on SunOS.