-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathINSTALL
250 lines (187 loc) · 10.6 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
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
Updated for version 3.21.1 of the OPeNDAP BES.
Building and Installing the BES
---------------------------------------------------------------------------
BUILDING FROM A GIT CLONE
BUILDING FROM A SOURCE DISTRIBUTION
BUILDING AN RPM
RUNNING DISTCHECK
BUILD REQUIREMENTS
NOTES
CONFIGURATION AND TESTING
Please skim BUILD REQUIREMENTS and NOTES sections of this file
before reporting problems. Also, this software _requires_ other
software components be built and installed and that its configuration
file be edited. Make sure you read over the CONFIGURATION AND TESTING
section! Thanks.
---------------------------------------------------------------------------
BUILDING FROM A GIT CLONE
Also see http://docs.opendap.org/index.php/Hyrax_GitHub_Source_Build
Note that as of 2/3/15 the BES master branch software supports DAP4
and DAP2, and thus requires libdap4. We no longer support DAP2-only
builds for the BES.
1. The BES repo on GitHub now includes the default set of BES modules,
'git clone https://github.com/OPENDAP/bes'
Then...
2. Run 'autoreconf --force --install --verbose'
3. Run './configure' It's quite likely you will want to set the
install directory for the BES to be something other than
/usr/local/bin, etc., so use --prefix to set the BES prefix. If you
have the dependencies installed in a 'non-standard' location, use
--with-dependencies=<path> to provide th prefix to those packages.
Note that we have a repo/tar-ball called 'hyrax-dependencies' that
will build all of the dependencies needed by hyrax. There are many
more --with-* options including once for each individual third-party
package; --help will list all those options.
4. Run 'make'. If you have several cores, use -j <n> to speed things
up.
5. Test it: 'make check'. Try -j here, but some of the tests may balk
at a parallel build. Without -j they should all pass or have an
'expected failure'.
6. Install it: 'make install'
BUILDING FROM A SOURCE DISTRIBUTION (a tar.gz file)
To build the BES software, follow these steps:
1. Type `./configure' at the system prompt. On some systems you may
have to type `sh configure'.
2. Type `make' to build the software, `make check' to run the tests.
If you have cppunit installed then additional tests will be run. We
recommend that you install cppunit if you have not already.
3. Type `make install' to install the BES software. The package
installs in /usr/local/ by default; use --prefix to change that.
BUILDING AN RPM
There are several targets in the BES Makefile that can be used to build
RPM packages. The target 'rpm' will assume you want to use the bes.spec
file and build an RPM for either the bes alone or bes w/modules (depending
on the file that configure.ac is linked to). In the latter case, only
modules with dependencies that are installed using RPM will be built.
The BES Makefile also has another set of targets that are intended for
use with a BES + modules build and will build _all_ of the modules, using
static linkage for the one that don't have their dependencies provided by
an RPM. To build this kind of RPM, you need to first get and build the
hyrax-dependencies package and do so using one of the special targets in its
Makefile for 'static-rpms'. You will also need to force it to build only
static libraries using CONFIGURE_FLAGS=--disable-shared when you rum 'make'.
RUNNING DISTCHECK
If you've used the hyrax-dependencies package to build the BES + modules,
and you're using automake 1.13 or older, run the Makefile's distcheck
using 'make distcheck.' The configure script should arrange for the Makefile
target to set the value of the environment variable DISTCHECK_CONFIGURE_FLAGS.
Without setting that environment variable, the distcheck build won't
find any of the dependencies. Also using MFLAGS=-j9 (use whatever
number is appropriate or your machine) will speed things up.
AFTER INSTALLING
o See the CONFIGURATION section once you have finished building the BES.
o Set PATH environment variable to include the bin directory of where
bes was installed. For example, if using the default installation
directory, which is /usr/local, make sure that /usr/local/bin is on your
path.
o Set LD_LIBRARY_PATH environment variable to include the lib directory of
where bes was installed. For example, if using the default installation
directory, which is /usr/local, make sure that /usr/local/lib is part of
LD_LIBRARY_PATH. You might want to add the following about LIBRARY PATH:
If you have set $prefix so that the libraries are installed in a directory
that's included in ld.so.conf (linux, other systems may use a slightly
different name) you don't have to use LD_LIBRARY_PATH but, if you don't,
make sure to re-run ldconfig.
o Once built and configured, you will start and stop the BES using the
'besctl' script located in the installation directories bin directory. To
start the BES:
besctl start
To stop the BES:
besctl stop
Note: Stopping the BES only stops the daemon and the main listener.
Use 'besctl kill' to stop everything right away and 'besctl pids' to
see if there are any BES processing still hanging around. If you
have clients connected to the BES then the listeners handling
requests from those clients will remain up until the connections are
closed. This is only the case in the servers 'multiple' mode and not
its 'single' mode (refer to the BES configuration file for more on
this topic).
BUILD REQUIREMENTS
o To build from a fresh git clone, you'll need automake 1.13, autoconf
2.69 and libtool 2.2+. Earlier versions may work, but may cause
problems, particularly with the 'distcheck' target for make. Given
those requirements, use 'autoreconf --force --install --verbose' and then
build as described above.
If you have an Intel Mac and you are experiencing configuration
issues then you might need to download the latest and greatest
autoconf, automake, and libtool and build them, or use Homebrew to
install those packages.
o The BES optionally uses libdap, but is not required. For Hyrax, you
will need libdap version 3.21.1 or greater to build this software.
See http://www.opendap.org/download/. You will need libxml2, 2.9.0
or newer. We provide source versions of the packages on our web
site; the official web page for libxml2 is: http://xmlsoft.org/.
You will also need libcurl 7.61.0 or newer.
o If you are concerned about introducing problems with your OS's
package system, build and install libdap, libxml2, etc., into a
special directory (e.g., /opt/opendap/) and then be sure to set PATH
to include the dap-config and xml2-config scripts before running
configure (e.g., run configure as
'PATH="$PATH:/opt/opendap/bin';./configure'). You probably should
install libdap.a under /opt/opendap as well, so set prefix to that
path:
'PATH="$PATH:/opt/opendap/bin';./configure --prefix=/opt/opendap'
o You should have GNU gcc/g++ 8.5 or greater for Linux and Apple clang 14
for OSX.
NOTES
o If you are building on a new platform (one for which we don't supply
binaries), please run the tests and tell us about any failures.
o If you are developing code that uses the DAP, use the GitHub repo
o The gnulib software is used to provide replacement functions when
autoconf detects that is necessary. To update the gnulib, check it out
from CVS and run '$gnulib_home/gnulib-tool --lgpl --import' in this
directory. Macros in configure.ac supply gnulib-tool with all the
information it needs. Only developers working on libdap should ever have
to do this.
o To build a rpm file for a source or binary distribution: 1) Use 'make
dist' to build a *.tar.gz file; 2) Copy that to ~/rpm/SOURCES,
and; 3) Run 'rpmbuild -ts ~/rpm/SOURCES/bes.*.tar.gz' to make the
source package. Use '-tb' to make the binary package. I use a
~/.rpmmacros file that contains:
%_topdir /home/jimg/rpm
%_tmppath /home/jimg/rpm/tmp
Or, use the 'rpm' target in the Makefile.
o DEBUGGING AIDS
- Debugging is built in to the BES and does not require any special
debug flags during compile time. To activate debugging in the BES,
simply use the -d cerr|<filename> option to besctl, besdaemon, and
beslistener. You should just need to use besctl. You can either
specify cerr or a file name with the -d option. If you specify cerr
then debug output will go to standard error. If you specify a file
name, then debug output will go to that file. You can not specify
cout, as standard output is redirected to the socket.
- You can also check the BES log file, where the location is specified
in the BES configuration file. There might be some useful information
in that file.
- In the past we used efence and dbnew to help debug dynamic memory
programming errors. We are now using valgrind and suggest you do the
same. On some Linux platforms you should export MALLOC_CHECK_=0 in the
shell before running valgrind. This is true for the unit tests and may
be true for other code. You'll also notice that the Makefile contains
CXX and C compile-time flags for debugging. These will greatly simplify
using valgrind and/or a debugger. To use these, don't hack up the
Makefile.am. Instead export CXXFLAGS with the values you want and then
run configure. For example:
export CXXFLAGS="-g3 -O0 -Wall -fno-defer-pop"; ./configure
CONFIGURATION AND TESTING
o CONFIGURATION
- The configuration file is located in the installation directory under
etc/bes and is called bes.conf. This file will need to be edited, and
is fairly well documented. Any modules installed will have their
own configuration file in the modules directory. So, if you
installed in /usr/local, then this file will be located in
/usr/local/etc/bes/bes.conf and the modules directory where module
configuration files will go is /usr/local/etc/bes/modules.
- If you want to include libdap in the build then you will need to
either have dap-config on your path, or you can specify
--with-dap=<path_to_dap> if it is not on your path.
- Using openssl with the BES. The BES client/server code can include the
use of openssl for secure connections. You can specify the
--with-openssl=<path_to_openssl> on the command line if it is not
installed in any of the default locations.
o TESTING
- Once you have built the software you can run 'make check' to make sure
that the software is working properly. There are also tests in the
bes/cmdln directory that can be used to test as well, but is not a
part of the default test environment. To use the tests in bes/cmdln
please contact OPeNDAP for assistance.