[GAP Forum] Compiling GAP for Use in C Program
Chris Jefferson
caj21 at st-andrews.ac.uk
Sat Feb 15 12:04:51 GMT 2014
While this is not at all the answer to what you asked, you could
consider using SCSCP, which is a library which lets you communicate with
GAP. I have a very simple C++ SCSCP library here:
https://bitbucket.org/ChrisJefferson/miniscscp, although it is easy to
use SCSCP (except you have to use an XML library)
If you are making many very cheap calls to GAP this can be a bit slow,
but it also makes it easy to parallelise your code as well.
Chris
On 14/02/14 19:37, Wolstenholme, Robert wrote:
> I want to compile some of my GAP functions into static libraries for use in a C program. I have compiled them using gac -c on Ubuntu but I 'm not sure how to now call these functions in my C program. I tried a few things but whenever I tried to link and create a binary I got an error.
>
> For example I initially tried a "Hello World" example with
>
> HelloWorld.g =
> -------------------------------------------------------------+
> PrintEO := function ( n ) Print( "Hello World" ); end; |
> -------------------------------------------------------------+
>
> HelloWorldMain.c =
> -----------------------+
> #include <stdio.h> |
> |
> '''?void PrintEO()?'''' |
> int main() |
> { |
> '''?PrintEO()?''' |
> return 0; |
> } |
> -----------------------+
> Where I don't know what to put for the '''?PrintEO()?'''. I analysed the created source code using gac -C but it still wasn't clear to me. How would I go about getting this to work?
>
> Rob
>
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
More information about the Forum
mailing list