Created
March 29, 2015 13:26
-
-
Save jcsaaddupuy/222675081127b26a92e3 to your computer and use it in GitHub Desktop.
Install boost + libtorrent in a virtualenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
get_boost(){ | |
wget -c "http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.gz" | |
[ $? -ne 0 ] && exit 1 | |
tar xf boost_1_57_0.tar.gz | |
[ $? -ne 0 ] && exit 1 | |
pushd ./boost_1_57_0 | |
[ $? -ne 0 ] && exit 1 | |
./bootstrap.sh --with-python=$(which python) --prefix=$VIRTUAL_ENV | |
[ $? -ne 0 ] && exit 1 | |
./b2 --prefix=$VIRTUAL_ENV | |
[ $? -ne 0 ] && exit 1 | |
./b2 --prefix=$VIRTUAL_ENV install | |
[ $? -ne 0 ] && exit 1 | |
popd | |
} | |
get_libtorrent(){ | |
wget -c "http://downloads.sourceforge.net/project/libtorrent/libtorrent/libtorrent-rasterbar-1.0.3.tar.gz" | |
[ $? -ne 0 ] && exit 1 | |
tar xf libtorrent-rasterbar-1.0.3.tar.gz | |
[ $? -ne 0 ] && exit 1 | |
pushd ./libtorrent-rasterbar-1.0.3 | |
[ $? -ne 0 ] && exit 1 | |
# see https://github.com/OpenBazaar/OpenBazaar/issues/1017#issuecomment-66898889 | |
./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --enable-encryption --prefix=$VIRTUAL_ENV --with-boost=$VIRTUAL_ENV --enable-python-binding --with-libiconv --with-boost-python=mt PYTHON=python PYTHON_LDFLAGS="$(python2-config --libs)" BOOST_ROOT=../boost_1_57_0 | |
[ $? -ne 0 ] && exit 1 | |
make && make install | |
[ $? -ne 0 ] && exit 1 | |
python setup.py build | |
[ $? -ne 0 ] && exit 1 | |
python setup.py install | |
[ $? -ne 0 ] && exit 1 | |
popd | |
export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib | |
python -c 'import libtorrent as lt' || echo 'Fail'; exit 1 | |
echo 'export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib' >> $VIRTUAL_ENV/bin/postactivate | |
} | |
get_boost | |
get_libtorrent | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On low mempry system :
ubuntu 14.04 pre-requisites