mlab cohere_pairs patch

Hi,

here is a suggested patch for mlab’s cohere_pairs function. The old version was broken, due to some outdated code.

Cheers,

Ariel

mlab_cohere_pairs_patch.py (5.22 KB)

···


Ariel Rokem
Helen Wills Neuroscience Institute

University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

Thanks Ariel for the patch. Could you explain your patch in words --
what was broken before and how you fixed it. Also, while your patch
is particularly simple, since it is just a single function
replacement, we encourage people to submit svn diffs against HEAD or
the branch they are patching. It just makes life simpler for us,
since we (fortunately) get a lot of contributions. I strongly
encourage people to include a complete, free-standing example that I
can run unmodified which shows the undesired behavior pre-patch and
the desired behavior post-patch, with a clear verbal of what to look
for. I wrote this function 5 years ago, and while I remember it
pretty well, I will not be as familiar with it after such a long
hiatus as you are now.

http://matplotlib.sourceforge.net/faq/howto_faq.html#contributing-howto

JDH

···

On Tue, Aug 11, 2009 at 5:02 PM, Ariel Rokem<arokem@...453...> wrote:

here is a suggested patch for mlab's cohere_pairs function. The old version
was broken, due to some outdated code.

Hi -

I would like to do that, but now, after I grabbed the most recent svn from main source and tried to build it (so that I can replicate the broken-ness of the code) I get this:

ASR:matplotlib arokem$ python setup.py install

···

============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.0.svn
python: 2.5.2 |EPD 4.0.30001| (r252:60911, Sep 19 2008,
12:00:24) [GCC 4.0.1 (Apple Computer, Inc. build

                    5370)]
          platform: darwin

REQUIRED DEPENDENCIES
numpy: 1.3.0.dev5972
freetype2: 9.17.3

OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.37

           Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
          wxPython: 2.8.7.1
                    * WxAgg extension not required for wxPython >= 2.8
              Gtk+: no
                    * Building for Gtk+ requires pygtk; you must be able

                    * to "import gtk" in your build/install environment
   Mac OS X native: yes
                Qt: no
               Qt4: Qt: 4.5.2, PyQt4: 4.5.2
             Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: 1.4
pytz: 2008c

OPTIONAL USETEX DEPENDENCIES
dvipng: 1.9

       ghostscript: 8.57
             latex: 3.141592

[Edit setup.cfg to suppress the above messages]

… lots more output to the shell - everything looks OK…

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.5/src/ft2font.o build/temp.macosx-10.3-i386-2.5/src/mplutils.o build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o build/lib.macosx-10.3-i386-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc

collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib
lipo: can’t open input file: /var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//ccuiy1nA.out (No such file or directory)

error: command ‘g++’ failed with exit status 1

Am I doing something wrong? I promise to follow your instructions, if I can make it work :slight_smile:

Thanks,

Ariel

On Tue, Aug 11, 2009 at 5:14 PM, John Hunter <jdh2358@…149…> wrote:

On Tue, Aug 11, 2009 at 5:02 PM, Ariel Rokem<arokem@…453…> wrote:

here is a suggested patch for mlab’s cohere_pairs function. The old version

was broken, due to some outdated code.

Thanks Ariel for the patch. Could you explain your patch in words –

what was broken before and how you fixed it. Also, while your patch

is particularly simple, since it is just a single function

replacement, we encourage people to submit svn diffs against HEAD or

the branch they are patching. It just makes life simpler for us,

since we (fortunately) get a lot of contributions. I strongly

encourage people to include a complete, free-standing example that I

can run unmodified which shows the undesired behavior pre-patch and

the desired behavior post-patch, with a clear verbal of what to look

for. I wrote this function 5 years ago, and while I remember it

pretty well, I will not be as familiar with it after such a long

hiatus as you are now.

http://matplotlib.sourceforge.net/faq/howto_faq.html#contributing-howto

JDH


Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

No worries -- OSX is a nightmare. First try this:

  make build_osx105

and if that works, you can

  python setup.py install

If that doesn't work, try

  cd release/osx
  # read the readme, then
  make fetch_deps dependencies
  # install bdist_wininst as instructed
  make installers

the latter sequence is what I do when building the installers, and
will grab all the dependencies, build them from src with the right
flags, and use them instead of the system wide installed ones.

There is no reason for you to go through this for a simple pure python
patch, but I am interested in figuring out a way for regular OSX users
to be able to build mpl, so am happy to use you as a crash test dummy
:slight_smile:

See also:

  http://matplotlib.sourceforge.net/users/installing.html#building-on-osx
  http://matplotlib.sourceforge.net/faq/installing_faq.html#os-x-questions

JDH

···

On Tue, Aug 11, 2009 at 8:29 PM, Ariel Rokem<arokem@...453...> wrote:

Am I doing something wrong? I promise to follow your instructions, if I can
make it work :slight_smile:

Resending, with CC to list.

Thanks for the help! Nightmare of the living crash-test dummy…

I tried following your instructions. Here’s what that looks like:

ASR:matplotlib arokem$ make build_os105

