LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-18-2006, 02:20 PM   #1
GTrax
Member
 
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 214

Rep: Reputation: 33
Basic question about failed compiles


We have the package. Whether its tar.gz, or .tgz or other combinations, assume we have it open in the user's home directory.

The generic INSTALL instructions say run a script
Code:
username@1[~]$ ./configure
and all sorts of stuff rushes by, sometimes with disturbing messages. Assume it completes. then..
Code:
username@1[~]$ make
(more stuff happens)
username@1[~]$ make install
(if you are lucky all is done)
Most times I try this, it fouls up for some reason or other. OK - so we have to first get a dependency figured, or install something else first, whatever..

My questions are, what of the blizzard of directories and links and headers and executables already created. Do we have to "undo" any of it?

Could we undo the mess if we wanted to?

If we think we are ready to try again, do we just go ahead and do "./configure" and "make install" right over the top of it all?

Forgive such a basic question, but its hell if you never figured it out before :| Thanks..
 
Old 10-18-2006, 02:45 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Some source install comes with a make uninstall. Others don't so you have to search for the places it installs to. Also when you have a failed install it is sometimes good to run make clean or run make distclean.
 
Old 10-18-2006, 02:58 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,160

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
So I can review what happened (and what was installed where), I do my compiles like this:
Code:
$ ./configure 2>&1 | tee configure.out
$ make 2>&1 | tee make.out
$ make test 2>&1 | tee make_test.out
$ make install 2>&1 | tee make_install.out
That way if there is no "make uninstall" or "make clean", I at least have a chance of tracking things down for manual removal by looking at the make*.out files.
 
Old 10-18-2006, 03:00 PM   #4
GTrax
Member
 
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 214

Original Poster
Rep: Reputation: 33
OK - but what are the consequences of not cleaning up?
If, after trying to provide your best guess at what it needs, you try again.. Will the scripts overwrite the previous files?

I am thinking that a failed compile must happen so often that the exercise of cleaning up a whole tree of generated files manually is not something seasoned compiler users would likely put up with for long.
 
Old 10-18-2006, 03:05 PM   #5
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by haertig
So I can review what happened (and what was installed where), I do my compiles like this:
Code:
$ ./configure 2>&1 | tee configure.out
$ make 2>&1 | tee make.out
$ make test 2>&1 | tee make_test.out
$ make install 2>&1 | tee make_install.out
That way if there is no "make uninstall" or "make clean", I at least have a chance of tracking things down for manual removal by looking at the make*.out files.

Could you explain the ./configure 2>&1 | tee configure.out. I have never seen that done and I am interested in what that does. I am guessing the second part is outputing the information form the command to a file. but not sure what 2>&1 does.
 
Old 10-18-2006, 03:07 PM   #6
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Just looked around and found out that 2>&1 means to take stderr should go to the sameplace as stdout
 
Old 10-18-2006, 03:09 PM   #7
GTrax
Member
 
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 214

Original Poster
Rep: Reputation: 33
Thanks haertig
I had figured the use of the | piping operator.
Also the > redirection operator. I never met "tee" before.
If a ./configure indicates problems *before* you even get around to "make", I take it you use configure.out to let you know what needs to be cleaned up.
 
Old 10-18-2006, 03:12 PM   #8
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Same here. It is sort of like cat. Thanks for the nice lesson haertig. Always wanted something to that effect but could neve come up with a solution such as that.
 
Old 10-18-2006, 03:19 PM   #9
GTrax
Member
 
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 214

Original Poster
Rep: Reputation: 33
Do you all ignore long lists of compiler errors, so long as you don't see the word "fatal"? There are hundreds of complaints like
" error: expected primary-expression before 'unsigned' "
and..
"error: ISO C++ forbids declaration of 'Display' with no type. "

None of it seems to have stopped it :| ??
 
Old 10-18-2006, 03:27 PM   #10
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
I normally don't. If I see an error I try to fix it. It is better to fix it now then later.
 
