-
Notifications
You must be signed in to change notification settings - Fork 11
/
virtualenv-notes
292 lines (232 loc) · 6.67 KB
/
virtualenv-notes
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# NOTE, only work on the virtualenv on the "sgn04" machine!
# (rsync it to /tmp and back)
sgn04:
cd /tmp
export PATH=~/miniconda3b/bin:${PATH}
unset PYTHONPATH
conda create -p /tmp/viewer-conda-3 python==3.6
source activate /tmp/viewer-conda-3
cd /tmp/viewer-conda-3
conda install freetype
wget ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-6.2.tar.bz2
tar xjf wcslib-6.2.tar.bz2
cd wcslib-6.2
export CFLAGS=-fPIC
./configure --prefix=/tmp/viewer-conda-3
make -j8
make install
export WCSLIB_LIB=/tmp/viewer-conda-3/lib/libwcs.a
export PKG_CONFIG_PATH=/tmp/viewer-conda-3/lib/pkgconfig
wget http://downloads.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz
tar xzf swig-3.0.8.tar.gz
cd swig-3.0.8
./configure --prefix=/tmp/viewer-conda-3 --without-pcre --without-perl5
make
make -j8
make install
cd ..
git clone https://github.com/dstndstn/astrometry.net.git astrometry
cd astrometry
make -k
unset PKG_CONFIG_PATH
make -k
make -k py
cd ..
git clone https://github.com/dstndstn/tractor.git tractor-git
cd tractor-git/
make
make version
ln -s tractor-git/tractor .
git clone https://github.com/legacysurvey/legacypipe.git legacypipe-git
ln -s legacypipe-git/py/legacypipe/ .
cd ..
pip install psycopg2
cd viewer-conda-3/
pip install psycopg2
pip install matplotlib
pip install uwsgi
pip install django
pip install fitsio==0.9.11
pip install astropy
pip install scipy
pip install Pillow
pip install requests
-------------------------
export PATH=~/miniconda3b/bin:${PATH}
unset PYTHONPATH
unset PKG_CONFIG_PATH
conda create -y -p /tmp/viewer-dev-conda-3 python==3.6
source activate /tmp/viewer-dev-conda-3
cd /tmp/viewer-dev-conda-3
conda install -y freetype
pip install numpy
pip install scipy
pip install matplotlib
wget ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-6.2.tar.bz2
tar xjf wcslib-6.2.tar.bz2
cd wcslib-6.2
export CFLAGS=-fPIC
./configure --prefix=/tmp/viewer-dev-conda-3
make -j8
make install
export WCSLIB_LIB=/tmp/viewer-dev-conda-3/lib/libwcs.a
export PKG_CONFIG_PATH=/tmp/viewer-dev-conda-3/lib/pkgconfig
cd ..
wget http://downloads.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz
tar xzf swig-3.0.8.tar.gz
cd swig-3.0.8
./configure --prefix=/tmp/viewer-dev-conda-3 --without-pcre --without-perl5
make
make -j8
make install
cd ..
git clone https://github.com/dstndstn/astrometry.net.git astrometry
cd astrometry
make -k
make -k py
cd ..
git clone https://github.com/dstndstn/tractor.git tractor-git
cd tractor-git/
make
make version
cd ..
ln -s tractor-git/tractor .
git clone https://github.com/legacysurvey/legacypipe.git legacypipe-git
ln -s legacypipe-git/py/legacypipe/ .
pip install uwsgi
pip install django
pip install fitsio==0.9.11
pip install astropy
-------------------------
sgn04:
cd /tmp
rsync -arv ~/cosmo/webapp/viewer-dev/viewer-dev-conda-2 .
export PATH=~/miniconda3b/bin:${PATH}
unset PYTHONPATH
source activate viewer-dev-conda-2
# ... tinker...
rsync -arv viewer-dev-conda-2 edison:cosmo/webapp/viewer-dev/
# ??
# virtualenv --always-copy venv
#on sgn04
cd /tmp
virtualenv venv
cd venv
source bin/activate
pip install numpy
pip install uwsgi
pip install django
mkdir build
cd build
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
tar xzf freetype-2.4.12.tar.gz
cd freetype-2.4.12
./configure --prefix=/tmp/venv
make
make install
cd ..
wget ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-5.12.tar.bz2
tar xjf wcslib-5.12.tar.bz2
cd wcslib-5.12
export CFLAGS=-fPIC
./configure --prefix=/tmp/venv
make
make install
cd ../..
export WCSLIB_LIB=/tmp/venv/lib/libwcs.a
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/tmp/venv/lib/pkgconfig
cd build
wget http://downloads.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz
tar xzf swig-3.0.8.tar.gz
cd swig-3.0.8
./configure --prefix=/tmp/venv --without-pcre --without-perl5
cd ../..
git clone https://github.com/dstndstn/astrometry.net.git astrometry
cd astrometry
make -k
4make -k py
(cd libkd && make py)
cd ..
git clone https://github.com/dstndstn/tractor.git tractor-git
cd tractor-git/
make
cd ..
ln -s tractor-git/tractor .
git clone https://github.com/legacysurvey/legacypipe.git legacypipe-git
ln -s legacypipe-git/py/legacypipe/ .
cd ..
virtualenv --relocatable venv
pip install psycopg2
pip install matplotlib
easy_install -U setuptools
pip install astropy
pip install scipy
pip install nose # optional
pip install pillow # for jpeg plots
git clone https://github.com/esheldon/fitsio.git fitsio-git
cd fitsio-git
python setup.py install --home=$(pwd)/installed
cd ..
ln -s fitsio-git/installed/lib/python/fitsio .
# ------ older attempts ---------
# NOTE, only work on the virtualenv on the "sgn02" machine!
Start with
http://astrometry.net/svn/trunk/projects/unwise-web/virtualenv-notes
ie,
module unload python
module unload swig
module unload gcc
module load python
cd /project/projectdirs/cosmo/webapp/viewer/
virtualenv venv
cd venv
source bin/activate
pip install numpy
pip install Django==1.6.2
pip install fitsio
cd build
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
tar xzf freetype-2.4.12.tar.gz
cd freetype-2.4.12
./configure --prefix=/project/projectdirs/cosmo/webapp/viewer/venv
make
make install
cd ../..
# Apply Django patches...
(cd lib/python2.6/site-packages/; patch -p3) < ../../unwise.me/venv-unwise-phot/unwise-web/django-1.6.2-on-python-2.6.1-b.patch
patch -p3 < ../../unwise.me/venv-unwise-phot/unwise-web/django-1.6.2-on-python-2.6.1.patch
module load swig/3.0.2
cd build
wget ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-4.25.1.tar.bz2
tar xjf wcslib-4.25.1.tar.bz2
cd wcslib-4.25.1
./configure --prefix=/project/projectdirs/cosmo/webapp/viewer/venv
make
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}://project/projectdirs/cosmo/webapp/viewer/venv/lib/pkgconfig
# dynamic linking... how do we pass LD_LIBRARY_PATH? Try static...
export WCSLIB_LIB=/project/projectdirs/cosmo/webapp/viewer/venv/lib/libwcs.a
# need to rebuild with -fPIC
export CFLAGS=-fPIC
cd wcslib-4.25.1
make clean
./configure ...
make
make install
git clone [email protected]:dstndstn/astrometry.net astrometry
(cd astrometry && make -k)
(cd astrometry && make -k py)
(cd astrometry/libkd && make pyspherematch)
git clone [email protected]:dstndstn/tractor.git tractor-git
(cd tractor-git && make)
ln -s tractor-git/tractor tractor
ln -s tractor-git/projects/desi .
#pip install matplotlib
# (was failing to "import matplotlib.pylab" with _backend_agg.so missing symbol)
cd build
wget http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.4.3/matplotlib-1.4.3.tar.gz
tar xzf matplotlib-1.4.3.tar.gz
cd matplotlib-1.4.3
# https://github.com/matplotlib/matplotlib/issues/2577
python setup.py build --force
python setup.py install
pip install scipy