I've read some more about perl and forking and the problem seems to be here:

http://perldoc.perl.org/perlfork.html

"The open(FOO, "|-") and open(BAR, "-|") constructs are not yet 
implemented."

Unfortunately, of the workarounds offered in that document, only the 
"pipe_to_fork" works in Windows (tested on ActivePerl 5.8.0 and 
Strawberry 5.10.0), "pipe_from_fork" does not.

I am wondering, though, why forking is used at all - couldn't one use 
the backtick operator to capture the output from the C preprocessor?

The source code im "matwrap" (lines ~170) mentions that this is "likely 
to get fouled up if any of the arguments had to be quoted[..]. Instead, 
we want to use exec() with a list argument."

But why not backticks? I tried it and it is at least unaffected by quotes.

Alternatively, if the "memory penalty" of reading all that output before 
parsing it is considered a problem, why not in fact use the simple OPEN 
open command, but quote the execution string with q{}?


Thoughts anyone?
Daniel

On 18.08.2009 20:40, Andrew Ross wrote:
> On Tue, Aug 18, 2009 at 05:03:39PM +0200, Daniel Sachse wrote:
>> Hi all,
>>
>> I've sent this question as a Support Request on SFnet and was referred 
>> to this mailing list (not without some good initial help, thanks smekal).
>>
>> The case is this:
>>
>> I'm trying to get PLplot to work together with Octave on a (urks) 
>> Windows machine. PLplot compiles (and runs) fine for GCC but as soon as 
>> I enable the Octave binding, I get this:
>>
>>  > mingw32-make
>> [..]
>> [ 43%] Generating plplot_octave.cc, tmp_stub
>> '-' is not recognized as an internal or external command,
>> operable program or batch file.
>> matwrap: C preprocessor exited with error status
>> mingw32-make[2]: *** [bindings/octave/plplot_octave.cc] Error 2
>> mingw32-make[1]: *** [bindings/octave/CMakeFiles/plplot_octave.dir/all] 
>> Error 2
>> mingw32-make: *** [all] Error 2
>>
>>
>> The "is not recognized" expression is a Windows command line error 
>> message when it tries to open/run something that does not exist.
>>
>> I have traced the error to the perl script matwrap, line ~211 
>> (plus/minus) where it seems that the program wants to try and fork - 
>> which, in Windows, leads to problems. What can I do?
>>
>> Greetings from Oslo,
>> Daniel
>> Huge fan of Open Source, but unfortunately bound to Windows.
> 
> Daniel, 
> 
> Thank you for your bug report. I don't know whether anyone has tried
> octave support for windows before - others can better advise on that.
> The octave support uses matwrap to automatically generate the 
> bindings. Unfortunately this no longer seems to be supported, and 
> this is at least part of the reason that example 19 is not 
> implemented - function callbacks are not supported.
> 
> I have been considering trying using swig instead. We already use 
> swig for generating the java, python and lua bindings. This might
> require a bit of work to set up but should in the long run be more
> flexible and maintainable since we already have some swig 
> experience amongst the developers. It should (?) also be portable 
> to windows.
> 
> Anyway, back to your current problem. I suspect if you had access to 
> a Linux / Unix box you could generate the necessary files from 
> matwrap there and then copy them to the build tree on your windows 
> box. Unless the plplot octave API changes (relatively uncommon) 
> this will not need to be repeated. Whilst not a perfect solution, 
> it would be interesting to see if this is enough to get a working 
> octave binding.
> 
> If you would like to try this, but don't have acccess to a linux
> box then let us know and we can probably send you the files
> off list.
> 
> Andrew


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to