Installation can't find locally installed Numeric

One never ceases to learn :slight_smile: I discovered ldd, and

    > when I run it on the offending file _nc_image.so, I see
    > that libpng isn't linked into it at all. So there's
    > probably an linking option set wrong in setupext.py
    > responsable for linking libpng. I'll try and find it,
    > but if anyone here can save me some time and tell me,
    > I'd greatly appreciate it.

The place to start poking around is in setupext.py's build_image

This function does a numerix switch to add flags for Numeric and
numarray if it finds them. Both paths (Numeric and numarray) call

    add_agg_flags(module)

and add_agg_flags calls

    module.libraries.append('png')

so libpng should be in your link chain. Since you have a nonstandard
Numeric install, make sure the numerix logic is working as it should
(eg what is the value of "numerix" in build_image?)

I suggest rm -rf ing your build subdir and starting cleanly.

Let us know what you find....

JDH

The value of numerix is “Numeric”, as it should be. Also, add_agg_flags is called four times,

of which once inside build_image, so libpng should be linked in. I tried linking libpng into a simple

c++ program, no problem there.

···

On 10/6/05, John Hunter <jdhunter@…4…> wrote:

The place to start poking around is in setupext.py’s build_image

This function does a numerix switch to add flags for Numeric and
numarray if it finds them. Both paths (Numeric and numarray) call

add_agg_flags(module)

and add_agg_flags calls

module.libraries.append('png')

so libpng should be in your link chain. Since you have a nonstandard
Numeric install, make sure the numerix logic is working as it should

(eg what is the value of “numerix” in build_image?)


Alex Borghgraef

Alex,

It would be helpful if you post your basedir (from the beginning of setupext.py),
the output of the build command (maybe just the lines for nc_image) and the operating
system you are using. This will show whether python is looking for libpng in
the correct directory.

Nadia

···

On Oct 10, 2005, at 5:38 AM, Alexander Borghgraef wrote:

On 10/6/05, John Hunter <jdhunter@...4...> wrote:

The place to start poking around is in setupext.py's build_image

This function does a numerix switch to add flags for Numeric and
numarray if it finds them. Both paths (Numeric and numarray) call

add\_agg\_flags\(module\)

and add_agg_flags calls

module\.libraries\.append\(&#39;png&#39;\)

so libpng should be in your link chain. Since you have a nonstandard
Numeric install, make sure the numerix logic is working as it should
(eg what is the value of "numerix" in build_image?)

The value of numerix is "Numeric", as it should be. Also, add_agg_flags is called four times,
of which once inside build_image, so libpng should be linked in. I tried linking libpng into a simple
c++ program, no problem there.

--
Alex Borghgraef

Alex,

It would be helpful if you post your basedir (from the beginning of
setupext.py),

basedir = {

'win32'  : ['win32_static',],

'linux2' : ['/usr/local', '/usr',],

'linux'  : ['/usr/local', '/usr',],

# Charles Moad recommends not putting in /usr/X11R6 for darwin

# because freetype in this dir is too old for mpl

'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local',

            '/usr', '/sw'],

'freebsd4' : ['/usr/local', '/usr'],

'freebsd5' : ['/usr/local', '/usr'],

'freebsd6' : ['/usr/local', '/usr'],   

'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',],

}

the output of the build command (maybe just the lines for nc_image)

The lines containing -lpng:
c++ -pthread -shared
build/temp.linux-i686-2.3/src/_gtkagg.o
build/temp.linux-i686-2.3/src/mplutils.o
build/temp.linux-i686-2.3/src/_transforms.o
build/temp.linux-i686-2.3/CXX/cxx_extensions.o
build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o
build/temp.linux-i686-2.3/CXX/cxxsupport.o
build/temp.linux-i686-2.3/CXX/cxxextensions.o -L/usr/local/lib
-L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/lib -L/usr/lib
-lpng -lz -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -lgobject-2.0
-lglib-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
-lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0
-ldl -lglib-2.0 -o
build/lib.linux-i686-2.3/matplotlib/backends/_gtkagg.so
-Wl,–export-dynamic

building ‘matplotlib.backends._tkagg’ extension

c++ -pthread -shared build/temp.linux-i686-2.3/src/_tkagg.o
build/temp.linux-i686-2.3/CXX/cxx_extensions.o
build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o
build/temp.linux-i686-2.3/CXX/cxxsupport.o
build/temp.linux-i686-2.3/CXX/cxxextensions.o -L/usr/share/tcl8.4/…/
-L/usr/share/tk8.4/…/ -L/usr/local/lib -L/usr/lib -L/usr/local/lib
-L/usr/lib -ltk8.4 -ltcl8.4 -lpng -lz -lstdc++ -lm -lfreetype -lz
-lstdc++ -lm -o build/lib.linux-i686-2.3/matplotlib/backends/_tkagg.so

building ‘matplotlib.backends._nc_backend_agg’ extension

c++ -pthread -shared
build/temp.linux-i686-2.3/agg23/src/agg_trans_affine.o
build/temp.linux-i686-2.3/agg23/src/agg_path_storage.o
build/temp.linux-i686-2.3/agg23/src/agg_bezier_arc.o
build/temp.linux-i686-2.3/agg23/src/agg_curves.o
build/temp.linux-i686-2.3/agg23/src/agg_vcgen_dash.o
build/temp.linux-i686-2.3/agg23/src/agg_vcgen_stroke.o
build/temp.linux-i686-2.3/agg23/src/agg_rasterizer_scanline_aa.o
build/temp.linux-i686-2.3/agg23/src/agg_image_filters.o
build/temp.linux-i686-2.3/src/_image.o
build/temp.linux-i686-2.3/src/ft2font.o
build/temp.linux-i686-2.3/src/mplutils.o
build/temp.linux-i686-2.3/CXX/cxx_extensions.o
build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o
build/temp.linux-i686-2.3/CXX/cxxsupport.o
build/temp.linux-i686-2.3/CXX/cxxextensions.o
build/temp.linux-i686-2.3/src/_nc_backend_agg.o -L/usr/local/lib
-L/usr/lib -L/usr/local/lib -L/usr/lib -lpng -lz -lstdc++ -lm
-lfreetype -lz -lstdc++ -lm -o
build/lib.linux-i686-2.3/matplotlib/backends/_nc_backend_agg.so

building ‘matplotlib.ft2font’ extension

c++ -pthread -shared build/temp.linux-i686-2.3/src/_nc_image.o
build/temp.linux-i686-2.3/src/mplutils.o
build/temp.linux-i686-2.3/agg23/src/agg_trans_affine.o
build/temp.linux-i686-2.3/agg23/src/agg_path_storage.o
build/temp.linux-i686-2.3/agg23/src/agg_rasterizer_scanline_aa.o
build/temp.linux-i686-2.3/agg23/src/agg_image_filters.o
build/temp.linux-i686-2.3/agg23/src/agg_bezier_arc.o
build/temp.linux-i686-2.3/CXX/cxx_extensions.o
build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o
build/temp.linux-i686-2.3/CXX/cxxsupport.o
build/temp.linux-i686-2.3/CXX/cxxextensions.o -L/usr/local/lib
-L/usr/lib -lpng -lz -lstdc++ -lm -o
build/lib.linux-i686-2.3/matplotlib/_nc_image.so

building ‘matplotlib._nc_cntr’ extension

None of these .so files have libpng linked in. I’ll include the output of ldd for the last one:

~/incoming/matplotlib-0.84 |10> ldd build/lib.linux-i686-2.3/matplotlib/_nc_image.so

    libz.so.1 => /usr/lib/libz.so.1 (0x0017b000)

    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0075e000)

    libm.so.6 => /lib/tls/libm.so.6 (0x005fd000)

    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00111000)

    libpthread.so.0 => /lib/tls/libpthread.so.0 (0x006f9000)

    libc.so.6 => /lib/tls/libc.so.6 (0x00e29000)

    /lib/ld-linux.so.2 (0x00139000)

and
the operating
system you are using. This will show whether python is looking for

libpng in
the correct directory.

I’m using Fedora core 3 as user (meaning I have installed Numeric locally). The libpng.so file is where you’d

expect it to be, in /usr/lib. This is seriously strange, I didn’t get any errors either, just a bunch of warnings.

I’ll include them as well, though I doubt they’ll be useful:

~/incoming/matplotlib-0.84 |6> python setup.py build > buildlog

