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

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令进入TOPHAT2目录。

```
cd
/path/to/TOPHAT2
```


3. 执行以下命令解压TopHat2安装包。

```
tar xvf
tophat-2.1.1.tar.gz
```


4. 准备一个“Patch”文件，将以下内容复制到“tophat.patch”文件中，与“tophat-2.1.1”目录在同一目录。

  a. 执行以下命令创建“tophat.patch”文件。
    vi tophat.patch

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

```
diff -uBw -aur tophat-2.1.1/src/juncs_db.cpp tophat-2.1.1-patched/src/juncs_db.cpp
--- tophat-2.1.1/src/juncs_db.cpp   2016-02-14 19:21:17.354079000 +0100
+++ tophat-2.1.1-patched/src/juncs_db.cpp   2016-06-02 11:26:34.097425159 +0200
@@ -338,7 +338,7 @@
uint32_t left_coord = atoi(scan_left_coord);
uint32_t right_coord = atoi(scan_right_coord);
bool antisense = *orientation == '-';
-           junctions.insert(make_pair<Junction, JunctionStats>(Junction(ref_id, left_coord, right_coord, antisense), JunctionStats()));
+           junctions.insert(make_pair(Junction(ref_id, left_coord, right_coord, antisense), JunctionStats()));
}
}
diff -uBw -aur tophat-2.1.1/src/tophat_reports.cpp tophat-2.1.1-patched/src/tophat_reports.cpp
--- tophat-2.1.1/src/tophat_reports.cpp 2016-02-23 22:20:44.320710000 +0100
+++ tophat-2.1.1-patched/src/tophat_reports.cpp 2016-06-02 11:26:22.057239478 +0200
@@ -2705,7 +2705,7 @@
junction_stat.gtf_match = true;
junction_stat.accepted = true;
-               gtf_junctions.insert(make_pair<Junction, JunctionStats>(Junction(ref_id, left_coord, right_coord, antisense), junction_stat));
+               gtf_junctions.insert(make_pair(Junction(ref_id, left_coord, right_coord, antisense), junction_stat));
}
}
fprintf(stderr, "Loaded %d GFF junctions from %s.\n", (int)(gtf_junctions.size()), gtf_juncs.c_str());
```


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

```
patch -Np0 -i tophat.patch
```


6. 执行以下命令进入解压后的目录。

```
cd tophat-2.1.1
```


7. 执行以下命令进行配置。

```
./configure --prefix=
/path/to/TOPHAT2
--with-boost=
/path/to/BOOST
```


8. 执行以下命令进行编译安装。

```
make -j 1
make install
```
