[SciPy-User] Weave compilation woes: 'multiple definition of '_end''

Troels Emtekær Linnet tlinnet at gmail.com
Sun Apr 21 14:36:15 EDT 2013


Puhhh, compilations errors can kill the most enthusiastic person.

If you have a uni mail, and if I was you, I would first try the enthought
python distribution.
http://www.enthought.com/. The EPD, and not the Canopy thing. (
https://www.enthought.com/repo/epd/installers/)

That have solved all my dependency problems since then, and the packages I
need more, I install with pip, or github.

Hope it helps

[tlinnet at tomat ~]$ python2.7
Enthought Python Distribution -- www.enthought.com
Version: 7.3-2 (64-bit)

Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 11 2012, 17:52:16)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "credits", "demo" or "enthought" for more information.
>>> import scipy.weave
>>> scipy.weave.test()
Running unit tests for scipy.weave
NumPy version 1.6.1
NumPy is installed in
/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/numpy
SciPy version 0.10.1
SciPy is installed in
/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy
Python version 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 11 2012, 17:52:16)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
nose version 1.1.2
........................................................................................................................................
----------------------------------------------------------------------
Ran 136 tests in 1.788s

OK
<nose.result.TextTestResult run=136 errors=0 failures=0>
>>> import os
>>> os.system("python2.7
/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/examples/binary_search.py")
Binary search for 50000 items in 100000 length list of integers:
 speed in python: 0.247366905212
 speed of bisect: 0.0408248901367
 speed up: 6.06
<weave: compiling>
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3
running build_ext
running build_src
build_src
building extension "sc_ed14cc6c23f0bead753206178f55fedf0" sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'sc_ed14cc6c23f0bead753206178f55fedf0' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -O2
-I/sbinlab2/software/x64/fftw/include -fPIC

creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/tlinnet
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/tlinnet/.python27_compiled
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/tlinnet/.python27_compiled/m1
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave
creating
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx
compile options:
'-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/numpy/core/include
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/include/python2.7
-c'
g++:
/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.cpp
g++:
/sbinlab2/tlinnet/.python27_compiled/m1/sc_ed14cc6c23f0bead753206178f55fedf0.cpp
g++ -pthread -shared -g -L/sbinlab2/software/x64/fftw/lib
-I/sbinlab2/software/x64/fftw/include
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/tlinnet/.python27_compiled/m1/sc_ed14cc6c23f0bead753206178f55fedf0.o
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.o
-L/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib
-lpython2.7 -o
/sbinlab2/tlinnet/.python27_compiled/m1/sc_ed14cc6c23f0bead753206178f55fedf0.so
running scons
 speed in c: 0.226359128952
 speed up: 1.09
 speed in c(no asserts): 0.227307081223
 speed up: 1.09
<weave: compiling>
running build_ext
running build_src
build_src
building extension "sc_cc760b308ce9a978d2eb41b2f6b4f0d10" sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'sc_cc760b308ce9a978d2eb41b2f6b4f0d10' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -O2
-I/sbinlab2/software/x64/fftw/include -fPIC

compile options:
'-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/numpy/core/include
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/include/python2.7
-c'
g++:
/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.cpp
g++:
/sbinlab2/tlinnet/.python27_compiled/m1/sc_cc760b308ce9a978d2eb41b2f6b4f0d10.cpp
g++ -pthread -shared -g -L/sbinlab2/software/x64/fftw/lib
-I/sbinlab2/software/x64/fftw/include
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/tlinnet/.python27_compiled/m1/sc_cc760b308ce9a978d2eb41b2f6b4f0d10.o
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.o
-L/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib
-lpython2.7 -o
/sbinlab2/tlinnet/.python27_compiled/m1/sc_cc760b308ce9a978d2eb41b2f6b4f0d10.so
running scons
 speed for scxx: 0.257591962814
 speed up: 0.96
 speed for scxx(no asserts): 0.234634876251
 speed up: 1.05
<weave: compiling>
running build_ext
running build_src
build_src
building extension "sc_498c4885708b1863d6add0a5eadc8a7c0" sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'sc_498c4885708b1863d6add0a5eadc8a7c0' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -O2
-I/sbinlab2/software/x64/fftw/include -fPIC

compile options:
'-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/numpy/core/include
-I/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/include/python2.7
-c'
extra options: '-O2 -G6'
g++:
/sbinlab2/tlinnet/.python27_compiled/m1/sc_498c4885708b1863d6add0a5eadc8a7c0.cpp
g++: unrecognized option '-G6'
g++:
/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.cpp
g++: unrecognized option '-G6'
g++ -pthread -shared -g -L/sbinlab2/software/x64/fftw/lib
-I/sbinlab2/software/x64/fftw/include
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/tlinnet/.python27_compiled/m1/sc_498c4885708b1863d6add0a5eadc8a7c0.o
/tmp/tlinnet/python27_intermediate/compiler_562de53720db2727b91043c80bf5f4a3/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/scxx/weave_imp.o
-L/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib
-lpython2.7 -o
/sbinlab2/tlinnet/.python27_compiled/m1/sc_498c4885708b1863d6add0a5eadc8a7c0.so
running scons
 speed in c(numpy arrays): 0.22613120079
 speed up: 1.09
search(a,3450) 3450 3450 3450
search(a,-1) -1 -1 0
search(a,10001) 10001 10001 10001
0
>>> os.system("python2.7
/sbinlab2/software/python-enthought-dis/epd-7.3-2-rh5-x86_64/lib/python2.7/site-packages/scipy/weave/examples/array3d.py")
numpy:
[[[ 0  1  2  3]
  [ 4  5  6  7]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
Pure Inline:
img[  0][  0]=   0   1   2   3
img[  0][  1]=   4   5   6   7
img[  0][  2]=   8   9  10  11
img[  1][  0]=  12  13  14  15
img[  1][  1]=  16  17  18  19
img[  1][  2]=  20  21  22  23
Blitz Inline:
img[  0][  0]=   0   1   2   3
img[  0][  1]=   4   5   6   7
img[  0][  2]=   8   9  10  11
img[  1][  0]=  12  13  14  15
img[  1][  1]=  16  17  18  19
img[  1][  2]=  20  21  22  23
0


Troels Emtekær Linnet
Ved kløvermarken 9, 1.th
2300 København S
Mobil: +45 60210234


2013/4/21 Patrick Mineault <patrick.mineault at gmail.com>

> I'm trying to get weave running on a 64-bit Ubuntu 11.10 install, as I'm
> using a library (spearmint) which depends on it. The library refuses to
> run, giving me a g++ error, so I checked the weave configuration. Running
> weave.test works fine:
>
>
> >>> import scipy.weave
>> >>> scipy.weave.test()
>> Running unit tests for scipy.weave
>> NumPy version 1.5.1
>> NumPy is installed in /usr/lib/pymodules/python2.7/numpy
>> SciPy version 0.12.0
>> SciPy is installed in /usr/local/lib/python2.7/dist-packages/scipy
>> Python version 2.7.2+ (default, Jul 20 2012, 22:15:08) [GCC 4.6.1]
>> nose version 1.0.0
>>
>> ........................................................................................................................................
>> ----------------------------------------------------------------------
>> Ran 136 tests in 1.658s
>>
>> OK
>> <nose.result.TextTestResult run=136 errors=0 failures=0>
>>
>
>
> Some of the examples in scipy/weave/examples work too, like binary_search,
> albeit with a few warnings:
>
> patrick at packpatricklinux:/usr/local/lib/python2.7/dist-packages/scipy/weave$
>> python
>> /usr/local/lib/python2.7/dist-packages/scipy/weave/examples/binary_search.py
>>
>> Binary search for 50000 items in 100000 length list of integers:
>>  speed in python: 0.193926095963
>>  speed of bisect: 0.0424749851227
>>  speed up: 4.57
>> <weave: compiling>
>> running build_ext
>> running build_src
>> build_src
>> building extension "sc_ed14cc6c23f0bead753206178f55fedf1" sources
>> build_src: building npy-pkg config files
>> customize UnixCCompiler
>> customize UnixCCompiler using build_ext
>> customize UnixCCompiler
>> customize UnixCCompiler using build_ext
>> building 'sc_ed14cc6c23f0bead753206178f55fedf1' extension
>> compiling C++ sources
>> C compiler: g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
>> -fPIC
>>
>> compile options: '-I/usr/local/lib/python2.7/dist-packages/scipy/weave
>> -I/usr/local/lib/python2.7/dist-packages/scipy/weave/scxx
>> -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7
>> -c'
>> g++: /usr/local/lib/python2.7/dist-packages/scipy/weave/scxx/weave_imp.cpp
>> g++:
>> /home/patrick/.python27_compiled/sc_ed14cc6c23f0bead753206178f55fedf1.cpp
>> g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
>> -Wl,-Bsymbolic-functions
>> /tmp/patrick/python27_intermediate/compiler_aa001b8a6f0e3d090bc9a3710745b2f8/home/patrick/.python27_compiled/sc_ed14cc6c23f0bead753206178f55fedf1.o
>> /tmp/patrick/python27_intermediate/compiler_aa001b8a6f0e3d090bc9a3710745b2f8/usr/local/lib/python2.7/dist-packages/scipy/weave/scxx/weave_imp.o
>> -o /home/patrick/.python27_compiled/sc_ed14cc6c23f0bead753206178f55fedf1.so
>> running scons
>>  speed in c: 0.0843539237976
>>  speed up: 2.30
>>  speed in c(no asserts): 0.0844378471375
>>  speed up: 2.30
>> <weave: compiling>
>> running build_ext
>> running build_src
>> build_src
>> building extension "sc_cc760b308ce9a978d2eb41b2f6b4f0d11" sources
>> build_src: building npy-pkg config files
>> customize UnixCCompiler
>> customize UnixCCompiler using build_ext
>> customize UnixCCompiler
>> customize UnixCCompiler using build_ext
>> building 'sc_cc760b308ce9a978d2eb41b2f6b4f0d11' extension
>> compiling C++ sources
>> C compiler: g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
>> -fPIC
>>
>> compile options: '-I/usr/local/lib/python2.7/dist-packages/scipy/weave
>> -I/usr/local/lib/python2.7/dist-packages/scipy/weave/scxx
>> -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7
>> -c'
>> g++:
>> /home/patrick/.python27_compiled/sc_cc760b308ce9a978d2eb41b2f6b4f0d11.cpp
>> g++: /usr/local/lib/python2.7/dist-packages/scipy/weave/scxx/weave_imp.cpp
>> g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
>> -Wl,-Bsymbolic-functions
>> /tmp/patrick/python27_intermediate/compiler_aa001b8a6f0e3d090bc9a3710745b2f8/home/patrick/.python27_compiled/sc_cc760b308ce9a978d2eb41b2f6b4f0d11.o
>> /tmp/patrick/python27_intermediate/compiler_aa001b8a6f0e3d090bc9a3710745b2f8/usr/local/lib/python2.7/dist-packages/scipy/weave/scxx/weave_imp.o
>> -o /home/patrick/.python27_compiled/sc_cc760b308ce9a978d2eb41b2f6b4f0d11.so
>> running scons
>>  speed for scxx: 0.105831861496
>>  speed up: 1.83
>>  speed for scxx(no asserts): 0.0926380157471
>>  speed up: 2.09
>> <weave: compiling>
>> running build_ext
>> running build_src
>> build_src
>> building extension "sc_498c4885708b1863d6add0a5eadc8a7c1" sources
>> build_src: building npy-pkg config files
>> customize UnixCCompiler
>> customize UnixCCompiler using build_ext
>> customize UnixCCompiler
>> customize UnixCCompiler using build_ext
>> building 'sc_498c4885708b1863d6add0a5eadc8a7c1' extension
>> compiling C++ sources
>> C compiler: g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
>> -fPIC
>>
>> compile options: '-I/usr/local/lib/python2.7/dist-packages/scipy/weave
>> -I/usr/local/lib/python2.7/dist-packages/scipy/weave/scxx
>> -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7
>> -c'
>> extra options: '-O2 -G6'
>> g++:
>> /home/patrick/.python27_compiled/sc_498c4885708b1863d6add0a5eadc8a7c1.cpp
>> g++: error: unrecognized option ‘-G6’
>> g++: error: unrecognized option ‘-G6’
>> search(a,3450) 3450 3450 3450
>> search(a,-1) -1 -1 0
>> search(a,10001) 10001 10001 10001
>>
>
> However, there appears to be something wrong with blitz inline, as running
> the array3d.py example shows:
>
> patrick at packpatricklinux:/usr/local/lib/python2.7/dist-packages/scipy/weave$
>> python
>> /usr/local/lib/python2.7/dist-packages/scipy/weave/examples/array3d.py
>> numpy:
>> [[[ 0  1  2  3]
>>   [ 4  5  6  7]
>>   [ 8  9 10 11]]
>>
>>  [[12 13 14 15]
>>   [16 17 18 19]
>>   [20 21 22 23]]]
>> Pure Inline:
>> img[  0][  0]=   0   1   2   3
>> img[  0][  1]=   4   5   6   7
>> img[  0][  2]=   8   9  10  11
>> img[  1][  0]=  12  13  14  15
>> img[  1][  1]=  16  17  18  19
>> img[  1][  2]=  20  21  22  23
>> Blitz Inline:
>> /usr/bin/ld: error: linker defined: multiple definition of '_end'
>> /usr/bin/ld:
>> /tmp/patrick/python27_intermediate/compiler_aa001b8a6f0e3d090bc9a3710745b2f8/home/patrick/.python27_compiled/sc_49e94d1bdd1ad16917064c910093194f1.o:
>> previous definition here
>> collect2: ld returned 1 exit status
>> /usr/bin/ld: error: linker defined: multiple definition of '_end'
>> /usr/bin/ld:
>> /tmp/patrick/python27_intermediate/compiler_aa001b8a6f0e3d090bc9a3710745b2f8/home/patrick/.python27_compiled/sc_49e94d1bdd1ad16917064c910093194f1.o:
>> previous definition here
>> collect2: ld returned 1 exit status
>> Traceback (most recent call last):
>>   File
>> "/usr/local/lib/python2.7/dist-packages/scipy/weave/examples/array3d.py",
>> line 106, in <module>
>>     main()
>>   File
>> "/usr/local/lib/python2.7/dist-packages/scipy/weave/examples/array3d.py",
>> line 102, in main
>>     blitz_inline(arr)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/scipy/weave/examples/array3d.py",
>> line 90, in blitz_inline
>>     weave.inline(code, ['arr'], type_converters=converters.blitz)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/scipy/weave/inline_tools.py", line
>> 357, in inline
>>     **kw)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/scipy/weave/inline_tools.py", line
>> 484, in compile_function
>>     verbose=verbose, **kw)
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/weave/ext_tools.py",
>> line 369, in compile
>>     verbose = verbose, **kw)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/scipy/weave/build_tools.py", line
>> 273, in build_extension
>>     setup(name = module_name, ext_modules = [ext],verbose=verb)
>>   File "/usr/lib/pymodules/python2.7/numpy/distutils/core.py", line 186,
>> in setup
>>     return old_setup(**new_attr)
>>   File "/usr/lib/python2.7/distutils/core.py", line 169, in setup
>>     raise SystemExit, "error: " + str(msg)
>> scipy.weave.build_tools.CompileError: error: Command "g++ -pthread
>> -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions
>> /tmp/patrick/python27_intermediate/compiler_aa001b8a6f0e3d090bc9a3710745b2f8/home/patrick/.python27_compiled/sc_49e94d1bdd1ad16917064c910093194f1.o
>> /tmp/patrick/python27_intermediate/compiler_aa001b8a6f0e3d090bc9a3710745b2f8/usr/local/lib/python2.7/dist-packages/scipy/weave/scxx/weave_imp.o
>> -o
>> /home/patrick/.python27_compiled/sc_49e94d1bdd1ad16917064c910093194f1.so"
>> failed with exit status 1
>>
>
>
> I get a very similar error ('multiple definitions of _end') with the
> package I'm interested in, so I assume the source is the same. I searched
> on the archives and google and couldn't find a solution. What could be the
> source of the error?
>
> Patrick
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20130421/b7023f7d/attachment.html>


More information about the SciPy-User mailing list