Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: "Power PC Ubuntu Compling for Dummies"

  1. #1
    Join Date
    Jul 2010
    Beans
    56

    "Power PC Ubuntu Compling for Dummies"

    Hello,

    I am quoting a response from another user from another thread I posted because this response for me has created another question in my mind - about compiling.

    This was a response from Tylerjd on how to compile a program like Seamonkey to the Power PC Ubuntu. But I would like to know if this can be used for other programs that are "intel only" using the source code?

    Also, where can someone like me who has no programming skills (except a very basic laughable HTML page maybe?) learn more about compiling programs like this?

    And finally - for Mac OS 10.4 Tiger II know this is an Ubuntu forum but we're using Macs right? I use both Tiger and Ubuntu on my Power Mac) -- since OS X is unix-based, are there similar compiling techniques for programs on the Mac OS X side as well? Like can I port an Ubuntu program I like or another open source program I like to Tiger using Apple's console?

    Thank you in advance for any replies. I appreciate any assistance you can render, and I want to try this with Sea Monkey and see what happens.

    Here's the quote:


    Quote Originally Posted by Tylerjd View Post
    You do have a point in that last sentence.

    You don't need to be a programmer to compile a program.

    Generally speaking you need to know four commands that you would run in the terminal. (this could be used as a great learning experience)

    The first thing you need to do is to get the source, which is usually in a tar.gz format. Let us take Seamonkey as an example (as Firefox seems to be all pre-configured for specific architectures. The source would be found here.
    It comes packaged as a .tar.bz2, which is like a tar.gz. Download it into your downloads folder.

    When it is finished, goto the area that you downloaded it and double click to extract it. It should be extracted into a seamonkey-2.2 folder. Then open terminal.

    In terminal, use the command cd to goto the folder, so your command would be something along the lines of (replace the seamonkey-2.2 to whatever the you extracted the tar.bz2 to)
    Code:
    cd Downloads/seamonkey-2.2/
    Which brings you into the directory where the seamonkey source is located.

    These next commands may seem scary at first, but only the last one does anything that may be hard to undo to your system- that being installing seamoney. You'll see what I mean.

    Time to compile the code. Make sure to reread this a few times before you do anything in order to have an understanding of what you are doing

    First, you will need to make sure you have all of your tools. As it seems like you have never compiled anything before, you will need to install the developer tools required to install.

    In the following code boxes, don't type anything in the parentheses. Those are comments telling you what the command is doing.
    Code:
    sudo apt-get install build-essential (Installs the developer  tools. You will need to enter the password associated with your account)
    (Wait for that to finish, make take some time depending on internet connection)
    
    ./configure (Makes sure you have all of the required dependancies to  build seamonkey. If it says that it fails, google the step that it  failed on, see if there is a package that you can install that will  resolve it, then run the command again)
    (It will look like a lot of scary code, but it is nothing to worry about.)
    
    make (yes, a very simple command, and that is all of the hard work,  which is compiling the actual program. Your CPU will be used a lot, and  it may take some time to finish the process, so go grab a coffee.)(if  this step fails, then post back here)
    
    
    sudo make install 
    (this last command (make install) installs the program, and you will  need to enter your password again)
    And that is all that is to it. Seamonkey should show up under applications, and if not just run the command "seamonkey &" in terminal

  2. #2
    Join Date
    Jul 2005
    Beans
    382

    Re: "Power PC Ubuntu Compling for Dummies"

    One of the most useful ways of compiling software for the powerpc is to make use of the ppa repositories. You'll find many of these mentioned in the forums where developers can upload newer versions of packaged programs or programs that are not officially available in Ubuntu, or where there is some issue that prevents automatic builds, for example a dependency is missing.
    Since Ubuntu is only officially supported for x86 architectures, if a developer submits code to a ppa it is only automatically built for x86 (and x64) and so no packages appear in Synaptic for users of other architectures.
    However, the source code is available and it includes all the necessary 'extras' to make deb installer packages so that once installed you can use Synaptic to view, uninstall whatever and all the program files go into the right places.
    To compile a package is easy, let's say you want to compile the program 'foo'. Firstly you need to install the necessary build packages:

    Code:
    sudo apt-get install build-essential fakeroot dpkg-dev
    Then make a new directory to work in and cd into it

    Code:
    mkdir foo-build
    cd foo-build
    Add the required ppa repository to your repository list and update

    Code:
    sudo add-apt-repository ppa:foo
    sudo apt-get update
    then download the source

    Code:
    apt-get source foo
    This will download and extract the source code tree. Once complete there will be a new subdirectory in your build directory, cd into it:

    Code:
    cd foo-version-etc
    You need to make sure you have all the dependencies installed:

    Code:
    sudo apt-get build-dep foo
    Then the clever bit:

    Code:
    dpkg-buildpackage -rfakeroot -b
    (If you have a multi-core machine you can speed up the build by adding a 'jobs' flag:
    Code:
    dpkg-buildpackage -rfakeroot -b -j4
    Have a cup of tea. When the compilation is finished cd back up to the build directory:

    Code:
    cd ..
    There you will (if all went well) find one or more 'deb' files, which you install with:

    Code:
    sudo dpkg -i ./*.deb
    I only learned this a few months ago and now it's second nature. I found it on this site:

    http://www.cyberciti.biz/faq/rebuild...inary-package/

    I found some of the steps used on that site were unneccesary and some of the 'sudo' use was unneccessary too so my method is a little neater.

    For some packages I have found that sometimes you have to build some of the dependencies too. You just have to run through this same process for the dependency first.

    I regularly use this process for the unity-2d ppa and for vlc on powerpc.
    Last edited by pauljwells; October 29th, 2011 at 05:40 PM. Reason: added the 'update' step as pointed out by rsavage, Thanks!
    Registered Linux User #407403

  3. #3
    Join Date
    Jul 2005
    Beans
    382

    Re: "Power PC Ubuntu Compling for Dummies"

    There is a ppa for seamonkey here

    https://launchpad.net/~ubuntu-mozill...y/+archive/ppa

    you would obviously replace all the 'foos' in my post with 'seamonkey'

    I would say that seamonkey is going to be complex and it's possible that there could be 'hiccups' in the build. Don't be put off, but try something known to work first (like the unity-2d packages, which are worth installing anyway on powerpc) to get the hang of it before you start hacking...
    Registered Linux User #407403

  4. #4
    Join Date
    Jan 2011
    Beans
    994

    Re: "Power PC Ubuntu Compling for Dummies"

    Thanks pauljwells, will try this out!

  5. #5
    Join Date
    Jul 2010
    Beans
    56

    Re: "Power PC Ubuntu Compling for Dummies"

    Hello,

    Thank you for the information on that SeakMonkey thing, I will definitely put that to use.. But not just SeaMonkey - I am trying to find out wher I can learn general compiling techniques so that I can do this for pretty much any Linux program I want to run on Ubuntu, if possible.

    "Learning to fish" rather than just asking for a fish. I am interested in any books or websites or even threads on the subject.

    Thanks again.

  6. #6
    Join Date
    Jul 2005
    Beans
    382

    Re: "Power PC Ubuntu Compling for Dummies"

    Compiling is (if the dev did his work properly) a no-brainer...

    Code:
    ./configure
    make
    sudo make install
    is really all there is to it!

    Packaging is a little more complex, but compiling a package is also easy (see my post above)

    Some more complex programs use 'cmake' which is a turbocharged configure system for dealing with different architectures, but again is quite straightforward - the programs that use it will give you detailed instructions.

    The fun starts when you start to hack, after all, why compile if there's already a package available? I started because on powerpc some stuff doesn't work but can be made to work with (fairly) simple fixes. The hard part isn't usually making the fix but finding the broken code.

    My personal advice: learn python! (other codes are available...)
    Registered Linux User #407403

  7. #7
    Join Date
    Jan 2011
    Beans
    994

    Re: "Power PC Ubuntu Compling for Dummies"

    MacPenguin1972, I don't know if you've tried any of this yet, but I had a go at compiling Firefox using pauljwells' excellent post. I think I am right in thinking that getting the latest Firefox sparked your interest in this?

    Admittedly, I didn't use a powerpc machine, but I don't think that matters.

    The various ppa for firefox are explained here https://help.ubuntu.com/community/FirefoxNewVersion .

    I've copied the exact commands I used. You can see how they follow pauljwells post.

    Code:
    sudo apt-get install build-essential fakeroot dpkg-dev
    mkdir firefox-build
    cd firefox-build
    sudo add-apt-repository ppa:mozillateam/firefox-stable 
    sudo apt-get update
    apt-get source firefox
    cd firefox-6.0.2+build2+nobinonly
    sudo apt-get build-dep firefox
    dpkg-buildpackage -rfakeroot -b
    cd ..
    sudo dpkg -i firefox_6.0.2+build2+nobinonly-0ubuntu0.11.04.1_amd64.deb
    I also tried compiling Firefox 7 and Firefox 9. These proved more troublesome, but I succeeded in the end. The compiling failed with a nondescript error and this is where the "skill" of compiling lies. So I did what every man does in this situation..... hit google of course with the error. Took me a while to find it, but I think I had actually run out of memory! I increased my swap, tried it again and bobs your uncle!

    Whilst compiling, the memory usage as determined by system monitor was mostly around 500MB. With no applications loaded it is usually about 360MB (using standard ubuntu). At some point during compiling though it must exceed 2GB. Therefore, I suggest your combined swap + memory must be something like a minimum of 2.5GB. If you're lowish on physical memory then possibly you could boot into single user mode without a GUI to conserve memory?

    It took a few hours to compile and I could see for some people with a slower processor it would be an all nighter! It also uses 5GB of hard drive space. Yes that is 'GB'!

    More info about compling firefox can be found here https://developer.mozilla.org/En/Simple_Firefox_build .

    I didn't really need to compile firefox, I just did it to see if I could. It pretty much worked exactly as it should of. I think there is a quicker way to get Firefox into powerpc lucid and maverick using apt-pinning, but if you want the novelty of compiling it yourself then I say go for it!
    Last edited by rsavage; September 11th, 2011 at 08:39 AM.

  8. #8
    Join Date
    Jul 2005
    Beans
    382

    Re: "Power PC Ubuntu Compling for Dummies"

    Quote Originally Posted by rsavage View Post
    using pauljwells' excellent post
    I Can't tell you how happy it makes me to read this!
    Registered Linux User #407403

  9. #9
    Join Date
    Jan 2011
    Beans
    994

    Re: "Power PC Ubuntu Compling for Dummies"

    Quote Originally Posted by pauljwells View Post
    I Can't tell you how happy it makes me to read this!
    I say it like I see it! Only I think I've spotted an error in both our posts! After you add a ppa you need to do a "sudo apt-get update" I think. I've now edited my post.....

  10. #10
    Join Date
    Feb 2011
    Beans
    202

    Re: "Power PC Ubuntu Compling for Dummies"

    Quote Originally Posted by pauljwells View Post
    One of the most useful ways of compiling software for the powerpc is to make use of the ppa repositories. You'll find many of these mentioned in the forums where developers can upload newer versions of packaged programs or programs that are not officially available in Ubuntu, or where there is some issue that prevents automatic builds, for example a dependency is missing.
    Since Ubuntu is only officially supported for x86 architectures, if a developer submits code to a ppa it is only automatically built for x86 (and x64) and so no packages appear in Synaptic for users of other architectures.
    However, the source code is available and it includes all the necessary 'extras' to make deb installer packages so that once installed you can use Synaptic to view, uninstall whatever and all the program files go into the right places.
    To compile a package is easy, let's say you want to compile the program 'foo'. Firstly you need to install the necessary build packages:

    Code:
    sudo apt-get install build-essential fakeroot dpkg-dev
    Then make a new directory to work in and cd into it

    Code:
    mkdir foo-build
    cd foo-build
    Add the required ppa repository to your repository list and update

    Code:
    sudo add-apt-repository ppa:foo
    sudo apt-get update
    then download the source

    Code:
    apt-get source foo
    This will download and extract the source code tree. Once complete there will be a new subdirectory in your build directory, cd into it:

    Code:
    cd foo-version-etc
    You need to make sure you have all the dependencies installed:

    Code:
    sudo apt-get build-dep foo
    Then the clever bit:

    Code:
    dpkg-buildpackage -rfakeroot -b
    (If you have a multi-core machine you can speed up the build by adding a 'jobs' flag:
    Code:
    dpkg-buildpackage -rfakeroot -b -j4
    Have a cup of tea. When the compilation is finished cd back up to the build directory:

    Code:
    cd ..
    There you will (if all went well) find one or more 'deb' files, which you install with:

    Code:
    sudo dpkg -i ./*.deb
    I only learned this a few months ago and now it's second nature. I found it on this site:

    http://www.cyberciti.biz/faq/rebuild...inary-package/

    I found some of the steps used on that site were unneccesary and some of the 'sudo' use was unneccessary too so my method is a little neater.

    For some packages I have found that sometimes you have to build some of the dependencies too. You just have to run through this same process for the dependency first.

    I regularly use this process for the unity-2d ppa and for vlc on powerpc.
    And if you want to find a certain package's source, how do you find it's ppa, or a ppa for it?
    Linux Mint 17.1 running on my AMD A8-6600K desktop; Ubuntustudio 14.04 running on a Macbook 2,1

Page 1 of 4 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •