Error compiling Python Image Library (pil-1.1.6.p2)...

39 views
Skip to the first unread message

akuloncmir

unread,
10 Jun 2010, 18:59:3210/06/2010
to sage-devel
I am building Sage from source as a user without root privileges. The
machine on which I am building Sage has the following specifications:

Red Hat Enterprise Linux Client release 5.2 (Tikanga)
4 X 1GHz Dual-Core AMD Opteron(tm) Processor 2220
32G RAM

.

In the "make" output, I'm seeing 68 instances of

/usr/local/lib/libpython2.6.a: could not read symbols: Bad value

. Shouldn't Sage ignore all pre-existing installs of Python?

Despite the 68 "Bad value" messages, the only portion of Sage that
does not successfully build is the Python Image Library
(pil-1.1.6.p2). At least, I have good reason to believe that this is
the only portion that fails to build, as the only test run by "make
test" that fails does so because of the condition "ImportError: No
module named Image":

=====
BEGIN: Relevant "make test" output.
=====
sage -t "devel/sage/sage/plot/plot3d/base.pyx"
**********************************************************************
File "/home/txbruser/TxBR/sage-4.4.3/devel/sage/sage/plot/plot3d/
base.pyx", line 1160:
sage: G.save(f)
Exception raised:
Traceback (most recent call last):
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example,
filename, compileflags)
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_35[4]>", line 1, in <module>
G.save(f)###line 1160:
sage: G.save(f)
File "base.pyx", line 1197, in
sage.plot.plot3d.base.Graphics3d.save (sage/plot/plot3d/base.c:11690)
ImportError: No module named Image
**********************************************************************
File "/home/txbruser/TxBR/sage-4.4.3/devel/sage/sage/plot/plot3d/
base.pyx", line 1165:
sage: G.save(f, zoom=2, figsize=[5, 10])
Exception raised:
Traceback (most recent call last):
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example,
filename, compileflags)
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_35[5]>", line 1, in <module>
G.save(f, zoom=Integer(2), figsize=[Integer(5),
Integer(10)])###line 1165:
sage: G.save(f, zoom=2, figsize=[5, 10])
File "base.pyx", line 1197, in
sage.plot.plot3d.base.Graphics3d.save (sage/plot/plot3d/base.c:11690)
ImportError: No module named Image
**********************************************************************
File "/home/txbruser/TxBR/sage-4.4.3/devel/sage/sage/plot/plot3d/
base.pyx", line 1170:
sage: G.save(f, viewer='jmol') # Looks the same
Exception raised:
Traceback (most recent call last):
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example,
filename, compileflags)
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_35[6]>", line 1, in <module>
G.save(f, viewer='jmol') # Looks the same###line 1170:
sage: G.save(f, viewer='jmol') # Looks the same
File "base.pyx", line 1197, in
sage.plot.plot3d.base.Graphics3d.save (sage/plot/plot3d/base.c:11690)
ImportError: No module named Image
**********************************************************************
File "/home/txbruser/TxBR/sage-4.4.3/devel/sage/sage/plot/plot3d/
base.pyx", line 1175:
sage: cube().save(tmp_filename() + '.gif')
Exception raised:
Traceback (most recent call last):
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example,
filename, compileflags)
File "/home/txbruser/TxBR/sage-4.4.3/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_35[7]>", line 1, in <module>
cube().save(tmp_filename() + '.gif')###line 1175:
sage: cube().save(tmp_filename() + '.gif')
File "base.pyx", line 1197, in
sage.plot.plot3d.base.Graphics3d.save (sage/plot/plot3d/base.c:11690)
ImportError: No module named Image
**********************************************************************
1 items had failures:
4 of 8 in __main__.example_35
***Test Failed*** 4 failures.
For whitespace errors, see the file /home/txbruser/.sage//
tmp/.doctest_base.py
[16.6 s]
=====
END: Relevant "make test" output.
=====

.

=====
BEGIN: Relevant "make" output.
=====
gcc -pthread -shared build/temp.linux-x86_64-2.6/_imaging.o build/
temp.linux-x86_64-2.6/decode.o build/temp.linux-x86_64-2.6/encode.o
build/temp.linux-x86_64-2.6/map.o build/temp.linux-x86_64-2.6/
display.o build/temp.linux-x86_64-2.6/outline.o build/temp.linux-
x86_64-2.6/path.o build/temp.linux-x86_64-2.6/libImaging/Access.o
build/temp.linux-x86_64-2.6/libImaging/Antialias.o build/temp.linux-
x86_64-2.6/libImaging/Bands.o build/temp.linux-x86_64-2.6/libImaging/
BitDecode.o build/temp.linux-x86_64-2.6/libImaging/Blend.o build/
temp.linux-x86_64-2.6/libImaging/Chops.o build/temp.linux-x86_64-2.6/
libImaging/Convert.o build/temp.linux-x86_64-2.6/libImaging/
ConvertYCbCr.o build/temp.linux-x86_64-2.6/libImaging/Copy.o build/
temp.linux-x86_64-2.6/libImaging/Crc32.o build/temp.linux-x86_64-2.6/
libImaging/Crop.o build/temp.linux-x86_64-2.6/libImaging/Dib.o build/
temp.linux-x86_64-2.6/libImaging/Draw.o build/temp.linux-x86_64-2.6/
libImaging/Effects.o build/temp.linux-x86_64-2.6/libImaging/
EpsEncode.o build/temp.linux-x86_64-2.6/libImaging/File.o build/
temp.linux-x86_64-2.6/libImaging/Fill.o build/temp.linux-x86_64-2.6/
libImaging/Filter.o build/temp.linux-x86_64-2.6/libImaging/FliDecode.o
build/temp.linux-x86_64-2.6/libImaging/Geometry.o build/temp.linux-
x86_64-2.6/libImaging/GetBBox.o build/temp.linux-x86_64-2.6/libImaging/
GifDecode.o build/temp.linux-x86_64-2.6/libImaging/GifEncode.o build/
temp.linux-x86_64-2.6/libImaging/HexDecode.o build/temp.linux-
x86_64-2.6/libImaging/Histo.o build/temp.linux-x86_64-2.6/libImaging/
JpegDecode.o build/temp.linux-x86_64-2.6/libImaging/JpegEncode.o build/
temp.linux-x86_64-2.6/libImaging/LzwDecode.o build/temp.linux-
x86_64-2.6/libImaging/Matrix.o build/temp.linux-x86_64-2.6/libImaging/
ModeFilter.o build/temp.linux-x86_64-2.6/libImaging/MspDecode.o build/
temp.linux-x86_64-2.6/libImaging/Negative.o build/temp.linux-
x86_64-2.6/libImaging/Offset.o build/temp.linux-x86_64-2.6/libImaging/
Pack.o build/temp.linux-x86_64-2.6/libImaging/PackDecode.o build/
temp.linux-x86_64-2.6/libImaging/Palette.o build/temp.linux-x86_64-2.6/
libImaging/Paste.o build/temp.linux-x86_64-2.6/libImaging/Quant.o
build/temp.linux-x86_64-2.6/libImaging/QuantHash.o build/temp.linux-
x86_64-2.6/libImaging/QuantHeap.o build/temp.linux-x86_64-2.6/
libImaging/PcdDecode.o build/temp.linux-x86_64-2.6/libImaging/
PcxDecode.o build/temp.linux-x86_64-2.6/libImaging/PcxEncode.o build/
temp.linux-x86_64-2.6/libImaging/Point.o build/temp.linux-x86_64-2.6/
libImaging/RankFilter.o build/temp.linux-x86_64-2.6/libImaging/
RawDecode.o build/temp.linux-x86_64-2.6/libImaging/RawEncode.o build/
temp.linux-x86_64-2.6/libImaging/Storage.o build/temp.linux-x86_64-2.6/
libImaging/SunRleDecode.o build/temp.linux-x86_64-2.6/libImaging/
TgaRleDecode.o build/temp.linux-x86_64-2.6/libImaging/Unpack.o build/
temp.linux-x86_64-2.6/libImaging/UnpackYCC.o build/temp.linux-
x86_64-2.6/libImaging/XbmDecode.o build/temp.linux-x86_64-2.6/
libImaging/XbmEncode.o build/temp.linux-x86_64-2.6/libImaging/
ZipDecode.o build/temp.linux-x86_64-2.6/libImaging/ZipEncode.o -L/usr/
local/lib -L/home/txbruser/TxBR/sage-4.4.3/local/lib -L/usr/lib -L/
home/txbruser/TxBR/sage-4.4.3/local/lib -ljpeg -lz -lpython2.6 -o
build/lib.linux-x86_64-2.6/_imaging.so
/usr/bin/ld: /usr/local/lib/libpython2.6.a(abstract.o): relocation
R_X86_64_32 against `a local symbol' can not be used when making a
shared object; recompile with -fPIC
/usr/local/lib/libpython2.6.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Disabling TK in PIL build.
running install
running build
running build_py
running build_ext
building '_imaging' extension
gcc -pthread -shared build/temp.linux-x86_64-2.6/_imaging.o build/
temp.linux-x86_64-2.6/decode.o build/temp.linux-x86_64-2.6/encode.o
build/temp.linux-x86_64-2.6/map.o build/temp.linux-x86_64-2.6/
display.o build/temp.linux-x86_64-2.6/outline.o build/temp.linux-
x86_64-2.6/path.o build/temp.linux-x86_64-2.6/libImaging/Access.o
build/temp.linux-x86_64-2.6/libImaging/Antialias.o build/temp.linux-
x86_64-2.6/libImaging/Bands.o build/temp.linux-x86_64-2.6/libImaging/
BitDecode.o build/temp.linux-x86_64-2.6/libImaging/Blend.o build/
temp.linux-x86_64-2.6/libImaging/Chops.o build/temp.linux-x86_64-2.6/
libImaging/Convert.o build/temp.linux-x86_64-2.6/libImaging/
ConvertYCbCr.o build/temp.linux-x86_64-2.6/libImaging/Copy.o build/
temp.linux-x86_64-2.6/libImaging/Crc32.o build/temp.linux-x86_64-2.6/
libImaging/Crop.o build/temp.linux-x86_64-2.6/libImaging/Dib.o build/
temp.linux-x86_64-2.6/libImaging/Draw.o build/temp.linux-x86_64-2.6/
libImaging/Effects.o build/temp.linux-x86_64-2.6/libImaging/
EpsEncode.o build/temp.linux-x86_64-2.6/libImaging/File.o build/
temp.linux-x86_64-2.6/libImaging/Fill.o build/temp.linux-x86_64-2.6/
libImaging/Filter.o build/temp.linux-x86_64-2.6/libImaging/FliDecode.o
build/temp.linux-x86_64-2.6/libImaging/Geometry.o build/temp.linux-
x86_64-2.6/libImaging/GetBBox.o build/temp.linux-x86_64-2.6/libImaging/
GifDecode.o build/temp.linux-x86_64-2.6/libImaging/GifEncode.o build/
temp.linux-x86_64-2.6/libImaging/HexDecode.o build/temp.linux-
x86_64-2.6/libImaging/Histo.o build/temp.linux-x86_64-2.6/libImaging/
JpegDecode.o build/temp.linux-x86_64-2.6/libImaging/JpegEncode.o build/
temp.linux-x86_64-2.6/libImaging/LzwDecode.o build/temp.linux-
x86_64-2.6/libImaging/Matrix.o build/temp.linux-x86_64-2.6/libImaging/
ModeFilter.o build/temp.linux-x86_64-2.6/libImaging/MspDecode.o build/
temp.linux-x86_64-2.6/libImaging/Negative.o build/temp.linux-
x86_64-2.6/libImaging/Offset.o build/temp.linux-x86_64-2.6/libImaging/
Pack.o build/temp.linux-x86_64-2.6/libImaging/PackDecode.o build/
temp.linux-x86_64-2.6/libImaging/Palette.o build/temp.linux-x86_64-2.6/
libImaging/Paste.o build/temp.linux-x86_64-2.6/libImaging/Quant.o
build/temp.linux-x86_64-2.6/libImaging/QuantHash.o build/temp.linux-
x86_64-2.6/libImaging/QuantHeap.o build/temp.linux-x86_64-2.6/
libImaging/PcdDecode.o build/temp.linux-x86_64-2.6/libImaging/
PcxDecode.o build/temp.linux-x86_64-2.6/libImaging/PcxEncode.o build/
temp.linux-x86_64-2.6/libImaging/Point.o build/temp.linux-x86_64-2.6/
libImaging/RankFilter.o build/temp.linux-x86_64-2.6/libImaging/
RawDecode.o build/temp.linux-x86_64-2.6/libImaging/RawEncode.o build/
temp.linux-x86_64-2.6/libImaging/Storage.o build/temp.linux-x86_64-2.6/
libImaging/SunRleDecode.o build/temp.linux-x86_64-2.6/libImaging/
TgaRleDecode.o build/temp.linux-x86_64-2.6/libImaging/Unpack.o build/
temp.linux-x86_64-2.6/libImaging/UnpackYCC.o build/temp.linux-
x86_64-2.6/libImaging/XbmDecode.o build/temp.linux-x86_64-2.6/
libImaging/XbmEncode.o build/temp.linux-x86_64-2.6/libImaging/
ZipDecode.o build/temp.linux-x86_64-2.6/libImaging/ZipEncode.o -L/usr/
local/lib -L/home/txbruser/TxBR/sage-4.4.3/local/lib -L/usr/lib -L/
home/txbruser/TxBR/sage-4.4.3/local/lib -ljpeg -lz -lpython2.6 -o
build/lib.linux-x86_64-2.6/_imaging.so
/usr/bin/ld: /usr/local/lib/libpython2.6.a(abstract.o): relocation
R_X86_64_32 against `a local symbol' can not be used when making a
shared object; recompile with -fPIC
/usr/local/lib/libpython2.6.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Error building PIL: 'Error installing PIL'

