Aha! Now I understand what the problem is. I divided the output from
BP console between stderr and stdout. My intention was to separate
"algorithm output" from other messages, warnings, etc. Perhaps we need
to rethink that or provide an option to send all output to stdout.
Look at the code in source/BP2/ConsoleMessages.[c/h] to see the current
behavior. You can easily change all of the elements of the array
gOutDestinations[] to point to stdout in the function
ConsoleMessagesInit() so that you can continue your work.
Anthony
On 7/7/20, 3:56 AM, Bernard Bel wrote:
> Strangely, $cmd = "./bp --version" yieds no output, nor does $cmd =
> "./bp --version > try.txt" create a non-empty "try.txt" file. However
> they both generate apache errors which are the actual expected output.
> For instance apache error when calling "./bp --version" is:
>
> Bol Processor console app
> Version 2.9.8 (Jul 7 2020)
>
> In other words, the output of apache error is actually the output
> expected from BP. In reality BP runs properly. For instance this PHP
> sequence:
>
> chdir("ctests");
> $cmd = "../bp -gr.NotReich -d --csoundout > out.sco";
> exec($cmd,$o);
> print_r($o);
>
> creates the correct out.sco file while it sends the "console" output to
> apache_error.log:
>
> Bol Processor console app
> Version 2.9.8 (Jul 7 2020)
> This is a beta version for evaluation...
> Reading grammar file -gr.NotReich...
> [...]
> In sum, the problem is not running BP but rather retrieving its "console
> output" somewhere else than apache_error.log. Unlike "hello.c" calling
> printf for the output:
|