#
#LFS BUGFIX: 3.7m in /usr/include not 3.7.
ln -s /usr/include/python3.7m /usr/include/python3.7
mkdir stagedir
./bootstrap.sh --with-toolset=gcc --with-icu --with-python=/usr/bin/python2
install -Dm755 tools/build/src/engine/b2 stagedir/bin/b2
# Support for OpenMPI
echo "using mpi ;" >> project-config.jam
# boostbook is needed by quickbook
install -dm755 stagedir/share/boostbook
cp -a tools/boostbook/{xsl,dtd} stagedir/share/boostbook/
# default "minimal" install: "release link=shared,static
# runtime-link=shared threading=single,multi"
# --layout=tagged will add the "-mt" suffix for multithreaded libraries
# and installs includes in /usr/include/boost.
# --layout=system no longer adds the -mt suffix for multi-threaded libs.
# install to ${_stagedir} in preparation for split packaging
stagedir/bin/b2 \
variant=release \
debug-symbols=off \
threading=multi \
runtime-link=shared \
link=shared,static \
toolset=gcc \
python=2.7 \
cflags="${CPPFLAGS} ${CFLAGS} -fPIC -O3" \
cxxflags="${CPPFLAGS} ${CXXFLAGS} -std=c++14 -fPIC -O3" \
\
--layout=system \
\
\
--prefix="$(pwd)/stagedir" \
install
# because b2 in boost 1.62.0 doesn't seem to respect python parameter, we
# need another run for liboost_python3.so
./bootstrap.sh \
--with-toolset=gcc \
--with-icu \
--with-python=/usr/bin/python3 \
--with-libraries=python
stagedir/bin/b2 clean
stagedir/bin/b2 \
variant=release \
debug-symbols=off \
threading=multi \
runtime-link=shared \
link=shared,static \
toolset=gcc \
python=3.7 \
cflags="${CPPFLAGS} ${CFLAGS} -fPIC -O3" \
cxxflags="${CPPFLAGS} ${CXXFLAGS} -std=c++14 -fPIC -O3" \
\
--layout=system \
\
\
--prefix="$(pwd)/stagedir/python3" \
--with-python \
install
#boost
cp -a stagedir/{bin,include,share} /usr
cp -a stagedir/lib/*.a /usr/lib/
cp -a stagedir/lib/cmake /usr/lib/
install -Dm644 stagedir/python3/lib/libboost_*.a /usr/lib/
cp -a stagedir/python3/lib/cmake/* /usr/lib/cmake/
ln -s /usr/bin/b2 /usr/bin/bjam
#boostlib
cp -a stagedir/lib /usr
cp -a stagedir/python3/lib/libboost_* /usr/lib
# https://github.com/boostorg/python/issues/203#issuecomment-391477685
for _lib in python numpy; do
ln -srL /usr/lib/libboost_${_lib}{27,}.so
ln -srL /usr/lib/libboost_${_lib}3{7,}.so
done
Comments:
Updated version. Instructions from Arch Linux
Bugfix: Symlink to fix python3.7 support error