Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Is my home directory fine and what should I name the file?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie theKbStockpiler's Avatar
    Join Date
    Sep 2010
    Location
    Upstate NY
    Posts
    211

    Build application from Source. Where is this best done.




    Is my home directory fine and what should I name the file?

  2. #2
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    488
    A subdirectory under your home directory is best. I'm not sure about what you mean with "name the file". There will almost certainly be multiple files, and the output will be whatever the makefile dictates. If you're writing your own app, then you can name it whatever you like. Linux doesn't care about filenames or extensions, so you're free to call your app whatever you want.

  3. #3
    Linux Newbie theKbStockpiler's Avatar
    Join Date
    Sep 2010
    Location
    Upstate NY
    Posts
    211

    Thanks for the Reply!

    This is my second Linux install that is working well and I learned from the first one how not to turn it into a mess with files all over the place.

  4. #4
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    if this is an application that only your 1 user will use, then somewhere under your home directory is fine. If you want all users to be able to use it (install as root) then you will want it to be under /usr/local/
    this is the standard location for apps installed outside of your package manager for most distros, and you should be safe doing it there.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  5. #5
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    488
    Perhaps I'm not completely understanding your question. The app should be built in your /home somewhere, because that's the only place you own. After it has been built, you can then install it anywhere. Apps generally go in /usr/bin, /usr/local/bin, or sometimes /opt, although somewhere in /usr is most common. If you want to be able to run it from the command line by just typing the name of the executable, then it has to be in a folder in your path. You can either put it in one of those places, or modify the path to include the folder where you put it.

  6. #6
    Linux Newbie theKbStockpiler's Avatar
    Join Date
    Sep 2010
    Location
    Upstate NY
    Posts
    211

    I think it works like windows.

    I think the configure file places the built application in a predetermined place. How this is changed is beyond me plus I'm just guessing. With MS if the exe. is not in a shared file only the one user can access it. You can unpack the application anywhere and delete it and it will still work because it has been built and relocated where it needs to be by the configure script. I made a directory in the Stockpilers directory. I have done this type of thing before but only achieved a primer for the second time, this time. I never got past the make file complaints on a source only install but have had source rpms work okay. I changed the ownership to myself so it would only be a learning experience in building form source and not one from permissions.

    If this is a wrong assumption go ahead and correct me but from my first experience I think it works this way. My question originally was more about house-keeping but you can never have enough Linux knowledge. On my newer install I make files within the original user folders so it does not turn into a disorganized mess. The source package has to be in a directory to the best of may knowledge. The tip about the path was great.

    Thanks for the Replies! It is appreciated!
    Last edited by theKbStockpiler; 12-06-2010 at 04:10 AM.

  7. #7
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    usualy, when you do the `./configure` you can put `./configure --prefix=/usr/local/` (or whever you want) to change the highest level directory where everything else goes by default. if you do `./configure --prefix=/home/userid/application_name` then you will have 1 directory where all of the application's files reside. If you want to remove the app, just delete that 1 directory. To execute the app, it is usually $PREFIX/bin/executable_name.

    the commands to install MOST software would be

    cd /source/directory
    ./configure --prefix=/path/to/install
    make
    make install # <- this one is usualy done as root if you're doing it in public directories.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  8. #8
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    488
    If you downloaded the package, it is usually preconfigured to install to the directory the executable expects. Installing it in other directories can have unexpected side effects, depending on how the app was written. The safest way to do it is to just change to the directory containing the configure file, then running
    Code:
    ./configure
    make
    sudo makeinstall
    You can change the makinstall to checkinstall if you want, and the package management system will be informed about the installation, and you can then remove it with apt, aptitude, or Synaptic, fairly easily and cleanly.

    The original post wasn't entirely clear, so I wasn't sure if the app being compiled was downloaded or written from scratch. It appears this is about downloaded app source packages, so I would recommend extracting the tarball to your home directory, retaining the directory structure in the tarball, which should give you everything in a subdirectory hierarchy under your home. Do the configuration and compiling there, and after installation you should be able to delete the entire subfolder and all its contents, and retain the installation. Some apps don't install to the / hierarchy, though, and run from wherever they were made. If you don't run makeinstall or checkinstall as root, the installation will probably be to the current directory, and only the current user can access it. If you want every user to be able to run it, install it as root, and if you want only the current user to be able to run it, don't use sudo. There are exceptions to everything, of course, but this is the usual procedure.

  9. #9
    Linux Newbie theKbStockpiler's Avatar
    Join Date
    Sep 2010
    Location
    Upstate NY
    Posts
    211

    While I have your attention : This is not really related to the original post

    I found an actual and informative guide to AutoTools atLinux.com :: Best practices with autotools No joke. You can actually learn something from it!

    To learn more about AutoTools, it would help to know how I would go about writing a program in lets say C without AutoTools or what would a application developer have to do or NOT do so the program would run on just ONE platform/O.S?

    Thanks again for the great and informative replies!

  10. #10
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    488
    A program will only run on the platform/OS it's compiled for. If you compile it in Linux, it will only run on Linux. If you use a Windows compiler, it will only run under Windows, same for Mac. For most programs, you'll also have to make other changes to make it run on a different OS, since the libraries are different. I don't know about AutoTools, but if it's a Linux-specific tool, you probably can't compile your apps for Windows or Mac directly. Linux is Linux, mostly, so anything compiled under one distro will usually run fine on another distro, since the kernels are the same, just different versions perhaps.

Page 1 of 2 1 2 LastLast

Posting Permissions

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