[GAP Forum] Technical question / interface

Frank Lübeck Frank.Luebeck at math.rwth-aachen.de
Thu Aug 30 11:58:41 BST 2007


On Tue, Aug 28, 2007 at 11:57:47PM +0200, Thomas Rehn wrote:
> for a research project I try to utilize the group calculation facilities of
> GAP. Due to performance and design issues the main program implementing
> various algorithms is written in C and C++. For using GAP I wrote a wrapper
> class (which uses popen and two pipes) for the GAP binary and its command
> line. The problem here is that on writing a "g := Group(...);" command
> the "gap> "-prompt appears twice (whereas on other used commands it appears
> only once), so I have no unique easy mark to use to recognize the end of a
> GAP calculation. Treating the group assignments separately waiting for two
> prompts would be possible, but this is not a very general approach.
>
> Do you know a better way to interface GAP for this purpose or a flexible
> workaround for the prompt-mark problem?

Dear Thomas, dear Forum,

For remote GAP processes I'm calling GAP with the options:

   gap  -b -q -e -n -T -r

Try 'gap -h' to get an explanation of these options. In particular,
the -q makes GAP "quiet" and it doesn't print prompts anymore.

When sending a request to such a remote GAP process I append a statement
like 'Print("\nENDGAPOUTPUT\n");' such that I know that the output
corresponding to  my input is finished when I find a line containing
"ENDGAPOUTPUT".

With best regards,

 Frank

-- 
///  Dr. Frank Lübeck, Lehrstuhl D für Mathematik, Templergraben 64,  ///
\\\                    52062 Aachen, Germany                          \\\
///  E-mail: Frank.Luebeck at Math.RWTH-Aachen.De                        ///
\\\  WWW:    http://www.math.rwth-aachen.de/~Frank.Luebeck/           \\\



More information about the Forum mailing list