source: git/HOWTO-libsingular @ dc0a3b

spielwiese
Last change on this file since dc0a3b was dc0a3b, checked in by Hans Schoenemann <hannes@…>, 13 years ago
without dynamic kernel for libsingular git-svn-id: file:///usr/local/Singular/svn/trunk@14228 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.1 KB
Line 
1export CC="gcc -fpic -DPIC -DLIBSINGULAR"
2export CXX="g++ -fpic -DPIC -DLIBSINGULAR"
3
4./configure
5or
6./configure --without-dynamic-kernel
7
8make install-libsingular
9
10---------------------------------------
11how to compile and run the the example:
12g++ -I......include -o tt tt.cc -L..../Singular -lsingular
13export LD_LIBRARY_PATH=...../Singular
14./tt
15--------------------------------------
16the example:
17#include <libsingular.h>
18void main()
19{
20  // init path names etc.
21  siInit((char *)"/home/hannes/singular-gap/Singular/p_Procs_FieldZp.so");
22
23  // construct the ring Z/32003[x,y,z]
24  // the variable names
25  char **n=(char**)omalloc(3*sizeof(char*));
26  n[0]=omStrDup("x");
27  n[1]=omStrDup("y");
28  n[2]=omStrDup("z");
29
30  ring R=rDefault(32003,3,n);
31  // make R the default ring:
32  rChangeCurrRing(R);
33
34  // create the polynomial 1
35  poly p1=p_ISet(1,R);
36
37  // create tthe polynomial 2*x^3*z^2
38  poly p2=p_ISet(2,R);
39  pSetExp(p2,1,3);
40  pSetExp(p2,3,2);
41  pSetm(p2);
42
43  // print p1 + p2
44  pWrite(p1); printf(" + \n"); pWrite(p2); printf("\n");
45
46  // compute p1+p2
47  p1=p_Add_q(p1,p2,R); p2=NULL;
48  pWrite(p1);
49
50  // cleanup:
51  pDelete(&p1);
52  rKill(R);
53}
Note: See TracBrowser for help on using the repository browser.