File: install_centos_prereqs.sh

package info (click to toggle)
genomicsdb 1.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,316 kB
  • sloc: cpp: 68,637; ansic: 58,281; java: 8,230; python: 2,315; sh: 2,115; perl: 1,621; makefile: 499; xml: 496
file content (143 lines) | stat: -rwxr-xr-x 5,051 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash

# The MIT License (MIT)
# Copyright (c) 2019-2021 Omics Data Automation, Inc.
# Copyright (c) 2023 dātma, inc™
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

install_devtoolset() {
  echo "Installing devtoolset"
  if [[ $CENTOS_VERSION -ge 8 ]]; then
    yum -y makecache &&
      yum -y grouplist &&
      yum -y groupinstall "Development Tools"
  else
    yum install -y centos-release-scl &&
      yum install -y devtoolset-7 &&
      echo "source /opt/rh/devtoolset-7/enable" >> $PREREQS_ENV
  fi
}

install_cmake3() {
  CMAKE=`which cmake`
  if [[ ! -z $CMAKE ]]; then
    CMAKE_VERSION=$($CMAKE -version | awk '/version/{print $3}')
  fi
  if [[ -z $CMAKE_VERSION || CMAKE_VERSION < "3.6" ]]; then
    echo "Installing cmake..."
    wget -nv https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1-Linux-x86_64.sh -P /tmp &&
      chmod +x /tmp/cmake-3.19.1-Linux-x86_64.sh &&
      /tmp/cmake-3.19.1-Linux-x86_64.sh --prefix=/usr/local --skip-license
    if [ ! -f /usr/local/bin/cmake3 ]; then
      ln -s /usr/local/bin/cmake /usr/local/bin/cmake3
    fi
  fi
}

install_openjdk() {
  if [[ $CENTOS_VERSION -ge 8 ]]; then
    echo "Installing openjdk" &&
      yum install -y -q java-17-openjdk-devel &&
      echo "export JRE_HOME=/usr/lib/jvm/jre" >> $PREREQS_ENV
  else
    curl -O https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz &&
    tar zxvf openjdk-17.0.2_linux-x64_bin.tar.gz &&
    mv jdk-17.0.2 /usr/local/ &&
    echo "export JAVA_HOME=/usr/local/jdk-17.0.2" >> $PREREQS_ENV
  fi
}

install_mpi() {
  yum install -y -q mpich-devel &&
  echo "export PATH=/usr/lib64/mpich/bin:\$PATH" >> $PREREQS_ENV &&
  echo "export LD_LIBRARY_PATH=/usr/lib64:/usr/lib:\$LD_LIBRARY_PATH" >> $PREREQS_ENV
}

install_csv() {
  if [[ $CENTOS_VERSION -lt 8 ]]; then 
    yum install -y -q libcsv libcsv-devel &&
      yum install -y -q csv
  fi
}

# Sufficient to build/install the genomicsdb libraries
install_minimum_prerequisites() {
   yum install -y -q deltarpm
   yum update -y -q &&
     yum install -y -q epel-release &&
     yum install -y -q which wget git &&
     yum install -y -q autoconf automake libtool unzip &&
     yum install -y -q cmake3 patch &&
     yum install -y -q perl perl-IPC-Cmd &&
     yum install -y -q libuuid libuuid-devel &&
     yum install -y -q curl libcurl-devel
}

install_openssl() {
  OPENSSL_PREFIX=$INSTALL_PREFIX/ssl
  if [[ ! -d $OPENSSL_PREFIX ]]; then
    echo "Installing OpenSSL"
    pushd /tmp
    wget $WGET_NO_CERTIFICATE https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz &&
    tar -xvzf openssl-$OPENSSL_VERSION.tar.gz &&
    cd openssl-$OPENSSL_VERSION &&
    CFLAGS=-fPIC ./config -fPIC no-shared --prefix=$OPENSSL_PREFIX --openssldir=$OPENSSL_PREFIX &&
    make && make install && echo "Installing OpenSSL DONE"
    rm -fr /tmp/openssl*
    popd
  fi
  add_to_env OPENSSL_ROOT_DIR $OPENSSL_PREFIX
  add_to_env LD_LIBRARY_PATH $OPENSSL_PREFIX/lib
}

install_system_prerequisites() {
  yum install -y -q deltarpm
  yum update -y -q &&
    yum install -y -q sudo &&
    yum install -y -q which wget git make &&
    install_mpi &&
    install_devtoolset &&
    install_openjdk &&
    yum install -y -q autoconf automake libtool unzip &&
    yum update -y -q autoconf &&
    yum install -y -q epel-release &&
    yum install -y zlib-devel &&
    yum install -y -q openssl-devel &&
    install_cmake3 &&
    yum install -y -q libuuid libuuid-devel &&
    yum install -y -q patch &&
    yum install -y -q zstd &&
    yum install -y -q curl libcurl-devel &&
    install_csv
}

install_nobuild_prerequisites() {
  yum install -y -q deltarpm
  yum update -y -q &&
    install_mpi &&
    yum install -y -q epel-release &&
    yum install -y zlib-devel &&
    yum install -y -q openssl-devel &&
    yum install -y -q cmake3 &&
    yum install -y -q patch &&
    yum install -y -q libuuid libuuid-devel &&
    yum install -y -q zstd &&
    yum install -y -q curl libcurl-devel
}