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 - Could not find dynamic library: p_Procs_FieldIndep.so (path)
Author Message
  Post subject:  Re: Could not find dynamic library: p_Procs_FieldIndep.so (path)  Reply with quote
Thanks for your help. Indeed, doing this did the trick:

Code:
export SINGULAR_BASE=/home/mydir/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 SINGULAR_PROCS_DIR=$SINGULAR_BASE/Singular/MOD/
export SINGULARPATH=$SINGULAR_BASE/Singular/LIB/

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SINGULAR_LIB_DIR:$SINGULAR_LIB_2:$SINGULAR_LIB_3:$SINGULAR_LIB_4:$SINGULAR_LIB_5:$SINGULARPATH:$SINGULAR_PROCS_DIR
Post Posted: Fri Mar 31, 2017 3:17 pm
  Post subject:  Re: Could not find dynamic library: p_Procs_FieldIndep.so (path)  Reply with quote
These are 2 different things:

A) shared libraries: the rules for your OS apply: i.e. set LD_LIBRARY_PATH for the dynamic linker to find then
(see "man ld", "man ldconfig", "info gcc").
They are called lib*.so and can be found (on Linux) by "ldd libSingular.so"

B) dynamic modules for Singular: their name does not start with lib, and they are searched in the places given by SINGULAR_PROCS_DIR (and ...., see my previous post)
Post Posted: Tue Mar 28, 2017 11:03 am
  Post subject:  Re: Could not find dynamic library: p_Procs_FieldIndep.so (path)  Reply with quote
From where my own code is located, the Singular directory is 2 directories up.
So I make this call in my code:
Quote:
siInit((char *)"../../Singular/.libs/libSingular.so");

Next, I do an export, as you suggested, for the following directories:
Quote:
export SINGULAR_PROCS_DIR=../../Singular/MOD/
export SINGULARPATH=../../Singular/LIB/

Now, when running my code it complains:
Quote:
./mysingular: error while loading shared libraries: libSingular-4.1.0.so: cannot open shared object file: No such file or directory

The only "libSingular-4.1.0.so" I can find is this one:
Quote:
../../Singular/.libs/libSingular-4.1.0.so

Do I have to link this to the "MOD" directory?
Post Posted: Fri Mar 24, 2017 5:43 pm
  Post subject:  Re: Could not find dynamic library: p_Procs_FieldIndep.so (path)  Reply with quote
First of all: siInit must only be called once.

Its arguments should be a readable file (usually it is the main binary Singular,
derived from argv[0]).
If the directory this file is in is %b, and %r is the prefix given in the configuration (or /usr/local
if nothing was given)
then Singulars *.lib files are searched in %b/../share/singular/LIB, and %b/LIB,
dynamic modules are searched in "%b/MOD;" "%r/lib/singular/MOD;" "%r/libexec/singular/MOD;".
(see ressources/feRessources.cc).
Otherwise, one may set the environment variables
SINGULAR_PROCS_DIR for the dynamic modules,
SINGULARPATH for *.lib files,
Post Posted: Thu Mar 23, 2017 12:27 pm
  Post subject:  Re: Could not find dynamic library: p_Procs_FieldIndep.so (path)  Reply with quote
Adding
Quote:
siInit((char *)"./Singular/libsingular.so");

still gives me:
Quote:
? cannot open `standard.lib`
// ** 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.

Adding both lines like:
Quote:
siInit((char *)"../../Singular/.libs/libSingular.so");
siInit((char *)"../../libpolys/polys/.libs/p_Procs_FieldIndep.so");

gives me:
Quote:
? cannot open `standard.lib`
coeff 7 already initialized
coeff 8 already initialized
? cannot open `standard.lib`
// ** Could not find dynamic library: p_Procs_FieldIndep.so (path )
// ** Singular will work properly, but much slower.
Post Posted: Wed Mar 22, 2017 1:04 pm
  Post subject:  Re: Could not find dynamic library: p_Procs_FieldIndep.so (path)  Reply with quote
You are missing the initialization:
Code:
void main()
{
  // init path names etc.: the string should point to an existing
  //            executable in a directory $B
  //            LIBs are searched in $B/LIB, $B/../LIB,
  //            see kernel/feRessource.cc
  // also needed to find its dynamic modules in $B/MOD, $B/../lib/singular/MOD, $B/../libexec/singular/MOD,...
  siInit((char *)"./Singular/libsingular.so");
....
Post Posted: Wed Mar 22, 2017 11:05 am
  Post subject:  Could not find dynamic library: p_Procs_FieldIndep.so (path)  Reply with quote
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?
Post Posted: Tue Mar 21, 2017 6:58 pm


It is currently Fri May 13, 2022 11:03 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group