Author Topic: [Solved] How to put make -j2  (Read 502 times)

Offline tele

  • Full Member
  • ***
  • Posts: 197
[Solved] How to put make -j2
« on: October 19, 2012, 07:28:24 AM »
How to put make -j2 in

Quote
#%{?_smp_mflags} - corresponds to an option -j -build multiprocessor
%make %{?_smp_mflags}
« Last Edit: October 24, 2012, 12:54:19 PM by tele »
---
Sorry, if my language is wrong,
you please write notice where I do mistakes, I will try to learn.

Online TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 732
Re: How to put make -j2
« Reply #1 on: October 19, 2012, 07:55:23 AM »
The _smp_mflags macro will expand to -j2 on a dual processor system.

So if you put:
Code: [Select]
make %{?_smp_mflags}
in the %build section of the SPEC file it will expand to make -j2 on a dual processor system

Code: [Select]
[terry@dell ~]$ rpm -E "make %{?_smp_mflags}"
make -j2

Also the %make macro already includes reference to _smp_mflags so just putting %make in the SPEC file will include the -j option on multiprocessor systems.

Code: [Select]
[terry@dell ~]$ rpm -E "%make"
make -j2

Terry.
« Last Edit: October 19, 2012, 08:00:42 AM by TerryN »
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline tele

  • Full Member
  • ***
  • Posts: 197
Re: How to put make -j2
« Reply #2 on: October 20, 2012, 12:19:09 AM »
Quote
macro will expand to -j2 on a dual processor system.
Not for Kadu software
in Kadu this is work  make -jx + number cores , where x=1 and  one core = 1, two cores=2 , tree cores =3 , etc.
so  1+1= 2 ,
so  make -j2 and this is for  only one  processor system - this is from manual Kadu
I don't know why this is work , I do not know if this is correct.

But thanks, now I know for what %{?_smp_mflags} this is and how to put.
« Last Edit: October 20, 2012, 05:56:51 AM by tele »
---
Sorry, if my language is wrong,
you please write notice where I do mistakes, I will try to learn.

Online TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 732
Re: How to put make -j2
« Reply #3 on: October 20, 2012, 11:43:35 AM »
I don't know why this is work , I do not know if this is correct.

The -j option to make specifies the number of jobs to run simultaneously during the build.  You can set it to anything you like.  The only effect it has is on how long the build will take.  It makes sense to set it to at least the number of processors and that is what the RPM macros do.  It is debatable whether setting it higher makes any significant improvement to build speed.   Since our SRPMS need to build efficiently on any packager's machine it is better to stick with the RPM defaults.

Terry.
« Last Edit: October 20, 2012, 11:50:15 AM by TerryN »
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|