The user then needs to link its program with the Agat library, where the functions are defined . If can be done with a command line like:
gcc -o aleat aleat.c -lAGAT.Remember to add a -I and/or -L if the libAGAT.h libAGAT.a is not in the directory where you are doing your compilations. Thus leading to something like:
gcc -o aleat aleat.c -I /net/safir/Agat/Sun4/ -L /net/safir/Agat/Sun4 -lAGATTake a look at reference manual ;)
#include <libAGAT.h>
void sndint_( char *ch, int *code){
agatSendInt(ch,*code);
}
void sndlng_( char *ch, int *code){
agatSendLong(ch,*code);
}
void sndflt_( char *ch, int *code){
agatSendFloat(ch,*code);
}
void snddbl_( char *ch, double *code){
agatSendDouble(ch,*code);
}
Now, here is a sample of a Fortan program:
program dummy
do i=0.d0,10.d0,1.d-1
f=dsqrt(x)
snddbl ("squareroot",f)
enddo
stop
end
Then to compile and link your programs together you should execute this line
to generate a .o file.gcc -c fortranInterf.c. And at the end:
f77 -o dummy dummy.f fortranInterf.o -lAgat
text="squareroot\0"
snddbl (texte,f)
Finaly just run your prepared programm under control of the agat server.
agat -f test.agt myprog
A good idea is to ask your Window Manager to place new windows at random position. (eg for ctwm: RandomPlacement) If you don't specify this, you won't be able to use button1 function.
Have a look to the Agat.ad file to see the different default ressources.