jazz/BioCluster_Setup: BioCluster_Setup.sh

File BioCluster_Setup.sh, 5.1 KB (added by jazz, 15 years ago)
Line 
1#!/bin/bash
2
3if [ ! -e /etc/debian_version ]; then
4  echo "本批次安裝檔目前僅適用 Debian 或 Ubuntu 系列,敬請見諒!!"
5  exit 1
6fi
7
8#####################################################################
9# 以下為基本程式設計與生資相關自由軟體
10#####################################################################
11########
12# 安裝基本程式語言編譯環境
13########
14sudo apt-get -y install gcc g++ make autoconf build-essential
15########
16# 安裝 JDK 6 編譯環境
17########
18sudo apt-get -y install sun-java6-jdk
19########
20# 安裝 GNU R 相關套件
21# (去除 rjava 與 rmpi 套件, 因為 rmpi 必須特別設定成使用 mpich2 )
22########
23sudo apt-get -y install r-base
24sudo 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########
28if [ ! -e biocLite.R ]; then
29  sudo wget http://www.bioconductor.org/biocLite.R
30fi
31if [ ! -e BioConductor.R ]; then
32  cat > BioConductor.R << EOF
33source(file="$(pwd)/biocLite.R")
34biocLite()
35EOF
36  sudo R --no-save < BioConductor.R
37fi
38########
39# 安裝 GNU R ape 套件
40########
41sudo apt-get -f install libc6-dev g77 gfortran liblapack-dev
42if [ ! -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
45fi
46if [ ! -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
49fi
50if [ ! -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
53fi
54if [ ! -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
57fi
58#####################################################################
59# 以下為叢集環境的需求
60#####################################################################
61########
62# 安裝 MPICH2
63########
64if [ ! -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 ..
72fi
73########
74# 安裝 openPBS / torque
75########
76if [ ! -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
89create queue batch
90set queue batch queue_type = Execution
91set queue batch started = True
92set queue batch enabled = True
93set server default_queue = batch
94set server resources_default.nodes = 1
95set server scheduling = True
96EOF
97  sudo /opt/torque/bin/qmgr < torque_conf
98  cat >> config << EOF
99\$pbsserver    $(hostname)
100\$logevent     255
101EOF
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 ..
109fi
110
111########
112# 安裝 Lustre
113########
114if [ ! -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
120fi
121#####################################################################
122# 以下為叢集版本的生資相關軟體
123#####################################################################
124########
125# 安裝 Rmpi
126########
127if [ ! -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 --with-mpi=/opt/mpich2
130fi
131########
132# 安裝 mpiBLAST
133# 參考 http://debianclusters.cs.uni.edu/index.php/Installing_mpiBLAST
134########
135if [ ! -e mpiBLAST-1.5.0-pio.tgz ]; then
136  wget http://www.mpiblast.org/downloads/files/mpiBLAST-1.5.0-pio.tgz
137  tar zxvf mpiBLAST-1.5.0-pio.tgz
138  cd mpiblast-1.5.0-pio
139  ./ncbi/make/makedis.csh 2>&1|tee out.makedis.txt
140  ./ncbi/make/makedis.csh 2>&1|tee out.makedis.txt
141  ./ncbi/make/makedis.csh 2>&1|tee out.makedis.txt
142  ./configure --prefix=/opt/mpiblast --with-mpi=/opt/mpich2 --with-ncbi=`pwd`/ncbi --enable-MPI_Alloc_mem
143  sudo make
144  sudo make install
145  cd ..
146fi
147#####################################################################
148# 電腦叢集的網頁監控機制
149#####################################################################
150########
151# 安裝 wwwBLAST
152########
153if [ ! -e wwwblast-2.2.20-ia32-linux.tar.gz ]; then
154  wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/wwwblast-2.2.20-ia32-linux.tar.gz
155  tar zxvf wwwblast-2.2.20-ia32-linux.tar.gz
156fi