-9

I want to time how long it takes to compile the latest version of Red Hat Enterprise Linux 6. I have downloaded the SRPMs from the Red Hat's FTP server.

How do I time how long it takes to compile all of the packages?

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67
  • Having read the comments below I see no relation to the scope of serverfault. Please read our [faq]. – user9517 Apr 06 '12 at 17:16

2 Answers2

5

I'm not going to blow up my workstation for days on end by testing this, but given a directory of SRPMS I don't see why this wouldn't work:

time (for RPM in $(ls *.srpm); do rpmbuild --rebuild $RPM; done)

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67
  • 1
    `ls *.rpm` might exceed max. length of the input. I'd suggest `time find $BASEDIR -type f -name '*.srpm' -exec rpmbuild --rebuild {} \;` – Martin M. May 15 '14 at 20:25
4

Create a build environment and and set up a long chain of rpmbuild --rebuild packagename.srpm commands...

But the better* approach is to simply go to CentOS.org. Download the ISO images for the current release from a local mirror server.

*Assuming you're not modifying any packages.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • Ok but I want to compile the code for testing. When I download the source code from Red Hat or Centos how I can compile it? – Peter Penzov Apr 06 '12 at 15:19
  • `rpmbuild --rebuild packagename.srpm` – ewwhite Apr 06 '12 at 15:20
  • This is only for one package. There are 3000+ packages. I cannot do this every time. – Peter Penzov Apr 06 '12 at 15:23
  • @PeterPenzov Shell script. – Jeff Ferland Apr 06 '12 at 15:27
  • 3
    There's no reason to compile your own version of the operating system. CentOS is available in pre-compiled form. The build process involved with compiling the entire OS is involved and requires a lot of space and CPU time to accomplish. Why would you want to do this? – ewwhite Apr 06 '12 at 15:27
  • I want to make a stress test on 4 CPU server – Peter Penzov Apr 06 '12 at 15:28
  • 4
    If you're looking to test CPU utilization on a machine or generate an artificial load, download the `stress` utility as detailed here: http://serverfault.com/a/209894/13325 – ewwhite Apr 06 '12 at 15:30
  • 4
    @PeterPenzov For future reference, your question is how to generate CPU load on a system, not how to compile Red Hat from source. You'll get to the easiest solution the quickest if you just stick to the original problem. – Aaron Copley Apr 06 '12 at 15:44
  • My point is different. I'm working on university project with Linux. I need to measure how long it will take to compile Linux. – Peter Penzov Apr 06 '12 at 15:47
  • What do you mean by "Linux"? Compiling the kernel is a different matter than compiling all the packages in a major commercial distribution. And, to find out how long it takes to do the latter, it's probably easier for everyone just to ask the CentOS or Scientific Linux guys. – cjc Apr 06 '12 at 15:50
  • Would you be so king to keep a focus on the question. – Peter Penzov Apr 06 '12 at 15:54
  • 1
    He is focusing on the question, specifically, trying to figure out why you'd want to do this. Don't be rude. – ceejayoz Apr 06 '12 at 16:09
  • 4
    @PeterPenzov You're not providing us the full details. We're trying to focus on your question, but it feels like a moving target at the moment. You should edit your original question posting to provide as much detail as you can. – Jeff Ferland Apr 06 '12 at 16:10