-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
341 lines (217 loc) · 9.52 KB
/
README
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
JCSDA CRTM v2.3.x Build Instructions
====================================
$Revision: 99117 $
CRTM SUPPORT EMAIL: [email protected]
If you have problems building the library please include the
generated "config.log" file in your email correspondence.
Contents
===============================
1. Configuration
a. The easy (I hope) way
b. The more flexible way
2. Building the library
3. Testing the library
4. Installing the library
a. GNU Install
- Linking to the library
b. NCO Install
- Linking to the library
c. Uninstalling the library
5. Cleaning up
6. Feedback and contact info
1. CONFIGURATION
================
The CRTM tarball directory structure looks like:
./
|-README .................. this file
|-configure ............... configuration script
|-Makefile.in ............. makefile template
|-config-setup/ ........... "courtesy" configuration definition scripts
|-fix/ .................... coefficient datafiles
`-libsrc/ ................. library source files
The build system for the CRTM uses an autoconf-generated configure script.
The build makefiles now assume that environment variables (envars) will
be defined that describe the compilation environment. The envars
that *must* be defined are:
FC: the Fortran95/2003 compiler executable,
FCFLAGS: the flags/switches provided to the Fortran compiler,
a. The easy (I hope) way...
-------------------------
Several shell (and C shell) source files are provided for the compilers to
which we have access and have tested here. These shell source files are in
the "config-setup/" subdirectory of the tarball.
The current list of test compiler environments in the config-setup/ directory
are:
$ ls config-setup/
ftn.setup ftn.setup.csh
g95-debug.setup gfortran.setup.csh pgf95.setup
g95-debug.setup.csh ifort-debug.setup pgf95.setup.csh
g95.setup ifort-debug.setup.csh xlf2003-debug.setup
g95.setup.csh ifort.setup xlf2003-debug.setup.csh
gfortran-debug.setup ifort.setup.csh xlf2003.setup
gfortran-debug.setup.csh pgf95-debug.setup xlf2003.setup.csh
gfortran.setup pgf95-debug.setup.csh
All of the above files define values for the envars FC, FCFLAGS, LDFLAGS,
and LIBS.
To use these files to define the CRTM build environment, you should source
them. For example, if you use the sh/bash/ksh shells and you want to setup
for a build using the gfortran compiler using debug options you would type:
$ . config-setup/gfortran-debug.setup
If you are a C shell aficionado, the equivalent command would be
% source config-setup/gfortran-debug.setup.csh
You can tailor you build environment by modifying the relevant build
configuration setup file in the "config-setup/" subdirectory.
Or, if you are going to be testing library builds multiple times, create your
own configuration setup file.
Once you've sourced the setup file, you run the configuration script like so:
$ ./configure --prefix=<install directory>
The --prefix switch sets the installation directory and defaults to /usr/local so
make sure you set it to a directory in which you have write access.
By default, the CRTM is built for big-endian I/O. The --disable-big-endian switch
builds the library and test programs for little-endian I/O:
$ ./configure --disable-big-endian --prefix=<install directory>
b. The more flexible way
------------------------
If you need more flexibility in the library build you can specify the necessary
information directly to the configure script that generates the makefiles. For
example, for the intel ifort compiler:
$ ./configure --prefix=${PWD} \
--disable-big-endian \
FC="ifort" \
FCFLAGS="-O3 -g -traceback"
The --prefix switch sets the installation directory and defaults to /usr/local so
make sure you set it to a directory in which you have write access.
The --disable-big-endian switch builds the library and test programs for little-endian
I/O. The default is big-endian I/O.
NOTE: The --disable-big-endian switch (whether it's turned on or off) modifies the
compilation environment by setting (or deselecting) the compiler switches
that control the endian-ness of the I/O. As such, you should be careful if
you set those compiler switches directly on the command line via FCFLAGS.
2. BUILDING THE LIBRARY
=======================
To start the library build for a particular configuration, simply type
$ make
3. CHECKING THE LIBRARY BUILD
=============================
To run the accompanying tests using the just-built library, simply type
$ make check
This will build and run any tests. The current output from the (successful)
test runs looks like:
========================================
Running test: big-endian I/O on little-endian platform...
**********************************************************
check_crtm
Check/example program for the CRTM Forward and K-Matrix
functions using big_endian coefficient datafiles
CRTM Version: REL-2.3.x
**********************************************************
Initializing the CRTM...
Processing a total of 421 channels...
399 from cris399_npp
22 from atms_npp
Calling the CRTM functions for cris399_npp...
Calling the CRTM functions for atms_npp...
Destroying the CRTM...
TEST SUCCESSFUL!
========================================
4. INSTALLING THE LIBRARY
=========================
Installation of the library *always* occurs into its own directory within the
directory specified by the --prefix switch. The name of the installation
directory follows the convention:
<library name>_<version>
So, if a library version (say, v2.3.0) build was configured with --prefix=$PWD
then the installation directory will be
${PWD}/crtm_v2.3.0
a. GNU Install
--------------
To perform a GNU-type install, type:
$ make install
For a library version, say, v2.3.0, this will create a directory called
"crtm_v2.3.0". That directory structure is shown below:
crtm_v2.3.0/
|
|--include/
| |
| |--accoeff_binary_io.mod
| |--accoeff_define.mod
| ...etc...
| |--zeeman_input_define.mod
| `--zeeman_utility.mod
|
`--lib/
|
`--libcrtm.a
Note that the only version-numbered item in this type of install is the name of
the installation directory itself.
Linking to the library
......................
Let's assume the above install was moved into "/usrx/local/nceplibs", to use the
library in this structure in your own application, the usual environment variables
would be modified something like:
libroot="/usrx/local/nceplibs/crtm_v2.3.0"
FCFLAGS="-I${libroot}/include ${FCFLAGS}"
LDFLAGS="-L${libroot}/lib ${LDFLAGS}"
LIBS="-lcrtm"
(with appropriate syntax changes for csh)
b. NCO Install
--------------
To install the library conforming to the NCO directory organisation and naming
conventions, type:
$ make nco_install
For a library version, say, v2.3.0, this will create a directory called
"crtm_v2.3.0". That directory is organised according to the current NCO structure
on WCOSS in /nwprod/lib, as shown below:
crtm_v2.3.0/
|
|--libcrtm_v2.3.0.a
|
`--incmod/
|
`--crtm_v2.3.0/
|
|--accoeff_binary_io.mod
|--accoeff_define.mod
...etc..
|--zeeman_input_define.mod
`--zeeman_utility.mod
The contents of the "crtm_v2.3.0" directory can then be moved into the official
/nwprod/lib location as needed.
NOTE: ********** IMPORTANT - READ THIS **********
To avoid installing over the top of an existing installation, this NCO-style
installation *DOES NOT* install the CRTM into an existing directory. If the
installation directory already exists, an error is issued and the installation
process halts.
********** IMPORTANT - HAVE YOU READ IT? **********
Linking to the library
......................
Let's assume the above install was moved into "/usrx/local/nceplibs", to use the
library in this structure in your own application, the usual environment variables
would be modified something like:
libroot="/usrx/local/nceplibs"
FCFLAGS="-I${libroot}/incmod/crtm_v2.3.0 ${FCFLAGS}"
LDFLAGS="-L${libroot} ${LDFLAGS}"
LIBS="-lcrtm_v2.3.0"
(with appropriate syntax changes for csh)
c. Uninstalling the library
---------------------------
To uninstall the library (assuming you haven't moved the installation directory
contents somewhere else) you can type:
$ make uninstall
This will DELETE the created installation directory. So, for a library version,
say, v2.3.0, if your configure script invocation was something like
$ ./configure --prefix=${PWD} ...other command line arguments...
then the "uninstall" target will delete the "${PWD}/crtm_v2.3.0" directory.
5. CLEANING UP
==============
Two targets are provided for cleaning up after the build. To remove all the
build products type
$ make clean
To also remove all the configuration products (i.e. the makefiles) type
$ make distclean
6. FEEDBACK AND CONTACT INFO
============================
That's pretty much it. Any questions or bug reports can be sent to CRTM Support.
CRTM SUPPORT EMAIL: [email protected]
If you have problems building the library please include the generated "config.log"
file in your email correspondence.