LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 03-19-2009, 05:37 PM   #1
crabpot8
LQ Newbie
 
Registered: Jun 2008
Posts: 12

Rep: Reputation: 0
What does "make install" actually do?


Hey all,

For some classes I have to use the ACE_OS library. I have really had no issues, but I have always wondered why you have to do "make install"

what does this command do? Does it have something to do with shared libraries?

I know on the school computers sometimes I cannot run programs that I have compiled with and ACE_OS dependency, but if I type
$setenv LD_LIBRARY_PATH /path/to/ace_os5.6.5.so

then it will run fine (I obviously dont have root access on these machines, so I could never figure out how to make this "cannot find shared object" error go away permanently

Thanks,
crab
 
Old 03-19-2009, 05:45 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,082

Rep: Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714Reputation: 2714
Quote:
Originally Posted by crabpot8 View Post
Hey all,

For some classes I have to use the ACE_OS library. I have really had no issues, but I have always wondered why you have to do "make install"

what does this command do? Does it have something to do with shared libraries?

I know on the school computers sometimes I cannot run programs that I have compiled with and ACE_OS dependency, but if I type
$setenv LD_LIBRARY_PATH /path/to/ace_os5.6.5.so

then it will run fine (I obviously dont have root access on these machines, so I could never figure out how to make this "cannot find shared object" error go away permanently

Thanks,
crab
It runs through the Makefile, and performs the install, based on the instructions in it. Puts it into locations, does whatever. When you type in "make", it builds the object(s).

The Makefile is essentially a list of instructions, saying how programs should be compiled/linked/installed/whatever. That's a very simplified way of stating it, but that's what "make install" does.
 
Old 03-19-2009, 05:53 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,049

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Quote:
Originally Posted by crabpot8 View Post
Hey all,

For some classes I have to use the ACE_OS library. I have really had no issues, but I have always wondered why you have to do "make install"
What does "make install" do entirely depends on the concrete case we are talking about. "make" is a tool that -unless otherwise instructed via command line options- looks into the current directory for a makefile, and builds the target you instructed it to build. In this case, the target is "install". Such target is usually scripted in a fashion that it will install a number of files after the program is compiled. Each file to the right place (i.e. binaries in /bin or /usr/bin, docs in /usr/share/doc..... ), but it will also set permissions and ownerships and maybe do some other tasks.

So, in short, to compile a program you usually do "make", and to install it after compiling you do "make install". Usually you do need root permissions if you want to install to /

Quote:
what does this command do? Does it have something to do with shared libraries?
It usually installs the stuff in your system, however, this entirely depends on the one who scripted the makefile. It wouldn't make much sense to use the "install" target to launch a pacman clone, but it's certainly possible to do so.

But, you can safely assume that "make install" will install the program or whatever you just built in your system.

Quote:
I know on the school computers sometimes I cannot run programs that I have compiled with and ACE_OS dependency, but if I type
$setenv LD_LIBRARY_PATH /path/to/ace_os5.6.5.so

then it will run fine (I obviously dont have root access on these machines, so I could never figure out how to make this "cannot find shared object" error go away permanently
LD_LIBRARY_PATH is an environment variable that contains paths where to search for dynamic link libraries that your programs will need to run. If you could install this library on the system then you wouldn't need to worry (hence, it might be a good idea to ask the admin if it's possible to do so). If you can't get the library installed in the system, then you need to put it on some other directory, and then add that directory to LD_LIBRARY_PATH as you are doing right now.

You can automate this process. But this entirely depends on how do you work. If you login in command line mode and you use bash as your shell, then you just need to add this into your ~/.bash_profile file:

Code:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/whatever/"
If you intend to use an xterm instead, then this would go into ~/.bashrc. You can just put it in both as well. I also recommend reading the "INVOCATION" section in the bash man page (assuming that you use bash, if not, then read the man page for your shell, whatever that is).

It just depends on how do you login and your shell of choice.

Last edited by i92guboj; 03-19-2009 at 06:01 PM.
 
Old 03-19-2009, 05:55 PM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
The make install step of the installation process, just copies the compiled programs, the man pages, the shared objects and so on... to their specific locations. External programs compiled from source are usually installed in /usr/local by default but this is not a general rule. It depends on the developer's choice. Obviously, if you don't have root privileges, you cannot install a software into directories owned by root.

Anyway, you can specify a custom installation directory in the configure step, usually:
Code:
./configure --prefix=/home/crab
if you choose a directory owned by you as a user, you can actually install a program (that is you can perform the make install step without being root). Take in mind that the installation step may create directories if they don't exist: if you choose your home as installation directory, maybe you will end up with newly created directories like /home/crab/bin, /home/crab/man, /home/crab/lib.

To avoid this you can install the program into the source directory itself and then create link to the executables in the $HOME/bin directory (on most distribution it is already in the PATH) and create/modify the environment variables needed by the program to run.

LD_LIBRARY_PATH is one of these variables. It contains the path (multiple paths separated by colon) of the shared objects (libraries) that are not in standard locations like /lib, /usr/lib, /usr/lib64 and so on.

If you want to make the modification permanent, just add
Code:
setenv LD_LIBRARY_PATH /path/to/ace_os5.6.5.so
to the file $HOME/.cshrc. This file is sourced by the C-shell every time you start a new session, so that the needed environment will be always available to the user.
 
Old 03-19-2009, 08:38 PM   #5
JaksoDebr
Member
 
Registered: Mar 2009
Distribution: Fedora, Slackware
Posts: 104

Rep: Reputation: 21
'make install' does only what is defined for it in the Makefile. If the Makefile doesn't have a section for it, then it does nothing.

Commonly 'make install' will be run as root and be responsible to copy the relevant executables and configuration files in proper places on the system, so that any user can use it. When installing an application into /usr/bin (a location in the $PATH of all users), then the application can be launched without having to specify the full pathname.

If you omit the 'make install' step, then you need to launch the application either by going to the specific directory (and even running it like './appname') or by giving the full pathname.

Linux Archive

Last edited by JaksoDebr; 04-02-2009 at 06:23 AM.
 
Old 03-20-2009, 12:36 PM   #6
crabpot8
LQ Newbie
 
Registered: Jun 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Wow, thanks so much to all. I guess this is a case of the simple explanation was not the one I ever thought of!

It makes sense now, thanks to everyone for the thorough responses!

Crab
 
Old 03-20-2009, 01:06 PM   #7
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
Somewhere nearby, you'll find a file named: Makefile. Open it up, and have a look inside. (But don't touch anything...)

You'll find the word install in there somewhere... it's what we call a make target. You'll also probably find other make-targets, like all and clean.

In any case, the essential information that you find in a Makefile is: "what depends on what, and if you determine that something needs to be rebuilt, how do you do it?"

Thus, for example, when you say make install, the "make" utility is going to find that target, and work backwards to see what prerequisites there are, and to determine whether those prerequisite steps have already been done. For instance, if the program hasn't been compiled yet, that will happen first, then the stuff will be "installed." (And the Makefile will specify exactly how to do that.)

make is one of those utilities for which the concept is intuitively simple, and the implementation can be quite complex indeed. (And we haven't even touched on configure!) In any case, we can usually stick to the "intuitively simple," namely, "it just works." You can just tell it what to make, and ... sit back and watch the pretty blinking lights.
 
Old 03-21-2009, 04:10 PM   #8
crabpot8
LQ Newbie
 
Registered: Jun 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by sundialsvcs View Post
Somewhere nearby, you'll find a file named: Makefile. Open it up, and have a look inside. (But don't touch anything...)

You'll find the word install in there somewhere... it's what we call a make target. You'll also probably find other make-targets, like all and clean.

In any case, the essential information that you find in a Makefile is: "what depends on what, and if you determine that something needs to be rebuilt, how do you do it?"

Thus, for example, when you say make install, the "make" utility is going to find that target, and work backwards to see what prerequisites there are, and to determine whether those prerequisite steps have already been done. For instance, if the program hasn't been compiled yet, that will happen first, then the stuff will be "installed." (And the Makefile will specify exactly how to do that.)

make is one of those utilities for which the concept is intuitively simple, and the implementation can be quite complex indeed. (And we haven't even touched on configure!) In any case, we can usually stick to the "intuitively simple," namely, "it just works." You can just tell it what to make, and ... sit back and watch the pretty blinking lights.
Ah, now that does make things a lot simpler . I never realized that multiple targets were contained in one Makefile. (We have to use make clean all the time, and it never occurred to me that clean might actually be a target, and not some special case of the make command)

Again, thanks for the awesome answers - you guys have really helped me get this a lot better.
 
  


Reply

Tags
install, make


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
So many errors when I typed the "make" and "make install" command Niceman2005 Linux - Software 23 07-22-2009 03:33 PM
differences between "make install" and "make paranoid-install" ? Xavius Linux - Newbie 3 03-22-2009 03:50 AM
window maker "make" / "make install" problem xiekke Fedora 2 08-08-2007 11:55 AM
Constant errors during "make" or "make install" with SUSE 10.1 Alpha 4 TehFlyingDutchman Linux - Software 3 12-30-2005 07:25 PM
BASH problems: "configure, make, make install" commands don't work ditch* Linux - General 3 07-19-2005 05:37 PM


All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration