Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition in matplotlib mkdir() #11686

Closed
jdemeyer opened this issue Aug 13, 2011 · 86 comments
Closed

Race condition in matplotlib mkdir() #11686

jdemeyer opened this issue Aug 13, 2011 · 86 comments

Comments

@jdemeyer
Copy link

I regularly see this error when testing on the buildbot:

sage -t -long  -force_lib devel/sage/doc/de/tutorial/tour_functions.rst
**********************************************************************
File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/devel/sage-main/doc/de/tutorial/tour_functions.rst", line 24:
    sage: plot(f, 0, 2)
Exception raised:
    Traceback (most recent call last):
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_0[5]>", line 1, in <module>
        plot(f, Integer(0), Integer(2))###line 24:
    sage: plot(f, 0, 2)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/sage/misc/displayhook.py", line 174, in displayhook
        print_obj(sys.stdout, obj)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/sage/misc/displayhook.py", line 142, in print_obj
        print >>out_stream, `obj`
      File "sage_object.pyx", line 154, in sage.structure.sage_object.SageObject.__repr__ (sage/structure/sage_object.c:1463)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/sage/plot/plot.py", line 1081, in _repr_
        self.show()
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/sage/misc/decorators.py", line 426, in wrapper
        return func(*args, **kwds)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/sage/plot/plot.py", line 1723, in show
        self.save(DOCTEST_MODE_FILE, **kwds)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/sage/misc/decorators.py", line 426, in wrapper
        return func(*args, **kwds)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/sage/plot/plot.py", line 2453, in save
        figure = self.matplotlib(**options)
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/sage/plot/plot.py", line 1930, in matplotlib
        from matplotlib.figure import Figure, figaspect
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/matplotlib/figure.py", line 18, in <module>
        from axes import Axes, SubplotBase, subplot_class_factory
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/matplotlib/axes.py", line 18, in <module>
        import matplotlib.contour as mcontour
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/matplotlib/contour.py", line 21, in <module>
        import matplotlib.texmanager as texmanager
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/matplotlib/texmanager.py", line 72, in <module>
        class TexManager:
      File "/Users/buildbot/build/sage/bsd-1/bsd_64_upgrade/build/sage-4.5.3-4.7.1/local/lib/python/site-packages/matplotlib/texmanager.py", line 92, in TexManager
        os.mkdir(texcache)
    OSError: [Errno 17] File exists: '/tmp/dot_sage.WboXjWq0ow/matplotlib-1.0.1/tex.cache'

The problem looks to be the following race condition in the matplotlib code:

    if not os.path.exists(texcache):
        os.mkdir(texcache)

New spkg available at

http://sage.math.washington.edu/home/palmieri/SPKG/matplotlib-1.0.1.p0.spkg

CC: @jhpalmieri @jasongrout

Component: packages: standard

Keywords: MPL Errno 17 libpng

Author: John Palmieri

Reviewer: Leif Leonhardy

Merged: sage-4.7.2.alpha2

Issue created by migration from https://trac.sagemath.org/ticket/11686

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:1

Seen this before (i.e., similar), haven't we?

@jhpalmieri
Copy link
Member

comment:2

Looks like the same issue (with the same fix) as in #10159. I reported this to the matplotlib mailing list in October 2010, but no response.

In fact, what happened to the patches from #10159 which dealt with this issue? Leif has noted on #10588 that those patches seem to have been lost in the update to version 1.0.1...

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:3

Replying to @nexttime:

Seen this before (i.e., similar), haven't we?

This is a regression introduced by #10588, previously fixed in John's spkg from #10159, because the spkg of the former had not been based on the latter (and the bug hasn't [yet] been fixed upstream, at least not in 1.0.1).

