Update to build boost for python2 AND python3 cleanly

This commit is contained in:
Praveen Palanisamy 2018-11-09 18:52:33 -05:00
parent 77a12809f6
commit 2f4897a313
1 changed files with 12 additions and 1 deletions

View File

@ -86,7 +86,6 @@ else
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
log "Extracting boost." log "Extracting boost."
tar -xzf boost_1_67_0.tar.gz tar -xzf boost_1_67_0.tar.gz
rm boost_1_67_0.tar.gz
mkdir -p ${BOOST_BASENAME}-install/include mkdir -p ${BOOST_BASENAME}-install/include
mv boost_1_67_0 ${BOOST_BASENAME}-source mv boost_1_67_0 ${BOOST_BASENAME}-source
# rm -Rf boost_1_67_0 # rm -Rf boost_1_67_0
@ -98,22 +97,34 @@ else
py2="/usr/bin/env python2" py2="/usr/bin/env python2"
py2_root=`${py2} -c "import sys; print(sys.prefix)"` py2_root=`${py2} -c "import sys; print(sys.prefix)"`
pyv=`$py2 -c "import sys;x='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(x)";`
./bootstrap.sh \ ./bootstrap.sh \
--with-toolset=clang \ --with-toolset=clang \
--prefix=../boost-install \ --prefix=../boost-install \
--with-libraries=python,filesystem \ --with-libraries=python,filesystem \
--with-python=${py2} --with-python-root=${py2_root} --with-python=${py2} --with-python-root=${py2_root}
echo "using python : ${pyv} : ${py2_root}/bin/python2 ;" > ${HOME}/user-config.jam
./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} stage release ./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} stage release
./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} install ./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} install
./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} --clean-all ./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} --clean-all
# Get rid of python2 build artifacts completely & do a clean build for python3
popd >/dev/null
rm -Rf ${BOOST_BASENAME}-source
tar -xzf boost_1_67_0.tar.gz
mkdir -p ${BOOST_BASENAME}-install/include
mv boost_1_67_0 ${BOOST_BASENAME}-source
pushd ${BOOST_BASENAME}-source >/dev/null
py3="/usr/bin/env python3" py3="/usr/bin/env python3"
py3_root=`${py3} -c "import sys; print(sys.prefix)"` py3_root=`${py3} -c "import sys; print(sys.prefix)"`
pyv=`$py3 -c "import sys;x='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(x)";`
./bootstrap.sh \ ./bootstrap.sh \
--with-toolset=clang \ --with-toolset=clang \
--prefix=../boost-install \ --prefix=../boost-install \
--with-libraries=python \ --with-libraries=python \
--with-python=${py3} --with-python-root=${py3_root} --with-python=${py3} --with-python-root=${py3_root}
echo "using python : ${pyv} : ${py3_root}/bin/python3 ;" > ${HOME}/user-config.jam
./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} stage release ./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} stage release
./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} install ./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} install