Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28495 views
License: GPL3
ubuntu2004
1
% Copyright (c) 2000 The PARI Group
2
%
3
% This file is part of the PARI/GP documentation
4
%
5
% Permission is granted to copy, distribute and/or modify this document
6
% under the terms of the GNU General Public License
7
\appendix{A Sample program and Makefile}
8
9
We assume that you have installed the PARI library and include files as
10
explained in Appendix A or in the installation guide. If you chose
11
differently any of the directory names, change them accordingly in the
12
Makefiles.
13
14
If the program example that we have given is in the file \kbd{extgcd.c}, then
15
a sample Makefile might look as follows. Note that the actual file
16
\kbd{examples/Makefile} is more elaborate and you should have a look at it if
17
you intend to use \kbd{install()} on custom made functions.
18
19
\bprog
20
CC = cc
21
INCDIR = @includedir
22
LIBDIR = @libdir
23
CFLAGS = -O -I$(INCDIR) -L$(LIBDIR)
24
25
all: extgcd
26
27
extgcd: extgcd.c
28
$(CC) $(CFLAGS) -o extgcd extgcd.c -lpari -lm
29
@eprog
30
31
\noindent We then give the listing of the program \kbd{examples/extgcd.c}
32
seen in detail in \secref{se:prog}.
33
34
\bprogfile{../examples/extgcd.c}
35
\vfill\eject
36
37