Compiling for Powerpc, how to?

Discussion in 'PowerPC Macs' started by skinniezinho, Jun 19, 2013.

  1. skinniezinho macrumors 6502a

    Joined:
    Jan 1, 2009
    Location:
    Portugal
    #1
    Hi guys,
    As some may noticed I love powerpc, I love linux (the thinkpad is running arch linux) and with a Quad G5 on it's way I want to contribute a little more to a good life for powerpc.
    I noticed that some opensource programs offer builds for Intel mac, Powerpc linux but not powerpc mac, how can I do it since I have the source?
    One good example is librecad http://librecad.org/cms/home.html

    And sometimes there are others, any easy way to do it?
    I understand zero of programming.
     
  2. ihuman:D macrumors 6502a

    Joined:
    Jul 11, 2012
    Location:
    Ireland
    #2
    Have you tries the Linux page at their website?

    Wait, do you want to compile it for OS X or Linux?
     
  3. skinniezinho thread starter macrumors 6502a

    Joined:
    Jan 1, 2009
    Location:
    Portugal
    #3
    I don't see nothing special there..
     
  4. Wildy, Jun 19, 2013
    Last edited: Jun 19, 2013

    Wildy macrumors 6502

    Joined:
    Jan 25, 2011
    #4
    A little disclaimer: Many FOSS programs only offer Intel binaries because they happened to be built on an Intel machine. While there will be some which genuinely need the newer features from Snow Leopard etc., it is possible to build many on PPC.

    Most Linux programs are available from Macports, but there are many which don't use Mac-native libraries (Cocoa in particular) and so pull in a ton of other Linux dependancies that you won't find many Mac-native applications using (GTK for example). The bottom line is that if you want to provide binaries of these projects for PowerPC Mac users then you need to strip out these dependancies and substitute them for something which doesn't require a ton of setup.

    Anyway, LibreCAD looks to use Qt (instead of Cocoa or GTK), which provides a native UI for us Mac users. You will need to install the Qt devlopment kit. LibreCAD uses Qt 4, which is lucky because Qt 5 is not supported on PowerPC. Here is the download page: http://qt-project.org/downloads. It's quite possible that they don't ship a PowerPC binary, in which case you will have to compile this from source (will take a while). You may want to install Macports to get this, otherwise you can find the source on the Qt downloads page. Also on the list of things to build is git (also in Macports), which you will need when working with just about any FOSS project.

    So, on to the good stuff...

    Get the dependancies:
    Code:
    sudo port install gitgcc46 qt4-creator-mac qt4-mac boost muparser
    Change the gcc used to build ports:
    Code:
    sudo port select --set gcc mp-gcc46
    Once you have these tools, it's simply a case of following the instructions they provide. Download the source, and compile:
    Code:
    git clone https://github.com/LibreCAD/LibreCAD.git
    cd LibreCAD
    qmake librecad.pro -r -spec mkspec/macports
    make -j 2
    You may change the number 2 to whatever your core count+1 is.

    This should produce an executable .app.


    Installing Macports: http://trac.macports.org/wiki/InstallingMacPorts
    Building ports from source: http://trac.macports.org/wiki/UsingMacPortsQuickStart


    You are going to need to install a bunch of stuff first - there are a few hoops to jump through.

    First step is getting and installing the latest Xcode for PowerPC (I believe it's 3.x). This will provide you with the toolchain you'll be using to compile everything from now on.
     
  5. CptSky macrumors regular

    Joined:
    Feb 1, 2013
    #5
    You will be able to port only few apps if you know nothing in programming. When porting an app to another system, there is always bugs and you must update the build script. If the original maintainer doesn't support OS X PPC, except if you propose him a patch, he won't probably work on the issues.
     
  6. rabidz7 macrumors 65816

    rabidz7

    Joined:
    Jun 24, 2012
    Location:
    Ohio
    #6
    I tried to port nVclock, I never could figure it out. It would have been one of the greatest PowerPC apps. If anyone wants to attempt to port this, it would be wonderful!
     
  7. spunkgarLEWII macrumors regular

    Joined:
    Jun 1, 2013
    #7
    Why don't u do it, Rabidz? You seem to have gotten Mountain Lion and soon Mavericks to run on a PPC processor.. so, we will open the stage to you to develop nVclock for PowerPC.

     
  8. ihuman:D macrumors 6502a

    Joined:
    Jul 11, 2012
    Location:
    Ireland
    #8
    I think we have ourselves a little troll... ;)
     
  9. skinniezinho thread starter macrumors 6502a

    Joined:
    Jan 1, 2009
    Location:
    Portugal
    #9
    Wildy Thanks for the instructions, as soon as I can I will try it.

    Yes I know that I will only be able to port a few apps, or even none :p but I would like to try it =) if I can do it sucessfully it is one program more for ppc =)

    NVclock for overclocking nvidia cards?
     
  10. Wildy macrumors 6502

    Joined:
    Jan 25, 2011
    #10
    Nvclock relies very much on the Linux graphics subsystem, which is radically different from that of OSX. Nvclock would be good as a reference, but it would be quicker to rewrite it than to port it (there'd be more new code than unchanged code).
     
  11. rabidz7 macrumors 65816

    rabidz7

    Joined:
    Jun 24, 2012
    Location:
    Ohio
    #11
    I am working with the command line version.
    I do not know much about programming other than good html and css, and very, very basic java.
    I could not even find the stuff in the software that actually does the overclocking.
     
  12. Wildy macrumors 6502

    Joined:
    Jan 25, 2011
    #12
    By graphics subsystem, I mean the way the OS interacts with the graphics card, as opposed to the user interface.

    It has to be said, you didn't pick the easiest project to begin with!
     
  13. AdrianK macrumors 68020

    Joined:
    Feb 19, 2011
    #13
    Just an FYI that's markup, not programming.
     

Share This Page