Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to compile a GAP program in Linux/Debian?

I installed GAP in my Ubuntu 20.04.

I can write programs and compile them using terminal by writing gap then do the things that I found in GAP manual in your website without any difficult.

But, if I closed the terminal I lose everything, so obviously I have to write a program in a text editor first, then save it (this is my first problem do I have to save it as a .g file or .gap file or….?), next is to compile this program using terminal, I remember when I used C program we had to put something like this: gcc program.c -o program .

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So my second question (that I am sure you guessed) is how to compile this GAP file if we use GNU compiler?
Thanks in advance.

>Solution :

good question!

In section 2.2 of the GAP tutorial it explains that you should first save your file that contains your code with the extension .g, and then, after starting GAP in a terminal, you can use the Read() function to read your code from the file. This way, any functions or variables that you have in your file are read into GAP, to then be accessed by you later in the session.

For example, if I have some file example.g, and it is saved to my home directory, then I could navigate to my home directory in a terminal, start GAP with the gap command, and then type the following:

gap> Read("example.g");

and my code would be executed. See GAP tutorial for more info about this, in section 2.2. I am not sure if the GNU compiler would work with the GAP programming language. Hopefully this helps!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading