Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost 1.59.0 how do I clean the project?

Tags:

c++

boost

I built the project once, so it generated a bunch of .o and .a files. Now, I am trying to clean it.

This page: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html tells me that b2 --clean-all or b2 clean should work.

However, I tried:

  b2 clean
  b2 --clean
  b2 --clean-all

None of them seem to do anything. How do I clean the boost workspace?

like image 275
thang Avatar asked Aug 19 '15 10:08

thang


2 Answers

If use -n together with --clean-all, to report the commands it would run, like:

b2 --clean-all -n

Then I do see things cleaned as usual. Same with --clean. Maybe, you're confused by the fact that configuration is printed even with --clean? That's expected, since the things to build and clean depend on configuration tests.

like image 101
Vladimir Prus Avatar answered Nov 17 '22 11:11

Vladimir Prus


I usually build with --build-dir=/tmp/build-boost. On my system /tmp/ is mounted as tmpfs (so that when I reboot, the temporary files are gone anyways).

For this reason, I wager, you could simply look at the default value for --build-dir and remove that folder:

  --build-dir=DIR         Build in this location instead of building within
                          the distribution tree. Recommended!

Regardless of this, cleaning is not required for consistent (re)builds.

A simple trial run shows that the temporaries are created in ./bin.v2/libs/ (at least on my box). You can see for yourself e.g.

ommon.mkdir bin.v2/libs/filesystem
common.mkdir bin.v2/libs/filesystem/build
common.mkdir bin.v2/libs/filesystem/build/gcc-4.9.2
common.mkdir bin.v2/libs/filesystem/build/gcc-4.9.2/release
common.mkdir bin.v2/libs/filesystem/build/gcc-4.9.2/release/threading-multi
gcc.compile.c++ bin.v2/libs/filesystem/build/gcc-4.9.2/release/threading-multi/codecvt_error_category.o

Notes

  • --clean-all did remove those object files for me
  • using --build-dir=/somewhere/else indeed didn't create these object files in-tree (but still creates stage/lib/ obviously):

    common.mkdir /somewhere/else/boost/bin.v2/libs/filesystem
    common.mkdir /somewhere/else/boost/bin.v2/libs/filesystem/build
    common.mkdir /somewhere/else/boost/bin.v2/libs/filesystem/build/gcc-4.9.2
    common.mkdir /somewhere/else/boost/bin.v2/libs/filesystem/build/gcc-4.9.2/release
    common.mkdir /somewhere/else/boost/bin.v2/libs/filesystem/build/gcc-4.9.2/release/threading-multi
    gcc.compile.c++ /somewhere/else/boost/bin.v2/libs/filesystem/build/gcc-4.9.2/release/threading-multi/codecvt_error_category.o
    
like image 29
sehe Avatar answered Nov 17 '22 09:11

sehe