-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
53 lines (45 loc) · 1.3 KB
/
build.sh
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
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status
cpath=$(pwd)
overall_success=true
# Function to check command success
check_success() {
if [ $? -ne 0 ]; then
echo "Error: $1 failed"
overall_success=false
fi
}
# Create a directory for binaries
[ -d bin ] && rm -rf bin
mkdir bin
# Install and build wtdbg2
[ -d wtdbg2 ] && rm -rf wtdbg2
git clone https://github.com/ruanjue/wtdbg2
(cd wtdbg2 && make) || check_success "wtdbg2 build"
mv wtdbg2/kbm2 bin/ || check_success "moving kbm2"
rm -rf wtdbg2
# Install and build seqtk
[ -d seqtk ] && rm -rf seqtk
git clone https://github.com/lh3/seqtk.git
(cd seqtk && make) || check_success "seqtk build"
mv seqtk/seqtk bin/ || check_success "moving seqtk"
rm -rf seqtk
cd $cpath
case $1 in
osx | macos)
echo "OSX Build"
# OSX Build
clang++ splitreads.cpp -o graphk/oblr_utils/split -lz -std=c++11 -O3 || check_success "OSX splitreads build"
;;
*)
echo "Linux Build"
# Linux Build
g++ splitreads.cpp -o graphk/oblr_utils/split -lz -std=c++11 -O3 || check_success "Linux splitreads build"
;;
esac
if $overall_success; then
echo "All installations and builds completed successfully!"
else
echo "Some installations or builds failed. Please check the output for errors."
exit 1
fi