From 59f5585377a7bc55b5b5f565054dd2e8b7760696 Mon Sep 17 00:00:00 2001 From: Sergey Lyskov <3302736+lyskov@users.noreply.github.com> Date: Fri, 29 Mar 2024 18:58:38 -0600 Subject: [PATCH] update documentation and remove deprecated scripts (#41) * Update README.md * add reference docker files * add reference Docker files readme * remove deprecated Conda setup and instructions * remove PyRosetta deprecated build option and update readme --- README.md | 10 +- docker/README.md | 18 +++ docker/rosetta-alpine-3.9.dockerfile | 18 +++ docker/rosetta-ml.dockerfile | 47 ++++++++ docker/rosetta-ubuntu-18.04.dockerfile | 32 ++++++ docker/rosetta-ubuntu-20.04.dockerfile | 39 +++++++ docker/rosetta-ubuntu-22.04.dockerfile | 42 +++++++ source/conda/.gitignore | 1 - source/conda/README.md | 62 ---------- source/conda/build | 106 ------------------ source/conda/conda_build_config.yaml | 2 - source/conda/linux-anvil/README.md | 13 --- source/conda/linux-anvil/scripts/entrypoint | 26 ----- .../linux-anvil/scripts/entrypoint_source | 2 - source/conda/linux-anvil/scripts/run_commands | 49 -------- .../linux-anvil/xenial-with-gcc/Dockerfile | 47 -------- source/conda/linux-anvil/xenial/Dockerfile | 39 ------- source/conda/pyrosetta_docker_build.sh | 64 ----------- .../conda/recipes/pyrosetta-binder/build.sh | 58 ---------- .../conda/recipes/pyrosetta-binder/meta.yaml | 21 ---- source/conda/recipes/pyrosetta/build.sh | 71 ------------ source/conda/recipes/pyrosetta/meta.yaml | 32 ------ source/conda/recipes/rosetta/build.sh | 61 ---------- source/conda/recipes/rosetta/meta.yaml | 25 ----- source/conda/rosetta_docker_build.sh | 55 --------- source/src/python/PyRosetta/README.md | 93 ++++----------- source/src/python/PyRosetta/build.py | 7 +- 27 files changed, 227 insertions(+), 813 deletions(-) create mode 100644 docker/README.md create mode 100644 docker/rosetta-alpine-3.9.dockerfile create mode 100644 docker/rosetta-ml.dockerfile create mode 100644 docker/rosetta-ubuntu-18.04.dockerfile create mode 100644 docker/rosetta-ubuntu-20.04.dockerfile create mode 100644 docker/rosetta-ubuntu-22.04.dockerfile delete mode 100644 source/conda/.gitignore delete mode 100644 source/conda/README.md delete mode 100755 source/conda/build delete mode 100644 source/conda/conda_build_config.yaml delete mode 100644 source/conda/linux-anvil/README.md delete mode 100755 source/conda/linux-anvil/scripts/entrypoint delete mode 100644 source/conda/linux-anvil/scripts/entrypoint_source delete mode 100755 source/conda/linux-anvil/scripts/run_commands delete mode 100644 source/conda/linux-anvil/xenial-with-gcc/Dockerfile delete mode 100644 source/conda/linux-anvil/xenial/Dockerfile delete mode 100755 source/conda/pyrosetta_docker_build.sh delete mode 100644 source/conda/recipes/pyrosetta-binder/build.sh delete mode 100644 source/conda/recipes/pyrosetta-binder/meta.yaml delete mode 100755 source/conda/recipes/pyrosetta/build.sh delete mode 100644 source/conda/recipes/pyrosetta/meta.yaml delete mode 100755 source/conda/recipes/rosetta/build.sh delete mode 100644 source/conda/recipes/rosetta/meta.yaml delete mode 100755 source/conda/rosetta_docker_build.sh diff --git a/README.md b/README.md index bb48e902e7..e2dcf46971 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,15 @@ PyRosetta PyRosetta are Python bindings to the Rosetta library. These can be built from the Rosetta source code. -See for more information about PyRosetta. +See for more information about PyRosetta. + +Docker +====== + +Official Rosetta/PyRosetta images could be found at https://hub.docker.com/r/rosettacommons/rosetta. Both `serial` and `mpi` Rosetta builds provided as well as the number of PyRosetta builds including fully functional Jupyter setups with PyRosetta pre-installed and experimenta builds with `libtorch` and `tensorflow` integration. Please see https://hub.docker.com/r/rosettacommons/rosetta for more information. + +Various reference Docker files could be found in `rosetta/docker` dir. + Developing Rosetta ================== diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000000..bf76f51e03 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,18 @@ + +Rosetta/PyRosetta reference Docker recipes +========================================== + +Collection of various recipes to serve as example for setting up Rosetta/PyRosetta build environment. +Note that these recipes _does not actually clone/build Rosetta or PyRosetta_ and _only serve as examples_ to +how-to setup build environments. When using this images you will need to mount already cloned Rosetta repository build commands: +``` +# to build Rosetta +cd rosetta/source && ./scons.py -j8 mode=release bin + +# to build PyRosetta +cd rosetta/source/src/python/PyRosetta && python3 build.py -j8 +``` + +* `alpine-3.9` absolutely minimal Rosetta build environment +* `ubuntu-xx.xx` reference images for building Rosetta and PyRosetta +* `ml` PyRosetta reference image to build PyRosetta with `libtorch` and `TensorFlow` support diff --git a/docker/rosetta-alpine-3.9.dockerfile b/docker/rosetta-alpine-3.9.dockerfile new file mode 100644 index 0000000000..ba3a5a9428 --- /dev/null +++ b/docker/rosetta-alpine-3.9.dockerfile @@ -0,0 +1,18 @@ +# (c) Copyright Rosetta Commons Member Institutions. +# (c) This file is part of the Rosetta software suite and is made available under license. +# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. +# (c) For more information, see http://www.rosettacommons.org. Questions about this can be +# (c) addressed to University of Washington CoMotion, email: license@uw.edu. + +## @author Sergey Lyskov + +FROM alpine:3.9 + +RUN apk update +RUN apk add mc python git bash build-base zlib-dev +RUN apk add python3 cmake ninja +RUN apk add libexecinfo-dev + +RUN apk add clang clang-dev + +ENTRYPOINT cd ~ && /bin/bash diff --git a/docker/rosetta-ml.dockerfile b/docker/rosetta-ml.dockerfile new file mode 100644 index 0000000000..519fb2dbe9 --- /dev/null +++ b/docker/rosetta-ml.dockerfile @@ -0,0 +1,47 @@ +# (c) Copyright Rosetta Commons Member Institutions. +# (c) This file is part of the Rosetta software suite and is made available under license. +# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. +# (c) For more information, see http://www.rosettacommons.org. Questions about this can be +# (c) addressed to University of Washington CoMotion, email: license@uw.edu. + +## @author Sergey Lyskov + + +FROM ubuntu:22.04 + +# prevent any user interaction during install +ENV DEBIAN_FRONTEND=noninteractive + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apt-get -y update +RUN apt-get -y install --no-install-recommends mc git curl wget unzip +RUN apt-get -y install --no-install-recommends cmake ninja-build +RUN apt-get -y install --no-install-recommends build-essential clang +RUN apt-get -y install --no-install-recommends zlib1g-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev libffi-dev + +RUN apt-get -y install --no-install-recommends python3 python3-dev python3-numpy python3-setuptools python3-distutils python3-openssl python3-venv + +RUN apt-get -y install --no-install-recommends ca-certificates + +RUN apt-get -y install --no-install-recommends python-dev-is-python3 + + +# Download and extract TensorFlow +RUN wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz +RUN tar -xzf libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz -C /usr/local && rm libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz + +# Set environment variables for TensorFlow +ENV LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib/ +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ + +# Download and extract PyTorch +RUN cd /root && wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcpu.zip -O libtorch.zip +RUN cd /root && unzip libtorch.zip && rm libtorch.zip +RUN cp -r /root/libtorch/* /usr/local && rm -rf /root/libtorch + +# setting up python +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + +#RUN apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/docker/rosetta-ubuntu-18.04.dockerfile b/docker/rosetta-ubuntu-18.04.dockerfile new file mode 100644 index 0000000000..5d95143385 --- /dev/null +++ b/docker/rosetta-ubuntu-18.04.dockerfile @@ -0,0 +1,32 @@ +# (c) Copyright Rosetta Commons Member Institutions. +# (c) This file is part of the Rosetta software suite and is made available under license. +# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. +# (c) For more information, see http://www.rosettacommons.org. Questions about this can be +# (c) addressed to University of Washington CoMotion, email: license@uw.edu. + +## @author Sergey Lyskov + +FROM ubuntu:18.04 + + +# prevent any user interaction during install +ENV DEBIAN_FRONTEND=noninteractive + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apt-get -y update +RUN apt-get -y install --no-install-recommends mc git curl +RUN apt-get -y install --no-install-recommends cmake ninja-build +RUN apt-get -y install --no-install-recommends build-essential clang +RUN apt-get -y install --no-install-recommends zlib1g-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev libffi-dev + +RUN apt-get -y install --no-install-recommends python2.7 python-dev +RUN apt-get -y install --no-install-recommends python3 python3-dev python3-numpy python3-setuptools python3-distutils python3-openssl python3-venv + +RUN apt-get -y install --no-install-recommends clang-tidy +RUN apt-get -y install --no-install-recommends ca-certificates + +RUN apt-get -y install --no-install-recommends + +#RUN apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/docker/rosetta-ubuntu-20.04.dockerfile b/docker/rosetta-ubuntu-20.04.dockerfile new file mode 100644 index 0000000000..63b3f831d7 --- /dev/null +++ b/docker/rosetta-ubuntu-20.04.dockerfile @@ -0,0 +1,39 @@ +# (c) Copyright Rosetta Commons Member Institutions. +# (c) This file is part of the Rosetta software suite and is made available under license. +# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. +# (c) For more information, see http://www.rosettacommons.org. Questions about this can be +# (c) addressed to University of Washington CoMotion, email: license@uw.edu. + +## @author Sergey Lyskov + + +FROM ubuntu:20.04 + +# prevent any user interaction during install +ENV DEBIAN_FRONTEND=noninteractive + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apt-get -y update +RUN apt-get -y install --no-install-recommends mc git curl +RUN apt-get -y install --no-install-recommends cmake ninja-build +RUN apt-get -y install --no-install-recommends build-essential clang +RUN apt-get -y install --no-install-recommends zlib1g-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev libffi-dev + +RUN apt-get -y install --no-install-recommends python3 python3-dev python3-numpy python3-setuptools python3-distutils python3-openssl python3-venv + +RUN apt-get -y install --no-install-recommends clang-tidy +RUN apt-get -y install --no-install-recommends ca-certificates + +RUN apt-get -y install --no-install-recommends python3-dev + +RUN apt-get -y install --no-install-recommends mpich mpi-default-dev + +# optional +RUN apt-get -y install --no-install-recommends clang-format + +# setting up python +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + +#RUN apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/docker/rosetta-ubuntu-22.04.dockerfile b/docker/rosetta-ubuntu-22.04.dockerfile new file mode 100644 index 0000000000..a26ddff142 --- /dev/null +++ b/docker/rosetta-ubuntu-22.04.dockerfile @@ -0,0 +1,42 @@ +# (c) Copyright Rosetta Commons Member Institutions. +# (c) This file is part of the Rosetta software suite and is made available under license. +# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. +# (c) For more information, see http://www.rosettacommons.org. Questions about this can be +# (c) addressed to University of Washington CoMotion, email: license@uw.edu. + +## @author Sergey Lyskov + + +FROM ubuntu:22.04 + +# prevent any user interaction during install +ENV DEBIAN_FRONTEND=noninteractive + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apt-get -y update +RUN apt-get -y install --no-install-recommends mc git curl +RUN apt-get -y install --no-install-recommends cmake ninja-build +RUN apt-get -y install --no-install-recommends build-essential clang +RUN apt-get -y install --no-install-recommends zlib1g-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev libffi-dev + +RUN apt-get -y install --no-install-recommends python3 python3-dev python3-numpy python3-setuptools python3-distutils python3-openssl python3-venv + +RUN apt-get -y install --no-install-recommends clang-tidy +RUN apt-get -y install --no-install-recommends ca-certificates + +RUN apt-get -y install --no-install-recommends python-dev-is-python3 + +RUN apt-get -y install --no-install-recommends mpich mpi-default-dev # mpi + +# optional +RUN apt-get -y install --no-install-recommends clang-format + +# for Rosetta documentation build +RUN apt-get -y install --no-install-recommends doxygen graphviz + +# setting up python +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + +#RUN apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/source/conda/.gitignore b/source/conda/.gitignore deleted file mode 100644 index 6f6f5eb8f6..0000000000 --- a/source/conda/.gitignore +++ /dev/null @@ -1 +0,0 @@ -meta.version.yaml diff --git a/source/conda/README.md b/source/conda/README.md deleted file mode 100644 index d4a85fd5b0..0000000000 --- a/source/conda/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Conda Build Recipes - -A collection of build recipes and scripting components for building conda -packages for Rosetta components. These recipes can be used to generate -three packages: - -- `pyrosetta` - A `pyrosetta` build supporting the `pyrosetta.distributed` - namespace. Notably, this build references mandatory external - dependencies in the PyData stack and generates specialized - multi-threading compatible compiled components. - -- `pyrosetta-binder` - A binary distribution of the `clang`-based - `pyrosetta` binding generator used in the `pyrosetta` build process. - -- `rosetta` - The rosetta suite's command-line executables and associated - database components. - -## TLDR - -1. Install `docker`. -2. Use `rosetta_docker_build.sh ` to build the `rosetta` conda - package. -3. Use `pyrosetta_docker_build.sh ` to build the `pyrosetta` - conda package. - -## Build Layout - -These components are roughly organized into layers: - -- `recipes`: Conda recipe definitions with (a) dependency information and - (b) basic build scripts. - -- `build`: A wrapper around conda-build rendering version information for - a given recipe with the current tree's version information. - -- `full_build`: An simple wrapper script, utilizing `version.py` to - generate `.version.json` before invoking `build` for multiple recipes. - -- `[pyrosetta|rosetta]_docker_build.sh`: Scripts using minimal build - environments defined in linux-anvil to build broadly compatible linux - conda packages. This should be considered the primary entrypoint to - generate conda packages. - -## Build Debugging - -The `[pyrosetta|rosetta]_docker_build.sh` build scripts can be used to -diagnose failed builds within the anvil environment. To debug a failed -build: - - * Note the build prefix in the container. - Eg. - - `/home/conda/build/rosetta_12345` - - * Re-invoke the `docker run` config used to execute the build, replacing - the conda build call with a direct invocation of the workspace build - script. - - Eg. - `/home/conda/root/source/conda/build rosetta --croot /home/conda/build` - -> - `bash -c 'cd /home/conda/build/rosetta_12345 && ./conda_build.sh'` diff --git a/source/conda/build b/source/conda/build deleted file mode 100755 index 22ce66b396..0000000000 --- a/source/conda/build +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -import logging -import subprocess -import os -import json -import argparse - -logging.basicConfig( - level=logging.INFO, - format="%(message)s", - datefmt='%Y-%m-%dT%H:%M:%S' -) - -_version_files = ["source/.version.json", ".release.json"] -_script_root = os.path.dirname(os.path.abspath(__file__)) -_default_main = os.path.abspath(os.path.join(_script_root, "../../")) - - -def get_versions(main): - subprocess.call(os.path.join(main, "source/version.py")) - candidates = [os.path.join(main, v) for v in _version_files] - for version_json in candidates: - if os.path.exists(version_json): - return json.load(open(version_json, "r")) - else: - raise ValueError("No version specifier found, candidiates: %s" % candidates) - -def setup_conda_versions(main, versions): - recipes = os.path.join(_script_root, "recipes") - - logging.info('versions:\n%s', json.dumps(versions, indent=2)) - binder_version = versions["source"]["binder"] - rosetta_version = versions["version"] - - with open(recipes + "/pyrosetta-binder/meta.version.yaml", "w") as of: - of.write(""" -package: - version: {binder_version} - -source: - path: '{main}/source/src/python/PyRosetta/binder' -""".format(**locals())) - - with open(recipes + "/rosetta/meta.version.yaml", "w") as of: - of.write(""" -package: - version: {rosetta_version} - -source: - path: '{main}' -""".format(**locals())) - - with open(recipes+ "/pyrosetta/meta.version.yaml", "w") as of: - of.write(""" -package: - version: {rosetta_version} - -source: - path: '{main}' - -requirements: - build: - - pyrosetta-binder {binder_version} -""".format(**locals())) - -def format_command(target, conda_args): - recipe = os.path.join(_script_root , "recipes", target) - - def normarg(a): - if a.count(" ") != 0 and not a.startswith('"'): - return '"' + a + '"' - else: - return a - - return ( - "conda build --append-file {recipe}/meta.version.yaml {recipe} ".format(**locals()) + - " ".join(map(normarg, conda_args)) - ) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description='Build rosetta conda packages.') - parser.add_argument( - '--main', - type=str, default=_default_main, help='Rosetta main source path. [%s]' % _default_main) - parser.add_argument( - '-n', '--dry-run', - default=False, action='store_true', help='Version and print build commands, do not build.') - parser.add_argument("target", - choices=["pyrosetta-binder", "pyrosetta", "rosetta"], nargs=1) - parser.add_argument("conda", - type=str, default=[], nargs=argparse.REMAINDER, help="Args to passthrough to conda build.") - args = parser.parse_args() - - main = os.path.abspath(args.main) - versions = get_versions(args.main) - - setup_conda_versions(main, versions) - - cmd = format_command(args.target[0], args.conda) - logging.info("%s:\n %s", args.target[0], cmd) - if not args.dry_run: - subprocess.check_call(cmd, shell=True) diff --git a/source/conda/conda_build_config.yaml b/source/conda/conda_build_config.yaml deleted file mode 100644 index f14d95443c..0000000000 --- a/source/conda/conda_build_config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -python: - - 3.7 # [not osx] diff --git a/source/conda/linux-anvil/README.md b/source/conda/linux-anvil/README.md deleted file mode 100644 index e2d09f444b..0000000000 --- a/source/conda/linux-anvil/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# linux-anvil - -This is a minimal, xenial build image based off the `conda-forge` -[`linux-anvil`](https://github.com/conda-forge/docker-images/commit/c9a9a2ae2e3f873d18212a771e7b50b53684b674). -This build image represents a best-effort attempt at a minimal build -environment for `pyrosetta` and `rosetta` builds. - -The `linux-anvil` is *uniquely* designed to support `conda build` calls -while running as a non-root user. This allows image to be used to generate -build products in less-privileged contexts, writing build images into -a user-owned hosted directory via a bind mount. The target user should be -specified via the `HOST_USER_ID` env variable, rather than the standard -`-u` docker parameter. diff --git a/source/conda/linux-anvil/scripts/entrypoint b/source/conda/linux-anvil/scripts/entrypoint deleted file mode 100755 index a80ff27717..0000000000 --- a/source/conda/linux-anvil/scripts/entrypoint +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -il - -# Create conda user with the same uid as the host, so the container can write -# to mounted volumes -# Adapted from https://denibertovic.com/posts/handling-permissions-with-docker-volumes/ -USER_ID=${HOST_USER_ID:-9001} -useradd --shell /bin/bash -u $USER_ID -G lucky -o -c "" -m conda -export HOME=/home/conda -export USER=conda -export LOGNAME=conda -export MAIL=/var/spool/mail/conda -export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/conda/bin -if [ "$(uname -m)" = "x86_64" ]; then - export supkg="gosu" -else - export supkg="su-exec" -fi -chown conda:conda $HOME -cp -R /etc/skel $HOME && chown -R conda:conda $HOME/skel && (ls -A1 $HOME/skel | xargs -I {} mv -n $HOME/skel/{} $HOME) && rm -Rf $HOME/skel -cp /root/.condarc $HOME/.condarc && chown conda:conda $HOME/.condarc - -# Source everything that needs to be. -. /opt/docker/bin/entrypoint_source - -# Run whatever the user wants. -exec /opt/conda/bin/$supkg conda "$@" diff --git a/source/conda/linux-anvil/scripts/entrypoint_source b/source/conda/linux-anvil/scripts/entrypoint_source deleted file mode 100644 index 8df9fb100d..0000000000 --- a/source/conda/linux-anvil/scripts/entrypoint_source +++ /dev/null @@ -1,2 +0,0 @@ -# Activate the `root` conda environment. -. /opt/conda/bin/activate root diff --git a/source/conda/linux-anvil/scripts/run_commands b/source/conda/linux-anvil/scripts/run_commands deleted file mode 100755 index 148ed79520..0000000000 --- a/source/conda/linux-anvil/scripts/run_commands +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -il -set -e -set -x - -if [ "$(uname -m)" = "x86_64" ]; then - export supkg="gosu" - export condapkg="Miniconda3-4.5.4-Linux-x86_64.sh" - export conda_chksum="a946ea1d0c4a642ddf0c3a26a18bb16d" -else - export supkg="su-exec" - export condapkg="Miniconda3-4.5.4-Linux-ppc64le.sh" - export conda_chksum="05c1e073f262105179cf57920dfc4d43" -fi - -# give sudo permission for conda user to run yum (user creation is postponed -# to the entrypoint, so we can create a user with the same id as the host) -echo 'conda ALL=NOPASSWD: /usr/bin/yum' >> /etc/sudoers - -# Install the latest Miniconda with Python 3 and update everything. -curl -s -L https://repo.continuum.io/miniconda/$condapkg > miniconda.sh && \ - openssl md5 miniconda.sh | tee /dev/stderr | grep $conda_chksum && \ - bash miniconda.sh -b -p /opt/conda && \ - rm miniconda.sh - -echo "conda =4.6" >> /opt/conda/conda-meta/pinned && \ - export PATH=/opt/conda/bin:$PATH && \ - conda config --set show_channel_urls True && \ - conda update --all --yes && \ - conda clean -tipy - -# Install conda build and deployment tools. -export PATH="/opt/conda/bin:${PATH}" && \ - conda install --yes --quiet conda-build conda-verify anaconda-client jinja2 setuptools && \ - conda install --yes git && \ - conda clean -tipsy - -# Install docker tools -export PATH="/opt/conda/bin:${PATH}" && \ - conda install --yes conda-forge::$supkg && \ - export CONDA_SUEXEC_INFO=( `conda list $supkg | grep $supkg` ) && \ - echo "$supkg ${CONDA_SUEXEC_INFO[1]}" >> /opt/conda/conda-meta/pinned && \ - conda install --yes conda-forge::tini && \ - export CONDA_TINI_INFO=( `conda list tini | grep tini` ) && \ - echo "tini ${CONDA_TINI_INFO[1]}" >> /opt/conda/conda-meta/pinned && \ - conda clean -tipsy - -# Lucky group gets permission to write in the conda dir -groupadd -g 32766 lucky -chgrp -R lucky /opt/conda && chmod -R g=u /opt/conda diff --git a/source/conda/linux-anvil/xenial-with-gcc/Dockerfile b/source/conda/linux-anvil/xenial-with-gcc/Dockerfile deleted file mode 100644 index aacbbfc4df..0000000000 --- a/source/conda/linux-anvil/xenial-with-gcc/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -FROM ubuntu:xenial - -# Set an encoding to make things work smoothly. -ENV LANG en_US.UTF-8 - -# Install basic requirements. -RUN apt-get -qq update && \ - apt-get install -y \ - file \ - vim-tiny \ - bzip2 \ - make \ - patch \ - sudo \ - tar \ - openssl \ - openssh-client \ - curl \ - rsync \ - util-linux \ - wget && \ - apt-get -qq -y autoremove && \ - apt-get autoclean - -# Run common commands -COPY scripts/run_commands /opt/docker/bin/run_commands -RUN /opt/docker/bin/run_commands - -# Add a file for users to source to activate the `conda` -# environment `root` and the devtoolset compiler. Also -# add a file that wraps that for use with the `ENTRYPOINT`. -COPY scripts/entrypoint_source /opt/docker/bin/entrypoint_source -COPY scripts/entrypoint /opt/docker/bin/entrypoint - -# Ensure that all containers start with tini and the user selected process. -# Activate the `conda` environment `root` and the devtoolset compiler. -# Provide a default command (`bash`), which will start if the user doesn't specify one. -ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ] -CMD [ "/bin/bash" ] - -# Install system compilers for rosetta builds -RUN apt-get -qq update \ - && apt-get install -y \ - gcc \ - g++ \ - && apt-get -qq -y autoremove \ - && apt-get autoclean diff --git a/source/conda/linux-anvil/xenial/Dockerfile b/source/conda/linux-anvil/xenial/Dockerfile deleted file mode 100644 index efa674f5c2..0000000000 --- a/source/conda/linux-anvil/xenial/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM ubuntu:xenial - -# Set an encoding to make things work smoothly. -ENV LANG en_US.UTF-8 - -# Install basic requirements. -RUN apt-get -qq update && \ - apt-get install -y \ - file \ - vim-tiny \ - bzip2 \ - make \ - patch \ - sudo \ - tar \ - openssl \ - openssh-client \ - curl \ - rsync \ - util-linux \ - wget && \ - apt-get -qq -y autoremove && \ - apt-get autoclean - -# Run common commands -COPY scripts/run_commands /opt/docker/bin/run_commands -RUN /opt/docker/bin/run_commands - -# Add a file for users to source to activate the `conda` -# environment `root` and the devtoolset compiler. Also -# add a file that wraps that for use with the `ENTRYPOINT`. -COPY scripts/entrypoint_source /opt/docker/bin/entrypoint_source -COPY scripts/entrypoint /opt/docker/bin/entrypoint - -# Ensure that all containers start with tini and the user selected process. -# Activate the `conda` environment `root` and the devtoolset compiler. -# Provide a default command (`bash`), which will start if the user doesn't specify one. -ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ] -CMD [ "/bin/bash" ] diff --git a/source/conda/pyrosetta_docker_build.sh b/source/conda/pyrosetta_docker_build.sh deleted file mode 100755 index 3d3077166c..0000000000 --- a/source/conda/pyrosetta_docker_build.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -#http://redsymbol.net/articles/unofficial-bash-strict-mode/ - -set -euo pipefail -IFS=$'\n\t' - -function usage() { - echo "Usage: $BASH_SOURCE " - exit 1 -} - -if [ -z "${1:-}" ]; then usage; fi - -THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" -ROOT=$(realpath $THISDIR/../..) -ARTIFACTS=$(realpath ${1:-}) -UPLOAD_PACKAGES=False - -# Conda-build copies work tree into build root, so build root must be outside -# tree to avoid recursive copy. -case $(readlink -f $(realpath $ARTIFACTS))/ - in $(readlink -f $ROOT)/*) - echo "conda-build output root: '$ARTIFACTS' can not fall within working tree: '$ROOT'" && usage; -esac - -# Log docker info -docker info - -# In order for the conda-build process in the container to write to the mounted -# volumes, we need to run with the same id as the host machine, which is -# normally the owner of the mounted volumes, or at least has write permission -export HOST_USER_ID=$(id -u) - -# Check if docker-machine is being used (normally on OSX) and get the uid from -# the VM -if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then - export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) -fi - -docker build $ROOT/source/conda/linux-anvil -f $ROOT/source/conda/linux-anvil/xenial-with-gcc/Dockerfile - -DOCKER_IMAGE=$(docker build $ROOT/source/conda/linux-anvil -f $ROOT/source/conda/linux-anvil/xenial-with-gcc/Dockerfile -q) - -mkdir -p "$ARTIFACTS" - -set -x - -docker run \ - -v "${ROOT}":/home/conda/root:rw,z \ - -v "${ARTIFACTS}":/home/conda/build:rw,z \ - -e BINSTAR_TOKEN \ - -e HOST_USER_ID=$HOST_USER_ID \ - -e UPLOAD_PACKAGES=$UPLOAD_PACKAGES \ - $DOCKER_IMAGE \ - /home/conda/root/source/conda/build pyrosetta-binder --skip-existing --croot /home/conda/build - -docker run \ - -v "${ROOT}":/home/conda/root:rw,z \ - -v "${ARTIFACTS}":/home/conda/build:rw,z \ - -e BINSTAR_TOKEN \ - -e HOST_USER_ID=$HOST_USER_ID \ - -e UPLOAD_PACKAGES=$UPLOAD_PACKAGES \ - $DOCKER_IMAGE \ - /home/conda/root/source/conda/build pyrosetta --croot /home/conda/build diff --git a/source/conda/recipes/pyrosetta-binder/build.sh b/source/conda/recipes/pyrosetta-binder/build.sh deleted file mode 100644 index e18734ef4e..0000000000 --- a/source/conda/recipes/pyrosetta-binder/build.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -#http://redsymbol.net/articles/unofficial-bash-strict-mode/ - -set -exo pipefail -IFS=$'\n\t' - -if [[ ! -z "${CLANG:-}" ]]; then - # override conda-provided clang compiler with system clang - # still links against conda libc++ shared libraries - export CLANG=/usr/bin/clang - export CC=${CLANG} - export CLANGXX=/usr/bin/clang++ - export CXX=${CLANGXX} -fi - -python build.py -j - -LIB="${PREFIX}/lib/pyrosetta-binder.${PKG_VERSION}" - -mkdir -p $LIB -cp build/llvm-6.0.1/build_*/bin/binder ${LIB} - -mkdir -p ${LIB}/clang/lib -cp -r build/llvm-6.0.1/tools/clang/lib/Headers ${LIB}/clang/lib/Headers - -mkdir -p ${LIB}/pybind11/ -cp -r build/pybind11/include ${LIB}/pybind11/include - -mkdir -p ${PREFIX}/bin -pushd ${PREFIX}/bin -cat > pyrosetta-binder.${PKG_VERSION} < 1 and sys.argv[1] == "--pybind11-include-path": - assert len(sys.argv) == 2 - print(os.path.join(binder_install_path, "pybind11/include")) -else: - if not "--" in sys.argv: - sys.argv.append("--") - - subprocess.call( - [os.path.join(binder_install_path, "binder")] + - sys.argv[1:] + - ["-I" + os.path.join(binder_install_path, "clang/lib/Headers")] - ) -SHIM - -chmod a+x pyrosetta-binder.${PKG_VERSION} - -ln -f -s pyrosetta-binder.${PKG_VERSION} pyrosetta-binder diff --git a/source/conda/recipes/pyrosetta-binder/meta.yaml b/source/conda/recipes/pyrosetta-binder/meta.yaml deleted file mode 100644 index 77704d7572..0000000000 --- a/source/conda/recipes/pyrosetta-binder/meta.yaml +++ /dev/null @@ -1,21 +0,0 @@ -package: - name: pyrosetta-binder - -requirements: - build: - - python - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - cmake - - ninja - - run: - - python - -test: - commands: - - pyrosetta-binder --help - - -about: - home: https://github.com/rosettacommons/binder diff --git a/source/conda/recipes/pyrosetta/build.sh b/source/conda/recipes/pyrosetta/build.sh deleted file mode 100755 index c521883f43..0000000000 --- a/source/conda/recipes/pyrosetta/build.sh +++ /dev/null @@ -1,71 +0,0 @@ -#Configure!/bin/bash -#http://redsymbol.net/articles/unofficial-bash-strict-mode/ - -set -euo pipefail -IFS=$'\n\t' - -set -x - -echo "--- Env" -build_args=( ---create-package `pwd`/pyrosetta ---binder-config rosetta.config ---binder-config rosetta.distributed.config ---serialization ---multi-threaded ---no-zmq ---no-strip-module ---binder `which pyrosetta-binder` ---pybind11 `pwd`/source/external/pybind11/include -) - -if test -f "`pwd`/source/.version.json"; then - build_args+=(--version `pwd`/source/.version.json) -elif test -f "`pwd`/.release.json"; then - build_args+=(--version `pwd`/.release.json) -fi - -if [[ ! -z "${GCC:-}" ]]; then - # Override flags to just include prefix - export CFLAGS="-I${PREFIX}/include" - export CXXFLAGS="-I${PREFIX}/include" - - # Symlink conda-provided gcc into "gcc"; pyrosetta build.py only properly - # detects compilers named `gcc`/`g++` or `clang`/`clang++` - mkdir -p bin - ln -s -f ${GCC} bin/gcc - ln -s -f ${GXX} bin/g++ - - export PATH=$(pwd)/bin:$PATH - export CC=gcc - export CXX=g++ - - build_args+=(--compiler gcc) -fi - -if [[ ! -z "${CLANG:-}" ]]; then - # override conda-provided clang compiler with system clang - # still links against conda libc++ shared libraries - export CLANG=/usr/bin/clang - export CC=${CLANG} - export CLANGXX=/usr/bin/clang++ - export CXX=${CLANGXX} - build_args+=(--compiler ${CLANG}) -fi - -echo "--- Build" - -pushd source/src/python/PyRosetta - -python build.py ${build_args[@]} -j - -popd - -echo "--- Setup" -pushd pyrosetta -# Run initial test to prebuild databases -python -c 'import pyrosetta; pyrosetta.init(); pyrosetta.get_score_function()(pyrosetta.pose_from_sequence("TEST"))' - -pushd setup -${PREFIX}/bin/python setup.py install --single-version-externally-managed --record=record.txt > install.log -popd diff --git a/source/conda/recipes/pyrosetta/meta.yaml b/source/conda/recipes/pyrosetta/meta.yaml deleted file mode 100644 index 801c7fdca1..0000000000 --- a/source/conda/recipes/pyrosetta/meta.yaml +++ /dev/null @@ -1,32 +0,0 @@ -package: - name: pyrosetta - -requirements: - build: - - python - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - {{ pin_compatible('numpy') }} - - cmake - - ninja - host: - - python - - setuptools - - numpy - - zlib - run: - - python - - {{ pin_compatible('numpy') }} - - zlib - - pandas >=0.18 - - scipy >=1.0 - - traitlets - - python-blosc - - decorator - -test: - commands: - - python -m unittest pyrosetta.tests.distributed.test_smoke - -about: - home: http://rosettacommons.org diff --git a/source/conda/recipes/rosetta/build.sh b/source/conda/recipes/rosetta/build.sh deleted file mode 100755 index ff562644df..0000000000 --- a/source/conda/recipes/rosetta/build.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -set -x -set -e - -echo "--- Env" -unset MACOSX_DEPLOYMENT_TARGET - -TARGET_APPS="apps" - -if [[ ! -z "${GCC:-}" ]]; then - # Override flags to just include prefix - export CFLAGS="-I${PREFIX}/include" - export CXXFLAGS="-I${PREFIX}/include" - - # Override flags to just include prefix - export CFLAGS="-I${PREFIX}/include" - export CXXFLAGS="-I${PREFIX}/include" - - # Symlink conda-provided gcc into "gcc"; pyrosetta build.py only properly - # detects compilers named `gcc`/`g++` or `clang`/`clang++` - mkdir -p bin - ln -s -f ${GCC} bin/gcc - ln -s -f ${GXX} bin/g++ - - export PATH=$(pwd)/bin:$PATH - export CC=gcc - export CXX=g++ -fi - -if [[ ! -z "${CLANG:-}" ]]; then - # override conda-provided clang compiler with system clang - # still links against conda libc++ shared libraries - export CLANG=/usr/bin/clang - export CC=${CLANG} - export CLANGXX=/usr/bin/clang++ - export CXX=${CLANGXX} - build_args+=(--compiler ${CLANG}) - - # Override flags to just include prefix - export CFLAGS="-I${PREFIX}/include" - export CXXFLAGS="-I${PREFIX}/include" -fi - -echo "--- Configure" - -pushd source/cmake -./make_project.py all - -pushd build_release -cmake -G Ninja -DHDF5=ON -DCMAKE_INSTALL_PREFIX=${PREFIX} - -echo "--- Build" -ninja ${TARGET_APPS} - -echo "--- Install" -ninja install | grep -v Installing: | grep -v Up-to-date: - -echo "--- Done" -popd -popd diff --git a/source/conda/recipes/rosetta/meta.yaml b/source/conda/recipes/rosetta/meta.yaml deleted file mode 100644 index e7a01b2869..0000000000 --- a/source/conda/recipes/rosetta/meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -package: - name: rosetta - -requirements: - build: - - python - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - cmake - - ninja - - hdf5=1.8 - - host: - - zlib - - run: - - zlib - - hdf5=1.8 - -test: - commands: - - rosetta_scripts - -about: - home: http://rosettacommons.org diff --git a/source/conda/rosetta_docker_build.sh b/source/conda/rosetta_docker_build.sh deleted file mode 100755 index 09f93d8147..0000000000 --- a/source/conda/rosetta_docker_build.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -#http://redsymbol.net/articles/unofficial-bash-strict-mode/ - -set -euo pipefail -IFS=$'\n\t' - -function usage() { - echo "Usage: $BASH_SOURCE " - exit 1 -} - -if [ -z "${1:-}" ]; then usage; fi - -THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" -ROOT=$(realpath $THISDIR/../..) -ARTIFACTS=$(realpath ${1:-}) -UPLOAD_PACKAGES=False - -# Conda-build copies work tree into build root, so build root must be outside -# tree to avoid recursive copy. -case $(readlink -f $(realpath $ARTIFACTS))/ - in $(readlink -f $ROOT)/*) - echo "conda-build output root: '$ARTIFACTS' can not fall within working tree: '$ROOT'" && usage; -esac - -# Log docker info -docker info - -# In order for the conda-build process in the container to write to the mounted -# volumes, we need to run with the same id as the host machine, which is -# normally the owner of the mounted volumes, or at least has write permission -export HOST_USER_ID=$(id -u) - -# Check if docker-machine is being used (normally on OSX) and get the uid from -# the VM -if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then - export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) -fi - -docker build $ROOT/source/conda/linux-anvil -f $ROOT/source/conda/linux-anvil/xenial/Dockerfile - -DOCKER_IMAGE=$(docker build $ROOT/source/conda/linux-anvil -f $ROOT/source/conda/linux-anvil/xenial/Dockerfile -q) - -mkdir -p "$ARTIFACTS" - -set -x - -docker run \ - -v "${ROOT}":/home/conda/root:rw,z \ - -v "${ARTIFACTS}":/home/conda/build:rw,z \ - -e BINSTAR_TOKEN \ - -e HOST_USER_ID=$HOST_USER_ID \ - -e UPLOAD_PACKAGES=$UPLOAD_PACKAGES \ - $DOCKER_IMAGE \ - /home/conda/root/source/conda/build rosetta --croot /home/conda/build diff --git a/source/src/python/PyRosetta/README.md b/source/src/python/PyRosetta/README.md index 932b823418..bf06d3495f 100644 --- a/source/src/python/PyRosetta/README.md +++ b/source/src/python/PyRosetta/README.md @@ -1,87 +1,32 @@ PyRosetta 4 =========== -Building with external Rosetta libraries ----------------------------------------- -PyRosetta may be linked against externally compiled Rosetta shared libraries. -This may be used to suppport "extras" builds or debug builds of the shared -libraries with release-mode bindings. To support external links, configure & -build via cmake and clang, then specify `--external-link` to `build.py`. +**NOTE: Use for PyRosetta for commercial purposes requires purchase of a separate PyRosetta license which is different from Rosetta commercial license.** (This includes fee-for-service work by academic users.) Please see [UW Comotion](https://els2.comotion.uw.edu/product/pyrosetta) or email license@uw.edu for more information. -For example: -```` -export CC=`which clang` -export CXX=`which clang++` +Building from source +-------------------- -cd `git rev-parse --show-toplevel` - -pushd source/cmake -./make_project.py all - -pushd build_debug -cmake -G ninja && ninja - -popd -popd - -pushd source/src/python/PyRosetta -python build.py --external-link debug -```` - -Building PyRosetta under Anaconda python ----------------------------------------- -If you use Anaconda python (https://www.continuum.io) and would like to use -it to build PyRosetta, you will need to make the build system aware of the -location of the appropriate C headers and library. These values are specified -using the `python-include-dir` and `python-lib` command line flags when calling -`build.py`. For example, if Anaconda 3 is installed in the default location, -the command to run `build.py` would be: - -`python build.py -jX --python-include-dir=$HOME/anaconda3/include/python3.5m --python-lib=$HOME/anaconda3/lib/libpython3.5m.dylib` - -where X is the number of jobs to parallelize the build over. - -Bootstrap PyRosetta Development Environment -------------------------------------------- - -An existing PyRosetta build can be used to bootstrap a development -environment for python-level development. The bootstrap process will (a) -reset the work tree to match the source binary version and (b) copy the -source binary compiled module and database into the PyRosetta `src` -directory. - -To bootstrap into a conda-based development environment: +Requirements: +* CLang-3.4+ or GCC-4.8+ +* CMake +* [Ninja](https://ninja-build.org/) +* Python-3.8+ +Building PyRosetta: ``` -# Create and activate a development environment. -conda create -n pyrosetta-dev python=3.6 -conda activate pyrosetta-dev - -# Install pyrosetta, optionally specifying a target development version. -conda install -c rosettacommons pyrosetta - -# Copy binary and reset tree to the prebuilt version. -./bootstrap_dev_env - -# Replace conda package with development-mode install of working tree. -conda remove pyrosetta && pushd src && python setup.py develop +cd rosetta/source/src/python/PyRosetta +python3 build.py -j8 ``` -The bootstrap process resets the git working tree to the prebuilt version -in a detached HEAD state. To begin development create a feature branch -`git checkout -b user/py_feature`. If you have already created commits on -a existing branch your git HEAD will no longer point to this branch. - -You can recover this initial work post-bootstrap by checkout, -cherry-pick, or rebase. Assuming you were on an branch pre-bootstrap: +Useful build script options: +* `--create-package` create Python setup.py package +* `--create-wheel` create Python wheel package +* `--print-build-root` print path to where PyRosetta binaries will be located with given build options -* Create new branch `git checkout -b user/py_new`, checkout the state of - the old branch, `git checkout HEAD@{1} -- src` and work and - recommit `git commit`. -* Create new branch `git checkout -b user/py_new`, cherry-pick all the - work in the old branch `git cherry-pick origin/master..HEAD@{1}`. +Developing PyRosetta +--------------------------- +When developing/debugging PyRosetta is usually too time consuming to create and install it as a package during testing. To mitigate this PyRosetta build system is setup in way to allow PyRosetta import to be done at build location. Also, all Python files at build location are symlinks to original source files so it is possible to edit and test Python scripts without explicitly rebuilding the PyRosetta. -* Rebase the old branch (here `user/py_feature`) onto the current HEAD - `git rebase -i --onto HEAD origin/master user/py_feature`. +To use this feature you will first need to determent path of binaries with currently build options using `--print-build-root` build script options. Note that report path will be vary for different build options, compiler settings etc. Final build path could be obtained by adding `/build` suffix to reported location. Starting python interpreter at final build path will allow you to fully import and PyRosetta as if it was installed. diff --git a/source/src/python/PyRosetta/build.py b/source/src/python/PyRosetta/build.py index 55215f1e54..29b703d153 100755 --- a/source/src/python/PyRosetta/build.py +++ b/source/src/python/PyRosetta/build.py @@ -404,7 +404,7 @@ def setup_source_directory_links(rosetta_source_path): if os.path.islink(s): os.unlink(s) os.symlink(source_path, s) - if Options.external_link: + if False and Options.external_link: target_lib_path = os.path.relpath( os.path.join(rosetta_source_path, "cmake", "build_PyRosetta.{}".format(Options.external_link) ), prefix) s = os.path.join(prefix, "lib") @@ -547,7 +547,7 @@ def generate_cmake_file(rosetta_source_path, extra_sources): python_lib = Options.python_lib) ) - if Options.external_link: + if False and Options.external_link: rosetta_cmake = """ include_directories(SYSTEM {system_include}) include_directories({rosetta_include}) @@ -864,7 +864,7 @@ def main(args): parser.add_argument('--binder', default='', help='Path to Binder tool. If none is given then download, build and install binder into main/source/build/prefix. Use "--binder-debug" to control which mode of binder (debug/release) is used.') parser.add_argument("--binder-debug", action="store_true", help="Run binder tool in debug mode (only relevant if no '--binder' option was specified)") parser.add_argument("--binder-config", action="append", default=["rosetta.config"], help="Binder config file. [Default='rosetta.config']") - parser.add_argument("--print-build-root", action="store_true", help="Print path to where PyRosetta binaries will be located with given options and exit. Use this option to automate package creation.") + parser.add_argument("--print-build-root", action="store_true", help="Print path to where PyRosetta binaries will be located with given build options and exit. Use this option to automate package creation.") parser.add_argument('--cross-compile', action="store_true", help='Specify for cross-compile build') parser.add_argument('--pybind11', default='', help='Path to pybind11 source tree') parser.add_argument('--annotate-includes', action="store_true", help='Annotate includes in generated PyRosetta source files') @@ -872,7 +872,6 @@ def main(args): parser.add_argument('-p', '--create-package', default='', help='Create PyRosetta Python package at specified path (default is to skip creating package)') parser.add_argument('--create-wheel', default='', help='Create python wheel in the specified directory. (default is to skip creating wheel)') - parser.add_argument('--external-link', default=None, choices=["debug", "release"], help="Instead of building Rosetta libraries link to Rosetta libraries compiled with CMake PyRosetta. build") parser.add_argument('--python-include-dir', default=None, help='Path to python C headers. Use this if CMake fails to autodetect it') parser.add_argument('--python-lib', default=None, help='Path to python library. Use this if CMake fails to autodetect it')