[Openmcl-devel] trouble invoking gnuplot on windows

Mirko Vukovic mirko.vukovic at gmail.com
Sat Jan 17 08:09:10 PST 2015


I fixed the problem on my end.  I am posting the fix if someone comes upon
this email looking for the solution to a similar problem.  See below

On Fri, Jan 2, 2015 at 10:49 AM, Mirko Vukovic <mirko.vukovic at gmail.com>
wrote:

> Hello,
>
> I am trying to start a gnuplot process on windows 7 using the run-program
> command. This is on version 1.10 (dev)
>
> When I try to call the executable directly:
> (progn
>     (setf *gnuplot*
>       (ccl:run-program "\"C:/Program Files
> (x86)/gnuplot/bin/wnuplot.exe\""
>                '()
>                :input :stream
>                :output :stream
>                :error :output
>                :wait nil)
>       *gnuplot-input* (ccl:external-process-input-stream *gnuplot*)
>       *gnuplot-output* (ccl:external-process-output-stream *gnuplot*))
>     (ccl:external-process-status *gnuplot*))
>
> the process exits with status 2.
>
> I tried using the "cmd" shell, with the \k switch.
> (progn
>     (setf *gnuplot*
>       (ccl:run-program "cmd"
>                '("/k"
>                  "\"C:/Program Files (x86)/gnuplot/bin/gnuplot.exe\"")
>                :input :stream
>                :output :stream
>                :error :output
>                :wait nil)
>       *gnuplot-input* (ccl:external-process-input-stream *gnuplot*)
>       *gnuplot-output* (ccl:external-process-output-stream *gnuplot*))
>     (ccl:external-process-status *gnuplot*))
>
> But then the input and output streams are linked to the cmd process, not
> the gnuplot one.
>
> Any suggestions?
>
> Thank you for reading, and best wishes in 2015,
>
> Mirko
>

Posting this for future reference:

I downloaded gnuplot version 5 and placed its BIN directory into Windows'
path.  Then the following will successfully start the process

(CCL:RUN-PROGRAM "gnuplot.exe" NIL :INPUT :STREAM :OUTPUT T :ERROR :OUTPUT
:WAIT NIL)

I actually use
(setf *gnuplot*
      (ccl:run-program (namestring executable)
               ()
               :input :stream
               ;; send output to standard-output, which
               ;; goes to *inferior-lisp* buffer
               :output t
               :error :output
               :wait nil)
      *gnuplot-input* (ccl:external-process-input-stream *gnuplot*)
      *gnuplot-output* (ccl:external-process-output-stream *gnuplot*))

where *gnuplot* holds "gnuplot.exe".  I can then pass gnuplot commands to
the *gnuplot-input* stream.
Gnuplot's textual output (as from "show version") goes to SLIME's inferior
lisp buffer.

Mirko

Mirko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20150117/f4c33c8b/attachment.htm>


More information about the Openmcl-devel mailing list