forked from barronh/WHIPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.txt
501 lines (327 loc) · 15.4 KB
/
INSTALL.txt
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
INSTALL.txt
This file provides instructions on how to install the whips
program on your local *nix machine. There are currently no plans to
support a Windows installation.
PREREQUISITES
=============
WHIPS depends on the following 3rd party pieces of software
1) python (version 2.5.x or newer, but NOT version 3)
The software used here was all written for python version 2.5.x. or later
Though there is a version 3 of python, it is not backwards
compatible and should not be used.
Python may already be installed on your system. Try executing
which python
to see if this is the case. If you have it, try
python -V
and if the version number is greater than 2.5 you can skip this step.
If you do have to install python, or simply want a fresh copy, then
do the following:
1.1: Obtain the source code from the official python website
http://python.org/download/releases/
1.2: Untar the source
tar -xzvf python-2.x.y.tar.gz
1.3: Set any desired compilation environmental variables. These
include all variables commonly recognized by autoconf scripts,
including:
CC for the C compiler
CFLAGS for the C compiler flags
CXX for the C++ compiler
CXXFLAGS for the C++ compiler flags
and many others
If you have no idea what any of this means don't worry about it,
it's more than likely safe to ignore it.
1.4: Change to the unpacked directory and run the configuration
script. The script accepts numerous arguments, the most
important among them the --prefix argument that sets the base
directory for the install.
cd python-2.x.y
./configure --prefix=/path/to/base/directory
1.5: Make the program and install it to the base directory
make install
1.6: Confirm that your default python is now the one you just
installed. Run the following commands to regenerate the list of
commands as if you'd just logged in, then look at the full path
to the default copy of python.
rehash
which python
This should print out
/path/to/base/directory/bin/python
If it does not, you need to adjust your path in your shrc file
(~/.tcshrc, ~/.cshrc, ~/.bashrc, depending on your shell) to
point to the new copy of python. Do NOT attempt to use an alias
to point to the correct copy of python as this can cause serious
errors with python's installation tools.
2) Install HDF4
The software was orignally written with HDF 4.2.6. It should be
backwards compatible beyond that but no attempts have been made to
determine how far back it goes.
HDF4 software is necessary to read in the MOPITT data.
The following instructions detail how to install from source.
You're welcome to try to install the binaries available.
2.1: Download the HDF4 source code from
http://wwww.hdfgroup.org/ftp/HDF/HDF_Current/src/
2.2: Untar the source code
tar -xzvf hdf-4.2.6.tar.gz
2.3: Install JPEG. The HDF4 installation depends on the JPEG
libraries, so we'll need to install those before we can proceed
with installing HDF4.
2.3.1: Download the JPEG (v66 or newer) source code. A link is
provided at http://www.hdfgroup.org/release4/obtain.html
2.3.2: Untar JPEG
tar -xzvf jpegsrc.v66.tar.gz
2.3.3: Move to the untarred jpeg directory and run the configure
script. Again, make sure to set the --prefix flag to the
base directory of the install
cd jpeg-6b
./configure --prefix=/path/to/base/directory
2.3.4: Build the libraries
make
2.3.5: Install the libraries to the base directory. Note that
unlike most well-behaved distributions, this actually has a
chance of failing. If it complains about a file called
'cjpeg.1', try explicitly creating the filetree in which it
resides, then re-running the install. Note that we have to
run two separate commands to actually get the libraries.
make install
make install-lib
2.4: Install zlib. The HDF4 installation depends on this library
as well. We build it from source, though binaries may work
better for your system.
2.4.1: Obtain zlib. Note that though it is linked from the HDF4
site, the link was broken as of the last time I checked. The
source code can be obtained directly from http://zlib.net
2.4.2: Untar the zlib source distribution
tar -xzvf zlib-1.2.6.tar.gz
2.4.3: Change to folder and configure the zlib install. As
always, set the base directory using the --prefix flag
cd zlib-1.2.6
./configure --prefix=/path/to/base/directory
2.4.4: Test the installation if desired
make test
2.4.5: If the tests pass, install the libraries to the base
directory.
make install
2.5: Set some environmental variables that will be needed during
the install. Note that the F77 variable might not be necessary, but
CFLAGS does need to include the -fPIC flag
setenv F77 gfortran
setenv CFLAGS -fPIC
On 64-bit versions of OSX (and possibly other operating systems),
the compilers may get confused. If this is the case, it can be
rectified by adjusting the above to the following:
setenv F77 gfortran
setenv CFLAGS "-fPIC -m64"
setenv FFLAGS -m64
2.6: Configure HDF for installation. Note that unlike most
configurations, this step requires more than just the --prefix
flag. Make sure to give the correct path the base directory
under which the zlib and jpeg installs (not the source code!)
live. The --disable-netcdf is also critical, but may prevent
you from using this HDF build for other purposes.
cd hdf-4.2.6
./configure --with-zlib=/path/to/base/directory \
--with-jpeg=/path/to/base/directory \
--disable-netcdf \
--prefix=/path/to/base/directory
2.7: Build the HDF4 libraries
make
2.8: Test the installation
make test
2.9: Install to the base directory
make install
3) Install HDF5
This is a completely separate install from HDF4. You have to
install BOTH even though they are both HDF. Provides read
functionality for HDF-EOS files used by OMI instruments, as well as
supporting the netCDF installation (step 4)
As per usual, it is probably possible to acquire binaries, but the
instructions below are for compilation from source.
3.1: Acquire the HDF5 source code from
http://wwww.hdfgroup.org/ftp/HDF5/current/src
3.2: Untar the source code.
tar -xzvf hdf5-1.8.8.tar.gz
3.3: Set an environment variable to point the configuration script
to the desired FORTRAN compilers. The program has a really
buggy compiler autodetect "feature" that makes this necessary.
setenv FC gfortran
3.4: Configure, noting that this is again a case where the flags
passed to the configure script are mandatory. Make sure that
the --with-zlib flag points to a valid directory that contains
the zlib library and another with the include files. You
should already have installed zlib under step 2.4 above.
cd hdf5-1.8.8
./configure --prefix=/path/to/base/directory \
--enable-fortran \
--with-zlib=/path/to/base/directory/lib,/path/to/base/directory/include \
3.5: Build HDF5
make
3.6: Test the build
make check
3.7: Install the build
make install
4) Install netCDF
netCDF is necessary to write out to the commonly used netCDF file
format. The software has only been tested with a netcdf-4.1.3
installation. Earlier versions of netCDF-4 might work, and
there's even a chance netCDF-3 would work, but you're best off
with the latest verison.
4.1: Download the source from
http://www.unidata.ucar.edu/downloads/netcdf/index.jsp
4.2: Decompress the source code
untar -xzvf netcdf-4.1.3.tar.gz
4.3: Set environmental variables that will tell netCDF where the
HDF5 installation lives. We need to include both of these so
it can find the libraries and the include files
setenv LDFLAGS -L/path/to/base/directory/lib
setenv CPPFLAGS -I/path/to/base/directory/include
4.4: Configure the installation using the prefix flag to specify
the base directory for the install.
cd netcdf-4.1.3
./configure --disable-fortran --prefix=/path/to/base/directory
4.5: Build the program
make
4.6: Test the build
make check
4.7: If the test ran successfully, install.
make install
5) Install the geos framework
The geos framework (short for geometry engine - open source) is a
library containing many common GIS functions. We need it to build
shapely, the python module that we use to perform the geometry
operations needed in interpolation.
5.1: Obtain the source for the geos framework from
http://trac.osgeo.org/geos
5.2: Decompress the installation.
bunzip2 geos-3.3.2.tar.bz2
tar -xvf geos-3.3.2.tar
5.3: Configure the installtion, using the --prefix flag to specifiy
the base directory.
cd geos-3.3.2
./configure --prefix=/path/to/base/directory
5.4: Build geos
make
5.5: Install geos to the base directory
make install
5.6: If the library directory under your base directory is not in a
default location (IE /usr/local/lib) where the shell
automatically looks, you need to add it to the library path.
These lines should probably be added to your .tcshrc or .bashrc
or .cshrc file (depending on your shell) as whips won't work
properly if they are not.
setenv LD_LIBRARY_PATH /path/to/base/directory/lib:$LD_LIBRARY_PATH
6) Install pyhdf
This is, to the best of my knowledge, the only python library that
can read HDF4 files (like MOPITT). It should theoretically be
installable using the same technique as other python modules, but
seems to be more finicky.
6.1: Download the source for pyhdf from
http://sourceforge.net/projects/pysclint
6.2: Untar the source
tar -xzvf pyhdf-0.8.3.tar.gz
6.3: Set environment variables so that the pyhdf installation will
know where to find the hdf, zlib, and jpeg libraries. Note that
if these are in different libraries, you'll need to set the
variables to point to multiple directories. Note that because
these are only needed for the install they won't need to go in
the shrc file for your shell.
setenv INCLUDE_DIRS /path/to/base/directory
setenv LIBRARY_DIRS /path/to/base/directory
setenv NOSZIP 1
6.4: Go into the pyhdf folder and invoke the python setup script
(which will both compile and install the script)
cd pyhdf-0.8.3
python setup.py install
If you run into problems, make sure that you properly set the
-fPIC flag when compiling HDF4 (see step 2.7)
7) Install easy_install
easy_install is a widely implemented framework for the installation
of python modules. It performs many of the features of a
traditional package manager like yum or rpm, but most critically
does NOT uninstall packages and does NOT chase down dependencies.
We're going to use it extensively from here on out to install the
python modules needed by whips
7.1: Obtain the "egg" (distributed package) of easy_install from
the maintainers at
http://pypi.python.org/pypi/setuptools#downloads
Make sure to select the egg that matches your installation of
python.
7.2: Run the egg as a shell script and easy_install should install
itself under the binary directory associated with your python
installation.
sh setuptools-0.6c11-py2.7.egg
8) Install netCDF4-python
This particular python module requires a different installation
approach than the others listed below, so we take care of it
first. It's used for writing results to the popular netCDF
file type.
8.1: Download the source code for netcdf4-python from
code.google.com/p/netcdf4-python/downloads/list
8.2: Unpack the source distribution
tar -xzvf netcdf4-0.9.9.tar.gz
8.3: If you haven't done so already, set HDF5_DIR
environmental variable to point to the base directory for
the HDF5 install. In addition, set NETCDF4_DIR to point
to the base directory for the netCDF install.
setenv HDF5_DIR /path/to/base/directory/
setenv NETCDF4_DIR /path/to/base/directory/
8.4: Build the netCDF4-python library
cd netCDF4-0.9.9
python setup.py build
8.5: Assuming the build didn't throw any errors, install
the library.
python setup.py install
8.6: If you want to, test the installation. Note that in
some circumstances the library will work fine even if
the tests refuse to run entirely.
cd test
python run_all.py
9) Install python modules available through easy_install
These python modules are all used by whips to perform various
operations. They will be installed to whichever copy of python the
operating system finds first, which makes it all the more important
that you double check that this is the version you want (see step
1.6)
9.1: Install numpy, which is a basic array operation library.
easy_install numpy
9.2: Install shapely, a geometry library used by the interpolation
routines in whips
easy_install shapely
9.3: Install pyproj, which is a port of the popular PROJ4 fortran
library. It provides the optimized projection functions used by
whips.
easy_install PyProj
9.4: Install numexpr, which is required for pytables
easy_install numexpr
9.5: Install cython, which is also required for pytables
easy_install Cython
9.6: Install pytables, a program allowing python read/write
access to HDF5 files.
9.6.1: Tell pytables where the HDF5 installation is. Give it
the base directory (as opposed to the library directory) via
the environment variable HDF5_DIR. This environment variable
is only needed for the installation.
setenv HDF5_DIR /path/to/base/directory
9.6.2: Install the actual pytables module itself (note that it
isn't called pytables!)
easy_install tables
9.6.3: Add the lib directory where you installed tables to your
library path. This should go in your .tcshrc or .bashrc or
.cshrc file (depending on your shell) for whips to function
properly
setenv LD_LIBRARY_PATH /path/to/base/directory/lib:$LD_LIBRARY-PATH
10) Install whips
Like most of the other python modules described here, whips is
available through easy_install.
10.1: Install whips using the easy_install command
easy_install whips
10.2: The whips.py executable will be installed in
/path/to/base/directory/bin/
so if that folder isn't on your path, you'll need to make
it accessible from the command line. The easiest means is
probably to add it to the path in your remote config file
(.tcshrc or .bashrc or .cshrc or ...). This can be
accomplished from .tcshrc by adding the following line.
setenv PATH $PATH:/path/to/base/directory/bin/
Note that the first time you do this, you'll need to run
source ~/.tcshrc
for it to take effect.