---
title: 编译和安装
description: "1. 使用PuTTY工具，以root用户登录服务器。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpengbiobakery_02_0006.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpengbiobakery_02_0006.html
indexId: 108998eb5eefff92c11c9f91231bbbf58788ee000169bb489e9cda0540eea9ce71
---
# 编译和安装

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令，添加本地conda仓库。

```
conda config --add channels
file://
root/anaconda3
/
conda-bld/linux-aarch64
```


  “/root/anaconda3”为默认安装路径，用户可根据实际路径替换。

3. 执行以下命令，创建bioBakery编译运行环境。

```
conda create -n bioBakery
```


4. 执行以下命令，激活bioBakery环境。

```
conda activate bioBakery
```


5. 执行以下命令，创建“biobakery_workflows”和“recipe”目录。

```
mkdir -p biobakery_workflows/
recipe
```


6. 执行以下命令，创建“conda_build_config.yaml”文件。

  a. 创建“conda_build_config.yaml”文件。

```
vi conda_build_config.yaml
```


  b. 按“i”进入编辑模式，添加如下内容。

```
r_base: '3.4'
pin_run_as_build:
python:
max_pin: x.x
min_pin: x.x
python: '2.7'
numpy: '1.11'
perl: 5.26.0
lua: '5'
cpu_optimization_target: nocona
target_platform: linux-aarch64
```


  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
7. 执行以下命令，创建“meta.yaml”文件。

  a. 创建“meta.yaml”文件。

```
vi meta.yaml
```


  b. 按“i”进入编辑模式，添加如下内容。

```
# This file created by conda-build 3.0.27
# meta.yaml template originally from:
# /n/home05/ljmciver/conda-biobakery/recipes/biobakery_workflows, last modified Fri Feb 19 18:18:45 2021
# ------------------------------------------------
package:
name: biobakery_workflows
version: 3.0.0a7
source:
fn: biobakery_workflows-3.0.0a7.tar.gz
sha256: 8819d6a110d01005d5c855a5f6a906b0a6b75e33d20b96471ae41c5ab354203f
url: https://pypi.io/packages/source/b/biobakery_workflows/biobakery_workflows-3.0.0a7.tar.gz
build:
entry_points:
- biobakery_workflows = biobakery_workflows.biobakery_workflows:main
- biobakery_workflows_databases = biobakery_workflows.biobakery_workflows_databases:main
noarch: python
number: '0'
script: python setup.py install  --single-version-externally-managed --record=record.txt
string: pyh0b62126_0
requirements:
build:
- libgcc-ng 11.2.0
- openssl 1.1.1l
- ncurses 6.2
- python_abi 3.8
- wheel 0.37.0
- libgomp 11.2.0
- setuptools 59.2.0
- pip 21.3.1
- sqlite 3.36.0
- ld_impl_linux-aarch64 2.36.1
- _libgcc_mutex 0.1
- readline 8.1
- _openmp_mutex 4.5
- libffi 3.4.2
- zlib 1.2.11
- python 3.8.12
- libstdcxx-ng 11.2.0
- tk 8.6.11
- certifi 2021.10.8
- ca-certificates 2021.10.8
run:
- python 3.8.12
- anadama2
test:
commands:
- biobakery_workflows --help
- biobakery_workflows_databases --help
imports:
- biobakery_workflows
- biobakery_workflows.data
- biobakery_workflows.document_templates
- biobakery_workflows.tasks
- tests
about:
description: bioBakery workflows is a collection of workflows and tasks for executing
common microbial community analyses using standardized, validated tools and
parameters. Quality control and statistical summary reports are automatically
generated for most data types, which include 16S amplicons, metagenomes, and
metatranscriptomes. Workflows are run directly from the command line and tasks
can be imported to create your own custom workflows. The workflows and tasks
are built with AnADAMA2 which allows for parallel task execution locally and
in a grid compute environment.
doc_url: http://huttenhower.sph.harvard.edu/biobakery_workflows
home: http://huttenhower.sph.harvard.edu/biobakery_workflows
license: MIT
license_family: MIT
summary: 'bioBakery workflows: A collection of meta-omic analysis workflows'
extra:
copy_test_source_files: true
final: true
recipe-maintainers: biobakery-users@googlegroups.com
```


  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
8. 执行以下命令，创建“meta.yaml.template”文件。

  a. 创建“meta.yaml.template”文件。

```
vi meta.yaml.template
```


  b. 按“i”进入编辑模式，添加如下内容。

```
{% set name = "biobakery_workflows" %}
{% set version = "3.0.0a7" %}
{% set hash_type = "sha256" %}
{% set hash_value = "8819d6a110d01005d5c855a5f6a906b0a6b75e33d20b96471ae41c5ab354203f" %}
package:
name: '{{ name|lower }}'
version: '{{ version }}'
source:
fn: '{{ name }}-{{ version }}.tar.gz'
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
'{{ hash_type }}': '{{ hash_value }}'
build:
noarch: python
number: 0
script: python setup.py install  --single-version-externally-managed --record=record.txt
entry_points:
- biobakery_workflows = biobakery_workflows.biobakery_workflows:main
- biobakery_workflows_databases = biobakery_workflows.biobakery_workflows_databases:main
requirements:
build:
- python
- setuptools
run:
- python
- anadama2
- kneaddata
- humann
test:
imports:
- biobakery_workflows
- biobakery_workflows.data
- biobakery_workflows.document_templates
- biobakery_workflows.tasks
- tests
commands:
- biobakery_workflows --help
- biobakery_workflows_databases --help
about:
home: http://huttenhower.sph.harvard.edu/biobakery_workflows
license: MIT
license_family: MIT
summary: 'bioBakery workflows: A collection of meta-omic analysis workflows'
description: 'bioBakery workflows is a collection of workflows and tasks for executing common microbial community analyses using standardized, validated tools and parameters. Quality control and statistical summary reports are automatically generated for most data types, which include 16S amplicons, metagenomes, and metatranscriptomes. Workflows are run directly from the command line and tasks can be imported to create your own custom workflows. The workflows and tasks are built with AnADAMA2 which allows for parallel task execution locally and in a grid compute environment.'
doc_url: http://huttenhower.sph.harvard.edu/biobakery_workflows
extra:
recipe-maintainers: 'biobakery-users@googlegroups.com'
```


  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
9. 执行以下命令，退出“biobakery_workflows”和“recipe”目录。

```
cd ../..
```


10. 执行以下命令，编译bioBakery_workflows。

```
conda build ./biobakery_workflows/recipe
```


  如果编译失败，可使用以下命令添加清华源重新尝试： conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda

11. 执行以下命令，安装bioBakery_workflows。

```
conda install biobakery_workflows
```
