File: install.sh

package info (click to toggle)
reapr 1.0.18+dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,092 kB
  • ctags: 733
  • sloc: cpp: 4,816; perl: 1,467; sh: 160; makefile: 116
file content (169 lines) | stat: -rwxr-xr-x 4,356 bytes parent folder | download | duplicates (3)
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/usr/bin/env bash
set -e
rootdir=$PWD

unamestr=$(uname)

# Check if the OS seems to be Linux. This should be informative to
# Windows/Mac users that are trying to install this, despite it being
# developed for Linux. There is a VM avilable for Mac/Windows.
if [ "$unamestr" != "Linux" ]
then
    echo "Operating system does not appear to be Linux: uname says it's '$unamestr'"

    if [ "$1" = "force" ]
    then
        echo "'force' option used, carrying on anyway. Best of luck to you..."
    else
        echo "
If you *really* want to try installing anyway, run this:
./install.sh force

If you're using a Mac or Windows, then the recommended way to run REAPR is
to use the virtual machine."
        exit 1
    fi
fi


echo "------------------------------------------------------------------------------
                           Checking prerequisites
------------------------------------------------------------------------------
"
echo "Checking Perl modules..."

modules_ok=1

for module in File::Basename File::Copy File::Spec File::Spec::Link Getopt::Long List::Util
do
    set +e
    perl -M$module -e 1 2>/dev/null

    if [ $? -eq 0 ]
    then
        echo "  OK $module"
    else
        echo "  NOT FOUND: $module"
        modules_ok=0
    fi
    set -e
done

if [ $modules_ok -ne 1 ]
then
    echo "Some Perl modules were not found - please install them. Cannot continue"
    exit 1
else
    echo "... Perl modules all OK"
fi


echo
echo "Looking for R..."

if type -P R
then
    echo "... found R OK"
else
    echo "Didn't find R. It needs to be installed and in your path. Cannot continue"
fi


cd third_party

echo "
------------------------------------------------------------------------------
                           Compiling cmake
------------------------------------------------------------------------------
"
cd cmake
./bootstrap --prefix $PWD
make
cd ..
echo "
------------------------------------------------------------------------------
                           cmake compiled
------------------------------------------------------------------------------
"

echo "
------------------------------------------------------------------------------
                           Compiling Bamtools
------------------------------------------------------------------------------
"
cd bamtools
mkdir build
cd build
$rootdir/third_party/cmake/bin/cmake ..
make
cd $rootdir
echo "
------------------------------------------------------------------------------
                            Bamtools compiled
------------------------------------------------------------------------------
"

echo "
------------------------------------------------------------------------------
                              Compiling Tabix
------------------------------------------------------------------------------
"
cd third_party/tabix
make
cd ..
echo "
------------------------------------------------------------------------------
                              Tabix compiled
------------------------------------------------------------------------------
"

echo "
------------------------------------------------------------------------------
                             Compiling snpomatic
------------------------------------------------------------------------------
"
cd snpomatic
make
cd ..
echo "
------------------------------------------------------------------------------
                              snpomatic compiled
------------------------------------------------------------------------------
"

echo "
------------------------------------------------------------------------------
                             Compiling samtools
------------------------------------------------------------------------------
"
cd samtools
make
echo "
------------------------------------------------------------------------------
                              samtools compiled
------------------------------------------------------------------------------
"

echo "
------------------------------------------------------------------------------
                               Compiling Reapr
------------------------------------------------------------------------------
"
cd $rootdir/src
make
cd ..
ln -s src/reapr.pl reapr
echo "
Reapr compiled

All done!

Run
./reapr
for usage.

Read the manual
manual.pdf
for full instructions
"