make: *** No rule to make target `build_os105’. Stop.

ASR:matplotlib arokem$ cd release/osx
ASR:osx arokem$ open README.txt

I read the README - decide to skip reinstalling python and numpy, and skipped to the next step …

ASR:osx arokem$ unset PKG_CONFIG_PATH

ASR:osx arokem$ make fetch_deps dependencies
make: *** No rule to make target `fetch_deps’. Stop.
ASR:osx arokem$ make fetch
wget http://www.zlib.net/zlib-1.2.3.tar.gz &&\

wget [http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.33.tar.bz2](http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.33.tar.bz2) &&\
wget [http://download.savannah.gnu.org/releases/freetype/freetype-2.3.7.tar.bz2&&](http://download.savannah.gnu.org/releases/freetype/freetype-2.3.7.tar.bz2&&)\

wget [http://pypi.python.org/packages/source/b/bdist_mpkg/bdist_mpkg-0.4.4.tar.gz&&](http://pypi.python.org/packages/source/b/bdist_mpkg/bdist_mpkg-0.4.4.tar.gz&&)\
tar xvfz bdist_mpkg-0.4.4.tar.gz &&\

echo "You need to to install bdist_mpkg-0.4.4 now"

/bin/sh: wget: command not found
make: *** [fetch] Error 127

I googled “wget” - downloaded wget source-code, installed wget.

ASR:osx arokem$ make fetch

seemed to work now, after fetch got everything, I continued with
the crib sheet from the README.txt (which has an error in it, the 6th
step there is ‘cd …’. That didn’t work - instead I ran ‘make deps’ in
the directory I previously ended up in ‘/release/osx/’, that worked)

Finally:

ASR:osx arokem$ make installers
unset PKG_CONFIG_PATH &&
tar xvfz matplotlib-0.99.0.tar.gz &&
cd matplotlib-0.99.0 &&
rm -rf build &&
cp …/data/setup.cfg …/data/ReadMe.txt . &&\

export CFLAGS="-Os -arch ppc -arch i386 -I/Users/arokem/source/

matplotlib/release/osx/zlib-1.2.3 -I/Users/arokem/source/matplotlib/release/osx/libpng-1.2.33 -I/Users/arokem/source/matplotlib/release/osx/freetype-2.3.7/include" &&\

export LDFLAGS="-arch ppc -arch i386 -L/Users/arokem/source/matplotlib/release/osx/zlib-1.2.3 -L/Users/arokem/source/matplotlib/release/osx/libpng-1.2.33 -L/Users/arokem/source/matplotlib/release/osx/freetype-2.3.7" &&\

/Library/Frameworks/Python.framework/Versions/2.6/bin/bdist_mpkg --readme=ReadMe.txt &&\
hdiutil create -srcdir dist/matplotlib-0.99.0-py2.6-macosx10.5.mpkg  dist/matplotlib-0.99.0-py2.6-macosx10.5.dmg &&\

python2.6 setupegg.py bdist_egg

tar (child): matplotlib-0.99.0.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors

make: *** [installers] Error 2

But
the version number I have here is matplotlib-1.0.svn (is that what I am
supposed to have? I grabbed the svn as instructed on the webpage you
linked to before), so I go and edit the Makefile, to reflect that. I
run that again, it does a lot of stuff (I have the full output saved,
if you want to see that). Then, finally:

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-bundle -undefined dynamic_lookup -arch ppc -arch i386
-L/Users/arokem/source/matplotlib/release/osx/zlib-1.2.3
-L/Users/arokem/source/matplotlib/release/osx/libpng-1.2.33
-L/Users/arokem/source/matplotlib/release/osx/freetype-2.3.7 -Os -arch
ppc -arch i386 -I/Users/arokem/source/matplotlib/release/osx/zlib-1.2.3
-I/Users/arokem/source/matplotlib/release/osx/libpng-1.2.33
-I/Users/arokem/source/matplotlib/release/osx/freetype-2.3.7/include
build/temp.macosx-10.3-fat-2.5/src/ft2font.o
build/temp.macosx-10.3-fat-2.5/src/mplutils.o
build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o
build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o
build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o
build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/opt/local/lib
-L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm
-o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so
-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture

ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture

ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc

collect2: ld returned 1 exit status

ld warning: duplicate dylib /opt/local/lib/libz.1.dylib

lipo: can’t open input file: /var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//ccp3hmVy.out (No such file or directory)

error: command ‘g++’ failed with exit status 1

make: *** [installers] Error 1

So - I am back to square 1, it seems. Do you know where I should go from here?

Cheers,

Ariel

···

On Tue, Aug 11, 2009 at 6:37 PM, John Hunter <jdh2358@…149…> wrote:

On Tue, Aug 11, 2009 at 8:29 PM, Ariel Rokem<arokem@…453…> wrote:

Am I doing something wrong? I promise to follow your instructions, if I can

make it work :slight_smile:

No worries – OSX is a nightmare. First try this:

make build_osx105

and if that works, you can

python setup.py install

If that doesn’t work, try

cd release/osx

read the readme, then

make fetch_deps dependencies

install bdist_wininst as instructed

make installers

the latter sequence is what I do when building the installers, and

will grab all the dependencies, build them from src with the right

flags, and use them instead of the system wide installed ones.

There is no reason for you to go through this for a simple pure python

patch, but I am interested in figuring out a way for regular OSX users

to be able to build mpl, so am happy to use you as a crash test dummy

:slight_smile:

See also:

http://matplotlib.sourceforge.net/users/installing.html#building-on-osx

http://matplotlib.sourceforge.net/faq/installing_faq.html#os-x-questions

JDH


Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

Typo: John said:

make build_osx105

Note the extra 'x'.

By the way John, in this particular case, I don't think the change
warrants a before/after example, because the before case is "it
doesn't run" :slight_smile: The code today makes calls to Numeric routines like
typecode() that simply don't exist anymore, so it's totally broken:

In [1]: x = rand(512,3)

In [2]: ij = [(0,1),(1,2)]

In [3]: mlab.cohere_pairs(x,ij)

···

On Tue, Aug 11, 2009 at 7:29 PM, Ariel Rokem<arokem@...453...> wrote:

ASR:matplotlib arokem$ make build_os105
make: *** No rule to make target `build_os105'. Stop.

---------------------------------------------------------------------------
NameError Traceback (most recent call last)

/home/installers/src/scipy/matplotlib/<ipython console> in <module>()

/home/fperez/usr/opt/lib/python2.6/site-packages/matplotlib/mlab.pyc
in cohere_pairs(X, ij, NFFT, Fs, detrend, window, noverlap,
preferSpeedOverMemory, progressCallback, returnPxx)
    597 windowVals = window
    598 else:
--> 599 windowVals = window(np.ones((NFFT,), typecode(X)))
    600 ind = range(0, numRows-NFFT+1, NFFT-noverlap)
    601 numSlices = len(ind)

NameError: global name 'typecode' is not defined

The fixes Ariel is sending are strictly confined to making the code
run again, by using the equivalent numpy calls:

In [1]: x = rand(512,3)

In [2]: ij = [(0,1),(1,2)]

In [3]: mlab.cohere_pairs(x,ij)
Out[3]:
({(0, 1): 0.68070570340049885, (1, 2): 0.70577163603522997},
{(0, 1): -0.007568280470951907, (1, 2): 0.0027428217481150026},
array([ 0. , 0.0078, 0.0156, 0.0234, 0.0312, 0.0391, 0.0469, 0.0547,
        0.0625, 0.0703, 0.0781, 0.0859, 0.0938, 0.1016, 0.1094, 0.1172,
        0.125 , 0.1328, 0.1406, 0.1484, 0.1562, 0.1641, 0.1719, 0.1797,
        0.1875, 0.1953, 0.2031, 0.2109, 0.2188, 0.2266, 0.2344, 0.2422,
        0.25 , 0.2578, 0.2656, 0.2734, 0.2812, 0.2891, 0.2969, 0.3047,
        0.3125, 0.3203, 0.3281, 0.3359, 0.3438, 0.3516, 0.3594, 0.3672,
        0.375 , 0.3828, 0.3906, 0.3984, 0.4062, 0.4141, 0.4219, 0.4297,
        0.4375, 0.4453, 0.4531, 0.4609, 0.4688, 0.4766, 0.4844, 0.4922,
        0.5 , 0.5078, 0.5156, 0.5234, 0.5312, 0.5391, 0.5469, 0.5547,
        0.5625, 0.5703, 0.5781, 0.5859, 0.5938, 0.6016, 0.6094, 0.6172,
        0.625 , 0.6328, 0.6406, 0.6484, 0.6562, 0.6641, 0.6719, 0.6797,
        0.6875, 0.6953, 0.7031, 0.7109, 0.7188, 0.7266, 0.7344, 0.7422,
        0.75 , 0.7578, 0.7656, 0.7734, 0.7812, 0.7891, 0.7969, 0.8047,
        0.8125, 0.8203, 0.8281, 0.8359, 0.8438, 0.8516, 0.8594, 0.8672,
        0.875 , 0.8828, 0.8906, 0.8984, 0.9062, 0.9141, 0.9219, 0.9297,
        0.9375, 0.9453, 0.9531, 0.9609, 0.9688, 0.9766, 0.9844, 0.9922,
        1. ]))

Ariel, if you are still struggling with the binary build, since your
changes are confined to a pure python file, you can submit the patch
by simply running:

- svn udpate
- modify in-place mlab.py with your version of cohere_pairs
- svn diff > mlab_cohere_pairs.diff

You may want to watch out for the fact that the docstring in your
version doesn't start with

  u"""

This means the string is Unicode. It seems mpl has been unicode-ified
so it's best to fix this before you generate the diff. This is why
John encourages the diff to be made against HEAD, so these little
things can be easily spotted. By doing this, you'll notice small
changes in formatting you might not have meant to introduce, so it
lets you clean up the contribution before sending it so it really only
changes what you intended to.

Cheers,

f

By the way John, in this particular case, I don't think the change
warrants a before/after example, because the before case is "it
doesn't run" :slight_smile: The code today makes calls to Numeric routines like
typecode() that simply don't exist anymore, so it's totally broken:

Great -- this is just the kind of explanation I need. Though if we had
an example, it is unlikely that the code would go so long w/o being
exercised. We do supply some eeg data with mpl -- see
examples/pylab_examples/mri_with_eeg.py, so Ariel may want to write a
simple cohere_pairs examples which just generates a scatter plot or
something else to show the output and then we can include it in
backend driver do it is will be unlikely to suffer bit rot going
forward.

Ariel, if you are still struggling with the binary build, since your
changes are confined to a pure python file, you can submit the patch
by simply running:

- svn udpate
- modify in-place mlab.py with your version of cohere_pairs
- svn diff > mlab_cohere_pairs.diff

udpate = update

That will be fine -- I would like to help Ariel get his svn build
going, but if that is a distraction it doesn't need to slow the patch
down. For bugfixes we encourage patches against the release branch

  svn co https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint
mpl99

JDH

···

On Wed, Aug 12, 2009 at 2:26 AM, Fernando Perez<fperez.net@...149...> wrote:

Hi Fernando and John,

regardless of the clunky way in which I was trying to introduce our patch, I still want to be able to build MPL from source on my machine. It is a distraction, but, hey, it’s a distraction on top of a distraction on top of a distraction, so at this point, I might as well be distracted. Besides, it should end up being useful, and not only for me. Yesterday, there was someone on the matplotlib-users list with exactly the same problem in building MPL from source (sourceforge is not responding at the moment, so I can’t post a link to that message). If this is not a good time to trouble-shoot this, let me know and we can come back to this in a couple of weeks. It does seem like cohere_pairs has not gotten a lot of use, so the patch can also languish for another couple of weeks andI can get stuff done regardless of solving this problem, but I would love to be able to solve this, with your help.

So - I now checked out 0.99, running ‘make build_osx105’ (you do realize the ‘x’ stands for ‘10’, don’t you?) didn’t work, so I followed the instructions in source/osx/README

I still get exactly the same error as before:

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -bundle -undefined dynamic_lookup -arch ppc -arch i386 -L/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -L/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -L/Users/arokem/source/mpl99/release/osx/freetype-2.3.7 -Os -arch ppc -arch i386 -I/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -I/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -I/Users/arokem/source/mpl99/release/osx/freetype-2.3.7/include build/temp.macosx-10.3-fat-2.5/src/ft2font.o build/temp.macosx-10.3-fat-2.5/src/mplutils.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc

collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib
lipo: can’t open input file: /var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//cceiN12W.out (No such file or directory)

error: command ‘g++’ failed with exit status 1
make: *** [installers] Error 1

So - there is still some problem with the architecture. BTW - this closely resembles errors I used to get when trying to install ETS, but in the recent release of ETS, this problem seems to have been solved. Here’s something from enthought-dev, in that direction: https://mail.enthought.com/pipermail/enthought-dev/2009-June/022153.html

I tried following Robert Kern’s suggestion and edited /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile
in order to remove the ‘-arch ppc’ flag from the CFLAGS and LDFLAGS variables, and from one other place in that file, but that didn’t seem to help. Even though now g++ is called without the possibly offending ‘-arch ppc’ flag, somethow that flag is generated later on in the call (after ‘-undefined dynamic_lookup’) and I still get the same error:

g++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup -arch ppc -arch i386 -L/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -L/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -L/Users/arokem/source/mpl99/release/osx/freetype-2.3.7 -Os -arch ppc -arch i386 -I/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -I/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -I/Users/arokem/source/mpl99/release/osx/freetype-2.3.7/include build/temp.macosx-10.3-i386-2.5/src/ft2font.o build/temp.macosx-10.3-i386-2.5/src/mplutils.o build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o build/lib.macosx-10.3-i386-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc

collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib
lipo: can’t open input file: /var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//ccud2g4d.out (No such file or directory)

error: command ‘g++’ failed with exit status 1
make: *** [installers] Error 1

Any ideas?

Cheers,

Ariel

···

On Wed, Aug 12, 2009 at 3:42 AM, John Hunter <jdh2358@…149…> wrote:

On Wed, Aug 12, 2009 at 2:26 AM, Fernando Perez<fperez.net@gmail.com> wrote:

By the way John, in this particular case, I don’t think the change

warrants a before/after example, because the before case is "it

doesn’t run" :slight_smile: The code today makes calls to Numeric routines like

typecode() that simply don’t exist anymore, so it’s totally broken:

Great – this is just the kind of explanation I need. Though if we had

an example, it is unlikely that the code would go so long w/o being

exercised. We do supply some eeg data with mpl – see

examples/pylab_examples/mri_with_eeg.py, so Ariel may want to write a

simple cohere_pairs examples which just generates a scatter plot or

something else to show the output and then we can include it in

backend driver do it is will be unlikely to suffer bit rot going

forward.

Ariel, if you are still struggling with the binary build, since your

changes are confined to a pure python file, you can submit the patch

by simply running:

  • svn udpate
  • modify in-place mlab.py with your version of cohere_pairs
  • svn diff > mlab_cohere_pairs.diff

udpate = update

That will be fine – I would like to help Ariel get his svn build

going, but if that is a distraction it doesn’t need to slow the patch

down. For bugfixes we encourage patches against the release branch

svn co [https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint

mpl99](https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint mpl99)

JDH


Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

Hi again - a string of strange things just happened. After this recent chain of failures, I decided to try to do some random attempts at making this work.

First, I ran ‘sudo python setup.py install’ in the directory into which I had checked out the mpl source. After going through all of the above, that now went without a hitch(?!). I started ipython and imported matplotlib, but was disappointed to see that I was still importing 0.98.3, which is the version I previously had.

I then ran:

ASR:~ arokem$ easy_install matplotlib
Searching for matplotlib
Best match: matplotlib 0.99.0
Removing matplotlib 0.98.3.0001 from easy-install.pth file
Adding matplotlib 0.99.0 to easy-install.pth file

Using /Library/Frameworks/Python.framework/Versions/4.0.30001/lib/python2.5/site-packages
Processing dependencies for matplotlib
Finished processing dependencies for matplotlib

Now, when I open ipython and import matplotlib, the version I have is 0.99, and it seems to work (opens plots and such). So - somehow the process worked, but how?

Cheers,

Ariel

···

On Wed, Aug 12, 2009 at 10:08 AM, Ariel Rokem <arokem@…453…> wrote:

Hi Fernando and John,

regardless of the clunky way in which I was trying to introduce our patch, I still want to be able to build MPL from source on my machine. It is a distraction, but, hey, it’s a distraction on top of a distraction on top of a distraction, so at this point, I might as well be distracted. Besides, it should end up being useful, and not only for me. Yesterday, there was someone on the matplotlib-users list with exactly the same problem in building MPL from source (sourceforge is not responding at the moment, so I can’t post a link to that message). If this is not a good time to trouble-shoot this, let me know and we can come back to this in a couple of weeks. It does seem like cohere_pairs has not gotten a lot of use, so the patch can also languish for another couple of weeks andI can get stuff done regardless of solving this problem, but I would love to be able to solve this, with your help.

So - I now checked out 0.99, running ‘make build_osx105’ (you do realize the ‘x’ stands for ‘10’, don’t you?) didn’t work, so I followed the instructions in source/osx/README

I still get exactly the same error as before:

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -bundle -undefined dynamic_lookup -arch ppc -arch i386 -L/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -L/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -L/Users/arokem/source/mpl99/release/osx/freetype-2.3.7 -Os -arch ppc -arch i386 -I/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -I/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -I/Users/arokem/source/mpl99/release/osx/freetype-2.3.7/include build/temp.macosx-10.3-fat-2.5/src/ft2font.o build/temp.macosx-10.3-fat-2.5/src/mplutils.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc

collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib

lipo: can’t open input file: /var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//cceiN12W.out (No such file or directory)

error: command ‘g++’ failed with exit status 1
make: *** [installers] Error 1

So - there is still some problem with the architecture. BTW - this closely resembles errors I used to get when trying to install ETS, but in the recent release of ETS, this problem seems to have been solved. Here’s something from enthought-dev, in that direction: https://mail.enthought.com/pipermail/enthought-dev/2009-June/022153.html

I tried following Robert Kern’s suggestion and edited /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile
in order to remove the ‘-arch ppc’ flag from the CFLAGS and LDFLAGS variables, and from one other place in that file, but that didn’t seem to help. Even though now g++ is called without the possibly offending ‘-arch ppc’ flag, somethow that flag is generated later on in the call (after ‘-undefined dynamic_lookup’) and I still get the same error:

g++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup -arch ppc -arch i386 -L/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -L/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -L/Users/arokem/source/mpl99/release/osx/freetype-2.3.7 -Os -arch ppc -arch i386 -I/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -I/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -I/Users/arokem/source/mpl99/release/osx/freetype-2.3.7/include build/temp.macosx-10.3-i386-2.5/src/ft2font.o build/temp.macosx-10.3-i386-2.5/src/mplutils.o build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o build/lib.macosx-10.3-i386-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc

collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib

lipo: can’t open input file: /var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//ccud2g4d.out (No such file or directory)

error: command ‘g++’ failed with exit status 1
make: *** [installers] Error 1

Any ideas?

Cheers,

Ariel

On Wed, Aug 12, 2009 at 3:42 AM, John Hunter <jdh2358@…149…> wrote:

On Wed, Aug 12, 2009 at 2:26 AM, Fernando Perez<fperez.net@gmail.com> wrote:

By the way John, in this particular case, I don’t think the change

warrants a before/after example, because the before case is "it

doesn’t run" :slight_smile: The code today makes calls to Numeric routines like

typecode() that simply don’t exist anymore, so it’s totally broken:

Great – this is just the kind of explanation I need. Though if we had

an example, it is unlikely that the code would go so long w/o being

exercised. We do supply some eeg data with mpl – see

examples/pylab_examples/mri_with_eeg.py, so Ariel may want to write a

simple cohere_pairs examples which just generates a scatter plot or

something else to show the output and then we can include it in

backend driver do it is will be unlikely to suffer bit rot going

forward.

Ariel, if you are still struggling with the binary build, since your

changes are confined to a pure python file, you can submit the patch

by simply running:

  • svn udpate
  • modify in-place mlab.py with your version of cohere_pairs
  • svn diff > mlab_cohere_pairs.diff

udpate = update

That will be fine – I would like to help Ariel get his svn build

going, but if that is a distraction it doesn’t need to slow the patch

down. For bugfixes we encourage patches against the release branch

svn co [https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint

mpl99](https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint mpl99)

JDH


Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel


Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

Hi - scratch that. Only seems to be working. Actually it hangs when I run scripts that open figures. I am going to undo all this and forget I ever started down this path.

Cheers,

Ariel

···

On Wed, Aug 12, 2009 at 11:10 AM, Ariel Rokem <arokem@…453…> wrote:

Hi again - a string of strange things just happened. After this recent chain of failures, I decided to try to do some random attempts at making this work.

First, I ran ‘sudo python setup.py install’ in the directory into which I had checked out the mpl source. After going through all of the above, that now went without a hitch(?!). I started ipython and imported matplotlib, but was disappointed to see that I was still importing 0.98.3, which is the version I previously had.

I then ran:

ASR:~ arokem$ easy_install matplotlib
Searching for matplotlib
Best match: matplotlib 0.99.0
Removing matplotlib 0.98.3.0001 from easy-install.pth file
Adding matplotlib 0.99.0 to easy-install.pth file

Using /Library/Frameworks/Python.framework/Versions/4.0.30001/lib/python2.5/site-packages
Processing dependencies for matplotlib
Finished processing dependencies for matplotlib

Now, when I open ipython and import matplotlib, the version I have is 0.99, and it seems to work (opens plots and such). So - somehow the process worked, but how?

Cheers,

Ariel

On Wed, Aug 12, 2009 at 10:08 AM, Ariel Rokem <arokem@…453…> wrote:

Hi Fernando and John,

regardless of the clunky way in which I was trying to introduce our patch, I still want to be able to build MPL from source on my machine. It is a distraction, but, hey, it’s a distraction on top of a distraction on top of a distraction, so at this point, I might as well be distracted. Besides, it should end up being useful, and not only for me. Yesterday, there was someone on the matplotlib-users list with exactly the same problem in building MPL from source (sourceforge is not responding at the moment, so I can’t post a link to that message). If this is not a good time to trouble-shoot this, let me know and we can come back to this in a couple of weeks. It does seem like cohere_pairs has not gotten a lot of use, so the patch can also languish for another couple of weeks andI can get stuff done regardless of solving this problem, but I would love to be able to solve this, with your help.

So - I now checked out 0.99, running ‘make build_osx105’ (you do realize the ‘x’ stands for ‘10’, don’t you?) didn’t work, so I followed the instructions in source/osx/README

I still get exactly the same error as before:

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -bundle -undefined dynamic_lookup -arch ppc -arch i386 -L/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -L/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -L/Users/arokem/source/mpl99/release/osx/freetype-2.3.7 -Os -arch ppc -arch i386 -I/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -I/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -I/Users/arokem/source/mpl99/release/osx/freetype-2.3.7/include build/temp.macosx-10.3-fat-2.5/src/ft2font.o build/temp.macosx-10.3-fat-2.5/src/mplutils.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc

collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib

lipo: can’t open input file: /var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//cceiN12W.out (No such file or directory)

error: command ‘g++’ failed with exit status 1
make: *** [installers] Error 1

So - there is still some problem with the architecture. BTW - this closely resembles errors I used to get when trying to install ETS, but in the recent release of ETS, this problem seems to have been solved. Here’s something from enthought-dev, in that direction: https://mail.enthought.com/pipermail/enthought-dev/2009-June/022153.html

I tried following Robert Kern’s suggestion and edited /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile
in order to remove the ‘-arch ppc’ flag from the CFLAGS and LDFLAGS variables, and from one other place in that file, but that didn’t seem to help. Even though now g++ is called without the possibly offending ‘-arch ppc’ flag, somethow that flag is generated later on in the call (after ‘-undefined dynamic_lookup’) and I still get the same error:

g++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup -arch ppc -arch i386 -L/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -L/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -L/Users/arokem/source/mpl99/release/osx/freetype-2.3.7 -Os -arch ppc -arch i386 -I/Users/arokem/source/mpl99/release/osx/zlib-1.2.3 -I/Users/arokem/source/mpl99/release/osx/libpng-1.2.33 -I/Users/arokem/source/mpl99/release/osx/freetype-2.3.7/include build/temp.macosx-10.3-i386-2.5/src/ft2font.o build/temp.macosx-10.3-i386-2.5/src/mplutils.o build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o build/lib.macosx-10.3-i386-2.5/matplotlib/ft2font.so -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib, file is not of required architecture for architecture ppc

collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib

lipo: can’t open input file: /var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//ccud2g4d.out (No such file or directory)

error: command ‘g++’ failed with exit status 1
make: *** [installers] Error 1

Any ideas?

Cheers,

Ariel

On Wed, Aug 12, 2009 at 3:42 AM, John Hunter <jdh2358@…149…> wrote:

On Wed, Aug 12, 2009 at 2:26 AM, Fernando Perez<fperez.net@gmail.com> wrote:

By the way John, in this particular case, I don’t think the change

warrants a before/after example, because the before case is "it

doesn’t run" :slight_smile: The code today makes calls to Numeric routines like

typecode() that simply don’t exist anymore, so it’s totally broken:

Great – this is just the kind of explanation I need. Though if we had

an example, it is unlikely that the code would go so long w/o being

exercised. We do supply some eeg data with mpl – see

examples/pylab_examples/mri_with_eeg.py, so Ariel may want to write a

simple cohere_pairs examples which just generates a scatter plot or

something else to show the output and then we can include it in

backend driver do it is will be unlikely to suffer bit rot going

forward.

Ariel, if you are still struggling with the binary build, since your

changes are confined to a pure python file, you can submit the patch

by simply running:

  • svn udpate
  • modify in-place mlab.py with your version of cohere_pairs
  • svn diff > mlab_cohere_pairs.diff

udpate = update

That will be fine – I would like to help Ariel get his svn build

going, but if that is a distraction it doesn’t need to slow the patch

down. For bugfixes we encourage patches against the release branch

svn co [https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint

mpl99](https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint mpl99)

JDH


Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel


Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel


Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

Hi -

so - now, almost two weeks later, I can finally install MPL from
source. On to submitting that patch.

Here's what I get with mlab.cohere_pairs, as it is currently:

In [1]: a=np.array([[1,2,3,4],[1,2,3,4]])

In [2]: b=([1,1],[0,0])

In [3]: mlab.cohere_pairs(a,b)

mpl99mlab_cohere_pairs.diff (8.02 KB)

···

---------------------------------------------------------------------------
NameError Traceback (most recent call last)

/Users/arokem/<ipython console> in <module>()

/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib/mlab.pyc
in cohere_pairs(X, ij, NFFT, Fs, detrend, window, noverlap,
preferSpeedOverMemory, progressCallback, returnPxx)
    597 windowVals = window
    598 else:
--> 599 windowVals = window(np.ones((NFFT,), typecode(X)))
    600 ind = range(0, numRows-NFFT+1, NFFT-noverlap)
    601 numSlices = len(ind)

NameError: global name 'typecode' is not defined

So - as Fernando mentioned above, it is looking for something that
doesn't exist anymore. With the patch (diff attached), this error no
longer occurs.

Cheers,

Ariel

On Wed, Aug 12, 2009 at 11:25 AM, Ariel Rokem<arokem@...453...> wrote:

Hi - scratch that. Only *seems* to be working. Actually it hangs when I run
scripts that open figures. I am going to undo all this and forget I ever
started down this path.

Cheers,

Ariel

On Wed, Aug 12, 2009 at 11:10 AM, Ariel Rokem <arokem@...453...> wrote:

Hi again - a string of strange things just happened. After this recent
chain of failures, I decided to try to do some random attempts at making
this work.

First, I ran 'sudo python setup.py install' in the directory into which I
had checked out the mpl source. After going through all of the above, that
now went without a hitch(?!). I started ipython and imported matplotlib, but
was disappointed to see that I was still importing 0.98.3, which is the
version I previously had.

I then ran:

ASR:~ arokem$ easy_install matplotlib
Searching for matplotlib
Best match: matplotlib 0.99.0
Removing matplotlib 0.98.3.0001 from easy-install.pth file
Adding matplotlib 0.99.0 to easy-install.pth file

Using
/Library/Frameworks/Python.framework/Versions/4.0.30001/lib/python2.5/site-packages
Processing dependencies for matplotlib
Finished processing dependencies for matplotlib

Now, when I open ipython and import matplotlib, the version I have is
0.99, and it seems to work (opens plots and such). So - somehow the process
worked, but how?

Cheers,

Ariel

On Wed, Aug 12, 2009 at 10:08 AM, Ariel Rokem <arokem@...453...> wrote:

Hi Fernando and John,

regardless of the clunky way in which I was trying to introduce our
patch, I still want to be able to build MPL from source on my machine. It is
a distraction, but, hey, it's a distraction on top of a distraction on top
of a distraction, so at this point, I might as well be distracted. Besides,
it should end up being useful, and not only for me. Yesterday, there was
someone on the matplotlib-users list with exactly the same problem in
building MPL from source (sourceforge is not responding at the moment, so I
can't post a link to that message). If this is not a good time to
trouble-shoot this, let me know and we can come back to this in a couple of
weeks. It does seem like cohere_pairs has not gotten a lot of use, so the
patch can also languish for another couple of weeks andI can get stuff done
regardless of solving this problem, but I would love to be able to solve
this, with your help.

So - I now checked out 0.99, running 'make build_osx105' (you do realize
the 'x' stands for '10', don't you?) didn't work, so I followed the
instructions in source/osx/README

I still get exactly the same error as before:

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-bundle -undefined dynamic_lookup -arch ppc -arch i386
-L/Users/arokem/source/mpl99/release/osx/zlib-1.2.3
-L/Users/arokem/source/mpl99/release/osx/libpng-1.2.33
-L/Users/arokem/source/mpl99/release/osx/freetype-2.3.7 -Os -arch ppc -arch
i386 -I/Users/arokem/source/mpl99/release/osx/zlib-1.2.3
-I/Users/arokem/source/mpl99/release/osx/libpng-1.2.33
-I/Users/arokem/source/mpl99/release/osx/freetype-2.3.7/include
build/temp.macosx-10.3-fat-2.5/src/ft2font.o
build/temp.macosx-10.3-fat-2.5/src/mplutils.o
build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o
build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o
build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o
build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/opt/local/lib
-L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o
build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so
-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices
ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required
architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required
architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib,
file is not of required architecture for architecture ppc
collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib
lipo: can't open input file:
/var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//cceiN12W.out (No such
file or directory)
error: command 'g++' failed with exit status 1
make: *** [installers] Error 1

So - there is still some problem with the architecture. BTW - this
closely resembles errors I used to get when trying to install ETS, but in
the recent release of ETS, this problem seems to have been solved. Here's
something from enthought-dev, in that direction:
https://mail.enthought.com/pipermail/enthought-dev/2009-June/022153.html

I tried following Robert Kern's suggestion and edited
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile
in order to remove the '-arch ppc' flag from the CFLAGS and LDFLAGS
variables, and from one other place in that file, but that didn't seem to
help. Even though now g++ is called without the possibly offending '-arch
ppc' flag, somethow that flag is generated later on in the call (after
'-undefined dynamic_lookup') and I still get the same error:

g++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle
-undefined dynamic_lookup -arch ppc -arch i386
-L/Users/arokem/source/mpl99/release/osx/zlib-1.2.3
-L/Users/arokem/source/mpl99/release/osx/libpng-1.2.33
-L/Users/arokem/source/mpl99/release/osx/freetype-2.3.7 -Os -arch ppc -arch
i386 -I/Users/arokem/source/mpl99/release/osx/zlib-1.2.3
-I/Users/arokem/source/mpl99/release/osx/libpng-1.2.33
-I/Users/arokem/source/mpl99/release/osx/freetype-2.3.7/include
build/temp.macosx-10.3-i386-2.5/src/ft2font.o
build/temp.macosx-10.3-i386-2.5/src/mplutils.o
build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o
build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o
build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o
build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o -L/opt/local/lib
-L/usr/local/lib -L/usr/lib -L/sw/lib -lfreetype -lz -lz -lstdc++ -lm -o
build/lib.macosx-10.3-i386-2.5/matplotlib/ft2font.so
-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices
ld warning: in /opt/local/lib/libfreetype.dylib, file is not of required
architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required
architecture
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libxml2.2.dylib,
file is not of required architecture for architecture ppc
collect2: ld returned 1 exit status
ld warning: duplicate dylib /opt/local/lib/libz.1.dylib
lipo: can't open input file:
/var/folders/Qb/QbU9SmFNHoWnC7v-nTJYrE+++TI/-Tmp-//ccud2g4d.out (No such
file or directory)
error: command 'g++' failed with exit status 1
make: *** [installers] Error 1

Any ideas?

Cheers,

Ariel

On Wed, Aug 12, 2009 at 3:42 AM, John Hunter <jdh2358@...149...> wrote:

On Wed, Aug 12, 2009 at 2:26 AM, Fernando Perez<fperez.net@...149...> >>>> wrote:

> By the way John, in this particular case, I don't think the change
> warrants a before/after example, because the before case is "it
> doesn't run" :slight_smile: The code today makes calls to Numeric routines like
> typecode() that simply don't exist anymore, so it's totally broken:

Great -- this is just the kind of explanation I need. Though if we had
an example, it is unlikely that the code would go so long w/o being
exercised. We do supply some eeg data with mpl -- see
examples/pylab_examples/mri_with_eeg.py, so Ariel may want to write a
simple cohere_pairs examples which just generates a scatter plot or
something else to show the output and then we can include it in
backend driver do it is will be unlikely to suffer bit rot going
forward.

> Ariel, if you are still struggling with the binary build, since your
> changes are confined to a pure python file, you can submit the patch
> by simply running:
>
> - svn udpate
> - modify in-place mlab.py with your version of cohere_pairs
> - svn diff > mlab_cohere_pairs.diff

udpate = update

That will be fine -- I would like to help Ariel get his svn build
going, but if that is a distraction it doesn't need to slow the patch
down. For bugfixes we encourage patches against the release branch

svn co
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint
mpl99

JDH

--
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

--
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

--
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

--
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel

Thanks for following up -- applied to the release branch, merged to trunk

···

On Sat, Aug 22, 2009 at 6:00 PM, Ariel Rokem<arokem@...453...> wrote:

so - now, almost two weeks later, I can finally install MPL from
source. On to submitting that patch.

Hi -

following up on this patch, as suggested, I have added a use-case of
mlab.cohere_pairs to examples/pylab_examples/mri_with_eeg.py.

Cheers,

Ariel

pylab_example_cohere_pairs.diff (1.15 KB)

···

On Sat, Aug 22, 2009 at 4:27 PM, John Hunter<jdh2358@...149...> wrote:

On Sat, Aug 22, 2009 at 6:00 PM, Ariel Rokem<arokem@...453...> wrote:

so - now, almost two weeks later, I can finally install MPL from
source. On to submitting that patch.

Thanks for following up -- applied to the release branch, merged to trunk

--
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel