All times are UTC-06:00




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Sat Oct 21, 2006 9:01 am 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
Image

Goal: writing an article with many examples, how POWER ARCHITECTURE friendly programming can be achieved. This involves a description, how architecture neutral coding can be achieved, and also some pointers, where POWER developers can be reached.

Target audience of the article: software developers, who write code without considering, that life exists outside the x86 architecture.

Participants: anyone willing to fix a few ugly software packages elegantly and / or document it for the article.

Background: recently I was recompiling many software packages originally packaged for x86 on my Pegasos, as a service for Pegasos users and the broader POWER community. This is the Packman ( http://packman.links2linux.de/ ) package collection for SUSE Linux / openSUSE. Some of the packages could not be recompiled for various reasons. For me (a non programmer) most of these were show stoppers, but even who can fix it must be annoying to see code, which does not compile without modifications on POWER ARCHITECTURE. Compilations were made from Packman source rpm-s, which might be a different version than the latest available sources.

The problems and basic recommendations I identified are the following (sorry for the wording, I'm not a programmer):
Code:
- don't hard code architecture specific optimizations in Makefiles, like -mtune=i686 or similar, is it won't work on other architectures without modifications. If it really matters, make it conditional.

- if assembly is used to optimize code:
- find someone to do the same for PPC
- leave the original C code there as a fall back and as a sample, what has to be coded for other architectures
- never assume, that code will be compiled on i386, as it can cause trouble even on Opteron, and for sure on PPC and the rest of the platforms.

- don't use sys/io.h, as it's i386 specific, does not exists on other architectures.
This list is of course only partial, these were the problems which I met during compiles. This should be beefed up a bit with details and examples, and reworded for a programmer target audience.

ToDo:
Identify some software to fix. Good candidates are the one, which I failed to compile for Packman, but anyone can bring his / her own broken pet software :-)
Here is a partial list, those which I found useful after testing on x86:
i386 assembly:
cinerella: http://heroinewarrior.com/cinelerra.php3
twindy: http://www.niallmoody.com/twindy/
Broken Makefiles
soundtouch: http://www.surina.net/soundtouch/ (many packages depend on it)
MuSE: http://muse.dyne.org/
mixxx: http://mixxx.sourceforge.net/
sys/io.h:
zinf: http://www.zinf.org/

The next big task is to actually develop fixes for these software. Not just make it compile on POWER, but make sure, that it still can be compiled on the original platform (I can check that) and compile on POWER. And as the fix will be published in the article, make it elegant :-)

If a fix can't be made, document it why. If a fix can be made, document it how and why. It can be used as an example in the article and also sent to original developers. If you don't have time for coding, you can still help to pull all of these information together into one well written article!

Send patches upstream, so original developers recognize, that their code is used on other architectures and can support POWER later on without modifying source packages. And of course point them to the published (or working) version of the best practices article.

The end result will be published on http://www.ppczone.org/

How:
For collaboration I would like to use the new PowerCollaboration.org environment. This has a wiki, which is ideal to collaboratively write the article, a file manager to store sources and patches, a forum to discuss problems, etc.

Please let me know if you would like to participate and I will add you to the collaboration software. If you have strong feelings against such a web based application, you can still participate, but that makes (at least my :-) ) life a bit more difficult.

Have fun while making POWER a better recognized platform!

_________________
CzP
http://czanik.blogs.balabit.com/


Last edited by czp on Wed Dec 13, 2006 10:01 am, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Sat Oct 21, 2006 10:52 am 
Offline

Joined: Fri Sep 24, 2004 1:39 am
Posts: 297
Image

Hi, czp!

I wanted to open a very similar thread, but two very hard private weeks didn't let me...
I wanted to make a thread where all good programs which don't support ppc/altivec (well) are collected to find together solutions to make them work with full power...
I'm glad this thread exists now! :)
Lets expand it good and fast :)

As of cinelerra:
you should checkout cvs.cinelerra.org !
2 days ago I upgraded to rv940 successfully!

other progs:

- avidemux2: http://fixounet.free.fr/avidemux/
the configuaration system lacks good ppc/altivec support - with minor cosmetics it can be forced to fully support altivec
(I built 2.3-pre2 yesterday)

- AIGL/XGL/beryl

work very nice but need ppc-optimizations
AIGL even supports opengl apps
I get wrong colours with beryl though
(updated today, but haven't tried the new version till now)

- jahshaka 2.0 : http://www.jahshaka.org/
built successfully (at 08.10.06)
probably can be improved

-ABA-games: http://www.asahi-net.or.jp/~cs8k-cyu/
no useful apps, but ourstanding opensource-games (I love them ;) )
Most are programmed in d-language:
http://dgcc.sourceforge.net/ is an opensource d-frontend which also works on ppc:
I built successfully gunroar, parsec47, a7xpg & similar shooters, but I need help with the other ones
(these built, too but crash or don't show enemies or similar)

- http://www.xaraxtreme.org/
builds fine, but it's been a while i tried it

- you mentioned Muse - its included in my enlightenmedia project (as all other 1000 multimedia apps ;) ) so I seem to have built it successfully once...

- mixxx (see muse)

- http://mplayerxp.sourceforge.net/
makes massive use of x86-arch, but I forced it to build/work a longer time ago
haven't tried latest version

- http://lives.sourceforge.net/
builds, but probably can make use of better ppc-opts

- http://openmovieeditor.sourceforge.net/
builds & works fine

