Installing ipython with stuff without root
MY_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $MY_PATH/install/bin/thisroot.sh
export LD_LIBRARY_PATH=$MY_PATH/install/lib/:$LD_LIBRARY_PATH
source $MY_PATH/ipython/bin/activate
############################ CUDA #######################
sudo apt-get install nvidia-cuda-toolkit
CUDA_ROOT=/usr/local/cuda pip install pycuda
# with opnegl:
pip install pyopengl
cat > ~/.aksetup-defaults.py <<EOF
BOOST_INC_DIR = []
BOOST_LIB_DIR = []
BOOST_COMPILER = 'gcc43'
USE_SHIPPED_BOOST = True
BOOST_PYTHON_LIBNAME = ['boost_python-py27']
BOOST_THREAD_LIBNAME = ['boost_thread']
CUDA_TRACE = False
CUDA_ROOT = '/usr/local/cuda'
CUDA_ENABLE_GL = True
CUDA_ENABLE_CURAND = True
CUDADRV_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib64']
CUDADRV_LIBNAME = ['cuda']
CUDART_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib64']
CUDART_LIBNAME = ['cudart']
CURAND_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib64']
CURAND_LIBNAME = ['curand']
CXXFLAGS = []
LDFLAGS = []
EOF
pip install pycuda
rm ~/.aksetup-defaults.py
######################## BaseMap #######################
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
tar xvvf geos-3.4.2.tar.bz2
cd geos-3.4.2/
./configure --prefix=$INSTALLDIR
make
make install
GEOS_DIR=$INSTALLDIR pip install basemap --allow-external basemap --allow-unverified basemap
pip install Pillow
cd $DISTDIR
wget http://geant4.cern.ch/support/source/geant4.10.00.p01.tar.gz
wget http://sourceforge.net/projects/boost/files/latest/download?source=files -O boost.tar.gz
tar xvvf geant4.10.00.p01.tar.gz
tar xvvf boost.tar.gz
cd $DISTDIR/boost*
. bootstrap.sh --prefix=$INSTALLDIR
./b2
./b2 install
cd $DISTDIR/geant4.10.00.p01
mkdir build
cd build
#Enable opengl
cmake -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLDIR -DGEANT4_INSTALL_DATA=ON ..
make -j8
make install
cd $INSTALLDIR
ln -s lib lib64
cd $DISTDIR/geant4.10.00.p01/environments/g4py
mkdir build && cd build
GEANT4_INSTALL=$INSTALLDIR cmake \
-DBoost_INCLUDE_DIR:PATH=$INSTALLDIR/include \
-DPYTHON_EXECUTABLE:FILEPATH=$BASEDIR/ipython/bin/python \
-DPYTHON_INCLUDE_DIR:PATH=$INSTALLDIR/include/python2.7/ \
-DPYTHON_LIBRARY:FILEPATH=$INSTALLDIR/lib/libpython2.7.so \
-DROOT_CONFIG_EXECUTABLE:FILEPATH=$INSTALLDIR/bin ..
# remove IsGeneric from
# g4py/source/geometry/pyG4Polycone.cc
make && make install
# Forgets to copy cp ./source/geometry/G4geometry.so $BASEDIR/ipython/lib/Geant4
cd $BASEDIR/ipython/lib/python2.7/site-packages
ln -s $BASEDIR/ipython/lib/Geant4 Geant4
# sudo apt-get install gfortran
cd $DISTDIR
git clone git://github.com/xianyi/OpenBLAS
cd OpenBLAS && make FC=gfortran
make PREFIX=$INSTALLDIR install
cd $DISTDIR
mkdir numpy
pip install -d numpy numpy
cd numpy
tar xvvf numpy-*.tar.gz
cd numpy-*
cat > site.cfg <<EOF
[default]
library_dirs= $INSTALLDIR/lib/
[openblas]
libraries = openblas
library_dirs = $INSTALLDIR/lib
include_dirs = $INSTALLDIR/include
EOF
python setup.py install
pip install scipy
mkdir distribs
mkdir install
export BASEDIR=$PWD
export DISTDIR=$BASEDIR/distribs
export INSTALLDIR=$BASEDIR/install
cd $DISTDIR
wget https://sqlite.org/2014/sqlite-autoconf-3080403.tar.gz
wget http://download.zeromq.org/zeromq-4.0.3.tar.gz
wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
wget --no-check-certificate https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.tar.gz
wget ftp://root.cern.ch/root/root_v5.34.18.source.tar.gz
for f in `ls *.tar.gz`
do
tar xvvf $f
done
tar xvvf Python-2.7.6.tgz
cd $DISTDIR/sqlite-autoconf-*
./configure --prefix=$INSTALLDIR
make && make install
cd $DISTDIR/zeromq-*
./configure --prefix=$INSTALLDIR
make && make install
# yum install openssl-devel
# apt-get install libssl-dev zlib libbz2-dev
cd $DISTDIR/Python-2.7.6/
./configure CXXFLAGS="-I$INSTALLDIR/include" --prefix=$INSTALLDIR --enable-shared --enable-unicode=ucs4
make && make install
# yum install xorg-x11-server-devel gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel
# sudo apt-get install xorg-dev libxft-dev libxpm-dev
cd $INSTALLDIR/lib
ln -s libpython2.7.so libpython.so
cd $DISTDIR/root
mkdir -p $INSTALLDIR/opt
./build/unix/installXrootd.sh $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-3.2.7/include/xrootd --with-xrootd-libdir=$INSTALLDIR/opt/xrootd-3.2.7/lib
# freetype issues => change include <freetype/freetype.h> to just <freetype.h>
# in the graf2d/asimage/src/libAfterImage/asfont.c
make && make install
cd $BASEDIR
cp $DISTDIR/virtualenv-1.9/virtualenv.py .
LD_LIBRARY_PATH=$INSTALLDIR/lib/ $INSTALLDIR/bin/python virtualenv.py --python=$INSTALLDIR/bin/python ipython
cd $BASEDIR
cat > env.sh << "EOF"
MY_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $MY_PATH/install/bin/thisroot.sh
source $MY_PATH/ipython/bin/activate
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MY_PATH/install/lib
EOF
. env.sh
pip install pyzmq --install-option="--zmq=$INSTALLDIR"
CPPFLAGS="-I$INSTALLDIR/include" pip install pysqlite
pip install ipython[all]