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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
06-04-2014, 01:24 PM
|
#1
|
Member
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68
Rep: 
|
Explaine about compiling software from source code
Hello.
I need more info about compiling software from source code.
1) Where goes installed software after compiling ?
I read somewhere that compiled software goes to /usr/local
But I can't find it there.
I tried locate name but gives me a lot of confusing results.
2) Can i delete software unpacked directory (eg from home dir) after compiling ?
I'm using Centos (based on RHEL)
|
|
|
06-04-2014, 01:33 PM
|
#2
|
Member
Registered: May 2014
Posts: 55
Rep: 
|
|
|
|
06-04-2014, 02:02 PM
|
#3
|
Member
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68
Original Poster
Rep: 
|
I know how to compile.
My questions are releated after compiling.
|
|
|
06-04-2014, 02:23 PM
|
#4
|
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Rep: 
|
In stage 4 of the article potato farmer linked to:
4
Quote:
Run the command "./configure" to configure the source code automatically. Arguments such as " --prefix=" can be used to control the install location. This checks that you have the right libraries and versions.
|
/usr/local is the default if you don't specify anything else.
Yes, after compiling and installing, you can delete the source directory if you want.
|
|
|
06-05-2014, 06:23 AM
|
#5
|
Member
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68
Original Poster
Rep: 
|
The questions is, where it goes when prefix is not specified ?
|
|
|
06-05-2014, 06:41 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,508
|
actually it depends on the defaults of the given software. So there is no general answer.
|
|
|
06-05-2014, 06:51 AM
|
#7
|
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Rep: 
|
There are usually README and INSTALL text files included in source directories, they might tell you where it goes if you don't specify any prefix.
|
|
|
06-05-2014, 06:55 AM
|
#8
|
Member
Registered: Apr 2014
Distribution: Slackware
Posts: 92
Rep: 
|
Running ./configure --help might also tell you what the default prefix is. Also, in some cases, after running configure, it'll tell you where the software will be installed.
|
|
|
06-05-2014, 12:25 PM
|
#9
|
Member
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68
Original Poster
Rep: 
|
./configure --help gave me output:
Code:
nstallation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`//bin', `//lib' etc. You can specify
an installation prefix other than `/' using `--prefix',
for instance `--prefix=$HOME'.
But i think it's default info about software path.
I also checked README and INSTALL for path, but without any info about install path.
// Btw. What is --exec-prefix for ?
Let me explaine more what I want to achiev.
I want to learn and practise compiling sotwares (i knew it), locating installed program, managing it, removing.
For this, i pick up cups 1.7.2.
I'm running CentoS with cups 1.4.2, which i removed ( yum remove cups)
I installed cups 1.7.2 (./configure, make, make install)
And know i trying to locate it.
Code:
[root@centOS cups-1.7.2]# which cups
/usr/bin/which: no cups in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
locate cups
http://pastebin.com/iJ9Hn5QZ
Is there any other way to locate path to installed programs ?
And to them executable files.
Next thing will be , how to remove that program.
|
|
|
06-05-2014, 01:14 PM
|
#10
|
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Rep: 
|
Try whereis cups:
Code:
bash-4.2$ which cups
which: no cups in (/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/cuda-5.5/bin:/usr/lib64/kde4/libexec:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/qt/bin:/home/brian/bin)
bash-4.2$ whereis cups
cups: /etc/cups /usr/lib64/cups /usr/include/cups /usr/share/cups
Quote:
Originally Posted by blackRonin
Next thing will be , how to remove that program.
|
This works sometimes:
While in the source directory.
Last edited by brianL; 06-05-2014 at 01:19 PM.
|
|
|
06-05-2014, 02:22 PM
|
#11
|
Member
Registered: Apr 2014
Distribution: Slackware
Posts: 92
Rep: 
|
In the case of CUPS, there's no executable "cups". You're looking for "cupsd", where the 'd' stands for daemon.
|
|
|
06-07-2014, 01:58 PM
|
#12
|
Member
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68
Original Poster
Rep: 
|
thank you @brianL, "whereis" it's what i kept in mind.
Btw. what's your's (best) "policy" compiling software from source ?
I mean, where to kept them, install (using prefix or not)
What are you doing ?.
I'm so get used to windows (install from binaries, known path, registery entry etc)
|
|
|
06-08-2014, 04:55 AM
|
#13
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,508
|
you need to compile it inside a user's home dir, in a subdir (would be named like software-version). You need to compile as a normal user and install it as root. There is no general suggestion on prefix, it depends on your environment, your distro and also on the software itself. If you are unsure you can safely use the defaults (in general)
|
|
|
06-08-2014, 08:09 AM
|
#14
|
Member
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68
Original Poster
Rep: 
|
I'm talking about policy base on centOS.
I heard that some poeoples unpacking software to /opt and compile from there.
What's your opinion on that ?
|
|
|
06-09-2014, 10:23 AM
|
#15
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,508
|
no, that is not a good idea. The sources should be put outside of the living system (that means do not use /opt /var /etc or similar), but into a temporary working directory - you can use either /tmp or something inside a home of a user (this is the preferred solution). You will configure, build, test and finally install the software from this location.
|
|
|
All times are GMT -5. The time now is 04:27 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|