Post a reply
Username:
Note:If not registered, provide any username. For more comfort, register here.
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

Topic review - coding C++ and calling singular routines
Author Message
  Post subject:  Re: coding C++ and calling singular routines  Reply with quote
To answer my own question, to compile, I needed the following command:
Quote:
g++ -I../Singular/ -I../ -I../libpolys/ -I../factory/include/ -o libsing_test1 libsing-test1.cc -L../Singular/.libs/ -lSingular -L../libpolys/polys/.libs/ -lpolys -L../resources/.libs/ -lsingular_resources -L../omalloc/.libs/ -lomalloc


Later, to run the executable "libsing_test1", I needed to set the following environments:
Quote:
export SINGULAR_BASE=/home/mkolstein/Singular/Sources-spielwiese/
export SINGULAR_LIB_DIR=$SINGULAR_BASE/Singular/.libs/
export SINGULAR_LIB_2=$SINGULAR_BASE/libpolys/polys/.libs/
export SINGULAR_LIB_3=$SINGULAR_BASE/resources/.libs/
export SINGULAR_LIB_4=$SINGULAR_BASE/omalloc/.libs/

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SINGULAR_LIB_DIR:$SINGULAR_LIB_2:$SINGULAR_LIB_3:$SINGULAR_LIB_4
Post Posted: Mon Mar 20, 2017 6:45 pm
  Post subject:  Re: coding C++ and calling singular routines  Reply with quote
Hi,

Thanks for your reply.
I tried doing what you suggested.
I.e., I downloaded the source code for Singular from https://github.com/Singular/Sources
Then I compiled, using:
Quote:
source autogen.sh
./configure
make

Next, in my a subroutine, "mywork", where I copied the file
Quote:
"https://github.com/Singular/Sources/blob/master/libsing-test1.cc"


To compile this, I had to link to numerous include and lib directories, like this:
Quote:
g++ -I../Singular/ -I../ -I../libpolys/ -I../factory/include/ -o libsing_test1 libsing-test1.cc -L../Singular/.libs/ -lSingular


However, this gives me the error:

Quote:
/usr/bin/ld: /tmp/ccWfd0mN.o: undefined reference to symbol '_Z6p_ISetlP8ip_sring'
//home/mkolstein/Singular/Sources-spielwiese/libpolys/polys/.libs/libpolys-4.0.3.so: error adding symbols: DSO missing from command line

Do you have any suggestions, how to fix this?
Post Posted: Mon Mar 20, 2017 5:43 pm
  Post subject:  Re: coding C++ and calling singular routines  Reply with quote
Examples of using libSingular can be found at:
https://github.com/Singular/Sources/blo ... g-test1.cc
https://github.com/Singular/Sources/blo ... g-test2.cc
The comment at the beginning are for version 3.x.x,
for version 4.x.x use the output of libsingular-config
(resp. pkg-config).
To find the functions to call see
https://www.singular.uni-kl.de/dox/html/
(doxygen output from the sources)
and
http://www.mathematik.uni-kl.de/ftp/pub ... natomy.tgz
Post Posted: Thu Mar 16, 2017 6:18 pm
  Post subject:  coding C++ and calling singular routines  Reply with quote
Can I write a C++ code, and then link to some kind of Singular library so I can call Singular functions to solve my sets of polynomials from within my C++ code? Is there some manual somewhere to explain me how to do it?
If not, is there any other "system of polynomials solving" software that I can do this? I am currently looking into PHCpack which seems to be offer this possibility, but it's not straightforward. Are there any others? Bertini? Hompack? Macaulay2?

Cheers,

Machiel
Post Posted: Wed Mar 15, 2017 6:35 pm


It is currently Mon Dec 18, 2017 3:14 am
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group