-
Notifications
You must be signed in to change notification settings - Fork 14
/
install
executable file
·125 lines (104 loc) · 4.31 KB
/
install
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
#!/bin/bash
# This script is shamelessly adapted from https://github.com/saalfeldlab/n5-utils, thanks @axtimwalde & co!
VERSION="2.3.5-SNAPSHOT"
INSTALL_DIR=${1:-$(pwd)}
echo ""
echo "Installing into $INSTALL_DIR"
# check for operating system
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "Assuming on Linux operating system"
MEM=$(cat /proc/meminfo | grep MemTotal | sed s/^MemTotal:\\\s*\\\|\\\s\\+[^\\\s]*$//g)
MEMGB=$(($MEM/1024/1024))
MEM=$((($MEMGB/5)*4))
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Assuming on MacOS X operating system"
# sysctl returns total hardware memory size in bytes
MEM=$(sysctl hw.memsize | grep hw.memsize | sed s/hw.memsize://g)
MEMGB=$(($MEM/1024/1024/1024))
MEM=$((($MEMGB/5)*4))
else
echo "ERROR - Operating system (arg2) must be either linux or osx - EXITING (on windows please run as a normal Java class from e.g. Eclipse)"
exit
fi
echo "Available memory:" $MEMGB "GB, setting Java memory limit to" $MEM "GB"
mvn clean install
mvn -Dmdep.outputFile=cp.txt -Dmdep.includeScope=runtime dependency:build-classpath
echo ""
echo "Installing 'rs-fish' command into" $INSTALL_DIR
echo ""
echo '#!/bin/bash' > rs-fish
echo '' >> rs-fish
echo "JAR=\$HOME/.m2/repository/net/preibisch/Radial_SymmetryLocalization/${VERSION}/Radial_SymmetryLocalization-${VERSION}.jar" >> rs-fish
echo 'java \' >> rs-fish
echo " -Xmx${MEM}g \\" >> rs-fish
echo ' -XX:+UseConcMarkSweepGC \' >> rs-fish
echo -n ' -cp $JAR:' >> rs-fish
echo -n $(cat cp.txt) >> rs-fish
echo ' \' >> rs-fish
echo ' cmd.RadialSymmetry "$@"' >> rs-fish
echo ""
echo "Installing 'rs-fish-anisotropy' command into" $INSTALL_DIR
echo ""
echo '#!/bin/bash' > rs-fish-anisotropy
echo '' >> rs-fish-anisotropy
echo "JAR=\$HOME/.m2/repository/net/preibisch/Radial_SymmetryLocalization/${VERSION}/Radial_SymmetryLocalization-${VERSION}.jar" >> rs-fish-anisotropy
echo 'java \' >> rs-fish-anisotropy
echo " -Xmx${MEM}g \\" >> rs-fish-anisotropy
echo ' -XX:+UseConcMarkSweepGC \' >> rs-fish-anisotropy
echo -n ' -cp $JAR:' >> rs-fish-anisotropy
echo -n $(cat cp.txt) >> rs-fish-anisotropy
echo ' \' >> rs-fish-anisotropy
echo ' cmd.Anisotropy "$@"' >> rs-fish-anisotropy
echo ""
echo "Installing 'csv-overlay-imagej' command into" $INSTALL_DIR
echo ""
echo '#!/bin/bash' > csv-overlay-imagej
echo '' >> csv-overlay-imagej
echo "JAR=\$HOME/.m2/repository/net/preibisch/Radial_SymmetryLocalization/${VERSION}/Radial_SymmetryLocalization-${VERSION}.jar" >> csv-overlay-imagej
echo 'java \' >> csv-overlay-imagej
echo " -Xmx${MEM}g \\" >> csv-overlay-imagej
echo ' -XX:+UseConcMarkSweepGC \' >> csv-overlay-imagej
echo -n ' -cp $JAR:' >> csv-overlay-imagej
echo -n $(cat cp.txt) >> csv-overlay-imagej
echo ' \' >> csv-overlay-imagej
echo ' cmd.OverlayCSV "$@"' >> csv-overlay-imagej
echo ""
echo "Installing 'csv-overlay-bdv' command into" $INSTALL_DIR
echo ""
echo '#!/bin/bash' > csv-overlay-bdv
echo '' >> csv-overlay-bdv
echo "JAR=\$HOME/.m2/repository/net/preibisch/Radial_SymmetryLocalization/${VERSION}/Radial_SymmetryLocalization-${VERSION}.jar" >> csv-overlay-bdv
echo 'java \' >> csv-overlay-bdv
echo " -Xmx${MEM}g \\" >> csv-overlay-bdv
echo ' -XX:+UseConcMarkSweepGC \' >> csv-overlay-bdv
echo -n ' -cp $JAR:' >> csv-overlay-bdv
echo -n $(cat cp.txt) >> csv-overlay-bdv
echo ' \' >> csv-overlay-bdv
echo ' cmd.VisualizePointsBDV "$@"' >> csv-overlay-bdv
echo ""
echo "Installing 'embryo-correction' command into" $INSTALL_DIR
echo ""
echo '#!/bin/bash' > embryo-correction
echo '' >> embryo-correction
echo "JAR=\$HOME/.m2/repository/net/preibisch/Radial_SymmetryLocalization/${VERSION}/Radial_SymmetryLocalization-${VERSION}.jar" >> embryo-correction
echo 'java \' >> embryo-correction
echo " -Xmx${MEM}g \\" >> embryo-correction
echo ' -XX:+UseConcMarkSweepGC \' >>embryo-correction
echo -n ' -cp $JAR:' >> embryo-correction
echo -n $(cat cp.txt) >> embryo-correction
echo ' \' >> embryo-correction
echo ' corrections.ZCorrection "$@"' >> embryo-correction
chmod a+x rs-fish
chmod a+x rs-fish-anisotropy
chmod a+x csv-overlay-imagej
chmod a+x csv-overlay-bdv
chmod a+x embryo-correction
if [ $(pwd) == "$INSTALL_DIR" ]; then
echo "Installation directory equals current directory, we are done."
else
echo "Creating directory $INSTALL_DIR and moving files..."
mkdir -p $INSTALL_DIR
mv st-view $INSTALL_DIR/
fi
rm cp.txt
echo "Installation finished."