project-navigation
Personal tools

Author Topic: Need PPC help  (Read 10386 times)

courier

  • Guest
Need PPC help
« on: May 04, 2008, 02:10:42 am »
Well, I've beat my head against doing the PPC build from my Intel mac, and I can't work out how to do it.  So I need someone with a PPC mac to take a try.  (As I mentioned earlier, but not here, there is a 2.2.1 build for Intel macs at http://ecglaf.naegling.net/~ggould/ufoai-2.2.1-macosx-i386.dmg -- although I do hope someone will mirror that rather than everyone hitting my home machine...)

What you will need:  A PPC mac with XCode (the developer toolkit) and fink (the unix-style package manager) installed.

What you will need to do:  Follow the instructions at http://ufoai.ninex.info/wiki/index.php/Compile_for_Mac , except that for the URL in the svn command, use https://ufoai.svn.sourceforge.net/svnroot/ufoai/ufoai/ufoai_2.2/ (to get the 2.2.1 code rather than the latest unstable stuff).

I'm sorry that it's taking so long to get mac builds out to the community -- I'm new to this project and I'm learning as I go.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Need PPC help
« Reply #1 on: May 07, 2008, 11:31:52 am »

Offline tchristney

  • Rookie
  • ***
  • Posts: 75
    • View Profile
Re: Need PPC help
« Reply #2 on: May 08, 2008, 12:53:54 am »
Sorry, I've been super busy, i.e. too busy to play games... I'm just getting the svn version from tags/ufoai_2.2.1 and should have everything compiled tonight. I'm guessing that the snapshot in tags is the same code as released on Win and Linux. Mattn, do you have a map pk3 so I don't have to compile them, or just pull down the one from the linux version?

courier, you really should follow the wiki information and use MacPorts. It seems to work much better than Fink for this. Especially if you want to compile universal binaries! I was a fink user since 10.0 and basically gave up on it when I tried to make a universal binary for UFO:AI.

Mattn, would it be possible to get you to modify configure to recognize a Mac specific option that can be used to set the appropriate compiler/linker flags to make universal binaries on Mac? I know exactly what flags need to be set and where but am completely a newbie when it comes to the arcane incantations required for configure to work.

Offline Doctor J

  • Squad Leader
  • ****
  • Posts: 265
    • View Profile
Mac Compile
« Reply #3 on: May 10, 2008, 10:02:43 am »
UB disk images are very shiny, but [in my not so humble opinion] should be avoided for packages that are already large enough to be a problem for people with poor connections - that means us.  Also, users with full hard drives are going to end up using lipo or some other utility to remove all that extra fat they don't need.  Why not just release separate Intel/PPC versions - it's not that hard.

As to the MacPorts/fink competition, they each have their pros and cons.  Use MacPorts if you insist on making UB packages, as fink absolutely won't do that.  Otherwise, either will do the job.

Offline ponkan

  • Rookie
  • ***
  • Posts: 20
    • View Profile
Re: Need PPC help
« Reply #4 on: May 10, 2008, 11:48:07 am »
I suppose that depends on how easily an Intel Mac can be told to compile for PPC only -- I don't know if universal libraries can be used, or if a whole cross-compilation environment needs to be set up. Or if the utilities you mentioned are friendly to open source programs (i.e. nothing in the EULA that says resultant binary is for personal use only, can't be distributed yada yada). I would volunteer if I had a PPC machine, but unfortunately I don't.

Offline Doctor J

  • Squad Leader
  • ****
  • Posts: 265
    • View Profile
Re: Need PPC help
« Reply #5 on: May 10, 2008, 02:14:13 pm »
Well, if you want to go that route, go ahead.  It just seems easier to me, and perhaps less error prone, to do the PPC compile on a PPC - gasp!  No, in all seriousness i'm sure it's already been done.  The problem is nobody who has a PPC machine has write permission to upload, and vice versa.  Actually, tchristney has already built the Universal Binary of 2.2.1, but he doesn't have permissions either, and the man who does is apparently offline for some weeks...

Offline blondandy

  • Sergeant
  • *****
  • Posts: 391
    • View Profile
Re: Need PPC help
« Reply #6 on: May 10, 2008, 02:24:03 pm »
i have emailed the sf.net admins (mattn and hoehrer), asking them to look at this.

Offline tchristney

  • Rookie
  • ***
  • Posts: 75
    • View Profile
Re: Need PPC help
« Reply #7 on: May 11, 2008, 12:50:30 am »
I suppose that depends on how easily an Intel Mac can be told to compile for PPC only -- I don't know if universal libraries can be used, or if a whole cross-compilation environment needs to be set up. Or if the utilities you mentioned are friendly to open source programs (i.e. nothing in the EULA that says resultant binary is for personal use only, can't be distributed yada yada). I would volunteer if I had a PPC machine, but unfortunately I don't.

You should just be able to just run

Code: [Select]
./configure CFLAGS="-arch ppc" LDFLAGS="-arch ppc"
and then run make as usual. Of course the big problem comes if you don't have ppc libraries installed which will cause the link to fail.

UB disk images are very shiny, but [in my not so humble opinion] should be avoided for packages that are already large enough to be a problem for people with poor connections - that means us.  Also, users with full hard drives are going to end up using lipo or some other utility to remove all that extra fat they don't need.  Why not just release separate Intel/PPC versions - it's not that hard.

A bit of false economy that. By far the biggest portion of the download is the graphics and music. The libraries and executables comprise about 10 MB (of 400 MB) for universal binaries. So you might be able to save around 5 MB using lipo to strip out the unused architecture code.

ripclaw

  • Guest
Re: Need PPC help
« Reply #8 on: May 12, 2008, 03:01:48 pm »
May I help ?  I have a dual 1,25Ghz G4 PowerMac with 2 Gb Ram and fast I/O.
OS is Mac OS 10.4.11, XCode is Version 1.5

[glendronach:~] % gcc --version
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1666)
Copyright (C) 2002 Free Software Foundation, Inc.
[glendronach:~] % make --version
GNU Make version 3.79, by Richard Stallman and Roland McGrath.
Built for powerpc-apple-darwin7.0
[glendronach:~] % as -v
Apple Computer, Inc. version cctools-525.obj~1, GNU assembler version 1.38

Darwin glendronach.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc

I just checked out the sources from svn (2.2 branch) and gave it a try.
Is there anything to watch for/keep in mind/whatever to do - I usually only compile on linux and openbsd.

if someone had a "script" output from a cleanroom intel built, that would make things very easy.
(I assume that the code compiles, otherwise i might need instructions on upstream-patches.)

ripclaw

  • Guest
Re: Need PPC help
« Reply #9 on: May 12, 2008, 04:52:19 pm »
[glendronach:Projects/UFOAI/ufoai_2.2] % make
 * [UFO] src/client/cl_actor.c
cc1: error: unrecognized option `-Wdeclaration-after-statement'
make: *** [debug-darwin-powerpc/client/client/cl_actor.o] Error 1


--> I guess you folks have a minimum compiler requirement you do not mention in the faq.  :)

now downloading new compiler.

ripclaw

  • Guest
Re: Need PPC help
« Reply #10 on: May 12, 2008, 06:40:52 pm »
this one is fixed:  fink does not set $PATH correctly:

Quote
[glendronach:Projects/UFOAI/ufoai_2.2] % make lang && make maps
Making lang
cs.po
/bin/sh: line 1: msgfmt: command not found
da.po
/bin/sh: line 1: msgfmt: command not found
de.po
/bin/sh: line 1: msgfmt: command not found
el.po
/bin/sh: line 1: msgfmt: command not found
en.po
/bin/sh: line 1: msgfmt: command not found
es.po
/bin/sh: line 1: msgfmt: command not found
es_ES.po
/bin/sh: line 1: msgfmt: command not found
est.po
/bin/sh: line 1: msgfmt: command not found
fi.po
/bin/sh: line 1: msgfmt: command not found
fr.po
/bin/sh: line 1: msgfmt: command not found
it.po
/bin/sh: line 1: msgfmt: command not found
ja.po
/bin/sh: line 1: msgfmt: command not found
pl.po
/bin/sh: line 1: msgfmt: command not found
pt_BR.po
/bin/sh: line 1: msgfmt: command not found
ru.po
/bin/sh: line 1: msgfmt: command not found
slo.po
/bin/sh: line 1: msgfmt: command not found
sv.po
/bin/sh: line 1: msgfmt: command not found
th.po
/bin/sh: line 1: msgfmt: command not found
../../ufo2map -nice 19 -extra africa04d.map
---- ufo2map 1.1 ----
...

- appearantly msgfmt is not around, but fink with full set of recommendations according to faq is installed.
this looks like something went wrong obviously. compile went through with several warnings, but no bad stuff.

pls help with info on this msgfmt thing.
« Last Edit: May 12, 2008, 07:04:22 pm by ripclaw »

ripclaw

  • Guest
Re: Need PPC help
« Reply #11 on: May 12, 2008, 06:45:11 pm »
next thing:  make only seems to use one cpu during make maps.  :(
additional bug: make macinstaller does not check for existing 0*.pk3 files, it just overwrites with new download.

last part fails - why isnt yet obvious to me:

[glendronach:Projects/UFOAI/ufoai_2.2] % make macinstaller
make lang
Making lang
cs.po
1997 translated messages, 9 fuzzy translations, 3 untranslated messages.
da.po
1988 translated messages, 17 fuzzy translations, 4 untranslated messages.
de.po
1956 translated messages, 30 fuzzy translations, 23 untranslated messages.
el.po
1988 translated messages, 17 fuzzy translations, 4 untranslated messages.
en.po
2009 translated messages.
es.po
772 translated messages, 657 fuzzy translations, 580 untranslated messages.
es_ES.po
925 translated messages, 601 fuzzy translations, 483 untranslated messages.
est.po
836 translated messages, 616 fuzzy translations, 557 untranslated messages.
fi.po
428 translated messages, 236 fuzzy translations, 1345 untranslated messages.
fr.po
2008 translated messages.
it.po
1276 translated messages, 411 fuzzy translations, 322 untranslated messages.
ja.po
960 translated messages, 31 fuzzy translations, 1018 untranslated messages.
pl.po
1620 translated messages, 130 fuzzy translations, 259 untranslated messages.
pt_BR.po
1776 translated messages, 259 untranslated messages.
ru.po
1278 translated messages, 416 fuzzy translations, 315 untranslated messages.
slo.po
497 translated messages, 719 fuzzy translations, 793 untranslated messages.
sv.po
1735 translated messages, 81 fuzzy translations, 193 untranslated messages.
th.po
1349 translated messages, 371 fuzzy translations, 289 untranslated messages.
# delete all the maps first - we have to get them precompiled, otherwise multiplayer
# won't work due to mismatching checksums
cd base; ./archives.sh
generating archives

pics and textures...
models...
sound...
music...
maps...
videos...
media...
i18n...
don't include this in the zipfiles - gettext doesn't have support for it
ufos...
base...
...finished
cd base; wget http://mattn.ninex.info/download/0maps.pk3
--19:18:54--  http://mattn.ninex.info/download/0maps.pk3
           => `0maps.pk3.1'
Resolving mattn.ninex.info... done.
Connecting to mattn.ninex.info[62.89.119.2]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 73,888,236 [application/octet-stream]

100%[==================================================================>] 73,888,236   166.53K/s    ETA 00:00

