Using libraries in FFI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Using libraries in FFI

Annick
Hi,

I am using a module in FFI which depends on a large library let’s say 10 dynamic .so files in a directory.
How is it possible to use this library without making all symbolic links ?

Annick
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using libraries in FFI

Annick
Hi Eliot,

        My problem is not with the VM, my problem is with my own library that I connect to through FFI.
I know where the libraries are !

I have tried to add them in /etc/ld.so.conf.d , that does not work.
I have tried export LD_LIBRARY_PATH, but somehow it erases some libraries needed by pharo.
I have done sudo ldconfig ...

In fact I have one library that depends from another one.
In FFI I call one method which calls another method in the other library.
I have tried to create symbolics links in the directory …
I have checked that nm gives the right symbol with the right type ..

So I have no idea what to try now !

Annick

Le 22 oct. 2014 à 12:46, Eliot Miranda <[hidden email]> a écrit :

> Hi Annick,
>
>     LD_LIBRARY_PATH should be set to point to the relevant directories, but this can be tricky as there is a lot if variation across Linux distros as to where libraries are kept.  The squeak script that comes with the Cog VMs extends LD_LIBRARY_PATH, so if you know where your libraries are you can use the script to find the other libraries the VM needs (c library and plugins).
>
> Eliot (phone)
>
> On Oct 22, 2014, at 2:55 AM, Annick Fron <[hidden email]> wrote:
>
>> Hi,
>>
>> I am using a module in FFI which depends on a large library let’s say 10 dynamic .so files in a directory.
>> How is it possible to use this library without making all symbolic links ?
>>
>> Annick
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using libraries in FFI

philippeback
Try to run pharo with strace.

That way you will see all syscalls including libraries opens that pharo does attempt.

That's what I do when trying to figure out such things.

HTH
Phil
 


On Wed, Oct 22, 2014 at 2:45 PM, Annick Fron <[hidden email]> wrote:
Hi Eliot,

        My problem is not with the VM, my problem is with my own library that I connect to through FFI.
I know where the libraries are !

I have tried to add them in /etc/ld.so.conf.d , that does not work.
I have tried export LD_LIBRARY_PATH, but somehow it erases some libraries needed by pharo.
I have done sudo ldconfig ...

In fact I have one library that depends from another one.
In FFI I call one method which calls another method in the other library.
I have tried to create symbolics links in the directory …
I have checked that nm gives the right symbol with the right type ..

So I have no idea what to try now !

Annick

Le 22 oct. 2014 à 12:46, Eliot Miranda <[hidden email]> a écrit :

> Hi Annick,
>
>     LD_LIBRARY_PATH should be set to point to the relevant directories, but this can be tricky as there is a lot if variation across Linux distros as to where libraries are kept.  The squeak script that comes with the Cog VMs extends LD_LIBRARY_PATH, so if you know where your libraries are you can use the script to find the other libraries the VM needs (c library and plugins).
>
> Eliot (phone)
>
> On Oct 22, 2014, at 2:55 AM, Annick Fron <[hidden email]> wrote:
>
>> Hi,
>>
>> I am using a module in FFI which depends on a large library let’s say 10 dynamic .so files in a directory.
>> How is it possible to use this library without making all symbolic links ?
>>
>> Annick
>




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using libraries in FFI

Eliot Miranda-2
In reply to this post by Annick
Hi Annick,

On Wed, Oct 22, 2014 at 5:45 AM, Annick Fron <[hidden email]> wrote:
Hi Eliot,

        My problem is not with the VM, my problem is with my own library that I connect to through FFI.
I know where the libraries are !

I have tried to add them in /etc/ld.so.conf.d , that does not work.
I have tried export LD_LIBRARY_PATH, but somehow it erases some libraries needed by pharo.

But if you use the script I include with my VMs it won't erase.  It extends LD_LIBRARY_PATH.  Find an example attached.

 
I have done sudo ldconfig ...

In fact I have one library that depends from another one.
In FFI I call one method which calls another method in the other library.
I have tried to create symbolics links in the directory …
I have checked that nm gives the right symbol with the right type ..

So I have no idea what to try now !

Annick

Le 22 oct. 2014 à 12:46, Eliot Miranda <[hidden email]> a écrit :

> Hi Annick,
>
>     LD_LIBRARY_PATH should be set to point to the relevant directories, but this can be tricky as there is a lot if variation across Linux distros as to where libraries are kept.  The squeak script that comes with the Cog VMs extends LD_LIBRARY_PATH, so if you know where your libraries are you can use the script to find the other libraries the VM needs (c library and plugins).
>
> Eliot (phone)
>
> On Oct 22, 2014, at 2:55 AM, Annick Fron <[hidden email]> wrote:
>
>> Hi,
>>
>> I am using a module in FFI which depends on a large library let’s say 10 dynamic .so files in a directory.
>> How is it possible to use this library without making all symbolic links ?
>>
>> Annick
>





--
best,
Eliot

