LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-18-2011, 10:40 AM   #1
albertjan
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Rep: Reputation: 0
problem loading libimf.so using Python ctypes


Hi,

For a Python program that reads Spss system files I (actually, the .so files from Spss Inc. need it.) need libimf.so, which is the Intel math Fortran library. I am on ubuntu 10 (32 bits).
I downloaded the libraries from the intel website*) I untarred them and ran ran make install.**) Then I tried loading the said .so file with Python ctypes, but I got and OSError ("undefined symbol: __ashldi3"; full traceback below). Any ideas how to solve this?
I tried loading a couple of other .so files from the same library, and they work.

Thanks in advance!

Albert-Jan

PS: please note that I'm a Linux newbie

*)
https://registrationcenter.intel.com...&rm=NCOM&lang=

**)
cd /home/antonia/Downloads/l_fcompxe_2011.2.137_redist
tar zxf '/home/antonia/Downloads/l_fcompxe_2011.2.137_redist.tgz'
make install

***)
>>> import os, ctypes
>>> "libimf.so" in os.listdir("/home/antonia/Downloads/l_fcompxe_2011.2.137_redist/compiler/lib/ia32")
True
>>> ctypes.cdll.LoadLibrary("/home/antonia/Downloads/l_fcompxe_2011.2.137_redist/compiler/lib/ia32/libimf.so")
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
ctypes.cdll.LoadLibrary("/home/antonia/Downloads/l_fcompxe_2011.2.137_redist/compiler/lib/ia32/libimf.so")
File "/usr/lib/python2.6/ctypes/__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /home/antonia/Downloads/l_fcompxe_2011.2.137_redist/compiler/lib/ia32/libimf.so: undefined symbol: __ashldi3
>>> ctypes.cdll.LoadLibrary("/home/antonia/Downloads/l_fcompxe_2011.2.137_redist/compiler/lib/ia32/libirc.so")
<CDLL '/home/antonia/Downloads/l_fcompxe_2011.2.137_redist/compiler/lib/ia32/libirc.so', handle a547670 at a51b28c>
 
Old 03-18-2011, 12:14 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ. .. .. ..

1) 'libimf.so' 13 January 2011 :
readelf -s /opt/intel/composerxe-2011.2.137/compiler/lib/ia32/libimf.so | grep ashldi3
Code:
    16: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __ashldi3
  7816: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __ashldi3
2) 'libimf.so' 29 March 2009 :
readelf -s /opt/intel/Compiler/11.0/083/lib/ia32/libimf.so | grep ashldi3 : Nothing.

3) Intel-icc8-libs http://rpm.pbone.net/index.php3/stat....i386.rpm.html
-icc9 http://rpm.pbone.net/index.php3/stat....i386.rpm.html

Unless your application is created 2011, a "2005-2009" 'libimf.so' may do ?

..
 
Old 03-18-2011, 04:04 PM   #3
albertjan
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Talking

Hi Knudfl,

Thanks a lot for helping me! I'm a bit further now, and I've learnt a thing or two about Linux. Right after I installed libimf.so, I got an error that libstdc++.so.5 couldn't be found. So I installed that one, too. Now I get an error about libicui18n.so.32. I'm thinking, isn't it possible to, just like in the R statistical programming language (which is heavily influenced by Unix/Linux), do something like install.packages(pkgname, dependencies=TRUE).
I can't even find libicui18n.so.32 (at least not for my distro). Btw, is there never any risk that an older so-file version overwrites a newer one? Or will that never happen as long as alternative versions are never installed in /usr/lib ?

Okay, been tinkering with this long enough for now. Will drink some high-sulphite house wine *logging off* ;-)

Best wishes,
Albert-Jan
 
Old 03-18-2011, 06:47 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
'libicui18n.so.32' : So it is some really old software !

Libicu34 is Ubuntu 6.10. ( Year 2006 ) No old icu32 packages.
( Old Debian used icu18, icu36.)

The files are in this package : libicu32-3.2-2mdk.i586.rpm ( 2005 )
ftp://ftp.sunet.se/pub/Linux/distrib...-2mdk.i586.rpm
Suggest : sudo alien libicu32-3.2-2mdk.i586.rpm : A package.deb will be created.
The file libicui18n.so.32 will not do alone : The files libicu***.so.X all depend
on each other. But no other dependencies : 'sudo dpkg -i <package>.deb' will do.

( Source code : icu-3.2 ).

Quote:
.. any risk that an older so-file version overwrites a newer one ?
What we have seen till now all have unique file names.
The intel files have different "hideaway locations".
( libicu32 , libicu40 , libicu42 can be installed at the same time.)
So the answer is : So far no conflicts.

..

Last edited by knudfl; 03-18-2011 at 07:43 PM.
 
Old 03-20-2011, 02:06 PM   #5
albertjan
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,

Thank you once again! I'll certainly try this. I'm planning to write a small shell script and call this from within Python if the needed files are not installed.


Quote:
The files are in this package : libicu32-3.2-2mdk.i586.rpm ( 2005 )
ftp://ftp.sunet.se/pub/Linux/distrib...-2mdk.i586.rpm
May I ask how you knew that the right files/versons are in this package? Is this expert knowledge? Or is there some way of finding such things out myself in the future? (other than becoming an expert myself ;-)

Thanks!
Albert-Jan
Netherlands
 
Old 03-20-2011, 05:03 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
May I ask how you knew that the right files/versions are in this package ?
Actually this example is easy : The package libicu32 has these library names :
Real name = libicu***.so.32.0, "so name" = libicu***.so.32 .

( libicu40 : ***.so.40, libicu42 : ***so.42 ).

There are lots of examples, where the naming is not that obvious.
For later versions http://packages.ubuntu.com/karmic/libicu40
Then enter a file name in "Search" and choose 'package contents'
http://packages.ubuntu.com/search?se...bicui18n.so.40

Searching for an old file : http://rpm.pbone.net/ > Advanced search.
Not "deb" packages, but you will get information about the library-<version>,
that provides the file in question.
The link in post #4 is found at http://rpm.pbone.net/

..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error Linux Fortran compiler: libimf.so terrence Programming 6 06-15-2012 03:51 PM
java with python ctypes 1mela Programming 1 02-28-2010 05:00 PM
python problem - compiled from source - python -V still showing old version txm123 Linux - Newbie 1 02-15-2006 11:05 AM
Problem loading file of words in python Teoryn Programming 1 07-25-2005 07:40 PM
Python: loading page from forum fiomba Linux - Software 13 11-24-2004 09:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration