[Go to BBS]
All articles in a thread
SubjectQuestion on "porting SAD to WindowsXP"
Article No512
Date: 2008/01/17(Thu) 11:10:44
ContributorKAMADA Susumu < >
I have received the following question from one of the SAD colleagues.
Please answer this question.
------------------
I'm trying to port SAD to WindowsXP. I'm using gcc and g77 (v3.4.4) in the Cygwin environment. I have made some progress, but unfortunately the build process encounters errors when it tries to compile src/tfNetSemaphore_.c . It seems that this routine is associated with the use of "sockets". Is there any way to "switch off" the use of the socket stuff in SAD, possibly some flag in the configuration setup (like setting USE_X11=NO in sad.conf when you don't want to use X11)? I don't think that I need the socket stuff ...
------------------

SubjectRe: Question on "porting SAD to WindowsXP"
Article No514
Date: 2008/01/17(Thu) 18:39:47
ContributorAKio Morita
If you want to remove src/tfNetSemaphore_.c related codes,
Remove following lines from mk/sad.obj.mk.

OBJ_NetSemaphore=tfNetSemaphore_.o netSemaphore.o
SAD_STATIC_DEF_FUNCS+=NetSemaphore

SubjectRe: Question on "porting SAD to WindowsXP"
Article No516
Date: 2008/01/18(Fri) 10:23:32
ContributorKAMADA Susumu < >
The present status of the colleague's work is the following.
------------------
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.
------------------

SubjectRe^2: Question on "porting SAD to WindowsXP"
Article No517
Date: 2008/01/18(Fri) 18:43:23
ContributorAKio 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.