LinuxQuestions.org
Review your favorite Linux distribution.
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 07-21-2015, 12:22 PM   #1
rpittala
Member
 
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102
Blog Entries: 1

Rep: Reputation: Disabled
Question 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 ?
 
Old 07-21-2015, 12:33 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,891
Blog Entries: 13

Rep: Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944
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.
Old 07-22-2015, 12:28 AM   #3
rpittala
Member
 
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
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.
 
Old 07-23-2015, 01:25 AM   #4
rpittala
Member
 
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
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.
 
Old 07-26-2015, 02:43 PM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
There's a gcc cache thing that does that stuff.

Package ccache in debian.
 
1 members found this post helpful.
Old 08-12-2015, 02:33 AM   #6
rpittala
Member
 
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
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
Quote:
Makefile -T
 
Old 08-12-2015, 07:23 AM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,891
Blog Entries: 13

Rep: Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944Reputation: 4944
Sounds odd. Firstly because there is no command such as:
Code:
Makefile -T
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:
Code:
make -t <makefile>
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.
 
Old 08-13-2015, 12:11 AM   #8
rpittala
Member
 
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102

Original Poster
Blog Entries: 1

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


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
Reduce waiting time voda22 Linux - Server 2 11-27-2012 09:25 AM
UDEV takes more time to execute at boot up time.Can anyboby help me to reduce dis tim pabansal Linux - General 3 09-30-2011 06:45 AM
how to reduce time of git pulling each time when you do a make world on Xen sourc tkmsr Linux - Virtualization and Cloud 4 03-07-2011 11:09 AM
Running two files at the same time wjs1990 Linux - Newbie 2 02-20-2010 01:09 AM
how to reduce boot time raghuvamsi Linux - General 4 06-05-2008 01:40 PM

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

All times are GMT -5. The time now is 09:33 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
Open Source Consulting | Domain Registration