This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Enable parallel build gcc on Linux


I have a shell script to enable parallel build on Linux:

--
numprocs=$(/usr/bin/getconf _NPROCESSORS_ONLN)
cat <<EOF > makefile
MAKE=make -j `expr ${numprocs} + ${numprocs}`
include Makefile
CFLAGS:=\$(CFLAGS) -pipe
CXXFLAGS:=\$(CXXFLAGS) -pipe
EOF
---

You should run it in your build directory. It exposed out many parallel
build bugs in the gcc source tree, especially on SMP machines with
enough RAM. In my case, they are quad-Xeon with 4GB RAM and dual-Xeon
with 512MB RAM.


-- 
H.J. Lu (hjl@gnu.org)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]