spielwiese
Last change
on this file since 5f32d50 was
5f32d50,
checked in by Hans Schoenemann <hannes@…>, 12 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
|
Line | |
---|
1 | export CC="gcc -fpic -DPIC -DLIBSINGULAR" |
---|
2 | export CXX="g++ -fpic -DPIC -DLIBSINGULAR" |
---|
3 | |
---|
4 | ./configure |
---|
5 | or |
---|
6 | ./configure --without-dynamic-kernel |
---|
7 | |
---|
8 | make install-libsingular |
---|
9 | |
---|
10 | --------------------------------------- |
---|
11 | how to compile and run the the example: |
---|
12 | g++ -I......include -o tt tt.cc -L..../Singular -lsingular |
---|
13 | export SINGULAR="..../Singular-3-1-3/" |
---|
14 | export SINGULAR_SYSTEM_TYPE="ix86Mac-darwin/lib" |
---|
15 | if [ "${SINGULAR_SYSTEM_TYPE}" = "ix86Mac-darwin/lib" ]; then |
---|
16 | export |
---|
17 | DYLD_LIBRARY_PATH="${SINGULAR}/${SINGULAR_SYSTEM_TYPE}:${DYLD_LIBRARY_PATH}" |
---|
18 | else |
---|
19 | export |
---|
20 | LD_LIBRARY_PATH="${SINGULAR}/${SINGULAR_SYSTEM_TYPE}:${LD_LIBRARY_PATH}" |
---|
21 | fi |
---|
22 | unset SINGULAR_SYSTEM_TYPE |
---|
23 | |
---|
24 | ./tt |
---|
25 | -------------------------------------- |
---|
26 | the example: |
---|
27 | #include <libsingular.h> |
---|
28 | void 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.