-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathINSTALL.txt
More file actions
214 lines (187 loc) · 8.18 KB
/
Copy pathINSTALL.txt
File metadata and controls
214 lines (187 loc) · 8.18 KB
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
# This is a collection of instructions used during development to compile
# the installation package of Sen2Water. It is not a verified set of
# instructions for users.
# create directory tree
# copy parts provided as resource
# download java jdk
# download and compile snap, calvalus, install snap
# install c2rcc
# download, compile and install idepix
# download and install python
# compile and install msiresampling and s2wswitching
# download and install acolite
# download and install polymer
# install auxdata
# package delivery
version=0.4
tmpdir=$(pwd)
installdir=$tmpdir/sen2water-$version
#which gcc
#which cmake
cd $tmpdir
git clone --branch 0.2-maintenance https://github.com/bcdev/sen2water.git
wget https://cdn.azul.com/zulu/bin/zulu8.76.0.17-ca-jdk8.0.402-linux_x64.zip
#wget https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.zip
wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.2.5/apache-maven-3.2.5-bin.tar.gz
#wget https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tgz
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
git clone --branch 9.x.calvalus --depth 1 https://github.com/senbox-org/snap-engine.git
git clone --branch 9.x.calvalus --depth 1 https://github.com/senbox-org/snap-desktop.git
git clone --branch 9.x.calvalus --depth 1 https://github.com/senbox-org/s1tbx.git
git clone --branch 9.x.calvalus --depth 1 https://github.com/senbox-org/s2tbx.git
git clone --branch 9.x.calvalus --depth 1 https://github.com/senbox-org/s3tbx.git
git clone --branch 9.x.calvalus --depth 1 https://github.com/senbox-org/probavbox.git
git clone https://github.com/bcdev/calvalus2.git
git clone --depth 1 https://github.com/bcdev/snap-idepix.git
#git clone https://github.com/bcdev/acolite.git
git clone https://github.com/acolite/acolite.git
git clone https://github.com/acolite/acolite_tools.git
#git clone -b mb-sen2water https://github.com/bcdev/polymer.git
git clone https://github.com/hygeos/polymer.git
# TODO determine versions/tags for all repos
unzip zulu8.76.0.17-ca-jdk8.0.402-linux_x64.zip
unzip apache-maven-3.9.6-bin.zip
#tar xf Python-3.11.8.tgz
# snap
export PATH=$(pwd)/zulu8.76.0.17-ca-jdk8.0.402-linux_x64/bin:$PATH
export PATH=$(pwd)/apache-maven-3.9.6-bin/bin:$PATH
cd snap-engine
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ..
cd snap-desktop
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ..
cd s1tbx
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ..
cd s2tbx
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ..
cd s3tbx
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ..
cd probavbox
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ..
cd calvalus2/calvalus-snap
# need to comment away the dependencies and execution of unpacking hdf libs
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ../..
# edit version and JTransforms 2.4 instead of jtransforms 2.3
cd snap-idepix/idepix-core
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ../..
cd snap-idepix/idepix-s2msi
mvn -Dmaven.repo.local=/home/yarn/appcache/sen2water-tmp/m2 -DskipTests=true install
cd ../..
# make proj, libgdal
#wget https://download.osgeo.org/proj/proj-9.3.1.tar.gz
#wget https://download.osgeo.org/proj/proj-data-1.16.tar.gz
#tar xf proj-9.3.1.tar.gz
#cd proj-9.3.1
#mkdir build
#cd build
#cmake ..
#cmake --build .
#for f in CMakeCache.txt cmake_install.cmake CPackConfig.cmake CPackSourceConfig.cmake; do sed -i -e s,/usr/local,/home/yarn/appcache/sen2water-tmp/sen2water-0.2/lib/python, $f; done
#cmake --build . --target install
#cd ..
#cd ..
#mkdir -p sen2water-0.2/auxdata/proj-data
#tar xCf sen2water-0.2/auxdata/proj-data proj-data-1.16.tar.gz
#git clone https://github.com/OSGeo/gdal.git
#cd gdal
#mkdir build
#cd build
#cmake ..
#cmake --build .
#cmake --build . --target install
mkdir -p sen2water-$version/bin
mkdir -p sen2water-$version/etc
mkdir -p sen2water-$version/lib/jre
mkdir -p sen2water-$version/lib/python
mkdir -p sen2water-$version/lib/acolite
mkdir -p sen2water-$version/lib/polymer
mkdir -p sen2water-$version/lib/idepix
mkdir -p sen2water-$version/lib/c2rcc
mkdir -p sen2water-$version/lib/snap
mkdir -p sen2water-$version/lib/msiresampling
mkdir -p sen2water-$version/licenses
tar cCf zulu8.76.0.17-ca-jdk8.0.402-linux_x64 - jre | tar xCf sen2water-0.2/lib -
bash Miniconda3-latest-Linux-x86_64.sh -b -p $installdir/lib/conda
export MAMBA_ROOT_PREFIX=$installdir/lib/conda
export PATH=$(pwd)/bin:$PATH
eval "$($(pwd)/bin/micromamba shell hook -s posix)"
micromamba activate
#micromamba install -c conda-forge -f requirements.txt
micromamba install -c conda-forge -y $(cat requirements.txt|tr '\n' ' ')
# edit setup.cfg, comment away the requirements.txt line, then install reader
pip install --editable .
#cd Python-3.11.8
#./configure --enable-optimizations --prefix $installdir/lib/python
#make -j 4
#make install
#cd ..
#$installdir/lib/python/bin/python3 -m venv sen2water-$version/lib/python/s2wvenv
#. sen2water-$version/lib/python/s2wvenv/bin/activate
# patch 2 files in acolite and 2 files in polymer
cd polymer
make
cd ..
mv acolite/* sen2water-$version/lib/acolite
cp acolite_tools/acolite/TGC/tgc2.py sen2water-$version/lib/acolite
mv polymer/* sen2water-$version/lib/polymer
cp snap-idepix/idepix-core/target/idepix-core-9.0.7-SNAPSHOT.jar sen2water-$version/lib/idepix/
cp snap-idepix/idepix-s2msi/target/idepix-s2msi-9.0.7-SNAPSHOT.jar sen2water-$version/lib/idepix/
cp s3tbx/s3tbx-c2rcc/target/s3tbx-c2rcc-9.0.4.2cv.jar sen2water-$version/lib/c2rcc/
tar xCf sen2water-$version/lib sen2water/resources/snap-for-s2w.tar.gz
cp m2/org/esa/snap/lib-gdal/9.0.6.1cv/lib-gdal-9.0.6.1cv.jar sen2water-$version/lib/snap/snap/modules/
cp s2tbx/s2tbx-gdal-reader/target/s2tbx-gdal-reader-9.0.2.1cv.jar sen2water-$version/lib/snap/snap/modules/
cp calvalus2/calvalus-snap/target/snap-bundle/snap-all.jar sen2water-$version/lib/snap/snap/modules/
ln -s ../../../idepix/idepix-core-9.0.7-SNAPSHOT.jar sen2water-$version/lib/snap/snap/modules/
ln -s ../../../idepix/idepix-s2msi-9.0.7-SNAPSHOT.jar sen2water-$version/lib/snap/snap/modules/
ln -s ../../../c2rcc/s3tbx-c2rcc-9.0.4.2cv.jar sen2water-$version/lib/snap/snap/modules/
mkdir -p sen2water-$version/lib/snap/snap/modules/lib/amd64
cp calvalus2/calvalus-snap/target/snap-bundle/libopenjp2.so sen2water-$version/lib/snap/snap/modules/lib/amd64
mkdir -p sen2water-$version/lib/snap/snap/modules/ext/org.esa.snap.snap-core/org-esa-snap
ln -s ../../../snap-all.jar sen2water-$version/lib/snap/snap/modules/ext/org.esa.snap.snap-core/org-esa-snap/snap-runtime.jar
tar cCf sen2water - sen2water/__init__.py sen2water/eoutils sen2water/msiresampling sen2water/s2wswitching | tar xCf sen2water-0.2/lib/msiresampling -
cp sen2water/resources/README sen2water-$version/
cp sen2water/resources/bin/* sen2water-$version/bin/
cp sen2water/resources/etc/* sen2water-$version/etc/
#mkdir sen2water-0.2
#mkdir packages
#cd packages
#wget https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tgz
#tar xf Python-3.11.8.tgz
#cd Python-3.11.8
#./configure --enable-optimizations --prefix `pwd`/python
#make -j 4
#make install
#bin/python3 -m venv s2wvenv
#. s2wvenv/bin/activate
#cd ..
bash Miniconda3-latest-Linux-x86_64.sh -b -p conda
export MAMBA_ROOT_PREFIX=$(pwd)/conda
#export PATH=$(pwd)/bin:$PATH
eval "$($(pwd)/bin/micromamba shell hook -s posix)"
micromamba activate
#micromamba install -c conda-forge -f requirements.txt
micromamba install -c conda-forge -y $(cat requirements.txt|tr '\n' ' ')
# edit setup.cfg, comment away the requirements.txt line, then install reader
pip install --editable .
git clone https://github.com/bcdev/sen2water.git
cd sen2water
micromamba install -c conda-forge -r requirements.txt
pip install --editable .
cd wd
sen2water.sh
conda pack -f -o conda-s2w.tar.gz
cd sen2water-0.4/lib
rm conda
mkdir conda
cd conda
tar xf ../../../conda-s2w.tar.gz
cd ../../..
tar czf sen2water-0.4-20240719.tar.gz sen2water-0.4/{bin,lib,etc,licenses,README}