-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snakemake: Build a separate version 7
Snakemake is part of the packaged python, but since the larger python upgrade is still pending, install the tool as snakemake7.
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#! /bin/bash | ||
|
||
# COOKIE=$(mcookie|cut -c-8); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 0.3; exec bash /dev/shm/runme-$COOKIE.sh | ||
# TESTING=1 | ||
|
||
PKG=snakemake | ||
VERSION=7.1.1 | ||
|
||
PYTHONVERSION=3.9.10 | ||
BUILD=0 | ||
PYTHONVER=${PYTHONVERSION%.*} | ||
|
||
PREFIX=/pkg/$PKG-$VERSION-$BUILD | ||
if [ -n "$TESTING" ]; then PREFIX=/scratch/local2/$PKG-$VERSION-$BUILD ; fi | ||
|
||
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin | ||
|
||
set -xe | ||
umask 022 | ||
|
||
BUILD_TMPDIR=/scratch/local2/$PKG-$VERSION-$BUILD.$USER.build.tmp | ||
|
||
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR ) | ||
mkdir -p $BUILD_TMPDIR/home/.cache/pip | ||
mkdir -p $BUILD_TMPDIR/home/.local | ||
export TMPDIR=$BUILD_TMPDIR | ||
export HOME=$BUILD_TMPDIR/home | ||
|
||
exec </dev/null | ||
|
||
mkdir -p $PREFIX | ||
cat >$PREFIX/profile <<-EOF | ||
PATH=$PREFIX/bin:\$PATH | ||
export LD_LIBRARY_PATH=$PREFIX/lib\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH | ||
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\${PKG_CONFIG_PATH:+:}\$PKG_CONFIG_PATH | ||
export PKG_CONFIG_PATH | ||
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi | ||
EOF | ||
. $PREFIX/profile | ||
|
||
NPROC=$(( $(nproc) * 4 / 5 + 1 )) | ||
export MAKEFLAGS="-j $NPROC" | ||
|
||
BUILDDIR=$PREFIX/build | ||
|
||
mkdir -p $BUILDDIR | ||
cd $BUILDDIR | ||
|
||
# orig: https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz | ||
BEEHIVE=https://beehive.molgen.mpg.de/1440acb71471e2394befdb30b1a958d1/Python-3.9.10.tgz | ||
test -e Python-$PYTHONVERSION.tgz || wget -nv $BEEHIVE | ||
test -d Python-$PYTHONVERSION || tar -xf Python-$PYTHONVERSION.tgz | ||
cd Python-$PYTHONVERSION | ||
|
||
LDFLAGS="-Wl,-rpath=$PREFIX/lib" \ | ||
./configure \ | ||
--prefix=$PREFIX \ | ||
--enable-shared | ||
|
||
make -j $NPROC | ||
make install | ||
|
||
# it might come to happen that something down the line may just call 'python', defuse ... | ||
test -e $PREFIX/bin/python || ln -s python3 $PREFIX/bin/python | ||
|
||
python3 -m ensurepip | ||
pip3 install --prefix=$PREFIX -I pip | ||
pip3 install --prefix=$PREFIX snakemake==$VERSION | ||
|