File: compile_all_tools.sh

package info (click to toggle)
mapsembler2 2.2.4%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 7,288 kB
  • sloc: cpp: 51,204; ansic: 13,165; sh: 542; makefile: 394; asm: 271; python: 28
file content (242 lines) | stat: -rwxr-xr-x 7,862 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
#!/bin/bash
#Copyright inria / irisa (2013)
#
#
#pierre.peterlongo@inria.fr
#
#This software is a computer program whose purpose is performe optimized targeted assembly from reads
#
#This software is governed by the CeCILL license under French law and
#abiding by the rules of distribution of free software.  You can  use,
#modify and/ or redistribute the software under the terms of the CeCILL
#license as circulated by CEA, CNRS and INRIA at the following URL
#"http:#www.cecill.info".
#
#As a counterpart to the access to the source code and  rights to copy,
#modify and redistribute granted by the license, users are provided only
#with a limited warranty  and the software's author,  the holder of the
#economic rights,  and the successive licensors  have only  limited
#liability.
#
#In this respect, the user's attention is drawn to the risks associated
#with loading,  using,  modifying and/or developing or reproducing the
#software by the user in light of its specific status of free software,
#that may mean  that it is complicated to manipulate,  and  that  also
#therefore means  that it is reserved for developers  and  experienced
#professionals having in-depth computer knowledge. Users are therefore
#encouraged to load and test the software's suitability as regards their
#requirements in conditions enabling the security of their systems and/or
#data to be ensured and,  more generally, to use and operate it in the
#same conditions as regards security.
#
#The fact that you are presently reading this means that you have had
#knowledge of the CeCILL license and that you accept its terms.

#######################################################################
#################### HEADER, CHANGE VALUES HERE #######################
#######################################################################
k=29
b=""
Dopt=""
#######################################################################
#################### END HEADER                 #######################
#######################################################################
function help {
echo "compile_all_tools.sh is a script compilation for mapsembler2_extremities, mapsembler2_extend and kissreads_graph or kissreads to build mapsembler2_pipeline"
echo "Usage: ./compile_all_tools.sh <options>"
echo -e "<options>:"
echo -e "\t \t -k <k value>: Define the k value with witch build mapsembler2_extend and kissreads_graph"
echo -e "\t \t -D: Download the nodeWebkit package to build Graph Sequence Viewer (GSV) in desktop app (GSVDesktop). Without this option GSV can be use only with a browser as web app"
echo -e "\t \t -b <path of boost install>: Set the default path of boost install"
echo -e "\t\t -h Prints this message and exist"
echo "Any further question: read the readme file or contact us: pierre.peterlongo@inria.fr"
}

#######################################################################
#################### GET OPTIONS                #######################
#######################################################################
while getopts "b:k:Dh" opt; do
case $opt in
k)
echo "compilation of Mapsembler2_extend and KissreadsGraph with k= $OPTARG" >&2
k=$OPTARG
;;
b)
echo "path of boost install used: $OPTARG" >&2
b=$OPTARG
;;
D):
echo "use -D: nodeWebkit will be downloaded to build GSV desktop app" >&2
Dopt="-D"
;;
h)
help
exit
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
#######################################################################
#################### END GET OPTIONS            #######################
#######################################################################
#if test $# -eq 0
#then
#	k=29
#else
#    k=$1
#fi

if [ -d "./tools" ];
then echo "./tools directory already exist"	
else 
	mkdir tools
fi

echo "#######################################################################
################## COMPILE MAPSEMBLER2 EXTREMITIES ####################
#######################################################################"

cd mapsembler2_extremities
if [ -d "./build" ];
then echo "./build directory already exist"	
else 
	mkdir build
fi
cd build

if [ "$b" == "" ] ; then
cmake ..
else
cmake -DBOOST_ROOT=$b ..
fi
make -j 

cd ../../
cp  ./mapsembler2_extremities/build/mapsembler2_extremities tools
if [ $? -ne 0 ]
then
echo "There was a problem compiling Mapsembler2_extremities, sorry. Please fix the problem or contact pierre.peterlongo@inria.fr."
exit
fi

