source: git/HOWTO-libsingular @ 5f32d50

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