RoomFuConference Room SADv

sad on Solaris

SpeakerFLEI, Ge

(Date: Friday, November 8, 2002 11:23:08)


Hi, everyone,

when running SAD with tcl/tk 8.3.2 on Soalris 2.8 machine, I got memorry fault.

w=KBMainFrame["aaa",f];
*** 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 {if [%W selection present] { %W delete sel.first
sel.last } else {%W delete [expr [%W index insert] - 1] insert}}"]
???Tkinter::tclerror: Error in Tcl: -1 in Tcl["bind Text {if [string compare [%W tag ranges sel] {}] { %W delete
sel.first sel.last } else {%W delete {insert -1 chars} insert}}"]
Memory Full, request: 204360873 166887989 Infinity
Segmentation Fault (core dumped)

Could anyone give me some suggestions?

Thanks a lot,

Lei Ge


Comment by Noboru Yamamoto
( Date: Tuesday, November 19, 2002 21:10:17)

Hi,

I could build SAD with Tkinter included.Here is a very brief example of SAD session
using Tkinter and Tcl[] function.

yamamoto [bwg2]% pwd
/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]:=

To build SAD with Tkinter on SunOS:

yamamoto [xxxx]% uname -a
SunOS xxx 5.7 Generic_106541-19 sun4us sparc FJSV,GPUS

I needed the following tewaks.

1) When you apply tk.patch to Tk source as described in oldsad/src/README.TclTk-Linux,
you have to use "patch" command from FSF, i.e. GNU-patch rather than "patch" command
come with SunOS, ie. /usr/bin/patch.

2) After applying the patch, you need to modify oldsad/src/tk8.3.2/unix/tkUnixEvent.c as follwos.
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.

3)Change oldsad/src/Makefie.SunOS

Replace the definition of LTK in oldsad/src/Makefiel.SunOS.
=================================================================
LTK= $(EPICSLIBDIR) -L$(TCLINSTALLDIR)/lib -L$(OPENWINHOME)/lib ¥
-dynamic -lX11 ¥
-ltk$(TCL_VERSION) -ltcl$(TCL_VERSION)
=================================================================
add "-DBSD_COMP " to FOPT and COPT.

4) When you execte sad1.exe, you need to define DISPLA and LD_LIBRARY_PATH environment variables.
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.

Regards,

Noboru


Comment by noboru.yamamoto_at_kek.jp
( Date: Tuesday, November 26, 2002 18:20:01)

In the previous post,

#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

should be

#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


assuming __sun__ is defined on SunOS.