- lets fix the ivtv-ppc issues!

- http://alioth.debian.org/projects/splashy/
builds fine & probablby works (haven't rebooted since several days as 24hrs/day compile session...)
This would give us animated splashscreens during boot!

these are just a few of tons I tried
For my enlightenmedia & cdga2 I've built more than the half internet already :D


Top
   
 Post subject:
PostPosted: Sun Oct 22, 2006 2:54 am 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
Hello Frostwork,

About Cinerella: I have an earlier revision, and glad to hear, that it's fixed now. I'll ask the package maintainer to upgrade to this revision, so a PPC compile will be possible (we try to keep packages for all three openSUSE architectures in sync).

MuSE: it compiles fine, but at least the version I have, only after editing the Makefiles. They have:
Code:
CFLAGS = -pipe -D_REENTRANT -O2 -mmmx -fomit-frame-pointer -ffast-math
Probably in the main configure & configure.in is broken, as that's the only place, where 'mmx' is mentioned in a freshly unpacked source archive, and later Makefiles are generated from information included there.

The main point is, that sources should compile on POWER ARCHITECTURE without any tweaking and modifications. Could you please document any changes necessary to compile a software on PA? The first step is to make sure, that everything compiles. Then we can think about optimizations...

You could put fixes and short explanations about why they were needed here in the forum, or I would be really glad to add you to our collaboration environment under testing.

BTW: thanks for the great post, I found some interesting links in there :-)

_________________
CzP
http://czanik.blogs.balabit.com/


Top
   
 Post subject:
PostPosted: Sun Oct 22, 2006 4:39 am 
Offline

Joined: Thu Nov 18, 2004 11:48 am
Posts: 110
cvs.cinelerra.org is the way =)


Top
   
 Post subject:
PostPosted: Tue Oct 24, 2006 2:27 am 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
I downloaded latest Cinerella sources (945), but no luck, I run into this bug: http://bugs.cinelerra.org/show_bug.cgi?id=279
How did you work around this?

I tend to have a feeling, that asking you guys for documenting PPC related bugfixing does not create much activity here. So I'm lowering the entry barrier: could you provide me with some patches, how POWER related problems were solved by you? Then I try to document it, which seems to be the most difficult part in the coder world :-)

There is just one requirement I can't change: make those fixes elegant, as:
- they should be sent also upstream
- they will be used to demonstrate, how to code in a POWER architecture friendly manner.

_________________
CzP
http://czanik.blogs.balabit.com/


Top
   
 Post subject:
PostPosted: Wed Oct 25, 2006 1:21 pm 
Offline

Joined: Fri Sep 24, 2004 1:39 am
Posts: 297
Hi!
Couldn't reply earlies - my internet-mac died, the ralink drivers don't work yet on linux-ppc (have to use wifi atm) so I had to setup a acient x86 machine with ndiswrapper from scratch...
>How did you work around this?
the ffmpeg part isn't touched during cinelerra-configuration, so you'll have to edit the avconfig.h file manually!
I'm solving power related problems & build
"x86-only" stuff the whole day, but I currently can't find the time for writing "elegant" diffs as my private problems are by far not gone....
cheers,
frostwork


Top
   
 Post subject:
PostPosted: Thu Oct 26, 2006 5:58 am 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Quote:
I downloaded latest Cinerella sources (945), but no luck, I run into this bug: http://bugs.cinelerra.org/show_bug.cgi?id=279
How did you work around this?

I tend to have a feeling, that asking you guys for documenting PPC related bugfixing does not create much activity here. So I'm lowering the entry barrier: could you provide me with some patches, how POWER related problems were solved by you? Then I try to document it, which seems to be the most difficult part in the coder world :-)

There is just one requirement I can't change: make those fixes elegant, as:
- they should be sent also upstream
- they will be used to demonstrate, how to code in a POWER architecture friendly manner.
In reference to the bug; obviously bswap and shrl are not PowerPC opcodes (486 ones to be precise).

http://slack.sarava.org/slackbuilds/cin ... werpc.diff

Looks like someone made a patch. Can you try it Peter? :)

There must be a more elegant solution, unfortunately my compile Pegasos died a horrible death (it refuses to boot from my USB stick which I have my "portable development system" on) so I can't test my hunch right away. It looks just to be a totally broken configure script though, and not enough people on FFMPEG SVN trying it on a PowerPC.

That said.. Luca Barbato from Gentoo does a lot of work on FFMPEG. I will nag him for ideas.

_________________
Matt Sealey


Top
   
 Post subject:
PostPosted: Thu Oct 26, 2006 2:07 pm 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
Thanks, the patch worked as expected, so tomorrows Packman update will also include Cinelerra :-)

_________________
CzP
http://czanik.blogs.balabit.com/


Top
   
 Post subject:
PostPosted: Sun Nov 12, 2006 9:51 am 
Offline

Joined: Fri Sep 24, 2004 1:39 am
Posts: 297
Hi!
The patch is no longer required (it even doesn't exist anymore :) ) since latest cvs.cinelerra svn snapshot!
Now the (already installed) system-ffmpeg can be used
& whole cinelerra builds completely fine.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
PowerDeveloper.org: Copyright © 2004-2012, Genesi USA, Inc. The Power Architecture and Power.org wordmarks and the Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org.
All other names and trademarks used are property of their respective owners. Privacy Policy
Powered by phpBB® Forum Software © phpBB Group