This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Enable parallel build gcc on Linux
- To: gcc at gcc dot gnu dot org
- Subject: Enable parallel build gcc on Linux
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Thu, 8 Jun 2000 00:38:32 -0700
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)