squeak (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using libraries in FFI

Eliot Miranda-2


On Thu, Oct 23, 2014 at 8:46 AM, Eliot Miranda <[hidden email]> wrote:
Hi Annick,

On Wed, Oct 22, 2014 at 5:45 AM, Annick Fron <[hidden email]> wrote:
Hi Eliot,

        My problem is not with the VM, my problem is with my own library that I connect to through FFI.
I know where the libraries are !

I have tried to add them in /etc/ld.so.conf.d , that does not work.
I have tried export LD_LIBRARY_PATH, but somehow it erases some libraries needed by pharo.

But if you use the script I include with my VMs it won't erase.  It extends LD_LIBRARY_PATH.  Find an example attached.

Here's the operative line (the last one). PLUGINS is the directory containing VM plugins, SVMLLP is "Smalltalk VM LD_LIBRARY_PATH" and specifies the directories containing the C libraries the VM depends on (C library, libuuid, etc).

LD_LIBRARY_PATH=$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH} exec "$BIN/squeak" "$@"
 

 
I have done sudo ldconfig ...

In fact I have one library that depends from another one.
In FFI I call one method which calls another method in the other library.
I have tried to create symbolics links in the directory …
I have checked that nm gives the right symbol with the right type ..

So I have no idea what to try now !

Annick

Le 22 oct. 2014 à 12:46, Eliot Miranda <[hidden email]> a écrit :

> Hi Annick,
>
>     LD_LIBRARY_PATH should be set to point to the relevant directories, but this can be tricky as there is a lot if variation across Linux distros as to where libraries are kept.  The squeak script that comes with the Cog VMs extends LD_LIBRARY_PATH, so if you know where your libraries are you can use the script to find the other libraries the VM needs (c library and plugins).
>
> Eliot (phone)
>
> On Oct 22, 2014, at 2:55 AM, Annick Fron <[hidden email]> wrote:
>
>> Hi,
>>
>> I am using a module in FFI which depends on a large library let’s say 10 dynamic .so files in a directory.
>> How is it possible to use this library without making all symbolic links ?
>>
>> Annick
>





--
best,
Eliot



--
best,
Eliot
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using libraries in FFI

Eliot Miranda-2
Hi Wolfgang,

On Thu, Oct 23, 2014 at 8:59 AM, Wolfgang Eder <[hidden email]> wrote:
hi,
shouldn’t there be quotes here like such:

LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec "$BIN/squeak" "$@„

yes, thanks!
 

cheers wolfgang

Am 23.10.2014 um 17:49 schrieb Eliot Miranda <[hidden email]>:

LD_LIBRARY_PATH=$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH} exec "$BIN/squeak" "$@"
 







--
best,
Eliot
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using libraries in FFI

Annick
In reply to this post by Eliot Miranda-2
Thank you !

I will try that.
Annick
Le 23 oct. 2014 à 17:49, Eliot Miranda <[hidden email]> a écrit :



On Thu, Oct 23, 2014 at 8:46 AM, Eliot Miranda <[hidden email]> wrote:
Hi Annick,

On Wed, Oct 22, 2014 at 5:45 AM, Annick Fron <[hidden email]> wrote:
Hi Eliot,

        My problem is not with the VM, my problem is with my own library that I connect to through FFI.
I know where the libraries are !

I have tried to add them in /etc/ld.so.conf.d , that does not work.
I have tried export LD_LIBRARY_PATH, but somehow it erases some libraries needed by pharo.

But if you use the script I include with my VMs it won't erase.  It extends LD_LIBRARY_PATH.  Find an example attached.

Here's the operative line (the last one). PLUGINS is the directory containing VM plugins, SVMLLP is "Smalltalk VM LD_LIBRARY_PATH" and specifies the directories containing the C libraries the VM depends on (C library, libuuid, etc).

LD_LIBRARY_PATH=$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH} exec "$BIN/squeak" "$@"
 

 
I have done sudo ldconfig ...

In fact I have one library that depends from another one.
In FFI I call one method which calls another method in the other library.
I have tried to create symbolics links in the directory …
I have checked that nm gives the right symbol with the right type ..

So I have no idea what to try now !

Annick

Le 22 oct. 2014 à 12:46, Eliot Miranda <[hidden email]> a écrit :

> Hi Annick,
>
>     LD_LIBRARY_PATH should be set to point to the relevant directories, but this can be tricky as there is a lot if variation across Linux distros as to where libraries are kept.  The squeak script that comes with the Cog VMs extends LD_LIBRARY_PATH, so if you know where your libraries are you can use the script to find the other libraries the VM needs (c library and plugins).
>
> Eliot (phone)
>
> On Oct 22, 2014, at 2:55 AM, Annick Fron <[hidden email]> wrote:
>
>> Hi,
>>
>> I am using a module in FFI which depends on a large library let’s say 10 dynamic .so files in a directory.
>> How is it possible to use this library without making all symbolic links ?
>>
>> Annick
>





--
best,
Eliot



--
best,
Eliot