Static linking problem on matplotlib eggs

I'm trying to build some matplotlib eggs to bundle
and distribute with some other python packages. So, I am doing
my best to statically link to libraries like libpng, libfreetype, etc.
that users may not have installed. I am building using the following:

python setupegg.py config -L../staticlibs build bdist_egg

where ../staticlibs contains the libraries that I am statically
linking. Unfortunately, users are still getting errors such as the following:

ImportError: dlopen(/Library/Python/2.5/site-packages/
matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so, 2):
Library not loaded: /usr/local/lib/libpng12.0.dylib
Referenced from: /Library/Python/2.5/site-packages/
matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so
Reason: image not found

Anyone have a clue what I am not doing properly?

Thanks,
Chris

I just had to rebuild the OSX binary because a similar reason. I
forgot to change the basedir['darwin'] entry in setupext.py. Around
line 50.....

Change:
    'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local',
                '/usr', '/sw', '/usr/X11R6'],
To:
    'darwin' : [],

This will ensure you don't pick up shared libraries over the static
ones since they are preferred by gcc.

- Charlie

···

On Jan 12, 2008 12:04 PM, Chris <listservs@...935...> wrote:

I'm trying to build some matplotlib eggs to bundle
and distribute with some other python packages. So, I am doing
my best to statically link to libraries like libpng, libfreetype, etc.
that users may not have installed. I am building using the following:

python setupegg.py config -L../staticlibs build bdist_egg

where ../staticlibs contains the libraries that I am statically
linking. Unfortunately, users are still getting errors such as the following:

ImportError: dlopen(/Library/Python/2.5/site-packages/
matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so, 2):
Library not loaded: /usr/local/lib/libpng12.0.dylib
Referenced from: /Library/Python/2.5/site-packages/
matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so
Reason: image not found

Anyone have a clue what I am not doing properly?

Thanks,
Chris

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thanks Charlie,

I've done this, but for some reason, its still looking for things in /usr/local:

In file included from src/ft2font.h:11,
                  from src/ft2font.cpp:2:
/usr/local/include/ft2build.h:56:38: error: freetype/config/ftheader.h: No such file or directory

cf

···

On 12/01/2008, at 12:42 PM, Charlie Moad wrote:

I just had to rebuild the OSX binary because a similar reason. I
forgot to change the basedir['darwin'] entry in setupext.py. Around
line 50.....

Change:
   'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local',
               '/usr', '/sw', '/usr/X11R6'],
To:
   'darwin' : [],

This will ensure you don't pick up shared libraries over the static
ones since they are preferred by gcc.

- Charlie

On Jan 12, 2008 12:04 PM, Chris <listservs@...935...> wrote:

I'm trying to build some matplotlib eggs to bundle
and distribute with some other python packages. So, I am doing
my best to statically link to libraries like libpng, libfreetype, etc.
that users may not have installed. I am building using the following:

python setupegg.py config -L../staticlibs build bdist_egg

where ../staticlibs contains the libraries that I am statically
linking. Unfortunately, users are still getting errors such as the following:

ImportError: dlopen(/Library/Python/2.5/site-packages/
matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so, 2):
Library not loaded: /usr/local/lib/libpng12.0.dylib
Referenced from: /Library/Python/2.5/site-packages/
matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so
Reason: image not found

Anyone have a clue what I am not doing properly?

Thanks,
Chris

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

OK, I managed to build with the setupext.py list empty as you specified. However, for some reason, the resulting matplotlib egg *still* looks for dynamic libraries in /usr/local:

ImportError: dlopen(/Library/Python/2.5/site-packages/matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so, 2): Library not loaded: /usr/local/lib/libpng12.0.dylib
  Referenced from: /Library/Python/2.5/site-packages/matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so
  Reason: image not found

This is pretty bizarre.

···

On 12/01/2008, at 12:42 PM, Charlie Moad wrote:

I just had to rebuild the OSX binary because a similar reason. I
forgot to change the basedir['darwin'] entry in setupext.py. Around
line 50.....

Change:
  'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local',
              '/usr', '/sw', '/usr/X11R6'],
To:
  'darwin' : [],

This will ensure you don't pick up shared libraries over the static
ones since they are preferred by gcc.