19:26:07 (166.53 KB/s) - `0maps.pk3.1' saved [73888236/73888236]

cd src/ports/macosx/installer; make TARGET_CPU=powerpc
../../../../base/0base.pk3 -> UFOAI.app/base/0base.pk3
../../../../base/0snd.pk3 -> UFOAI.app/base/0snd.pk3
../../../../base/0pics.pk3 -> UFOAI.app/base/0pics.pk3
../../../../base/0music.pk3 -> UFOAI.app/base/0music.pk3
../../../../base/0models.pk3 -> UFOAI.app/base/0models.pk3
../../../../base/0media.pk3 -> UFOAI.app/base/0media.pk3
../../../../base/0maps.pk3 -> UFOAI.app/base/0maps.pk3
../../../../base/0ufos.pk3 -> UFOAI.app/base/0ufos.pk3
Installing /sw/lib/libpng.3.dylib...done
Installing @executable_path/../Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf...done
Installing /sw/lib/libjpeg.62.dylib...done
Installing /sw/lib/libintl.1.dylib...done
Installing /usr/lib/libcurl.4.dylib...done
Installing /sw/lib/libiconv.2.dylib...done
Installing @executable_path/../Frameworks/SDL_mixer.framework/Versions/A/SDL_mixer...done
Installing @executable_path/../Frameworks/SDL.framework/Versions/A/SDL...done
Finalizing ufo...done
Finalizing ufoded...done
Finalizing ufo2map...done
rm: ufoai-2.2.1-macosx-powerpc.dmg: No such file or directory
make[1]: *** [create-dmg] Error 1
make: *** [macinstaller] Error 2
[glendronach:Projects/UFOAI/ufoai_2.2] %

« Last Edit: May 12, 2008, 07:29:18 pm by ripclaw »

ripclaw

  • Guest
Re: Need PPC help
« Reply #12 on: May 12, 2008, 07:49:14 pm »
ok, here`s from build/installer.mk:

macinstaller:
        $(MAKE) lang
        # delete all the maps first - we have to get them precompiled, otherwise
 multiplayer
        # won't work due to mismatching checksums
        cd base; ./archives.sh
        cd base; wget http://mattn.ninex.info/download/0maps.pk3
        cd src/ports/macosx/installer; $(MAKE) TARGET_CPU=$(TARGET_CPU)
        scp src/ports/macosx/installer/ufoai-$(VERSION)-macosx-$(TARGET_CPU).dmg
 ufo:~/public_html/download
        scp src/ports/macosx/installer/ufoai-$(VERSION)-macosx-$(TARGET_CPU).dmg
 mirror:~/public_html

thou shallt not hardcode network transfers in thy make-scripts without proper labeling the stuff.

suggested fix in installer.mk:


macinstaller:
        ## set download variable, curl would overwrite wget.
        URL_MAPPK3=http://mattn.ninex.info/download/0maps.pk3
        DOWNLOADER=`which wget` ; which curl ; if [ $?] ; then DOWNLOADER=`which curl` ; fi
        if [ $"X$(DOWNLOADER)" -eq $"X" ] ; then echo "no download tool installed, install curl or wget" ; exit ; fi
        $(MAKE) lang
        # delete all the maps first - we have to get them precompiled, otherwise multiplayer
        # won't work due to mismatching checksums
        cd base ; ./archives.sh
        cd base ; if [ ! -x 0maps.pk3 ] ; then $(DOWNLOADER) $(URL_MAPPK3)
        cd src/ports/macosx/installer; $(MAKE) TARGET_CPU=$(TARGET_CPU)

copymacinstaller:
        cp src/ports/macosx/installer/ufoai-$(VERSION)-macosx-$(TARGET_CPU).dmg .

uploadmacinstaller:
        scp src/ports/macosx/installer/ufoai-$(VERSION)-macosx-$(TARGET_CPU).dmg
 ufo:~/public_html/download
        scp src/ports/macosx/installer/ufoai-$(VERSION)-macosx-$(TARGET_CPU).dmg
 mirror:~/public_html



last but not least:
[glendronach:Projects/UFOAI/ufoai_2.2] stefan% file src/ports/macosx/installer/*
src/ports/macosx/installer/Makefile:                   ASCII make commands text
src/ports/macosx/installer/UFOAI.app:                  directory
src/ports/macosx/installer/macfixlibs.pl:              perl script text executable
src/ports/macosx/installer/macinstall.sh:              Bourne shell script text executable
src/ports/macosx/installer/ufoai-2.2.1-macosx-:        directory
src/ports/macosx/installer/ufoai-2.2.1-macosx-powerpc: directory

file naming seems F**d up. no wonder it breaks.
« Last Edit: May 12, 2008, 07:58:44 pm by ripclaw »

ripclaw

  • Guest
Re: Need PPC help
« Reply #13 on: May 13, 2008, 01:55:29 am »
compiled a working binary. where and how to upload ?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Need PPC help
« Reply #14 on: May 13, 2008, 09:27:34 am »
we have a universal binary already - doesn't it work (sorry, i haven't followed the whole discussion here)