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

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令解压源码包。

```
cd
/path/to/CHASTE
tar -xvf Chaste-release_2019.1.tar.gz
```


3. 执行以下命令修改“translators.py”文件。

  a. 打开“translators.py”文件。

```
vim
/path/to/CHASTE
/
Chaste-release_2019.1/python/pycml/translators.py
```


  b. 按“i”进入编辑模式，修改如下内容。
    将第1830行取消注释，将第1831行注释掉。

    将第1838行取消注释，将第1839行注释掉。

    修改前：

```
1830                 #self.writeln('std::cout << "Too small: ', self.code_name(var), ' = " << ', self.code_name(var) , ' << std::endl << std::flush;')
1831                 self.writeln(error_template.format(self.var_display_name(var)))
1832                 self.close_block(False)
1833             for var in high_range_vars:
1834                 if using_cvode:
1835                     additional_tolerance_adjustment = ' + tol'
1836                 self.writeln('if (', self.code_name(var), ' > ', var.get_rdf_annotation(high_prop), additional_tolerance_adjustment, ')')
1837                 self.open_block()
1838                 #self.writeln('std::cout << "Too large: ', self.code_name(var), ' = " << ', self.code_name(var) , ' << std::endl << std::flush;')
1839                 self.writeln(error_template.format(self.var_display_name(var)))
```


    修改后：

```
1830                 self.writeln('std::cout << "Too small: ', self.code_name(var), ' = " << ', self.code_name(var) , ' << std::endl << std::flush;')
1831                 #self.writeln(error_template.format(self.var_display_name(var)))
1832                 self.close_block(False)
1833             for var in high_range_vars:
1834                 if using_cvode:
1835                     additional_tolerance_adjustment = ' + tol'
1836                 self.writeln('if (', self.code_name(var), ' > ', var.get_rdf_annotation(high_prop), additional_tolerance_adjustment, ')')
1837                 self.open_block()
1838                 self.writeln('std::cout << "Too large: ', self.code_name(var), ' = " << ', self.code_name(var) , ' << std::endl << std::flush;')
1839                 #self.writeln(error_template.format(self.var_display_name(var)))
```


  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
4. 执行以下命令编译安装Chaste。

```
cd
/path/to/CHASTE
mkdir chaste_build
cd chaste_build
cmake -DCMAKE_INSTALL_PREFIX=
/path/to/CHASTE
/chaste_build
/path/to/CHASTE/
Chaste-release_2019.1 -DBoost_INCLUDE_DIR=
/path/to/CHASTE/
CHASTE_LIBS/boost_1_58_0/build/include
make -j48 Continuous
make install
export PATH=
/path/to/CHASTE/
chaste_build/apps:$PATH
```
