Subject | : Re^2: Question on "porting SAD to WindowsXP" |
Article No | : 517 |
Date | : 2008/01/18(Fri) 18:43:23 |
Contributor | : AKio Morita |
> Thanks for your help … I will look on the bulletin board to see what's available. I was finally able to build the SAD executable on Windows by making "stubs" of the modules in src/tfNetSemaphore_.c . The "benchmark" SAD decks (bench.sad and bench2.sad) run OK. When I run design_example.sad, the program bombs with a segmentation fault on the following line: > > dr:=FFS["OUT 'a' DRAW BX BY & EX EY {BQ}*; TERM OUT; TDR 'a';"]; > dr; ! draw optics of unit cell > > Perhaps SAD links to files using sockets (?) … I'll keep working on it. > I recommend to use symbolic debugger(gdb or etc...) and analyze process back trace.
DRAW command in FFS[] invokes CANVASDRAW function defined in Packages/CANVASDRAW.n. (See also src/tffsa.f line 904-919)
DRAW commans's action depends to $DisplayFunction variable. $DisplayFunction is defined at Packages/init.n. >>$DisplayFunction=If[Check[System["/bin/csh -c 'which tdr' >/dev/null"],1], >> If[Environment["DISPLAY"]<=>"",CanvasDrawer,TopDrawer],TopDrawer,TopDrawer];
In the case of $DisplayFunction === TopDrawer, DRAW writes twiss parameters into the file ''a'' by using topdrawer format and TDR invokes ''tdr'' external command which is called ''topdrawer''.
In the case of $DisplayFunction === CanvasDrawer, DRAW invoke OpticsPlot[] function which displays optics by using SAD/Tkinter.
|