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.
|
|
07-21-2015, 12:22 PM
|
#1
|
Member
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102
Rep:
|
How to reduce the compilation time while re-running most of the same files ?
Hi all,
while running a make file or build, a number of files are generated(lets say from a tool) and placed into /Rajesh/path/code/ If the user then modifies an aspect of the files and are overwritten by the newly created files. As a result, the timestamps on all of the files are updated, leading to each of the files being recompiled. This results in both longer than necessary compile times, as well as issues with the size of the database to store all of the derived objects.This causes a complete rebuild of everything again.
how to avoid recompiling of the all the files, if the make file is looking at the time stamp of the each file even though the most of the code files are not modified at all ?
|
|
|
07-21-2015, 12:33 PM
|
#2
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,891
|
I think it's best if you provide a sample of your Makefile, or even a representative example. If the derived files depend on some single file and that file gets updated, then the derived files need to be re-generated. Or if the derived files would rarely change, then you need to maybe set up a specific make target just for causing the derived files to be constructed and maybe have one key file cause that object to be updated. There are ways to control this, but you've not really identified the problem well enough. Can you post your Makefile and cite what file you change and how it causes a full compile against your wishes?
|
|
1 members found this post helpful.
|
07-22-2015, 12:28 AM
|
#3
|
Member
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102
Original Poster
Rep:
|
My make file depends on other files for different options and rules.
As you said,"if the derived files would rarely change, then you need to maybe set up a specific make target just for causing the derived files to be constructed and maybe have one key file cause that object to be updated. There are ways to control this."
The above statement will help me to resolve the issue. Could you pls help me with an example of ways to control by setting up a make target.
Last edited by rpittala; 07-22-2015 at 12:39 AM.
|
|
|
07-23-2015, 01:25 AM
|
#4
|
Member
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102
Original Poster
Rep:
|
I had copied the files by preserving the time stamp (cp -p *.[cho] /var/tmp/) and re-copied the files to the same location from where the files were compiling.
The .o files are over written every time(which means the files are compiling) instead of skipping the compilation W.R.T the .c and .o files and consuming the same amount of time.
Last edited by rpittala; 07-23-2015 at 01:44 AM.
|
|
|
07-26-2015, 02:43 PM
|
#5
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
There's a gcc cache thing that does that stuff.
Package ccache in debian.
|
|
1 members found this post helpful.
|
08-12-2015, 02:33 AM
|
#6
|
Member
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102
Original Poster
Rep:
|
Thanks for the reply`s.
I have resolved it by going through my make files.
In general, as per the standards a Make file should look for the time stamps. But, there are certain Make files which look for the configuration records instead of time stamps and so is in my case.
So, the challenge here is to ignore the above condition by enabling some time stamp specific options. In my code, I have enabled it by running a Make file as
|
|
|
08-12-2015, 07:23 AM
|
#7
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,891
|
Sounds odd. Firstly because there is no command such as: But instead there is a command option for GNU Make known as -t which will touch all your files and force them to be remade: Sounds like that's what you did.
As stated before, if you posted the Makefile, then people would've looked at it and offered assistance developing rules and dependencies. Or perhaps you're not using standard GNU Make.
Sounds like you're happy with the outcome however, so best of luck.
|
|
|
08-13-2015, 12:11 AM
|
#8
|
Member
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102
Original Poster
Rep:
|
Hi rtmistler,
Yes, you were right.
I agree with the points mentioned by you. Yes, it is not a GNU make and it is IBM make file.
I thought of sharing the make file. But, in my investigations I found that the make file is looking for config records ..etc.,
But, as per the standard make files. A make file should look for the time stamp (as it is in GNU make) and surprised to see that the way IBM make file is looking at it by default.
|
|
|
All times are GMT -5. The time now is 09:33 AM.
|
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
|
|