echo "#######################################################################
#################### COMPILE MAPSEMBLER2 EXTEND #######################
#######################################################################"

if [ -d "./thirdparty" ]
	then
	cd ./thirdparty/
	if [ -d "./zlib" ]
		then
		cd ./zlib/
		if [ -d "./build" ]
			then echo "./build directory already exist"	
		else 
			mkdir build
		fi
		cd ./build
		cmake ..
		make
		cd ../../../	
	else 
		echo "./zlib directory doesn't exist"
		exit
	fi	
else 
	echo "./thirdparty directory doesn't exist"
	exit
fi

cd mapsembler2_extend
make k=$k
cd ..
cp mapsembler2_extend/mapsembler_extend tools/mapsembler2_extend
if [ $? -ne 0 ]
then
echo "There was a problem compiling Mapsembler2_extend, sorry. Please fix the problem or contact pierre.peterlongo@inria.fr."
exit
fi

echo "#######################################################################
###################### COMPILE KISSREADSGRAPH #########################
#######################################################################"

cd kissreads_graph
make k=$k
cd ..
cp kissreads_graph/kissreads_graph tools
if [ $? -ne 0 ]
then
echo "There was a problem compiling KissreadsGraph, sorry. Please fix the problem or contact pierre.peterlongo@inria.fr."
exit
fi

echo "#######################################################################
######################## COMPILE KISSREADS ############################
#######################################################################"

cd kissreads
make k=$k
cd ..
cp kissreads/kissreads tools
if [ $? -ne 0 ]
then
echo "There was a problem compiling Kissreads, sorry. Please fix the problem or contact pierre.peterlongo@inria.fr."
exit
fi

cd visu
cp GSV/doc/doc.pdf ../docs/GSV_doc.pdf
if [ "$Dopt" == "-D" ]
then
	sh buildGSV.sh
	
	cd ../
	if [ -d "./tools/GSVDesktop/" ];
    	then
       	 	rm -R tools/GSVDesktop/

	fi

	if [ -d "./visu/GSVDesktop.d/" ];
    	then 		
		mv visu/GSVDesktop.d tools/GSVDesktop/
	fi

	if [ -f "./GSVDesktop" ] || [ -d "./GSVDesktop.app" ];
    	then 
		echo "GSVDesktop shortcut already exist"
	else

		if [[ "$OSTYPE" == "linux" ]];
   			then  ln -s tools/GSVDesktop/GSVDesktop ./
		elif [[ "$OSTYPE" == "darwin"* ]];
    			then  ln -s tools/GSVDesktop/GSVDesktop.app ./
		fi
	fi
fi

if [ $? -ne 0 ]
    then
    echo "There was a problem compiling Graph Sequence Viewer, sorry. Please fix the problem or contact pierre.peterlongo@inria.fr."
exit
fi

echo "Compiling is done, if possible, :"
echo -e "\t 1/ copy executables \"tools/mapsembler2_extremities\", \"tools/mapsembler2_extend\", \"tools/kissreads_graph\", \"tools/kissreads\" and \"tools/GSVDesktop in a directory member of the PATH environment variable (e.g. /usb/local/bin)"
echo -e "\t 2/ replace PATH_RS=\"./tools\" by PATH_RS=\"\" in the \"run_mapsembler_and_phaser.sh\" configuration file"
MY_PATH="`( cd \"$MY_PATH\" && pwd )`"  # absolutized and normalized
if [ -z "$MY_PATH" ] ; then
# error; for some reason, the path is not accessible
# to the script (e.g. permissions re-evaled after suid)
exit 1  # fail
fi

echo "Leave it as is. In this case, if working outside this current directory (\"$MY_PATH\"), you will have to indicate in the \"run_mapsembler_and_phaser.sh\" where executables \"mapsembler\", \"phaser\" and \"GSV\" are located by changing the value of the PATH_RS variable"