OK, after updating one of the patches I posted (the numpy one), all
tests pass for me!
(must be testlong for my slow machine :))

I added the update here:
http://boxen.math.washington.edu/home/dima/patches/gfortran-macosx.tgz

Dima

On Sep 12, 4:26 pm, Dima Pasechnik <dimp...@gmail.com> wrote:
> OK, here 
> goes:http://boxen.math.washington.edu/home/dima/patches/gfortran-macosx.tgz
> Instructions are included.
> To apply patches, follow instructions 
> onhttp://sagemath.org/doc/developer/walk_through.html#reviewing-patches...
>
> I tested that is builds Sage 4.5.3 on MacOSX 10.5 ppc (32 bit,
> PowerBook G4).
> ("make test" is still running, I will post results when it is
> complete)
>
> It will be especially interesting to see this working on 10.4 and
> 10.6, and on 10.5 intel. And on 64bit.
>
> Dima
>
> On Sep 12, 3:33 pm, Dima Pasechnik <dimp...@gmail.com> wrote:
>
>
>
> > On Sep 12, 2:38 am, Dima Pasechnik <dimp...@gmail.com> wrote:
>
> > > I got stuck at scipy:
>
> > I have fixed this by making changes in numpy's patch for gnu.py.
> > The complete build of Sage-4.5.3.has successfully finished now.
> > I'll post the necessary patched, and the test results, shortly.
>
> > > In the log below, the line beginning with
> > > "sage_fortran -Wall -shared -Wall -shared -undefined dynamic_lookup -
> > > bundle..."
> > > definitely looks weird, as -shared option should not be there...
> > > (I must also say that the error message looks weird, too, as there is
> > > no option -dynamiclib anywhere to
> > > be see. However, it does react on -shared (which has no effect on
> > > MacOSX, IMHO), as I see by running
> > > the offending command by hand, in the spkg/build directory, with -
> > > shared removed!)
>
> > > I gather  that these options are set when building numpy.
> > > And I gather that numpy doesn't quite recognize the compiler/linker,
> > > as it should not be putting these -shared things there, even less
> > > two times...
>
> > > Any idea?
>
> > > Here are the specs of sage_fortran:
>
> > > sage_fortran  -v
> > > Using built-in specs.
> > > Target: powerpc-apple-darwin9
> > > Configured with: /Builds/apple/gcc_42-5577/build/obj/src/configure --
> > > disable-checking --prefix=/usr --mandir=/usr/share/man --enable-
> > > languages=c,objc,c++,obj-c++,fortran --program-transform-name=/^[cg]
> > > [^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin9 --
> > > with-gxx-include-dir=/usr/include/c++/4.0.0 --program-prefix= --
> > > host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9
> > > Thread model: posix
> > > gcc version 4.2.1 (Apple Inc. build 5577)
>
> > > install.log:
> > > ...
> > > building 'scipy.fftpack._fftpack' extension
> > > compiling C sources
> > > C compiler: gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -
> > > Wall -Wstrict-prototy
> > > pes
>
> > > creating build/temp.macosx-10.5-ppc-2.6/build
> > > creating build/temp.macosx-10.5-ppc-2.6/build/src.macosx-10.5-ppc-2.6
> > > creating build/temp.macosx-10.5-ppc-2.6/build/src.macosx-10.5-ppc-2.6/
> > > scipy
> > > creating build/temp.macosx-10.5-ppc-2.6/build/src.macosx-10.5-ppc-2.6/
> > > scipy/fftpack
> > > compile options: '-Ibuild/src.macosx-10.5-ppc-2.6 -I/usr/local/src/
> > > sage/sage-4.5.3/local/l
> > > ib/python2.6/site-packages/numpy/core/include -I/usr/local/src/sage/
> > > sage-4.5.3/local/inclu
> > > de/python2.6 -c'
> > > gcc: build/src.macosx-10.5-ppc-2.6/fortranobject.c
> > > gcc: scipy/fftpack/src/drfft.c
> > > gcc: scipy/fftpack/src/zfftnd.c
> > > gcc: scipy/fftpack/src/zrfft.c
> > > gcc: scipy/fftpack/src/zfft.c
> > > gcc: build/src.macosx-10.5-ppc-2.6/scipy/fftpack/_fftpackmodule.c
> > > sage_fortran -Wall -shared -Wall -shared -undefined dynamic_lookup -
> > > bundle build/temp.maco
> > > sx-10.5-ppc-2.6/build/src.macosx-10.5-ppc-2.6/scipy/fftpack/
> > > _fftpackmodule.o build/temp.ma
> > > cosx-10.5-ppc-2.6/scipy/fftpack/src/zfft.o build/temp.macosx-10.5-
> > > ppc-2.6/scipy/fftpack/sr
> > > c/drfft.o build/temp.macosx-10.5-ppc-2.6/scipy/fftpack/src/zrfft.o
> > > build/temp.macosx-10.5-
> > > ppc-2.6/scipy/fftpack/src/zfftnd.o build/temp.macosx-10.5-ppc-2.6/
> > > build/src.macosx-10.5-pp
> > > c-2.6/fortranobject.o -L/usr/lib/gcc/powerpc-apple-darwin9/4.2.1 -
> > > Lbuild/temp.macosx-10.5-
> > > ppc-2.6 -ldfftpack -lgfortran -o build/lib.macosx-10.5-ppc-2.6/scipy/
> > > fftpack/_fftpack.so
> > > powerpc-apple-darwin9-gfortran-4.2.1: -bundle not allowed with -
> > > dynamiclib
> > > powerpc-apple-darwin9-gfortran-4.2.1: -bundle not allowed with -
> > > dynamiclib
> > > error: Command "sage_fortran -Wall -shared -Wall -shared -undefined
> > > dynamic_lookup -bundle
> > >  build/temp.macosx-10.5-ppc-2.6/build/src.macosx-10.5-ppc-2.6/scipy/
> > > fftpack/_fftpackmodule
> > > .o build/temp.macosx-10.5-ppc-2.6/scipy/fftpack/src/zfft.o build/
> > > temp.macosx-10.5-ppc-2.6/
> > > scipy/fftpack/src/drfft.o build/temp.macosx-10.5-ppc-2.6/scipy/fftpack/
> > > src/zrfft.o build/t
> > > emp.macosx-10.5-ppc-2.6/scipy/fftpack/src/zfftnd.o build/
> > > temp.macosx-10.5-ppc-2.6/build/sr
> > > c.macosx-10.5-ppc-2.6/fortranobject.o -L/usr/lib/gcc/powerpc-apple-
> > > darwin9/4.2.1 -Lbuild/t
> > > emp.macosx-10.5-ppc-2.6 -ldfftpack -lgfortran -o build/lib.macosx-10.5-
> > > ppc-2.6/scipy/fftpa
> > > ck/_fftpack.so" failed with exit status 1
> > > Error building scipy.
>
> > > On Sep 11, 4:16 am, kcrisman <kcris...@gmail.com> wrote:
>
> > > > On Sep 10, 2:31 pm, Dima Pasechnik <dimp...@gmail.com> wrote:
>
> > > > > On Sep 11, 1:31 am, kcrisman <kcris...@gmail.com> wrote:
>
> > > > > > > Buthttp://r.research.att.com/tools/#gcc42provideshttp://r.research.att.c...
> > > > > > > which will do the installation of "10.4u", whatever this means,
>
> > > > > > Yeah, I'm not sure what this is either,
>
> > > > > > > Apple's SDK with gcc42 and gfortran42.
>
> > > > > > > So yes, it's the missing gcc42 for MacOSX 10.4, u(nstable?)
> > > > > > > IMHO for that few 10.4 systems that are left around, it's good 
> > > > > > > enough
> > > > > > > - it's certainly no worse than using some rather
> > > > > > > old (4.0) version of gcc...
>
> > > > > > Do you think it will be possible to install this side-by-side with 
> > > > > > the
> > > > > > Xcode?  I'm just scared that I'll hose my compiler by downloading
> > > > > > this :(
>
> > > > > yes, I think it is jolly possible; it's just a tar file, so you can
> > > > > have a look what you get. As far as I can see no Xcode files get
> > > > > overwritten.
>
> > > > > > > > but I would be very
> > > > > > > > happy if that were the case.  But ADC says "This release 
> > > > > > > > provides
> > > > > > > > additional GCC and LLVM compiler options, general bug fixes, 
> > > > > > > > and must
> > > > > > > > be installed on Leopard, Mac OS X 10.5.0 and higher."  And in 
> > > > > > > > the
> > > > > > > > documentation it says "Xcode 3.1.2 is compatible with Intel and
> > > > > > > > PowerPC Macs running Mac OS X 10.5 Leopard."  You can develop 
> > > > > > > > for
> > > > > > > > Tiger with it (even for Panther!) but can't actually run it
> > > > > > > > (apparently) on Tiger.  Also, one apparently can't even try, as 
> > > > > > > > only
> > > > > > > > Leopard supports having multiple Xcode installations.
>
> > > > > > > > :(
>
> > > > > > > > > and ships gcc 4.2 as well as gcc 4.0.
>
> > > > > > > > Just on the off chance you've tried this successfully... Is it
> > > > > > > > relatively trivial to get it to use gcc 4.2 only?  I would be
> > > > > > > > comfortable with requiring *developers* to have a later Xcode
>
> > > > > > > It's trivial (on 10.5, but same should certainly apply to 10.4u).
> > > > > > > E.g one can change the links in /usr/bin manually (i.e. gcc there 
> > > > > > > is a
> > > > > > > link to gcc4.0, so you change it to gcc4.2, and the same for cc 
> > > > > > > and g+
> > > > > > > +).
>
> > > > > > Ok, you've already lost me at "change the links in /usr/bin 
> > > > > > manually",
> > > > > > though maybe I can figure it out.  
>
> > > > > on the Xcode version I have (3.1.2) gcc, etc are just symbolic links:
> > > > > $ ls -l /usr/bin/gcc*
> > > > > lrwxr-xr-x  1 root  wheel       7 Sep 10 17:50 /usr/bin/gcc -> gcc-4.2
> > > > > -rwxr-xr-x  1 root  wheel   93088 Feb  5  2009 /usr/bin/gcc-4.0
> > > > > -rwxr-xr-x  1 root  wheel  105680 Jul  7  2009 /usr/bin/gcc-4.2
>
> > > > > $ ls -l /usr/bin/*fort*
> > > > > lrwxr-xr-x  1 root  wheel      12 Sep 10 17:55 /usr/bin/gfortran ->
> > > > > gfortran-4.2
> > > > > -rwxr-xr-x  1 root  wheel   96136 Jan 26  2010 /usr/bin/gfortran-4.2
> > > > > -rwxr-xr-x  1 root  wheel  519200 Jan 26  2010 /usr/bin/i686-apple-
> > > > > darwin9-gfortran-4.2.1
> > > > > -rwxr-xr-x  1 root  wheel  523296 Jan 26  2010 /usr/bin/powerpc-apple-
> > > > > darwin9-gfortran-4.2.1
>
> > > > > In order to get this, I did
> > > > > cd /usr/bin
> > > > > sudo ln -sf gcc-4.2 gcc
> > > > > sudo ln -sf gcc-4.2 cc
> > > > > sudo ln -sf g++-4.2 g++
> > > > > sudo ln -sf gfortran-4.2 gfortran
>
> > > > > That's it. (I don't know how to set this up in Xcode's GUI, but it's
> > > > > not needed for Sage).
> > > > > There are other ways: e.g. you can put these links to gcc-4.2 etc to
> > > > > another directory that comes ahead of /usr/bin
> > > > > in your PATH. Then, as long as your PATH is set this way, calling gcc
> > > > > would call gcc-4.2
>
> > > > > In order to switch back to gcc4.0 I  can do
> > > > > cd /usr/bin
> > > > > sudo ln -sf gcc-4.0 gcc
> > > > > sudo ln -sf gcc-4.0 cc
> > > > > sudo ln -sf g++-4.0 g++
>
> > > > > Well, if you managed to nuke your Xcode you could always reinstall...
>
> > > > > > But more practically, would I have
> > > > > > to do some variable exporting before doing Sage?  Or would this 
> > > > > > alone
> > > > > > make everything go solidly?  
> > > > > > What about for the Fortran part?
>
> > > > > the above fixes it. I noticed one minor problem with this gfortran:
> > > > > one needs to specify
> > > > > the location of libgfortran.a when using it as a linker, but that's
> > > > > also trivially done.
>
> > > > > > Or, again, maybe we could provide the 4.2 binary and the gfortran
> > > > > > binary directly inside Sage, and use that for all gcc and cc and g++
> > > > > > and whatever else there is that I don't know about...
>
> > > > > > Anyway, changing how we support a particular platform probably
> > > > > > deserves more discussion than its received on this thread, so for 
> > > > > > now
> > > > > > I'll wait to see if it worked for you to use this toolkit to
>
> ...
>
> read more »

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to