Igor Oks Igor Oks - 2 months ago 4x
Linux Question

How to install boost on Linux with custom location of gcc?

My gcc compiler is at a custom location /my/path/hpgcc

I've downloaded the boost sources. Executed bootstrap.sh, but it fails because it runs with the default gcc.

Looking into it, I see that it fails at the first thing it does: building the Boost.Build engine:

gcc -o bootstrap/jam0 command.c compile.c debug.c expand.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c

(fails because executed with the default gcc, and not my gcc version).

I've tried to change the gcc path in the user-config.jam file, but it doesn't help. Probably because the Boost.Build's build script boost_1_47_0/tools/build/v2/engine/build.sh doesn't use user-config.jam, and just uses the default locations.

Any solution?


Add the line:

using gcc : : /my/path/hpgcc ;

to user-config.jam. user-config.jam will usually be in /path/to/boost/tools/build/v2/, but you can put a custom user-config.jam or site-config.jam in any of the places listed here.

/my/path/hpgcc should be the full path to the g++ executable.

EDIT (Igor Oks) : What eventually solved the problem is that I edited boost_1_47_0/tools/build/v2/engine/build.sh to make it use my custom gcc.