How do you compile from source an application?

Discussion in 'General Discussion' started by moorsb, Mar 19, 2014.

  1. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    Is there a document that tells you how to compile an application for Udoo?
    Code block is installed on Ubuntu 12.04 image, When and why do you have to cross compile?
     
  2. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    SPEED !!!!

    A modern fast quad core P.C compile your code a lot faster than compiling native on your embedded micro .
    Faster eg orders of magnitude faster.

    also on the raspberry Pi etc you can`t sometimes can`t do it native due to the amount of memory.

    What application ? , some C code to run on thw multi core part or C code for the sam part ?
     
  3. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    GNURadio is one package, as well as Proview. Can I just compile it on the Udoo Quad or does it have to be compiled on another computer? I am wanting fast graphics. I am running Ubuntu 12.04 LTS now on Udoo. It comes with codeblocks installed. I am also having an issue with the users on the Ubuntu 12.04 is seems that Guest is the administrator . I am unable to login as Udoo and use the filemanager to copy folders and files it keeps giving me error that I do not have permission. Not sure if I should go to another image to get things going.
     
  4. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    The normal way is to install a downloaded package is first use "apt-get install build-essential" and use make.

    If you download a package which normally comes as a tar file , after you untar it you will normally see a read_me file which tells you how to compile it and install it.

    To run some commands you need to be root , which is done by logging in a root at first or switch users , or via a terminal use sudo in before any command .

    No , the best way is to do it native .
     
  5. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    If change user accounts to one with admin level. Then do you have to do everything via command prompts, which I struggle with or can you use the graphical interface and use file manager.
    That is what i have been doing yet it tells me I do not have privledge required
     
  6. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    If you log in as root , you are root with anything you start up else it starts it own user.
    So if you start the file manager , then that should be running as root .

    Open the file manager and open a terminal and make it full screen and type ps auxf
    and that should show you all the processes running and there user

    When it come to Linux I have the opposite problem, I've. Been working on headless servers so long I could not work out how to add a short cut to the desktop.
     
  7. allwet

    allwet New Member

    Joined:
    Oct 30, 2013
    Messages:
    29
    Likes Received:
    1
    I see a mix of issues here. I will address running as root on the UDOO. First, I am running with reference to the Ubunto 12.04 v2.1 release and assume the following:
    - you have an HDMI display running on the UDOO so you can see what you are doing.
    - you have experience compiling source code on a linux PC.
    - you have knowledge and experience with linux utilities and how to run them from a command line.
    - for debian users, all is similar, but initial login user is different.

    - Open a terminal window.
    - sudo -i (-i for "interactive")
    Now your terminal session is running as root in a subshell. Later, to exit, just use ctl-d to close out the subshell.
    Be careful running as root - you can really mess up things if you don't watch what you are doing.
    In this mode, you do not need to preface all commands with sudo since you are now in the interactive mode as a "sudo root user". Think of "sudo" as "switch user to root and do something". The interactive mode is "switch user to root and do many things".

    If you are running from the console port, after logging in as user "ubuntu" you are at ubuntu's account level running within one shell program. You don't have a window, so you can't open a terminal window. The rest is the same as a termial window session, but without the window.

    One more definition: application - an executable file that was built from source, has the correct ownership and permissions to be executable.
    I'll leave building your application to your research from here. When you are through, you will want to move your executable file to one of the directories in your normal search path as well as changing ownership and permissions on that executable.
    Most packages will install properly, but if you are trying to compile and execute your own program, then more Linux fundamental knowledge is needed.

    Hope this helps. I may have drifted off topic a little, but I sensed some new user issues.
     
  8. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    I am having issues with Ubuntu 12.04 LTS image getting permission to install software no matter if I login as SU or Sudo or not. I am trying to install a software package call gnuradio. I then decidec to give up on Ubuntu and move over to Debian, I think it has a realtime kernel installed . I keep loosing my internet connection using that package. My Wifi sees other locked routers but mine just goes away after 30 minutes. Wired also shuts down.
    I do not understand why they have released images that have major bugs. I guess they are just hardware guys.
     
    sambrin likes this.
  9. allwet

    allwet New Member

    Joined:
    Oct 30, 2013
    Messages:
    29
    Likes Received:
    1
    Software defined radio (SDR) is one of my interests in ham radio. Although not really ready to devote a lot of time to it, I took a stab at trying to install gnuradio on ubunto 12.04 LTS that I am currently running on my UDOO.

    I found the following webpage: http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGRFromSource which eludes to an easy way to install using the build-gnuradio script. Things were going fine until the script could not find a critical package: libqwtplot3d-qt4-dev. I then weazled down the web searches trying to find more leads with no success. I found a source repository for that library http://svn.debian.org/viewsvn/debian-science/packages/qwtplot3d/trunk. I tried entering this URL in /etc/apt/sources.list to see if I could perform an apt-get install on that package, but apt-get didn't like my addition.

    I was hoping that gnuradio could be installed using source build scripts, but it appears that ubuntu does not have all of the necessary dependencies available. Overcoming each missing package hurdle may lead to circular redundancy taking a lot of patience to get all the necessary packages.

    Going through this exercise, or at looking at some of the web pages, will help you get permissions going. First big problem I see is meeting all of the dependencies and loading all the missing packages. Once that is done, then you can download your gnuradio source tree into a "src" directory under your user account, then do a chmod to change the permissions of all the files in the tree prior to doing the build in that directory.

    I did find a dependency list to help. See the guradio build guide: http://gnuradio.org/redmine/projects/gnuradio/wiki/BuildGuide. If you haven't seen it yet, this may help.

    Good luck.
     
  10. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    Thanks for your effort, I was at the same spot. I found that I did not have enough software loaded to install the package. Why do they make it so hard to install software?? What good is the board if you can not get the software you want to run on it. Why not offer a full package of Ubuntu or What ever that will make installing software easy.
     
  11. allwet

    allwet New Member

    Joined:
    Oct 30, 2013
    Messages:
    29
    Likes Received:
    1
    I suspect that a lot of the reasoning is driven by the 8GB limit of the distribution image that has to fit on an 8GB uSD card. Another reason might be that some software extras, when they run, need more memory than what is available.
     
  12. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    What defines a "full package of Ubuntu" ??? Others have made this statement before in the forums, but the problem is that what's full for you is overkill for me, or underkill for another person as we all use our computers to do very different things.

    The important thing is having the repository so you can fetch the packages you need already compiled. The problem is that not everyone who makes software puts it into the repositories in such a way so it's easy to do. When they don't, then you run into the "ok, I need all the dependencies, now I need to build the software from source" game, which I agree can be hell. When it's all in the repository, it's usually pretty straightforward as "sudo apt-get install <package>" will usually take care of fetching all the dependency chain as well.

    I have been pushing the Udoo guys to move towards something more like the Raspbian way of doing things on the RPi - a custom version of the OS, where they control the repository, build all the code specifically for the Udoo and provide it all as packages. It would also help get us all on a common image instead of the current 5 or so different OS images... (Plus I happen to be a big Debian/Raspbian fan....) To me Ubuntu is just such a resource pig that it defeats the purpose on small boards like this. But then there are others who demand Ubuntu (mostly because of the name recognition IMO).
     
  13. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    Plus one on that , my favorite image would be a image with only the most basic packages install, but stable and with good working repository without dependency issues , to me getting a image with 1000 packages installed is just bloatware.
    Good idea of have a udoobian repository, which to me sound like a race out of the star wars universe.
     
  14. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    Exactly, I'd like to see nothing more than the following:

    * Uboot
    * Up to date kernel with all needed drivers for all the Udoo hardware and accessories, and any needed kernel mods for doing the various GPIO functions (like SPI, etc.) included.
    * default to command line on bootup
    * SIMPLE low-weight desktop (like FVWM) for those who want/need it
    * all the 3D drivers
    * some sort of package manager (Synaptic, or what have you) for those who prefer doing this from a GUI desktop.
    * the Arduino IDE

    Everything else we should be able to get ourselves as needed via packages. This just provides the raw bare essentials that get 99% of the people started. Could always include instructions for getting other stuff as needed for those who want a more full desktop environment or those who want a more embedded environment, etc. "Here's the recommended list of tools to fetch for XYZ purpose".
     
  15. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    It seems it would be in the best interest of the Udoo Team or who ever is taking ownership of this issue, some serious thought. I hope they can move on this as the hardware is useless if you have to spend days trying to install software.
     

Share This Page