0

I have Ubuntu 14.4. I want to load Py3.4 library (Lazarus code) but I don't know .so file name. i see several files by find-file:

  • libpython3.4.so
  • libpython3.4m.so
  • libpython3.4m.so.1

(each file in its own folder). What filename to use? In which folder must I look into?

1 Answer 1

3

Step 1: Where are the shared objects seeming to be?

schadenfreude@oubliette:~$ locate libpython3.4  | grep /usr/lib | grep so
/usr/lib/debug/usr/lib/libpython3.4m.so.1.0-gdb.py
/usr/lib/debug/usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0  
/usr/lib/python3.4/config-3.4dm-x86_64-linux-gnu/libpython3.4.so  
/usr/lib/python3.4/config-3.4dm-x86_64-linux-gnu/libpython3.4dm.so  
/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/libpython3.4.so  
/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/libpython3.4m.so  
/usr/lib/x86_64-linux-gnu/libpython3.4dm.so  
/usr/lib/x86_64-linux-gnu/libpython3.4dm.so.1  
/usr/lib/x86_64-linux-gnu/libpython3.4dm.so.1.0  
/usr/lib/x86_64-linux-gnu/libpython3.4m.so  
/usr/lib/x86_64-linux-gnu/libpython3.4m.so.1  
/usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0  

Step 2: Where do these things really point?

schadenfreude@oubliette:~$ ls -la /usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/ | grep libpython3.4 | grep so  
lrwxrwxrwx  1 root root       41 Apr 11  2014 libpython3.4m.so -> ../../x86_64-linux-gnu/libpython3.4m.so.1  
lrwxrwxrwx  1 root root       41 Apr 11  2014 libpython3.4.so -> ../../x86_64-linux-gnu/libpython3.4m.so.1  

schadenfreude@oubliette:~$ ls -la /usr/lib/x86_64-linux-gnu/ | grep libpython3.4 | grep so
lrwxrwxrwx   1 root root       19 Apr 11  2014 libpython3.4dm.so -> libpython3.4dm.so.1  
lrwxrwxrwx   1 root root       21 Apr 11  2014 libpython3.4dm.so.1 -> libpython3.4dm.so.1.0  
-rw-r--r--   1 root root  8669406 Apr 11  2014 libpython3.4dm.so.1.0  
lrwxrwxrwx   1 root root       18 Apr 11  2014 libpython3.4m.so -> libpython3.4m.so.1  
lrwxrwxrwx   1 root root       20 Apr 11  2014 libpython3.4m.so.1 -> libpython3.4m.so.1.0  
-rw-r--r--   1 root root  4292408 Apr 11  2014 libpython3.4m.so.1.0  

So, the one that's not just a link /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0

4
  • 1
    I think you should be using the link (/usr/lib/x86_64-linux-gnu/libpython3.4m.so.1), otherwise when the package is upgraded, you might end up using an older version. Also, it would easier to see look at the package contents: dpkg -L libpython3.4.
    – muru
    Feb 8, 2015 at 10:40
  • Fair point, and uptick. I'ld want to know what I was linking against changed, and rebuild/retest my package though. So, I want to be as specific as possible if I'm building it for me... or as generic as possible if I just want it to autobuild in a ppa (>= version numbers etc) Feb 8, 2015 at 10:41
  • you could reduce grep /usr/lib | grep so to grep '/usr/lib.*\.so' Feb 8, 2015 at 12:10
  • 1
    A fair point. My strong point isn't regexes, it's clarity and showing the OP how I reduced my result set over a step or two. I'll take a sub-optimal solution in exchange for clarity. Feb 8, 2015 at 12:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .