Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 640 lines (525 sloc) 23.2 KB
#! /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=python
VERSION=3.9.6
BUILD=0
PYTHONVER=${VERSION%.*}
CUDADIR=/pkg/cuda-11.1.1-0
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
# copy script to an accessible location
cp $0 $BUILD_TMPDIR; ME="$BUILD_TMPDIR/$(basename $0)"
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
exec </dev/null
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
. $CUDADIR/profile
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"
# bookkeeping, spots package downgrades
PIPMETADIR=$PREFIX/share/pipmeta
mkdir -p $PIPMETADIR
BUILDDIR=$PREFIX/build
mkdir -p $BUILDDIR
cd $BUILDDIR
# if false; then ######### DEBUG_BASE DEBUG_TF
# orig: https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
BEEHIVE=https://beehive.molgen.mpg.de/798b9d3e866e1906f6e32203c4c560fa/Python-3.9.6.tgz
test -e Python-$VERSION.tgz || wget -nv $BEEHIVE
test -d Python-$VERSION || tar -xf Python-$VERSION.tgz
cd Python-$VERSION
LDFLAGS="-Wl,-rpath=$PREFIX/lib" \
./configure \
--prefix=$PREFIX \
--enable-shared
make -j $NPROC
# make test # || true # 'test_socket' seems to run for ever
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
( # sip: tool to create Python bindings for C and C++ libraries., v6 is out, but not so popular at the moment
cd $BUILDDIR
SIP_VERSION=4.19.24
# orig: https://www.riverbankcomputing.com/static/Downloads/sip/$SIP_VERSION/sip-$SIP_VERSION.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/595e9ad6bb0a4b3a6ea92c163a05d19c/sip-4.19.24.tar.gz
test -e sip-$SIP_VERSION.tar.gz || wget -nv $BEEHIVE
test -d sip-$SIP_VERSION || tar -xf sip-$SIP_VERSION.tar.gz
cd sip-$SIP_VERSION
#### ATTN!
#### python meanders between /python${PYTHONVER} and /python${PYTHONVER}m
python3 configure.py \
-b $PREFIX/bin \
-d $PREFIX/lib/python$PYTHONVER/site-packages \
-e $PREFIX/include/python${PYTHONVER} \
-v $PREFIX/share/sip \
--sip-module=sip
# well, right here share/sip is spoilage, but maybe some packages will use the decent sip later on ...
mkdir -p $PREFIX/share/sip
make -j $NPROC
make install
)
( # now for the private (sic!) version required by newer PyQt
cd $BUILDDIR
SIP_VERSION=4.19.24
mkdir -p private_sip
cd private_sip
# orig: https://www.riverbankcomputing.com/static/Downloads/sip/$SIP_VERSION/sip-$SIP_VERSION.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/595e9ad6bb0a4b3a6ea92c163a05d19c/sip-4.19.24.tar.gz
test -e sip-$SIP_VERSION.tar.gz || wget -nv $BEEHIVE
test -d sip-$SIP_VERSION || tar -xf sip-$SIP_VERSION.tar.gz
cd sip-$SIP_VERSION
# note $PREFIX/share/sip/PyQt5 is mandatory
python3 configure.py \
-d $PREFIX/lib/python$PYTHONVER/site-packages \
-v $PREFIX/share/sip/PyQt5 \
--no-tools \
--sip-module=PyQt5.sip
mkdir -p $PREFIX/share/sip/PyQt5
make -j $NPROC
# The resulting sip.so in site-packages/PyQt5 differs indeed a bit (grep for PyQt5)
make install
)
(
cd $BUILDDIR
PYQT_VERSION=5.15.2
# orig: https://files.pythonhosted.org/packages/28/6c/640e3f5c734c296a7193079a86842a789edb7988dca39eab44579088a1d1/PyQt5-5.15.2.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/b94576e9e013210dc5aba061913e4bd4/PyQt5-5.15.2.tar.gz
test -e PyQt5-$PYQT_VERSION.tar.gz || wget -nv $BEEHIVE
test -d PyQt5-$PYQT_VERSION || tar -xf PyQt5-$PYQT_VERSION.tar.gz
cd PyQt5-$PYQT_VERSION
#### ATTN!
#### python meanders between /python${PYTHONVER} and /python${PYTHONVER}m
# export QTDIR=/usr/local/qt5
python3 configure.py \
-b $PREFIX/bin \
-d $PREFIX/lib/python$PYTHONVER/site-packages \
-n $PREFIX/share/qsci \
-q /usr/local/qt5/bin/qmake \
-v $PREFIX/share/sip/PyQt5 \
--sip-incdir=$PREFIX/include/python${PYTHONVER} \
--confirm-license \
--no-qml-plugin \
--no-designer-plugin \
--no-dist-info \
--verbose
make -j $NPROC
make install
)
(
cd $BUILDDIR
QSCINTILLA_VERSION=2.11.6
# orig: https://www.riverbankcomputing.com/static/Downloads/QScintilla/$QSCINTILLA_VERSION/QScintilla-$QSCINTILLA_VERSION.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/343cd0c2c8b425518df2e51eb994fbc6/QScintilla-2.11.6.tar.gz
test -e QScintilla-$QSCINTILLA_VERSION.tar.gz || wget -nv $BEEHIVE
test -d QScintilla-$QSCINTILLA_VERSION || tar -xf QScintilla-$QSCINTILLA_VERSION.tar.gz
cd QScintilla-$QSCINTILLA_VERSION
cd Python
# apidir follows PyQt, not Qt (default is: QT_INSTALL_DATA/qsci)
python3 configure.py \
--pyqt=PyQt5 \
--qmake=/usr/local/qt5/bin/qmake \
--apidir=$PREFIX/share/qsci \
--no-dist-info
make -j $NPROC
make install
)
# fi ######### DEBUG_BASE
# cd $BUILDDIR
python3 -m ensurepip
pip3 install --prefix=$PREFIX -I pip
( # fix 'please update' noise from pip
cd $PREFIX/lib/python$PYTHONVER/site-packages
sed -ne '/^#Epatch:pip/ s/^#Epatch:\S* // p' $ME | patch -p1 --verbose
)
pip3 list > $PIPMETADIR/pip3list_initial
pip3 install --prefix=$PREFIX ipython[all]
# install the basic ballpark ...
# numpy holds no ref to *_MAX_THREADS, albeit it's an issue, fix via profile?
# still persisting: NUMEXPR_MAX_THREADS issue caused by numexpr.utils (braindead defaults from this dependency)
pip3 install --prefix=$PREFIX SciPy NumPy Matplotlib pandas SymPy nose statsmodels
# clean up some dirt that statsmodels placed also into $PREFIX
rm -vf $PREFIX/LICENSE.txt
rm -vf $PREFIX/setup.cfg
pip3 install --prefix=$PREFIX Cython
# libxml2-python from pypi isn't up to date, cause lxml seems to be the favored binding
# do this early, not that some dependency tries it. (btw. libxslt-python isn't ported to python3)
(
. ${PREFIX}/profile
LIBXML2_VERSION=2.9.12
# orig: http://xmlsoft.org/sources/libxml2-${PKGVERSION}.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/f433a39be087a9f0b197eb2307ad9f75/libxml2-2.9.12.tar.gz
test -e libxml2-$LIBXML2_VERSION.tar.gz || wget -nv $BEEHIVE
test -d libxml2-$LIBXML2_VERSION || tar -xf libxml2-$LIBXML2_VERSION.tar.gz libxml2-$LIBXML2_VERSION/python
cd libxml2-$LIBXML2_VERSION/python
python3 setup.py build
python3 setup.py install
)
pip3 install --prefix=$PREFIX pysam
pip3 install --prefix=$PREFIX seaborn
pip3 install --prefix=$PREFIX scikit-learn
#pip3 install --prefix=$PREFIX metaseq # fails (Latest commit fa875d1 on Jan 10, 2017)
pip3 install --prefix=$PREFIX Mako
pip3 install --prefix=$PREFIX meson # required in mariux
pip3 install --prefix=$PREFIX cutadapt # Helpdesk 01/24/18 16:19, Sabrina Krakau
pip3 install --prefix=$PREFIX pygobject # Helpdesk 03/26/18 14:19, Virginie Stanisla
pip3 install --prefix=$PREFIX blink1 # Blink1-lib 07/04/18 12:00, Niclas Hofmann
pip3 install --prefix=$PREFIX umi-tools
pip3 install --prefix=$PREFIX sphinx
pip3 install --prefix=$PREFIX recommonmark
pip3 install --prefix=$PREFIX fastcluster
pip3 install --prefix=$PREFIX pydot
pip3 install --prefix=$PREFIX pygraphviz
pip3 install --prefix=$PREFIX deeptools
pip3 install --prefix=$PREFIX HTSeq
pip3 install --prefix=$PREFIX keras
pip3 install --prefix=$PREFIX keras_preprocessing # tensorflow ...
pip3 install --prefix=$PREFIX MotifScan # Alena 30.8.2018
pip3 install --prefix=$PREFIX MAmotif
pip3 install --prefix=$PREFIX hic2cool # Helpdesk Robert Schoepflin 17.09.2018
#pip3 install --prefix=$PREFIX hifive # only python 2.7+
pip3 install --prefix=$PREFIX snakemake
pip3 install --prefix=$PREFIX virtualenv # Donald
pip3 install --prefix=$PREFIX odfpy # Donald
pip3 install --prefix=$PREFIX Dumper # Thomas
pip3 install --prefix=$PREFIX igraph
pip3 install --prefix=$PREFIX louvain # monocle3 prep for Helene
pip3 install --prefix=$PREFIX selenium # 19.7.19 Kreitler -> https://webxray.org/
pip3 install --prefix=$PREFIX cooltools # Maria Valieva 17.7.2019
pip3 install --prefix=$PREFIX gmpy # From viper context (Helpdesk Laura Glaser 9.8.2019)
pip3 install --prefix=$PREFIX torch
pip3 install --prefix=$PREFIX torchvision
pip3 install --prefix=$PREFIX plotly
pip3 install --prefix=$PREFIX pyOpenCL
pip3 install --prefix=$PREFIX docopt
pip3 install --prefix=$PREFIX dbus-python
pip3 install --prefix=$PREFIX distro
pip3 install --prefix=$PREFIX notify
pip3 install --prefix=$PREFIX ply
pip3 install --prefix=$PREFIX threadpoolctl
pip3 install --prefix=$PREFIX pyopengl
# creates error, so remove it
rm -rf ${PREFIX}/lib/python$PYTHONVER/site-packages/OpenGL/Tk
# pip3 install --prefix=$PREFIX HiCExplorer # Would be a nice to have, but it likes to downgrade too much, pick some cherries
pip3 install --prefix=$PREFIX HiCMatrix
pip3 install --prefix=$PREFIX pybedtools
pip3 install --prefix=$PREFIX gffutils
pip3 install --prefix=$PREFIX --no-deps "pyGenomeTracks" # example produces plots, so give it a chance, otherwise it's just a dumbfucked downgrader
pip3 install --prefix=$PREFIX python-bioformats
pip3 install --prefix=$PREFIX jupyterlab # request Peter Arndt
pip3 install --prefix=$PREFIX jupyterlab-git
pip3 install --prefix=$PREFIX igv_jupyterlab # Matthias Lienhard HD 01-04-2020
pip3 install --prefix=$PREFIX igv-jupyter
mkdir -vp $PREFIX/share/jupyter/lab/settings # try to defeat a silly error in jupyter labextension install
pip3 install --prefix=$PREFIX scour # https://github.molgen.mpg.de/mariux64/pkg-scripts/issues/98
pip3 install --prefix=$PREFIX multiqc
pip3 install --prefix=$PREFIX thonny # nice little ide, kreitler
pip3 install --prefix=$PREFIX pybind11
pip3 install --prefix=$PREFIX svgwrite
pip3 install --prefix=$PREFIX pyomo
pip3 install --prefix=$PREFIX jsbsim # kreitler, hobby
pip3 install --prefix=$PREFIX bioservices
pip3 install --prefix=$PREFIX pairtools
pip3 install --prefix=$PREFIX SharedArray
pip3 install --prefix=$PREFIX pyabc # dependency for stochkit, HD 20.07.20 Gemma Noviello
pip3 install --prefix=$PREFIX petab
pip3 install --prefix=$PREFIX tadtool # HD 26.01.21 Michael Robson
# pip3 install --prefix=$PREFIX perf # fails, issue from Paul sep-20, no clue...
# pip3 install --prefix=$PREFIX glpk-py # kreitler, fails, wants setuptools_scm, do I want setuptools_scm?
pip3 install --prefix=$PREFIX helen # HD, a dependency from a request by helene :)
pip3 install --prefix=$PREFIX umap # HD, used by Matthias Lienhard
pip3 install --prefix=$PREFIX macs2 # HD, Alessa Ringel, Tobias Zehnder, old python2 version broke after glibc update
pip3 install --prefix=$PREFIX macs3
pip3 install --prefix=$PREFIX biopython # HD 2021-07-23 Magalhaes/Hnisz alphafold related (cool that we have missed biopython so far, LOL)
pip3 install --prefix=$PREFIX dm-tree
pip3 install --prefix=$PREFIX dm-haiku
pip3 install --prefix=$PREFIX jaxlib
pip3 install --prefix=$PREFIX jax
pip3 install --prefix=$PREFIX flatbuffers
pip3 install --prefix=$PREFIX contextlib2
pip3 install --prefix=$PREFIX ml_collections
# boost for pycuda
(
. ${PREFIX}/profile
BOOST_VERSION=(1.75.0 1_75_0)
PKGCFLAGS="-O2 -fPIC"
cd $BUILDDIR
# orig: https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de//38813f6feb40387dfe90160debd71251/boost_1_75_0.tar.gz
test -e boost_${BOOST_VERSION[1]}.tar.gz || wget -nv $BEEHIVE
test -d boost-${BOOST_VERSION[0]} || mkdir boost-${BOOST_VERSION[0]} && tar -xf boost_${BOOST_VERSION[1]}.tar.gz -C boost-${BOOST_VERSION[0]} --strip-components=1
#### ATTN!
#### python meanders between /python${PYTHONVER} and /python${PYTHONVER}m
cd boost-${BOOST_VERSION[0]}
sed -e "/using python/ s|;|: ${PREFIX}/include/python${PYTHONVER} ;|" \
-i bootstrap.sh
./bootstrap.sh \
--with-toolset=gcc \
--with-icu \
--with-python=$PREFIX/bin/python3 \
--with-libraries=python,thread || exit 1
./b2 \
-j $NPROC \
--layout=system \
--build-dir=build-python3 \
--prefix=$PREFIX \
--libdir=$PREFIX/lib \
--build-type=minimal \
toolset=gcc \
variant=release \
debug-symbols=off \
link=shared \
threading=multi \
runtime-link=shared \
python=$PYTHONVER \
cflags="$PKGCFLAGS" \
cxxflags="$PKGCFLAGS" \
install || exit 1
)
# use pycuda git version to get GL support
(
PYCUDAVERS=2020.1
PYTHON_LIBNAME=boost_python${PYTHONVER/./}
. ${PREFIX}/profile
cd $BUILDDIR
# future build might try this one
# https://github.com/inducer/pycuda/archive/refs/tags/v2021.1.tar.gz
# orig: https://github.com/inducer/pycuda/archive/v2020.1.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/580562d7af4d3249c5b42a1df8d428a0/pycuda-2020.1.tar.gz
test -e pycuda-${PYCUDAVERS}.tar.gz || wget -nv $BEEHIVE
test -d pycuda-${PYCUDAVERS} || tar -xf pycuda-${PYCUDAVERS}.tar.gz
cd pycuda-${PYCUDAVERS}
test -e siteconf.py && rm siteconf.py
python3 configure.py \
--cuda-enable-gl \
--cuda-root=$CUDADIR \
--no-use-shipped-boost \
--boost-python-libname=$PYTHON_LIBNAME \
--boost-inc-dir=$PREFIX/include \
--boost-lib-dir=$PREFIX/lib \
--cudadrv-lib-dir='${CUDA_ROOT}/lib,${CUDA_ROOT}/lib/stubs' \
--cudart-lib-dir='${CUDA_ROOT}/lib,${CUDA_ROOT}/lib/stubs' \
--curand-lib-dir='${CUDA_ROOT}/lib,${CUDA_ROOT}/lib/stubs' \
--ldflags=-L$PREFIX/lib
python3 setup.py install --prefix $PREFIX
)
(
# orig: https://github.com/nboley/idr/archive/2.0.3/idr-2.0.3.tar.gz # HD: Tobias Zehnder, 18.3.21
BEEHIVE=https://beehive.molgen.mpg.de/1bec61b526bb1dcf92a5ab99c27852d0/idr-2.0.3.tar.gz
test -e idr-2.0.3.tar.gz || wget -nv $BEEHIVE
test -d idr-2.0.3 || tar -xf idr-2.0.3.tar.gz
cd idr-2.0.3
python3 setup.py build
python3 setup.py install --prefix $PREFIX
)
(
# orig: https://github.com/stacked-git/stgit/archive/v1.0/stgit-1.0.tar.gz # Paul mariux64/pkg-scripts/issues/152
BEEHIVE=https://beehive.molgen.mpg.de/b20ab5a197fc3a141f4b00c5859c0a3b/stgit-1.0.tar.gz
test -e stgit-1.0.tar.gz || wget -nv $BEEHIVE
test -d stgit-1.0 || tar -xf stgit-1.0.tar.gz
cd stgit-1.0
python3 setup.py build
python3 setup.py install --prefix $PREFIX
)
(
# orig: https://github.com/openmm/openmm/archive/refs/tags/7.5.1.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/12fefb6ca030d1f4aace78ac1a8b94c3/openmm-7.5.1.tar.gz
test -e openmm-7.5.1.tar.gz || wget -nv $BEEHIVE
test -d openmm-7.5.1 || tar -xf openmm-7.5.1.tar.gz
cd openmm-7.5.1
# replace hardcoded "/usr/local/cuda/bin/nvcc" in libOpenMMCUDA.so (crying four trouble dude?)
# Otherwise OPENMM_CUDA_COMPILER needs to be used
sed -i -e "/bin\/nvcc/ s,/usr/local/cuda/bin/nvcc,/$CUDADIR/bin/nvcc," \
platforms/cuda/src/CudaPlatform.cpp
# apply 'DeepMind modification' to openmm, hopefully it will leave openmm usable :)
sed -ne '/^#Epatch:openmmtopo/ s/^#Epatch:\S* // p' $ME | patch -p1 --verbose
mkdir -p build
cd build
cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCUDA_TOOLKIT_ROOT_DIR=$CUDADIR \
-DBUILD_TESTING=OFF \
..
make -j $NPROC
make install
# make PythonInstall # this one sucks! (ignoring all locations cleanly found by cmake before...)
echo "# openmm library part done, now python-binding."
cd python
OPENMM_INCLUDE_PATH=$PREFIX/include OPENMM_LIB_PATH=$PREFIX/lib python3 setup.py build
OPENMM_INCLUDE_PATH=$PREFIX/include OPENMM_LIB_PATH=$PREFIX/lib python3 setup.py install
# place symlinks from plugins to lib, saving a LD_LIBRARY_PATH entry
cd $PREFIX/lib
for SO in plugins/*.so; do
ln -sv $SO
done
)
(
# orig:https://github.com/openmm/pdbfixer/archive/refs/tags/v1.7.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/dd383722fcf5213537656f691f4c2053/pdbfixer-1.7.tar.gz
test -e pdbfixer-1.7.tar.gz || wget -nv $BEEHIVE
test -d pdbfixer-1.7 || tar -xf pdbfixer-1.7.tar.gz
cd pdbfixer-1.7
python3 setup.py build
python3 setup.py install
)
pip3 list > $PIPMETADIR/pip3list_ballpark
# fi ######### DEBUG_TF
# cd $BUILDDIR
# finaly tensorflaw
(
TFVERSION=2.5.0
NCCLSHORTVERSION=2.7
. ${PREFIX}/profile
. /pkg/bazel-4.1.0-0/profile
cd $BUILDDIR
# https://github.com/tensorflow/tensorflow/archive/v2.5.0.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/b152ebdc7f72c4d32f7a9e58aa41b80d/tensorflow-2.5.0.tar.gz
test -e tensorflow-${TFVERSION}.tar.gz || wget -nv $BEEHIVE
test -d tensorflow-${TFVERSION} || tar -xf tensorflow-${TFVERSION}.tar.gz
cd tensorflow-${TFVERSION}
# https://bugs.archlinux.org/task/65953
#vars for config
export PYTHON_BIN_PATH=${PREFIX}/bin/python3
export USE_DEFAULT_PYTHON_LIB_PATH=1
export TF_NEED_JEMALLOC=1
export TF_NEED_KAFKA=0
export TF_NEED_OPENCL_SYCL=0
export TF_NEED_AWS=0
export TF_NEED_GCP=0
export TF_NEED_HDFS=0
export TF_NEED_S3=0
export TF_ENABLE_XLA=1
export TF_NEED_GDR=0
export TF_NEED_VERBS=0
export TF_NEED_OPENCL=0
export TF_NEED_MPI=0
export TF_NEED_TENSORRT=1
export TF_NEED_NGRAPH=0
export TF_NEED_IGNITE=0
export TF_NEED_ROCM=0
export TF_SET_ANDROID_WORKSPACE=0
export TF_DOWNLOAD_CLANG=0
export TF_NCCL_VERSION=${NCCLSHORTVERSION}
export TF_IGNORE_MAX_BAZEL_VERSION=1
export NCCL_INSTALL_PATH=${CUDADIR}
export GCC_HOST_COMPILER_PATH=/usr/bin/gcc
export TF_CUDA_CLANG=0
export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
export TF_CUDA_PATHS=${CUDADIR},${CUDADIR}/extras/CUPTI,${CUDADIR}/nvvm
export TF_CUDA_VERSION=$(${CUDADIR}/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')
export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' ${CUDADIR}/include/cudnn_version.h)
# hardware older than sm_52 is said to be unsupported, compute_86 denotes an emulation
export TF_CUDA_COMPUTE_CAPABILITIES=sm_52,sm_53,sm_60,sm_61,sm_62,sm_70,sm_72,sm_75,sm_80,sm_86,compute_86
# stay compatible with the cluster machines
export CC_OPT_FLAGS="-march=nehalem"
export TF_NEED_CUDA=1
./configure
bazel build \
--cxxopt="-march=nehalem" \
--copt="-march=nehalem" \
--noshow_loading_progress \
--noshow_progress \
--color="no" \
//tensorflow:libtensorflow.so \
//tensorflow:libtensorflow_cc.so \
//tensorflow:install_headers \
//tensorflow/tools/pip_package:build_pip_package
bazel shutdown # otherwise it hogs in cwd
# create a _clean/decent_ python package from so far created debris
test -d tensorflow-pip && rm -r tensorflow-pip
mkdir tensorflow-pip
./bazel-bin/tensorflow/tools/pip_package/build_pip_package --src ${BUILDDIR}/tensorflow-pip
cd ${BUILDDIR}
# ... cope with the ??? symlink-structure placed in bazels' build-TMPDIR (-h) (tell me why ?)
test -e tensorflow-pip.tar && rm tensorflow-pip.tar
tar -chf tensorflow-pip.tar tensorflow-pip
# and perform a regular install
test -d tensorflow-pip && rm -r tensorflow-pip
tar -xf tensorflow-pip.tar
cd ${BUILDDIR}/tensorflow-pip
# inhibit downgrading of packages installed
sed -ne '/^#Epatch:tfdep/ s/^#Epatch:\S* // p' $ME | patch -p2 --verbose
python3 setup.py build
python3 setup.py install --prefix $PREFIX
)
pip3 list > $PIPMETADIR/pip3list_after_tensorflow
# tidy up a bit
if [ -d $PREFIX/man/man1 ]; then
mv -v $PREFIX/man/man1/* $PREFIX/share/man/man1 || true
rm -rf $PREFIX/man
fi
# load all packages, see warnings and spot installation errors
# But don't care about r2py, a further dependence into R is not wanted!
echo "# START load test."
python3 -c 'help("modules")' > /dev/null
echo "# END load test."
exit
### PATCHES
# the code to cope with '--disable-pip-version-check' is spread over the module, so
# just quieten the enervating/misleading update reminder for at least 3 minors ...
#Epatch:pip --- a/pip/_internal/self_outdated_check.py 2021-07-27 17:47:47.374158577 +0200
#Epatch:pip +++ b/pip/_internal/self_outdated_check.py 2021-07-28 13:07:59.790436157 +0200
#Epatch:pip @@ -163,4 +163,6 @@
#Epatch:pip pip_version < remote_version and
#Epatch:pip pip_version.base_version != remote_version.base_version and
#Epatch:pip + ( pip_version.release[0] < remote_version.release[0] or
#Epatch:pip + pip_version.release[1] < (remote_version.release[1] - 3) ) and
#Epatch:pip was_installed_by_pip('pip')
#Epatch:pip )
# BTW: numpy is installed ...
#Epatch:tfdep --- a/tensorflow-pip/setup.py.orig 2021-07-29 21:21:33.000000000 +0200
#Epatch:tfdep +++ b/tensorflow-pip/setup.py 2021-08-05 18:14:26.011647329 +0200
#Epatch:tfdep @@ -77,6 +77,2 @@
#Epatch:tfdep REQUIRED_PACKAGES = [
#Epatch:tfdep - # NOTE: As numpy has releases that break semver guarantees and several other
#Epatch:tfdep - # deps depend on numpy without an upper bound, we must install numpy before
#Epatch:tfdep - # everything else.
#Epatch:tfdep - 'numpy ~= 1.19.2',
#Epatch:tfdep # Install other dependencies
# This is found in the docker image preparation for AlphaFold.
# I'm not completely happy patching existing libraries ...
#Epatch:openmmtopo --- a/wrappers/python/simtk/openmm/app/topology.py.orig 2021-04-07 22:09:01.000000000 +0200
#Epatch:openmmtopo +++ b/wrappers/python/simtk/openmm/app/topology.py 2021-08-05 16:49:10.191954117 +0200
#Epatch:openmmtopo @@ -355,2 +355,11 @@
#Epatch:openmmtopo return 'SG' in names and 'HG' not in names
#Epatch:openmmtopo + # This function is used to prevent multiple di-sulfide bonds from being
#Epatch:openmmtopo + # assigned to a given atom. This is a DeepMind modification.
#Epatch:openmmtopo + def isDisulfideBonded(atom):
#Epatch:openmmtopo + for b in self._bonds:
#Epatch:openmmtopo + if (atom in b and b[0].name == 'SG' and
#Epatch:openmmtopo + b[1].name == 'SG'):
#Epatch:openmmtopo + return True
#Epatch:openmmtopo +
#Epatch:openmmtopo + return False
#Epatch:openmmtopo
#Epatch:openmmtopo @@ -361,2 +370,3 @@
#Epatch:openmmtopo pos1 = positions[sg1.index]
#Epatch:openmmtopo + candidate_distance, candidate_atom = 0.3*nanometers, None
#Epatch:openmmtopo for j in range(i):
#Epatch:openmmtopo @@ -366,4 +376,10 @@
#Epatch:openmmtopo distance = sqrt(delta[0]*delta[0] + delta[1]*delta[1] + delta[2]*delta[2])
#Epatch:openmmtopo - if distance < 0.3*nanometers:
#Epatch:openmmtopo - self.addBond(sg1, sg2)
#Epatch:openmmtopo + if distance < candidate_distance and not isDisulfideBonded(sg2):
#Epatch:openmmtopo + candidate_distance = distance
#Epatch:openmmtopo + candidate_atom = sg2
#Epatch:openmmtopo + # Assign bond to closest pair.
#Epatch:openmmtopo + if candidate_atom:
#Epatch:openmmtopo + self.addBond(sg1, candidate_atom)
#Epatch:openmmtopo +
#Epatch:openmmtopo +