Also, the current spkg is full of crap in src/build/. (The whole directory can be deleted.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:4

Replying to @jhpalmieri:

In fact, what happened to the patches from #10159 which dealt with this issue? Leif has noted on #10588 that those patches seem to have been lost in the update to version 1.0.1...

It's different to what I first thought; see my previous comment... ;-)

With a bit of luck your patches from #10159 still apply seamlessly to the current upstream version; haven't tested that yet.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:5

Just checked: John's 1.0.0.p0 spkg has been in Sage 4.6.1 and 4.6.2.alpha0, then the one from #10588 got merged into Sage 4.6.2.alpha1.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:6

Replying to @nexttime:

With a bit of luck your patches from #10159 still apply seamlessly to the current upstream version; haven't tested that yet.

Hmmm, a little work has to be done:

~/Sage/spkgs/matplotlib-1.0.1.p1/patches$ patch __init__.py < __init__.py.patch 
patching file __init__.py
Hunk #1 succeeded at 103 with fuzz 2.
~/Sage/spkgs/matplotlib-1.0.1.p1/patches$ patch finance.py < finance.py.patch 
patching file finance.py
Hunk #1 FAILED at 4.
Hunk #2 succeeded at 173 (offset 4 lines).
1 out of 2 hunks FAILED -- saving rejects to file finance.py.rej
~/Sage/spkgs/matplotlib-1.0.1.p1/patches$ patch texmanager.py < texmanager.py.patch 
patching file texmanager.py
$

John, are you going to do this?

@jhpalmieri
Copy link
Member

Author: John Palmieri

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member

comment:7

I've created a new spkg, link in the ticket description. I'm posting the diff here for review purposes.

@jhpalmieri
Copy link
Member

comment:8

(I also deleted src/build and a few random .pyc files.)

@jhpalmieri
Copy link
Member

comment:9

(Actually, I didn't delete 'src/build', I just dropped in a freshly downloaded vanilla source as the 'src' directory, in case the previous version was corrupted in other ways than just the presence of 'build'.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:10

Replying to @jhpalmieri:

(Actually, I didn't delete 'src/build', I just dropped in a freshly downloaded vanilla source as the 'src' directory, in case the previous version was corrupted in other ways than just the presence of 'build'.)

Yep, the upstream sources of Ryan's and your spkg differ:

Hundreds of instances of

diff -r matplotlib-1.0.1/src/lib/pytz/tzfile.py matplotlib-1.0.1.p0/src/lib/pytz/tzfile.py
1c1
< #!/usr/bin/env python2
---
> #!/usr/bin/env python

and also

diff -r matplotlib-1.0.1/src/setup.py matplotlib-1.0.1.p0/src/setup.py
21c21
< rc = dict({'backend':'GTKAgg', 'numerix':'numpy'})
---
> rc = {'backend':'Agg'}
Only in matplotlib-1.0.1/src/: setupext.pyc
Only in matplotlib-1.0.1.p0/src/src: backend_agg.cpp
Only in matplotlib-1.0.1.p0/src/src: backend_gdk.c
Only in matplotlib-1.0.1.p0/src/src: image.cpp
Only in matplotlib-1.0.1.p0/src/src: path.cpp

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:11

Is this normal?

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)

I do have pkg-config installed, and $SAGE_ROOT/local/lib/pkgconfig/libpng12.pc (target of a symbolic link libpng.pc) looks like this:

...
Name: libpng
Description: Loads and saves PNG files
Version: 1.2.35
Libs: -L${libdir} -lpng12
...

So maybe either pkg-config or MPL is confused by the "wrong" Name: , since we patch MPL's setupext.py:

--- src/setupext.py	2010-06-11 10:50:55.000000000 -0500
+++ src/setupext.py	2010-06-11 14:42:15.000000000 -0500
@@ -538,7 +538,7 @@
     module.include_dirs.append(numpy.get_include())
 
 def add_png_flags(module):
-    try_pkgconfig(module, 'libpng', 'png')
+    try_pkgconfig(module, 'libpng12', 'png12')
     add_base_flags(module)
     add_numpy_flags(module)
     module.libraries.append('z')

Probably this patch should only be applied on MacOS X, since

 * setupext.py: link to libpng12 instead of libpng to apparently avoid
   some name clashes on OSX.

(Currently running doctests, so haven't checked if not applying the patch on Linux changes anything w.r.t. that.)

We should add freetype (and now also GNU patch) to the Dependencies:

REQUIRED DEPENDENCIES
                 numpy: 1.5.1
             freetype2: 9.16.3

== Dependencies ==

 * python
 * numpy

@jhpalmieri
Copy link
Member

comment:12

On my OS X box, I see the same thing with the old 1.0.1 and with the new one:

REQUIRED DEPENDENCIES
                 numpy: 1.5.1
             freetype2: found, but unknown version (no pkg-config)

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)

I see that on linux, or at least on sage.math, it reports the correct version for these.

I can

  • apply the patch to setupext.py only on Darwin.
  • apply the patch always, but add an if ... then ... else so it only does something different on Darwin.

Opinions?

I'll certainly add freetype and patch to the dependencies.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:13

Impressive:

$ du -h matplotlib-1.0.1*.spkg
12M	matplotlib-1.0.1.p0.spkg
19M	matplotlib-1.0.1.spkg

So the Sage tarball will get a bit smaller again.

(It'll get even smaller if someone someday removes the JSMath fonts and other obsolete files from SageNB's Mercurial repository; I'm not sure if we even ship duplicates in other packages.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:14

The version MPL reports for freetype2 clearly comes from Sage's .pc file, since my system one refers to a different one; also PKG_CONFIG_PATH is "properly" set to (just) Sage's pkg-config directory.

Is PKG_CONFIG_PATH set on sage.math outside the Sage environment? (We only set it to Sage's if it is empty, i.e. don't prepend Sage's in case it is already set.)

@jhpalmieri
Copy link
Member

comment:15

I'm confused now. On sage.math, if I look at the install log from the old matplotlib-1.0.1 (during a fresh Sage build), it says

OPTIONAL BACKEND DEPENDENCIES
		libpng: 1.2.35

But if I do "sage -f ..." on the same spkg, I get this in its install log:

OPTIONAL BACKEND DEPENDENCIES                
                 libpng: found, but unknown version (no pkg-config)

And of course, in this old spkg, this was the only patch installed, and it was installed regardless of the OS. I don't know what's going on, but I'm posting a new spkg which only applies the patch on Darwin. I hope this improves things on non-Darwin systems, or at least doesn't hurt anything on such systems.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:16

Replying to @jhpalmieri:

I can

  • apply the patch to setupext.py only on Darwin.

  • apply the patch always, but add an if ... then ... else so it only does something different on Darwin.

Opinions?

I think modifying the patch is easier, but do what you prefer.

Note that the change should only be made if the OS is Darwin and pkg-config is not installed, since Sage's libpng*.pc contains

Libs: -L${libdir} -lpng12

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:17

I should perhaps open another ticket for changing sage-env to always add Sage's pkg-config directory to PKG_CONFIG_PATH, since otherwise wrong libraries may get used.

@jhpalmieri
Copy link
Member

comment:18

Replying to @nexttime:

Note that the change should only be made if the OS is Darwin and pkg-config is not installed

Here's a version which does this. I'm not a shell script expert; is this a good way to accomplish it?

	if [ "$UNAME" = "Darwin" ]; then
	    command -v pkg-config || patch -p1 < "$patch"

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:19

Replying to @jhpalmieri:

Here's a version which does this. I'm not a shell script expert; is this a good way to accomplish it?

	if [ "$UNAME" = "Darwin" ]; then
	    command -v pkg-config || patch -p1 < "$patch"

I see you've redirected the output of command to /dev/null in the actual patch.

IMHO a bit more readable would be

    if [ "$UNAME" = Darwin ] && ! command -v pkg-config >/dev/null; then
        patch -p1 < "$patch" # Apply only on Darwin if pkg-config isn't installed
    fi

but for simplicity (if you're not going to change the patch) I would move the specific patch to patches/Darwin/ and do the following:

# Apply patches for all platforms.  See SPKG.txt for why and what.
for patch in ../patches/*.patch; do
    patch -p1 <"$patch"
    if [ $? -ne 0 ]; then
        echo >&2 "Error applying '$patch'"
        exit 1
    fi
done

# Apply patch(es) for Darwin.
if [ "$UNAME" = Darwin ]; then
    for patch in ../patches/Darwin/*.patch; do
        patch -p1 <"$patch"
        if [ $? -ne 0 ]; then
            echo >&2 "Error applying '$patch'"
            exit 1
        fi
    done
fi

(The latter would have to be changed from a loop to an if-statement depending on command -v ... if we only apply the single patch and don't test for pkg-config in the patch itself, i.e., from Python.)

Having the patch in a separate directory it's also immediately clear that it is platform-specific; unfortunately we here have another precondition.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:20

For whatever reason, I still get

...
NOTE: Set SAGE_MATPLOTLIB_GUI to anything but 'no' to try to build the Matplotlib GUI.
Not building any matplotlib graphical backends.
patching file lib/matplotlib/__init__.py
patching file lib/matplotlib/finance.py
patching file lib/matplotlib/texmanager.py
basedirlist is: ['/home/leif/Sage/sage-4.7.1.rc2/local']
============================================================================
BUILDING MATPLOTLIB
            matplotlib: 1.0.1
                python: 2.6.4 (r264, Aug 11 2011, 12:43:02)  [GCC 4.5.1]
              platform: linux2

REQUIRED DEPENDENCIES
                 numpy: 1.5.1
             freetype2: 9.16.3

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)
...

i.e. an "unknown" libpng version, even without the patch to setupext.py.

@jhpalmieri
Copy link
Member

comment:21

I think that using the vanilla source is best when possible, so I'm only going to apply the patch on Darwin. However, it's possible that someone will install (or uninstall) pkg-config and not recompile Sage, so I've put the test for that inside the patch.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:22

Haha:

~/Sage/sage-4.7.1.rc2$ env PKG_CONFIG_PATH=/foo ./sage -f ~/Sage/spkgs/matplotlib-1.0.1.p0.spkg 
Force installing /home/leif/Sage/spkgs/matplotlib-1.0.1.p0.spkg
...
NOTE: Set SAGE_MATPLOTLIB_GUI to anything but 'no' to try to build the Matplotlib GUI.
Not building any matplotlib graphical backends.
patching file lib/matplotlib/__init__.py
patching file lib/matplotlib/finance.py
patching file lib/matplotlib/texmanager.py
basedirlist is: ['/home/leif/Sage/sage-4.7.1.rc2/local']
============================================================================
BUILDING MATPLOTLIB
            matplotlib: 1.0.1
                python: 2.6.4 (r264, Aug 11 2011, 12:43:02)  [GCC 4.5.1]
              platform: linux2

REQUIRED DEPENDENCIES
                 numpy: 1.5.1
             freetype2: 9.22.3

OPTIONAL BACKEND DEPENDENCIES
                libpng: 1.2.42
...

So somehow Sage's libpng*.pc appears to be "broken".

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 14, 2011

comment:23

Replying to @nexttime:

So somehow Sage's libpng*.pc appears to be "broken".

Yep, apparently by sage-location, during the build.

If I reinstall libpng12, and then MPL, everything is fine.

The offending line was

SAGE_ROOT=${SAGE_ROOT}

SAGE_ROOT=/the/appropriate/absolute/path works. I have no idea why pkg-config doesn't take $SAGE_ROOT from the environment if it isn't defined in the .pc file itself; it IMHO used to -- last year, but meanwhile doesn't ... 8/

I.e.,

prefix=${SAGE_ROOT}

does no longer work unless SAGE_ROOT is also defined in the .pc file itself.

We may have to really wrap pkg-config in $SAGE_ROOT/local/bin with

#!/bin/sh

if [ -z "$SAGE_ROOT" ]; then
    echo >&2 "Error: $0: SAGE_ROOT not defined."
    exit 1
fi

exec /usr/bin/env PATH=`echo $PATH | sed -e "s|$SAGE_ROOT/local/bin:||"` \
    pkg-config --define-variable=SAGE_ROOT="$SAGE_ROOT" "$@"

(Or just call the system's pkg-config without --define-variable ... if SAGE_ROOT is undefined.)

Defining SAGE_ORIG_PATH in sage-env wouldn't be a bad idea either.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 17, 2011

comment:52

Replying to @nexttime:

Perhaps on some ancient Darwin systems as well if you can.

And perhaps also on iras by first installing the new libpng spkg and afterwards your old matplotlib spkg (the one that only applies the patch on Darwin).

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 17, 2011

Changed keywords from MPL Errno 14 libpng to MPL Errno 17 libpng

@jhpalmieri
Copy link
Member

comment:54

I'll leave the old SPKG around for a while, in case anyone needs it. I also just made a version which doesn't patch setupext.py at all, to help test #11696.

@jhpalmieri

This comment has been minimized.

@jdemeyer
Copy link
Author

comment:55

Is the new spkg now ready to be merged independently of #11696?

@jhpalmieri
Copy link
Member

comment:56

Yes, the new spkg is independent of #11696. (One of the consequences of the changes at #11696 is to make one of the patches in the new spkg unnecessary.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 18, 2011

comment:57

Replying to @jdemeyer:

Is the new spkg now ready to be merged independently of #11696?

Yes. I just forgot to delete the work issues when giving it positive review again.

I think it doesn't hurt if #11696 also (partially) fixes this in a different way, too, though, and the spkg there contains other important changes to the libpng spkg. (Currently, the latter needs work though, i.e. I have to update the spkg there, but as said, the MPL one here can be merged regardless of that.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 18, 2011

Changed work issues from Either check for pkg-config on other platforms as well, or make the ticket depend on #11696. to none

@jdemeyer
Copy link
Author

Merged: sage-4.7.2.alpha2

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Aug 30, 2011

Attachment: matplotlib-1.0.1.p0.log

Log of a failed build

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Aug 30, 2011

comment:59

Can this ticket be reopened again? My build failed (see http://groups.google.com/group/sage-release/browse_thread/thread/6daea0d0dfef0562).

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 30, 2011

comment:60

Replying to @sagetrac-johanbosman:

Can this ticket be reopened again? My build failed (see http://groups.google.com/group/sage-release/browse_thread/thread/6daea0d0dfef0562).

Cf. my comment here. (You could try building with my current libpng spkg there, though it needs work for other constellations.)

I'd prefer opening a follow-up ticket, as this ticket has already been merged; haven't looked at your build log yet, though.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 30, 2011

comment:61

Replying to @nexttime:

I'd prefer opening a follow-up ticket, as this ticket has already been merged; haven't looked at your build log yet, though.

(And this ticket was intended to just fix a regression, because the first MPL 1.0.1 spkg had accidentally been based on an obsolete one; therefore its title.)

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Aug 30, 2011

comment:62

Okay, we'll move the discussion somewhere else then. ;).

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 30, 2011

comment:63

Apparently MPL has problems using your pkg-config, for whatever reason...:

...
REQUIRED DEPENDENCIES
                 numpy: 1.5.1
             freetype2: found, but unknown version (no pkg-config)

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)
...

The patched setupext.py in contrast seems to find it, and therefore disables the work-around for when pkg-config is not installed.

(The note "(no pkg-config)" also appears if pkg-config is installed, but unable to read the .pc file, e.g. because of duplicate definitions of SAGE_ROOT in it.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 30, 2011

comment:64

Johan, please install this spkg (which provides some debugging output, not trying to fix anything yet), and inspect the top of the install log (only up to "[Edit setup.cfg to suppress the above messages]" if it fails, which I expect it to).

Thanks.

(I think I now know where the problem lies. :) )

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Aug 30, 2011

comment:65

How do I install this?

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 30, 2011

comment:66

Replying to @sagetrac-johanbosman:

How do I install this?

For example by typing

$ ./sage -f http://sage.math.washington.edu/home/leif/Sage/spkgs/matplotlib-1.0.1.p0-debug.spkg

in your SAGE_ROOT directory. (Or download it manually with your favourite program and pass the local filename to ./sage -f ....)

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Aug 30, 2011

comment:67

The point is that Sage did not build. Or is it okay for this purpose to use another version of Sage?

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 30, 2011

comment:68

Replying to @sagetrac-johanbosman:

The point is that Sage did not build. Or is it okay for this purpose to use another version of Sage?

This AFAIK shouldn't matter (that Sage didn't build), but I'm not totally sure.

Since I assume previous versions of Sage did build for you on that machine (with an older MPL spkg), I'd use the Sage installation where it failed (i.e., Sage 4.7.2.alpha2), since the error might (at least in theory) originate from something else.

To be on the safe side, copy the downloaded package to $SAGE_ROOT/spkg/standard/ and (re)run make. Then Sage shouldTM pick up the new spkg with debugging. The log is then spkg/logs/matplotlib-1.0.1.p0-debug.log.

(In case Sage doesn't pick up the right one, which I don't think, you could (re)move the original MPL spkg from there. A matter of file modification times, so you could equally just touch the new spkg.)

To see in advance which version Sage would install, do

$ (cd $SAGE_ROOT/spkg/standard/ && ./newest_version matplotlib)

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Aug 30, 2011

comment:69

Thanks for explaining. I'm trying to build it now. ;)

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Aug 30, 2011

comment:70

Hmm, I tried to upload the top of the build log, but I got an error message:

IOError: [Errno 28] No space left on device

Any suggestions?

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 30, 2011

comment:71

Replying to @sagetrac-johanbosman:

Hmm, I tried to upload the top of the build log, but I got an error message:

IOError: [Errno 28] No space left on device

To trac?

I didn't think of the (full) MPL log (which you attached) being that large btw.

Any suggestions?

Try replacing the already attached one with the newer, smaller one. Requires it having the same filename of course.

Or upload it onto sage.math and provide a link. If it's not too long, you could also quote it here in a comment (in a "code block").

Or mail it to me (notdotreallyatonlinedotde, replacing the obvious), then I can upload it to sage.math.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 30, 2011

comment:72

Hahaha, my guess was right:

...
has_pkgconfig(): trying 'pkg-config --help'...
has_pkgconfig(): command exited with 34304.
Output is:
Usage: pkg-config [OPTION...]
  --version                                      output version of pkg-config
  --modversion                                   output version for package
  --atleast-pkgconfig-version=VERSION            sh: line 1: 16589 Abort trap              pkg-config --help
has_pkgconfig(): returning False.
...
add_png_flags(): Sage: 'pkg-config' is in PATH, not trying to use work-around.
...

Johan, can you give the output of

$ pkg-config --version ; echo $?

$ pkg-config --help ; echo $?

?

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 31, 2011

comment:73

Replying to @nexttime:

Hahaha, my guess was right:

...
has_pkgconfig(): trying 'pkg-config --help'...
has_pkgconfig(): command exited with 34304.
...
has_pkgconfig(): returning False.
...
add_png_flags(): Sage: 'pkg-config' is in PATH, not trying to use work-around.
...

For the record, I have a (preliminary) MPL 1.0.1.p1 spkg fixing this, which Johan already tested.

(Cf. http://groups.google.com/group/sage-release/msg/49a4ded0bc168976.)

I'll open a follow-up for that one at some uncertain point in the future... (Remind me of that in case nothing should happen for a while.) ;-)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Oct 11, 2011

comment:74

Some follow-up, for upgrading to MPL 1.1.0: #11915

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants