I downloaded the source code for Singular from
https://github.com/Singular/Sources and compiled it succesfully.
Now I want to create my own code and link it to the Singular libs.
My (very simple) code is:
Code:
#include <libsingular.h>
int main()
{
char** n = (char**) omalloc( 3*sizeof(char*) );
n[0]=omStrDup("x");
n[1]=omStrDup("y");
n[2]=omStrDup("z");
ring R = rDefault(0, 3, n);
}
I compile this with:
Quote:
SINGULAR_BASE=/home/mkolstein/Singular/Sources-spielwiese/
FOO=$SINGULAR_BASE/libpolys/polys/.libs/p_Procs_FieldIndep.so
g++ -I$SINGULAR_BASE/Singular/ -I$SINGULAR_BASE/ -I$SINGULAR_BASE/libpolys/ -I$SINGULAR_BASE/factory/include/ -I$SINGULAR_BASE/libpolys/polys/.libs/ -o mysingular mySingular.cxx -L$SINGULAR_BASE/Singular/.libs/ -lSingular -L$SINGULAR_BASE/libpolys/polys/.libs/ -lpolys $FOO -L$SINGULAR_BASE/resources/.libs/ -lsingular_resources -L$SINGULAR_BASE/omalloc/.libs/ -lomalloc
and before running my executable, also make sure LD_LIBRARY_PATH can find all ".so" files:
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 SINGULAR_LIB_5=$SINGULAR_BASE/libpolys/polys/.libs/p_Procs_FieldIndep.so
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SINGULAR_LIB_DIR:$SINGULAR_LIB_2:$SINGULAR_LIB_3:$SINGULAR_LIB_4:$SINGULAR_LIB_5
However, when I run my executable "mysingular", I get the following warning:
Quote:
Bug >>feArgv0 == NULL<< at feResource.cc:403
// ** Could not find dynamic library: p_Procs_FieldIndep.so (path )
// ** Singular will work properly, but much slower.
// ** See the INSTALL section in the Singular manual for details.
How can I avoid this?