Brilliant! That works Thanks, Oliver __________________________________________________________________
From: John Doty <j...@noqsi.com> To: gEDA user mailing list <geda-user@moria.seul.org> Sent: Mon, September 6, 2010 2:09:26 PM Subject: Re: gEDA-user: gnetlist quitting after execl call On Sep 6, 2010, at 2:49 PM, Oliver King-Smith wrote: > John, > Ah much improved. I tried using system* but now I don't seem to be > getting my command line arguments. For example both > (system* "/sw/share/gEDA/scheme/subfunction" (string-append " --m=" > (number->string m) " --w=" > (number->string w) > " --l=" (number->string l) " --type=nmos" > ) ) > and > (system* "/sw/share/gEDA/scheme/subfunction" " --m=" > (number->string m) " --w=" > (number->string w) > " --l=" (number->string l) " --type=nmos" > ) > run my C++ program and return with guile continuing, but my program > sees no signs of the command line arguments. The following code barfs > out > (system* (string-append "/sw/share/gEDA/scheme/subfunction" " --m=" > (number->string m) " --w=" > (number->string w) > " --l=" (number->string l) " --type=nmos" > ) ) > with > 1: 0* [magic-new "small_amplifier"] > In /sw/share/gEDA/scheme/gnet-magic-new.scm: > 816: 1 [magic:write-top-cell "small_amplifier"] > 799: 2 (let* ((port (open-output-file #))) (display "magic > " port) ...) > 802: 3* [magic:components #<output: small_amplifier.mag 12> ("OUT" > "VSS" "VCC" ...)] > 781: 4 (if (not #) (begin # #)) > ... > 782: 5 (begin (let # # # ...) (magic:components port #)) > 783: 6* (let ((pattern #) (package #)) (display "use " port) ...) > 788: 7* [magic:write-component "M3"] > 762: 8 (let* ((device #)) (cond (# #) (# #) (else #))) > ... > 654: 9 [system* "/sw/share/gEDA/scheme/subfunction --m=1 --w=30 --l=5 > --type=pmos"] > Any suggestions? Use (system) if you want to use a single string for the whole command, or use a single string for each argument with (system*). > Oliver > __________________________________________________________________ > > From: John Doty <[1]...@noqsi.com> > To: gEDA user mailing list <[2]geda-u...@moria.seul.org> > Sent: Mon, September 6, 2010 12:22:31 PM > Subject: Re: gEDA-user: gnetlist quitting after execl call > On Sep 6, 2010, at 1:08 PM, Oliver King-Smith wrote: >> I am extending gnetlist and I dislike scheme. To work around this I >> wrote a little program in C++ to do the heavy lifting and I am > trying >> to call it from my scheme extension to gnetlist. >> I wrote the following function in scheme: >> (define magic:write_nmos_fet >> (lambda (w l m) >> (display (string-append "in write_nmos_fet " (number->string w) >> "\n") ) >> >> (execl "/sw/share/gEDA/scheme/subfunction" " --m=" > (number->string > There's your problem: (execl) is not like a call. It replaces the > current process, so it should never return unless something goes wrong. > Like execl() in libc. > You probably want (system) or (system*). >> m) >> " --w=" (number->string w) " --l=" (number->string l) " >> --type=nmos" ) >> (display "Finished C call\n" ) >> )) >> This works and calls my C++ program (called subfunction right now). >> The C++ program runs without problems and produces the expected >> output. My problem is nothing seems to run in my scheme program > after >> calling subfunction. For example the line: >> (display "Finished C call\n" ) >> does not run. Nothing else appears to run after this. However > there >> are no error messages. >> Does anyone have any suggestions as to why this might be? >> Is there a better way to be calling external programs from gnetlist? >> Oliver >> >> >> _______________________________________________ >> geda-user mailing list >> [1][3]geda-u...@moria.seul.org >> [2][4]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user > John Doty Noqsi Aerospace, Ltd. > [3][5]http://www.noqsi.com/ > [4][6]...@noqsi.com > _______________________________________________ > geda-user mailing list > [5][7]geda-u...@moria.seul.org > [6][8]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user > > References > > 1. mailto:[9]geda-u...@moria.seul.org > 2. [10]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user > 3. [11]http://www.noqsi.com/ > 4. mailto:[12]...@noqsi.com > 5. mailto:[13]geda-u...@moria.seul.org > 6. [14]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user > > > _______________________________________________ > geda-user mailing list > [15]geda-u...@moria.seul.org > [16]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user John Doty Noqsi Aerospace, Ltd. [17]http://www.noqsi.com/ [18]...@noqsi.com _______________________________________________ geda-user mailing list [19]geda-u...@moria.seul.org [20]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user References 1. mailto:j...@noqsi.com 2. mailto:geda-user@moria.seul.org 3. mailto:geda-user@moria.seul.org 4. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user 5. http://www.noqsi.com/ 6. mailto:j...@noqsi.com 7. mailto:geda-user@moria.seul.org 8. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user 9. mailto:geda-user@moria.seul.org 10. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user 11. http://www.noqsi.com/ 12. mailto:j...@noqsi.com 13. mailto:geda-user@moria.seul.org 14. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user 15. mailto:geda-user@moria.seul.org 16. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user 17. http://www.noqsi.com/ 18. mailto:j...@noqsi.com 19. mailto:geda-user@moria.seul.org 20. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
_______________________________________________ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user