Subject: Re: boost-libs compilation takes *extremely* long
To: Julio M. Merino Vidal <jmmv84@gmail.com>
From: Rhialto <rhialto@falu.nl>
List: tech-pkg
Date: 10/03/2005 01:34:39
On Thu 29 Sep 2005 at 21:30:03 +0200, Julio M. Merino Vidal wrote:
> On 9/29/05, Rhialto <rhialto@falu.nl> wrote:
> > I updated to the pkgsrc-2005Q3 branch, and started to rebuild stuff.
> > While doing devel/boost-libs, I get to
> >
> > gcc-C++-action /pkg_comp/obj/pkgsrc/devel/boost-libs/default/boost_1_33_0/build/bin/boost/libs/wave/build/libboost_wave.a/gcc/release/threading-multi/instantiate_cpp_literalgrs.o
> > load: 2.32  cmd: cc1plus 24750 [runnable] 4253.66u 3.65s 97% 213308k
> >
> > and this is already taking over 4200 cpu seconds on my amd64 cpu.
> > This is a bit ridiculous, isn't it?
> > I'm using the system gcc that comes with 2.0.2 (amd64 as I said).
> > The boost version from the previous branch did not have this problem.
> >
> > Any ideas?
> 
> How much ram/swap do you have?  Is the machine swapping?
> Try building with -O0 in CFLAGS/CXXFLAGS to see if it helps.

No, it isn't swapping. I have 1GB of RAM, and according to the ^T status
line, the compiler uses 213308 KB of memory, which grows very slowly.
I'll try adding -O0 (somewhere, I'm not sure if the build tool "bjam"
will respect CXXFLAGS) to see what happens.

I can add that I built the same version of boost on a couple of linux
machines (without pkgsrc, using the manual instructions, and they were
32-bits) and there the built finished.  At least one had gcc 3.3.4 (the
base system has 3.3.3). I can try perhaps if I can compile mine with
that version too, I have built it anyway because firefox (I think)
wanted it.

[ some time later ]

Here is the g++ command line from NetBSD:

/usr/bin/g++ -c -Wall -ftemplate-depth-255 -DNDEBUG -O3 -finline-functions -Wno-inline -pthread -I/pkg_comp/obj/pkgsrc/devel/boost-libs/default/boost_1_33_0/build/bin/boost/libs/wave/build -I/pkg_comp/obj/pkgsrc/devel/boost-libs/default/boost_1_33_0 -o /pkg_comp/obj/pkgsrc/devel/boost-libs/default/boost_1_33_0/build/bin/boost/libs/wave/build/libboost_wave.a/gcc/release/threading-multi/instantiate_cpp_literalgrs.o /pkg_comp/obj/pkgsrc/devel/boost-libs/default/boost_1_33_0/libs/wave/build/../src/instantiate_cpp_literalgrs.cpp -I/pkg_comp/obj/pkgsrc/devel/boost-libs/default/.buildlink/include -L/pkg_comp/obj/pkgsrc/devel/boost-libs/default/.buildlink/lib

and here it is from Linux:

g++ -c -Wall -ftemplate-depth-255 -g -O0 -fno-inline -Ibin/boost/libs/wave/build -I/vol1/olafs/distfiles/boost_1_33_0 -I /vol1/olafs/distfiles/boost_1_33_0 -o bin/boost/libs/wave/build/libboost_wave.a/gcc/debug/instantiate_cpp_literalgrs.o /vol1/olafs/distfiles/boost_1_33_0/libs/wave/build/../src/instantiate_cpp_literalgrs.cpp

Note that it has "-O0 -fno-inline" as opposed to "-O3 -finline-functions"...
and it takes just a couple of minutes.

Making the same change to the NetBSD command line does not help.
However, also using /usr/pkg/gcc34/bin/g++ makes the command finish in
less than 10 seconds (which now seems to be suspiciously fast...)

So then I tried adding GCC_REQD += 3.4 to the Makefile, and lo and
behold, now everything compiled in reasonable time.

It seems that ../../meta-pkgs/boost/Makefile.common already has
GCC_REQD = 3.2, so I suppose that it can just be changed.

I would consider this just a workaround, since gcc34 is a rather heavy
dependency...

> Julio M. Merino Vidal <jmmv84@gmail.com>
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl        -- Cetero censeo "authored" delendum esse.