In file included from /usr/include/python2.3/Python.h:8,

             from ./CXX/Objects.hxx:9,

             from ./CXX/Extensions.hxx:19,

             from src/_transforms.h:12,

             from src/_nc_transforms.cpp:2:

/usr/include/python2.3/pyconfig.h:850:1: warning: “_POSIX_C_SOURCE” redefined

In file included from /usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/os_defines.h:39,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/c++config.h:35,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/functional:54,

             from src/_nc_transforms.cpp:1:

/usr/include/features.h:150:1: warning: this is the location of the previous definition

In file included from /usr/include/python2.3/Python.h:8,

from /usr/include/pygtk-2.0/pygobject.h:5,

             from src/_gtkagg.cpp:10:

/usr/include/python2.3/pyconfig.h:850:1: warning: “_POSIX_C_SOURCE” redefined

In file included from /usr/include/string.h:26,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/cstring:51,

             from src/_gtkagg.cpp:1:

/usr/include/features.h:150:1: warning: this is the location of the previous definition

In file included from /usr/include/python2.3/Python.h:8,

             from ./CXX/Objects.hxx:9,

             from ./CXX/Extensions.hxx:19,

             from src/_transforms.h:12,

             from src/_transforms.cpp:2:

/usr/include/python2.3/pyconfig.h:850:1: warning: “_POSIX_C_SOURCE” redefined

In file included from /usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/os_defines.h:39,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/c++config.h:35,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/functional:54,

             from src/_transforms.cpp:1:

/usr/include/features.h:150:1: warning: this is the location of the previous definition

In file included from /usr/include/python2.3/Python.h:8,

             from src/_image.cpp:7:

/usr/include/python2.3/pyconfig.h:850:1: warning: “_POSIX_C_SOURCE” redefined

In file included from /usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/os_defines.h:39,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/c++config.h:35,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/iostream:44,

             from src/_image.cpp:1:

/usr/include/features.h:150:1: warning: this is the location of the previous definition

In file included from /usr/include/python2.3/Python.h:8,

             from ./CXX/Objects.hxx:9,

             from ./CXX/Extensions.hxx:19,

             from src/ft2font.h:18,

from src/_nc_backend_agg.cpp:18:

/usr/include/python2.3/pyconfig.h:850:1: warning: “_POSIX_C_SOURCE” redefined

In file included from /usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/os_defines.h:39,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/c++config.h:35,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/iostream:44,

             from src/_nc_backend_agg.cpp:4:

/usr/include/features.h:150:1: warning: this is the location of the previous definition

In file included from /usr/include/python2.3/Python.h:8,

             from ./CXX/Objects.hxx:9,

             from ./CXX/Extensions.hxx:19,

             from src/ft2font.h:18,

             from src/ft2font.cpp:2:

/usr/include/python2.3/pyconfig.h:850:1: warning: “_POSIX_C_SOURCE” redefined

In file included from /usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/os_defines.h:39,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/c++config.h:35,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/iosfwd:45,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/ios:44,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/istream:45,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/sstream:45,

             from src/ft2font.cpp:1:

/usr/include/features.h:150:1: warning: this is the location of the previous definition

In file included from /usr/include/python2.3/Python.h:8,

             from src/_nc_image.cpp:7:

/usr/include/python2.3/pyconfig.h:850:1: warning: “_POSIX_C_SOURCE” redefined

In file included from /usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/os_defines.h:39,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/i386-redhat-linux/bits/c++config.h:35,

from
/usr/lib/gcc/i386-redhat-linux/3.4.4/…/…/…/…/include/c++/3.4.4/iostream:44,

             from src/_nc_image.cpp:1:

/usr/include/features.h:150:1: warning: this is the location of the previous definition

74.056u 3.357s 1:17.71 99.6% 0+0k 0+0io 75pf+0w

···

On 10/10/05, Nadia Dencheva <dencheva@…86…> wrote:


Alex Borghgraef

Nobody has any ideas? I’m really clueless on this one. The logs clearly show the .so files being compiled with
-L/usr/lib -lpng as flags, yet ldd shows libpng is not linked in. Could it be that libpng needs to be linked in the
.o files? Any other sane explanations?

···


Alex Borghgraef