[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: gnetlist quitting after execl call



   Brilliant!
   That works
   Thanks,
   Oliver
     __________________________________________________________________

   From: John Doty <jpd@xxxxxxxxx>
   To: gEDA user mailing list <geda-user@xxxxxxxxxxxxxx>
   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]jpd@xxxxxxxxx>
   >  To: gEDA user mailing list <[2]geda-user@xxxxxxxxxxxxxx>
   >  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-user@xxxxxxxxxxxxxx
   >> [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]jpd@xxxxxxxxx
   >  _______________________________________________
   >  geda-user mailing list
   >  [5][7]geda-user@xxxxxxxxxxxxxx
   >  [6][8]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
   >
   > References
   >
   >  1. mailto:[9]geda-user@xxxxxxxxxxxxxx
   >  2. [10]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
   >  3. [11]http://www.noqsi.com/
   >  4. mailto:[12]jpd@xxxxxxxxx
   >  5. mailto:[13]geda-user@xxxxxxxxxxxxxx
   >  6. [14]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
   >
   >
   > _______________________________________________
   > geda-user mailing list
   > [15]geda-user@xxxxxxxxxxxxxx
   > [16]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
   John Doty              Noqsi Aerospace, Ltd.
   [17]http://www.noqsi.com/
   [18]jpd@xxxxxxxxx
   _______________________________________________
   geda-user mailing list
   [19]geda-user@xxxxxxxxxxxxxx
   [20]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

References

   1. mailto:jpd@xxxxxxxxx
   2. mailto:geda-user@xxxxxxxxxxxxxx
   3. mailto:geda-user@xxxxxxxxxxxxxx
   4. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
   5. http://www.noqsi.com/
   6. mailto:jpd@xxxxxxxxx
   7. mailto:geda-user@xxxxxxxxxxxxxx
   8. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
   9. mailto:geda-user@xxxxxxxxxxxxxx
  10. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
  11. http://www.noqsi.com/
  12. mailto:jpd@xxxxxxxxx
  13. mailto:geda-user@xxxxxxxxxxxxxx
  14. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
  15. mailto:geda-user@xxxxxxxxxxxxxx
  16. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
  17. http://www.noqsi.com/
  18. mailto:jpd@xxxxxxxxx
  19. mailto:geda-user@xxxxxxxxxxxxxx
  20. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user