Last active
July 16, 2016 14:16
-
-
Save KKostya/beaf62a91c4cec0cc782 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
BASEDIR=$PWD | |
sudo apt-get update | |
sudo apt-get install build-essential g++ git libssl-dev libbz2-dev libncurses5-dev libyaml-dev make | |
sudo apt-get install libpng++-dev libfreetype6-dev pkg-config | |
mkdir -p install | |
mkdir -p sources | |
export INSTALLDIR=$(readlink -f install) | |
export SOURCESDIR=$(readlink -f sources) | |
cd $SOURCESDIR | |
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz | |
wget http://download.zeromq.org/zeromq-4.1.4.tar.gz | |
wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-13.1.2.tar.gz | |
wget https://www.sqlite.org/2015/sqlite-autoconf-3090200.tar.gz | |
wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.21.tar.gz | |
git clone https://github.com/xianyi/OpenBLAS.git | |
git clone http://root.cern.ch/git/root.git | |
cd root | |
git checkout -b v6-06-00 v6-06-00 | |
cd .. | |
cd .. | |
cd $SOURCESDIR | |
for f in $(ls *.tar.gz) | |
do | |
tar xvvf $f | |
done | |
tar xvvf Python-*.tgz | |
cd $SOURCESDIR/sqlite-autoconf-* | |
./configure --prefix=$INSTALLDIR | |
make && make install | |
cd $SOURCESDIR/zeromq-* | |
./configure --prefix=$INSTALLDIR --without-libsodium | |
make && make install | |
cd $SOURCESDIR/libpng-* | |
./configure --prefix=$INSTALLDIR | |
make && make install | |
cd $SOURCESDIR/Python-*/ | |
./configure CXXFLAGS="-I$INSTALLDIR/include" --prefix=$INSTALLDIR --enable-unicode=ucs4 --enable-shared | |
# The fix for linking in the local shared library | |
sed -i.bak -e 's|/usr/local/lib|/|' -e 's|/usr/local/include|/|' setup.py | |
make && make install | |
#cd $SOURCESDIR/root | |
# mkdir -p $INSTALLDIR/opt | |
# ./build/unix/installXrootd.sh -v 4.1.1 $INSTALLDIR/opt | |
# ./configure --with-python-incdir=$INSTALLDIR/include/python2.7/ --with-python-libdir=$INSTALLDIR/lib --prefix=$INSTALLDIR --etcdir=$INSTALLDIR/etc --with-xrootd-incdir=$INSTALLDIR/opt/xrootd-4.1.1/include/xrootd --with-xrootd-libdir=$INSTALLDIR/opt/xrootd-4.1.1/lib | |
# make | |
# LD_LIBRARY_PATH=$INSTALLDIR/lib/ make install | |
#cd .. | |
cd $SOURCESDIR/virtualenv-*/ | |
LD_LIBRARY_PATH=$INSTALLDIR/lib/ $INSTALLDIR/bin/python setup.py install --prefix=$INSTALLDIR | |
cd $BASEDIR | |
PATH=$INSTALLDIR/bin:$PATH LD_LIBRARY_PATH=$INSTALLDIR/lib/ $INSTALLDIR/bin/virtualenv --python=$INSTALLDIR/bin/python ipython | |
cd $BASEDIR | |
PATH=$INSTALLDIR/bin:$PATH LD_LIBRARY_PATH=$INSTALLDIR/lib/ $INSTALLDIR/bin/virtualenv --python=$INSTALLDIR/bin/python ipython | |
cat > env.sh << "EOF" | |
MY_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
source $MY_PATH/ipython/bin/activate | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MY_PATH/install/lib | |
EOF | |
source env.sh | |
pip install --upgrade pip | |
pip install pyzmq --install-option="--zmq=$INSTALLDIR" | |
CPPFLAGS="-I$INSTALLDIR/include" pip install pysqlite | |
pip install ipython[all] | |
pip install numpy | |
pip install matplotlib |
This file contains hidden or 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
import serpent | |
import ethereum.tester | |
serpent_code = """ | |
def multiply(x): | |
return 2*x | |
""" | |
eState = ethereum.tester.state() | |
contract = eState.abi_contract(serpent_code) | |
contract.multiply(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment