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

:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
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:
g++ -I../Singular/ -I../ -I../libpolys/ -I../factory/include/ -o libsing_test1 -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:
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/

Post Posted: Mon Mar 20, 2017 6:45 pm
  Post subject:  Re: coding C++ and calling singular routines  Reply with quote

Thanks for your reply.
I tried doing what you suggested.
I.e., I downloaded the source code for Singular from
Then I compiled, using:

Next, in my a subroutine, "mywork", where I copied the file

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

However, this gives me the error:

/usr/bin/ld: /tmp/ccWfd0mN.o: undefined reference to symbol '_Z6p_ISetlP8ip_sring'
//home/mkolstein/Singular/Sources-spielwiese/libpolys/polys/.libs/ 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: ... ...
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
(doxygen output from the sources)
and ... 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?


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

It is currently Sun Dec 16, 2018 5:57 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group