LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-04-2014, 01:24 PM   #1
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Rep: Reputation: Disabled
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)
 
Old 06-04-2014, 01:33 PM   #2
potato_farmer
Member
 
Registered: May 2014
Posts: 55

Rep: Reputation: Disabled
See this:
http://www.wikihow.com/Compile-a-Program-in-Linux
 
Old 06-04-2014, 02:02 PM   #3
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Original Poster
Rep: Reputation: Disabled
I know how to compile.
My questions are releated after compiling.
 
Old 06-04-2014, 02:23 PM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Blog Entries: 61

Rep: Reputation: Disabled
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.
 
Old 06-05-2014, 06:23 AM   #5
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Original Poster
Rep: Reputation: Disabled
The questions is, where it goes when prefix is not specified ?
 
Old 06-05-2014, 06:41 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,508

Rep: Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060
actually it depends on the defaults of the given software. So there is no general answer.
 
Old 06-05-2014, 06:51 AM   #7
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Blog Entries: 61

Rep: Reputation: Disabled
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.
 
Old 06-05-2014, 06:55 AM   #8
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
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.
 
Old 06-05-2014, 12:25 PM   #9
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Original Poster
Rep: Reputation: Disabled
./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.
 
Old 06-05-2014, 01:14 PM   #10
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Blog Entries: 61

Rep: Reputation: Disabled
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 View Post
Next thing will be , how to remove that program.
This works sometimes:
Code:
make uninstall
While in the source directory.

Last edited by brianL; 06-05-2014 at 01:19 PM.
 
Old 06-05-2014, 02:22 PM   #11
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
In the case of CUPS, there's no executable "cups". You're looking for "cupsd", where the 'd' stands for daemon.
 
Old 06-07-2014, 01:58 PM   #12
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Original Poster
Rep: Reputation: Disabled
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)
 
Old 06-08-2014, 04:55 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,508

Rep: Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060
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)
 
Old 06-08-2014, 08:09 AM   #14
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 06-09-2014, 10:23 AM   #15
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,508

Rep: Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060Reputation: 8060
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.
 
  


Reply


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
Compiling from source code umamaheshmunez Linux - Software 9 10-24-2008 03:05 AM
compiling source code BoredStudent Linux - Desktop 1 10-26-2006 08:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:27 PM.

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
Open Source Consulting | Domain Registration