1 | #!/bin/bash |
---|
2 | |
---|
3 | if [ ! -e /etc/debian_version ]; then |
---|
4 | echo "本批次安裝檔目前僅適用 Debian 或 Ubuntu 系列,敬請見諒!!" |
---|
5 | exit 1 |
---|
6 | fi |
---|
7 | |
---|
8 | ##################################################################### |
---|
9 | # 以下為基本程式設計與生資相關自由軟體 |
---|
10 | ##################################################################### |
---|
11 | ######## |
---|
12 | # 安裝基本程式語言編譯環境 |
---|
13 | ######## |
---|
14 | sudo apt-get -y install gcc g++ make autoconf build-essential |
---|
15 | ######## |
---|
16 | # 安裝 JDK 6 編譯環境 |
---|
17 | ######## |
---|
18 | sudo apt-get -y install sun-java6-jdk |
---|
19 | ######## |
---|
20 | # 安裝 GNU R 相關套件 |
---|
21 | # (去除 rjava 與 rmpi 套件, 因為 rmpi 必須特別設定成使用 mpich2 ) |
---|
22 | ######## |
---|
23 | sudo apt-get -y install r-base |
---|
24 | sudo apt-get -y install `apt-cache search --names-only "^r-cran" | awk '{ print $1 }' | grep -v "r-cran-rjava" | grep -v "r-cran-rmpi" ` |
---|
25 | ######## |
---|
26 | # 安裝 GNU R BioConductor 套件 |
---|
27 | ######## |
---|
28 | if [ ! -e biocLite.R ]; then |
---|
29 | sudo wget http://www.bioconductor.org/biocLite.R |
---|
30 | fi |
---|
31 | if [ ! -e BioConductor.R ]; then |
---|
32 | cat > BioConductor.R << EOF |
---|
33 | source(file="$(pwd)/biocLite.R") |
---|
34 | biocLite() |
---|
35 | EOF |
---|
36 | sudo R --no-save < BioConductor.R |
---|
37 | fi |
---|
38 | ######## |
---|
39 | # 安裝 GNU R ape 套件 |
---|
40 | ######## |
---|
41 | sudo apt-get -f install libc6-dev g77 gfortran liblapack-dev |
---|
42 | if [ ! -e gee_4.13-13.tar.gz ]; then |
---|
43 | wget http://cran.r-project.org/src/contrib/gee_4.13-13.tar.gz |
---|
44 | sudo R CMD INSTALL gee_4.13-13.tar.gz |
---|
45 | fi |
---|
46 | if [ ! -e nlme_3.1-92.tar.gz ]; then |
---|
47 | wget http://cran.r-project.org/src/contrib/nlme_3.1-92.tar.gz |
---|
48 | sudo R CMD INSTALL nlme_3.1-92.tar.gz |
---|
49 | fi |
---|
50 | if [ ! -e lattice_0.17-25.tar.gz ]; then |
---|
51 | wget http://cran.r-project.org/src/contrib/lattice_0.17-25.tar.gz |
---|
52 | sudo R CMD INSTALL lattice_0.17-25.tar.gz |
---|
53 | fi |
---|
54 | if [ ! -e ape_2.3-1.tar.gz ]; then |
---|
55 | wget http://cran.r-project.org/src/contrib/ape_2.3-1.tar.gz |
---|
56 | sudo R CMD INSTALL ape_2.3-1.tar.gz |
---|
57 | fi |
---|
58 | ##################################################################### |
---|
59 | # 以下為叢集環境的需求 |
---|
60 | ##################################################################### |
---|
61 | ######## |
---|
62 | # 安裝 MPICH2 |
---|
63 | ######## |
---|
64 | if [ ! -e mpich2-1.0.8p1.tar.gz ]; then |
---|
65 | wget http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/1.0.8p1/mpich2-1.0.8p1.tar.gz |
---|
66 | tar zxvf mpich2-1.0.8p1.tar.gz |
---|
67 | cd mpich2-1.0.8p1 |
---|
68 | ./configure CFLAGS="-fPIC" CXXFLAGS="-fPIC" FFLAGS="-fPIC" prefix=/opt/mpich2 |
---|
69 | sudo make |
---|
70 | sudo make install |
---|
71 | cd .. |
---|
72 | fi |
---|
73 | ######## |
---|
74 | # 安裝 openPBS / torque |
---|
75 | ######## |
---|
76 | if [ ! -e torque-2.3.6.tar.gz ]; then |
---|
77 | wget wget http://www.clusterresources.com/downloads/torque/torque-2.3.6.tar.gz |
---|
78 | tar zxvf torque-2.3.6.tar.gz |
---|
79 | cd torque-2.3.6/ |
---|
80 | ./configure --prefix=/opt/torque |
---|
81 | sudo make |
---|
82 | sudo make install |
---|
83 | sudo /opt/torque/sbin/pbs_server -t create |
---|
84 | echo "$(hostname)" > nodes |
---|
85 | sudo mv nodes /var/spool/torque/server_priv/nodes |
---|
86 | echo "$(hostname)" > server_name |
---|
87 | sudo mv server_name /var/spool/torque/server_name |
---|
88 | cat > torque_conf << EOF |
---|
89 | create queue batch |
---|
90 | set queue batch queue_type = Execution |
---|
91 | set queue batch started = True |
---|
92 | set queue batch enabled = True |
---|
93 | set server default_queue = batch |
---|
94 | set server resources_default.nodes = 1 |
---|
95 | set server scheduling = True |
---|
96 | EOF |
---|
97 | sudo /opt/torque/bin/qmgr < torque_conf |
---|
98 | cat >> config << EOF |
---|
99 | \$pbsserver $(hostname) |
---|
100 | \$logevent 255 |
---|
101 | EOF |
---|
102 | sudo mv config /var/spool/torque/mom_priv/jobs/config |
---|
103 | sudo /opt/torque/bin/qterm -t quick |
---|
104 | sudo /opt/torque/sbin/pbs_server |
---|
105 | sudo /opt/torque/sbin/pbs_sched |
---|
106 | sudo /opt/torque/sbin/pbs_mom |
---|
107 | sudo /opt/torque/bin/pbsnodes -a |
---|
108 | cd .. |
---|
109 | fi |
---|
110 | |
---|
111 | ######## |
---|
112 | # 安裝 Lustre |
---|
113 | ######## |
---|
114 | if [ ! -e /etc/apt/sources.list.d/lustre.list ]; then |
---|
115 | sudo echo "deb http://www.pdsi-scidac.org/repository/debian testing main" > lustre.list |
---|
116 | sudo mv lustre.list /etc/apt/sources.list.d/lustre.list |
---|
117 | sudo apt-get update |
---|
118 | sudo apt-get -y --force-yes install pdsi-scidac-keyring |
---|
119 | sudo apt-get -y install linux-image-2.6.22.19-lustre-686 lustre-modules-2.6.22.19-lustre-686 lustre-utils |
---|
120 | fi |
---|
121 | ##################################################################### |
---|
122 | # 以下為叢集版本的生資相關軟體 |
---|
123 | ##################################################################### |
---|
124 | ######## |
---|
125 | # 安裝 Rmpi |
---|
126 | ######## |
---|
127 | if [ ! -e Rmpi_0.5-7.tar.gz ]; then |
---|
128 | wget http://www.stats.uwo.ca/faculty/yu/Rmpi/download/linux/Rmpi_0.5-7.tar.gz |
---|
129 | sudo R CMD INSTALL Rmpi_0.5-7.tar.gz --configure-args=--with-mpi=/opt/mpich2 |
---|
130 | fi |
---|
131 | ######## |
---|
132 | # 安裝 mpiBLAST |
---|
133 | # 參考 http://debianclusters.cs.uni.edu/index.php/Installing_mpiBLAST |
---|
134 | ######## |
---|
135 | sudo apt-get install csh |
---|
136 | if [ ! -e mpiBLAST-1.5.0-pio.tgz ]; then |
---|
137 | wget http://www.mpiblast.org/downloads/files/mpiBLAST-1.5.0-pio.tgz |
---|
138 | tar zxvf mpiBLAST-1.5.0-pio.tgz |
---|
139 | cd mpiblast-1.5.0-pio |
---|
140 | ./ncbi/make/makedis.csh 2>&1|tee out.makedis.txt |
---|
141 | ./ncbi/make/makedis.csh 2>&1|tee out.makedis.txt |
---|
142 | ./ncbi/make/makedis.csh 2>&1|tee out.makedis.txt |
---|
143 | ./configure --prefix=/opt/mpiblast --with-mpi=/opt/mpich2 --with-ncbi=`pwd`/ncbi --enable-MPI_Alloc_mem |
---|
144 | sudo make |
---|
145 | sudo make install |
---|
146 | cd .. |
---|
147 | fi |
---|
148 | |
---|
149 | wget ftp://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/mito.nt.gz |
---|
150 | |
---|
151 | cat > add_path << EOF |
---|
152 | echo "export PATH=\\\$PATH:/opt/torque/bin:/opt/mpich2/bin:/opt/mpiblast/bin" >> /etc/profile |
---|
153 | EOF |
---|
154 | sudo sh add_path |
---|
155 | |
---|
156 | ##################################################################### |
---|
157 | # 電腦叢集的網頁監控機制 |
---|
158 | ##################################################################### |
---|
159 | ######## |
---|
160 | # 安裝 wwwBLAST |
---|
161 | ######## |
---|
162 | if [ ! -e wwwblast-2.2.20-ia32-linux.tar.gz ]; then |
---|
163 | wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/wwwblast-2.2.20-ia32-linux.tar.gz |
---|
164 | tar zxvf wwwblast-2.2.20-ia32-linux.tar.gz |
---|
165 | fi |
---|
166 | ##################################################################### |
---|
167 | # 安裝 DRBL |
---|
168 | ##################################################################### |
---|
169 | if [ ! -e GPG-KEY-DRBL ]; then |
---|
170 | wget http://drbl.nchc.org.tw/GPG-KEY-DRBL |
---|
171 | sudo apt-key add GPG-KEY-DRBL |
---|
172 | echo "deb http://free.nchc.org.tw/drbl-core drbl stable" > drbl.list |
---|
173 | sudo mv drbl.list /etc/apt/sources.list.d/ |
---|
174 | sudo apt-get update |
---|
175 | sudo apt-get install drbl |
---|
176 | sudo /opt/drbl/sbin/drblsrv -i |
---|
177 | sudo /opt/drbl/sbin/drblpush -i |
---|
178 | fi |
---|