Is there anyway to use all 4 cores on my quad core during compilation? It appears I am only using 1 core. I am hoping there is a flag I can pass to the makefile.
Alternatively, I could probably break the makefile in four different makefiles for compiling and a separate makefile for linking. From there I could execute the compile makefiles seperately and finally the link makefile when the others are done.
Has anyone tried this? I'd really like to speed up compilations, especially when doing regression testing.
Using all cores during compile
Using all cores during compile
Look at the "-j" option to the make command. It takes a numeric argument that signifies how many simultaneous jobs should be running.Is there anyway to use all 4 cores on my quad core during compilation? It appears I am only using 1 core. I am hoping there is a flag I can pass to the makefile.
ccache is another useful project that can considerably speed up compilation by caching previous compiler output:
http://ccache.samba.org/
Using all cores during compile
On Thu, Oct 13, 2011 at 21:26, jwong <[email protected]> wrote:
Also "-O0" in CFLAGS can help
You can also pass --disable-tests to ./configureIs there anyway to use all 4 cores on my quad core during compilation? It appears I am only using 1 core. I am hoping there is a flag I can pass to the makefile.
Alternatively, I could probably break the makefile in four different makefiles for compiling and a separate makefile for linking. From there I could execute the compile makefiles seperately and finally the link makefile when the others are done.
Has anyone tried this? I'd really like to speed up compilations, especially when doing regression testing.
Also "-O0" in CFLAGS can help
Re: Using all cores during compile
make -j5(one more than you physically have) and --disable-tests in the configure.jwong wrote: Has anyone tried this? I'd really like to speed up compilations, especially when doing regression testing.
handy dandy bash script I use...adjust to your needs.
Code: Select all
#! /bin/sh
CC="gcc-4.6 -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure -v --prefix=/usr --without-capi --without-cups --without-jack --without-sane --with-x --without-openal --disable-tests --without-nas --without-v4l --without-gphoto --with-opencl
make depend && make -j4
echo {your password} | sudo -S make install
Using all cores during compile
On Fri, Oct 14, 2011 at 04:39, blaiseg07 <[email protected]> wrote:
Using ccache gcc instead of gcc would help even morejwong wrote:make -j5(one more than you physically have) and --disable-tests in the configure.Has anyone tried this? I'd really like to speed up compilations, especially when doing regression testing.
handy dandy bash script I use...adjust to your needs.
Code:
#! /bin/sh
CC="gcc-4.6 -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure -v --prefix=/usr --without-capi --without-cups --without-jack --without-sane --with-x --without-openal --disable-tests --without-nas --without-v4l --without-gphoto --with-opencl
make depend && make -j4
echo {your password} | sudo -S make install