real 0m23.256s
user 0m19.309s
sys 0m3.000s
sage: An error occurred while installing pil-1.1.6.p2
Please email sage-devel http://groups.google.com/group/sage-devel
explaining the problem and send the relevant part of
of /home/txbruser/TxBR/sage-4.4.3/install.log. Describe your
computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/home/txbruser/TxBR/sage-4.4.3/spkg/build/pil-1.1.6.p2 and type 'make
check' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
(cd '/home/txbruser/TxBR/sage-4.4.3/spkg/build/pil-1.1.6.p2' && '/home/
txbruser/TxBR/sage-4.4.3/sage' -sh)
When you are done debugging, you can type "exit" to leave the
subshell.
make[1]: *** [installed/pil-1.1.6.p2] Error 1
make[1]: Leaving directory `/home/txbruser/TxBR/sage-4.4.3/spkg'

real 239m51.011s
user 188m40.200s
sys 33m22.676s
Error building Sage.
=====
END: Relevant "make" output.
=====

Thanks,

Alex

Dr. David Kirkby

unread,
10 Jun 2010, 19:46:1410/06/2010
to sage-...@googlegroups.com
On 06/10/10 11:59 PM, akuloncmir wrote:
> I am building Sage from source as a user without root privileges. The
> machine on which I am building Sage has the following specifications:
>
> Red Hat Enterprise Linux Client release 5.2 (Tikanga)
> 4 X 1GHz Dual-Core AMD Opteron(tm) Processor 2220
> 32G RAM
>
> .
>
> In the "make" output, I'm seeing 68 instances of
>
> /usr/local/lib/libpython2.6.a: could not read symbols: Bad value
>
> . Shouldn't Sage ignore all pre-existing installs of Python?
>

Yes, it should, but it does not. I mentioned this on sage-solaris the other day,
though of course very few people read that, so nobody replied

http://groups.google.com/group/sage-solaris/browse_thread/thread/5dcc7ed68d279f67?hl=en

(In fact, I've yet to have a single reply to anything I've posted no sage-solaris!)

In my case, matplotlib failed to build. The "solution" (which is not a
solution), was to run as root:

# chmod 000 /usr/local/lib/libpython2.6.a /usr/local/lib/python2.6

so the install in /usr/local could not be found.

> Thanks,
>
> Alex
>

This is now http://trac.sagemath.org/sage_trac/ticket/9209

Dave

Jason Grout

unread,
10 Jun 2010, 23:32:5110/06/2010
to sage-...@googlegroups.com
On 6/10/10 6:46 PM, Dr. David Kirkby wrote:

>
> Yes, it should, but it does not. I mentioned this on sage-solaris the
> other day, though of course very few people read that, so nobody replied
>
> http://groups.google.com/group/sage-solaris/browse_thread/thread/5dcc7ed68d279f67?hl=en
>
>
> (In fact, I've yet to have a single reply to anything I've posted no
> sage-solaris!)


The archives link you give above shows lots of instances of people
replying to your posts.

I was just looking at the matplotlib dependency system today, so I'd be
interested in taking a look at the issue you raised to see if it's easy
to fix. Who is the admin to sage-solaris, so I can ask them to add my
email address? Can we add sage-solaris to gmane (see
http://gmane.org/subscribe.php)?

Thanks,

Jason

Dr David Kirkby

unread,
11 Jun 2010, 05:25:0411/06/2010
to sage-devel
On 11 June, 04:32, Jason Grout <jason-s...@creativetrax.com> wrote:
> On 6/10/10 6:46 PM, Dr. David Kirkby wrote:
>
>
>
> > Yes, it should, but it does not. I mentioned this on sage-solaris the
> > other day, though of course very few people read that, so nobody replied
>
> >http://groups.google.com/group/sage-solaris/browse_thread/thread/5dcc...
>
> > (In fact, I've yet to have a single reply to anything I've posted no
> > sage-solaris!)
>
> The archives link you give above shows lots of instances of people
> replying to your posts.

Sorry, I did not notice. 2 is not very useful though to be honest.

> I was just looking at the matplotlib dependency system today, so I'd be
> interested in taking a look at the issue you raised to see if it's easy
> to fix.  Who is the admin to sage-solaris, so I can ask them to add my
> email address?  Can we add sage-solaris to gmane (seehttp://gmane.org/subscribe.php)?
>
> Thanks,
>
> Jason

I'm an admin of sage-solaris, so can add you. I'll do that shortly.
But it looks like this problem is not specific to Solaris now, as the
original poster was running Redhat Enterprise Linux.

I have a similar issue (which may or may not be specific to Solaris),
that python will not build the _hashlib module on one of my SPARCs if
OpenSSL is installed in /usr/local/ssl.

On various machines in the last week or two I've had to make some
pretty drastic changes as root in order that Sage builds

# chmod 000 /usr/local/lib/libpython2.6.a /usr/local/lib/python2.6
(on my Sun Ultra 27, so matplotlib can't find my python 2.6.5, which
totally screws up the Sage build. Yet having python 2.4 in /usr/local
on another system is not a problem).

# chmod 000 /usr/local/ssl
(so Sage can't find OpenSSL on an old machine of mine)

# chmod 000 /usr/bin/pkg-config
(To enable matplotlib to find the Sage version of freetype, though the
old Sun one worked ok, so this was not an essential task. )

Clearly many packages are programmed to look in locations where
software is commonly installed, such as /usr/local. In some cases,
installations on the system get used in preference to the versions in
Sage. In some cases that causes a problem. It would be good if we
could find where this is happening in a systematic way. It's not
obvious to me how one could best do that.

Dave
Reply all
Reply to author
Forward
0 new messages