Old 10-18-2006, 04:53 PM   #11
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,160

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
Quote:
Originally Posted by GTrax
Do you all ignore long lists of compiler errors...
Errors stop the compile, so you really can't ignore them. Warnings do not stop the compile ... it will continue on.

I ignore warnings in other peoples code. Usually you'll see a bazillion of those and you'd pull your hair out trying to trace them all down. Usually they are meaningless in the big scheme of things, but if you find strange behavior in the resulting executable you might be able to track that down to a warning issued during the compile phase.

I investigate warnings in code I've written myself.
 
Old 10-18-2006, 05:03 PM   #12
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,160

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
Quote:
Originally Posted by GTrax
If a ./configure indicates problems *before* you even get around to "make", I take it you use configure.out to let you know what needs to be cleaned up.
"configure" usually just looks at what's installed (or missing) from your system and them generates an appropriate Makefile (maybe a bit of ancillary stuff too). So there's not much worth cleaning up after running into configure problems.

If you really want to clean up things after you've done your make install, just delete the entire source code tree! There should not be anything under the source directory that would be needed for day-to-day operation. Of course, some developer could write a really bad Makefile that leaves dependencies under the source tree. But they'd have to be pretty brain-damaged to do that. I can't say I've ever run into this abberation personally.
 
Old 10-19-2006, 07:48 AM   #13
GTrax
Member
 
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 214

Original Poster
Rep: Reputation: 33
The directory containing the package sources, makefiles, etc, I understand, can be put anywhere convenient (like user's home directory, or desktop) while it does it's work, and can be deleted after. But all the files it has created and put in places like /etc/ and /usr/bin might have to be chased down and deleted separately.

..unless maybe if one persists with the compile, figuring out what it needs, and finally get it error free at the end of "make install", knowing that all these resulting files have been re-written, (overwritten), fixed up; however many re-tries it took. That was the essence of my original question.

I do also wonder if attempting a compile from a user's home directory instead of being logged on as root would prevent files being written someplaces because of lack of permissions. Being root while meddling learning compiling feels kinda risky!

SimGear-0.3.10 seems quite broken, and at my present stage of using Linux, may be more than I can fix right now.
 
Old 10-19-2006, 08:04 AM   #14
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,160

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
Are you seeing errors during the "make install" part? Usually the errors come during the regular "make" part. The "iinstall" part typically just copies a few files to their final destinations. You don't generally expect this part to fail.

It is often recommended to run everything prior to "make install" as a normal user, and then switch to root right before the "make install". Sometimes you need to use the "fakeroot" program for the earlier "make" steps however. I have seen a program that required root prior to the "make install". Rare, and probably indicates a poor job by the developer on the Makefile.

You can always just edit the Makefile, look for the install section, and see what it's copying to where. Larger programs will have Makefiles that call other Makefiles, so you'll have to chain through them when you're looking. Locations may also be found in the configure script sometimes.
 
Old 10-19-2006, 08:10 AM   #15
odd2k
Member
 
Registered: Oct 2006
Distribution: Slackware-11.0
Posts: 35

Rep: Reputation: 15
Quote:
Originally Posted by haertig
It is often recommended to run everything prior to "make install" as a normal user, and then switch to root right before the "make install". Sometimes you need to use the "fakeroot" program for the earlier "make" steps however. I have seen a program that required root prior to the "make install". Rare, and probably indicates a poor job by the developer on the Makefile.
If I understand this correctly, the "make" step should normally not operate outside the source directory. And because the user normally has full access to said directory, he shouldn't need to be root until he actually calls make install to copy everything out from the source directory on the other parts of the disk. Correct?
 
  


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
First basic question? DBolan Linux - Newbie 5 04-29-2005 02:52 PM
Basic C++ question oulevon Programming 1 02-16-2005 05:55 PM
A really basic question jimscafe Debian 14 01-09-2004 06:44 PM
A really basic question pilotgi Linux - Newbie 10 10-14-2002 04:57 PM
Very Basic Question Terri Linux - Newbie 6 10-17-2001 01:31 AM


All times are GMT -5. The time now is 11:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration