Re: [Distutils] Absolute path library names

Lee Taylor wrote:
I'm not exactly sure if I know what you are trying to do, but hopefully the following might help... The 'libraries' key is only for listing libraries that will be linked in (ie. -lpgs -lppc, from your example) and the 'library_dirs' key is for listing library directories that will be looked in for the libraries to link (ie. -L/usr/X11R6/lib/X11). So, I believe your setup.py should look like: setup (.... ext_modules = [('name', {'sources' : [ your c sources ], 'libraries': ['pgs', 'ppc'], 'library_dirs' : ['/usr/X11R6/lib/X11'] }) ] ) Hope this helps. Brad

The error ist that shared_library_filename is nowhere defined. As I can guess from the source this function should look like: def shared_library_filename(lib): return 'lib'+lib+'.so' For a workaround use this: ... 'libraries': ['pgs','ppc','X11'], 'library_dirs': ['/usr/X11R6/lib'] .. because you want -L/usr/X11R6/lib -lX11. Bastian Kleineidam

Bastian Kleineidam wrote:
It is not a missing function, it is only a wrong piece of code. It should look like this: --------------------------------------------------------------------------------- diff -BurN --minimal --exclude=*.pyc distutils.orig/distutils/unixccompiler.py distutils.patched/distutils/unixccompiler.py --- distutils.orig/distutils/unixccompiler.py Wed Jun 28 03:29:09 2000 +++ distutils.patched/distutils/unixccompiler.py Wed Jul 12 15:29:21 2000 @@ -320,7 +320,7 @@ def find_library_file (self, dirs, lib): for dir in dirs: - shared = os.path.join (dir, self.shared_library_filename (lib)) + shared = os.path.join (dir, self.library_filename (lib,'shared')) static = os.path.join (dir, self.library_filename (lib)) # We're second-guessing the linker here, with not much hard ---------------------------------------------------------------------------------- library_filename comes from ccompiler.py, its second parameter is by default 'static'.
Rene Liebscher

On 12 July 2000, Rene Liebscher said:
That's only half of it -- you forgot to grep for the other place where I made this mistake! ;-) (Hint: same file, different place.) ...there, I've fixed 'em both. Will checkin shortly. Greg -- Greg Ward - just another /P(erl|ython)/ hacker gward@python.net http://starship.python.net/~gward/ War is Peace; Freedom is Slavery; Ignorance is Knowledge

The error ist that shared_library_filename is nowhere defined. As I can guess from the source this function should look like: def shared_library_filename(lib): return 'lib'+lib+'.so' For a workaround use this: ... 'libraries': ['pgs','ppc','X11'], 'library_dirs': ['/usr/X11R6/lib'] .. because you want -L/usr/X11R6/lib -lX11. Bastian Kleineidam

Bastian Kleineidam wrote:
It is not a missing function, it is only a wrong piece of code. It should look like this: --------------------------------------------------------------------------------- diff -BurN --minimal --exclude=*.pyc distutils.orig/distutils/unixccompiler.py distutils.patched/distutils/unixccompiler.py --- distutils.orig/distutils/unixccompiler.py Wed Jun 28 03:29:09 2000 +++ distutils.patched/distutils/unixccompiler.py Wed Jul 12 15:29:21 2000 @@ -320,7 +320,7 @@ def find_library_file (self, dirs, lib): for dir in dirs: - shared = os.path.join (dir, self.shared_library_filename (lib)) + shared = os.path.join (dir, self.library_filename (lib,'shared')) static = os.path.join (dir, self.library_filename (lib)) # We're second-guessing the linker here, with not much hard ---------------------------------------------------------------------------------- library_filename comes from ccompiler.py, its second parameter is by default 'static'.
Rene Liebscher

On 12 July 2000, Rene Liebscher said:
That's only half of it -- you forgot to grep for the other place where I made this mistake! ;-) (Hint: same file, different place.) ...there, I've fixed 'em both. Will checkin shortly. Greg -- Greg Ward - just another /P(erl|ython)/ hacker gward@python.net http://starship.python.net/~gward/ War is Peace; Freedom is Slavery; Ignorance is Knowledge
participants (5)
-
Bastian Kleineidam
-
Brad Chapman
-
Greg Ward
-
Lee Taylor
-
Rene Liebscher