<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.opendap.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kneumiller</id>
	<title>OPeNDAP Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.opendap.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kneumiller"/>
	<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php/Special:Contributions/Kneumiller"/>
	<updated>2026-05-06T16:46:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://docs.opendap.org/index.php?title=File:OPeNDAP-Logo_Large.png&amp;diff=13512</id>
		<title>File:OPeNDAP-Logo Large.png</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=File:OPeNDAP-Logo_Large.png&amp;diff=13512"/>
		<updated>2023-10-18T20:04:49Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: Kneumiller uploaded a new version of File:OPeNDAP-Logo Large.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The rally big logo with a clear background.&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13319</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13319"/>
		<updated>2022-01-20T16:54:49Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: /* Setup CentOS-8 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load the basic software development environment plus the additional packages of openjpeg2, jasper, and libtirpc&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you run through the rest of the hyrax build make sure to run &#039;&#039;&#039;make gdal&#039;&#039;&#039; and &#039;&#039;&#039;make hdf4&#039;&#039;&#039; inside the hyrax-dependencies to build and install gdal and hdf4&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13318</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13318"/>
		<updated>2022-01-20T16:51:42Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: /* Setup CentOS-8 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load the basic software development environment plus the additional packages of openjpeg2, jasper, and libtirpc&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you run through the rest of the hyrax build make sure to run &#039;&#039;&#039;make gdal&#039;&#039;&#039; and &#039;&#039;&#039;make hdf4&#039;&#039;&#039; inside the hyrax-dependencies&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13317</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13317"/>
		<updated>2022-01-20T16:51:02Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: /* Setup CentOS-8 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load the basic software development environment plus the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you run through the rest of the hyrax build make sure to run &#039;&#039;&#039;make gdal&#039;&#039;&#039; and &#039;&#039;&#039;make hdf4&#039;&#039;&#039; inside the hyrax-dependencies&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13316</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13316"/>
		<updated>2022-01-20T16:50:10Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: /* Setup CentOS-8 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;For CentOS 8 you will need a basic software development environment plus the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you run through the rest of the hyrax build make sure to run &#039;&#039;&#039;make gdal&#039;&#039;&#039; and &#039;&#039;&#039;make hdf4&#039;&#039;&#039; inside the hyrax-dependencies&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=ConfigureCentos&amp;diff=13315</id>
		<title>ConfigureCentos</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=ConfigureCentos&amp;diff=13315"/>
		<updated>2022-01-20T16:48:13Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: /* CentOS versions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[HowTo_guides|&amp;lt;&amp;lt; back to HowTo Guides]]&lt;br /&gt;
&lt;br /&gt;
This describes how to set up a vanilla CentOS computer so that we can build RPM binaries for the Hyrax data server. This was taken from notes describing how I configured a machine with a fresh install of CentOS 5.3 to build Hyrax. Augmented for CentOS 6. &lt;br /&gt;
&lt;br /&gt;
If you&#039;re installing this on a &#039;&#039;virtual&#039;&#039; host using VMware, see the section at the end of this document for some tips on making that VM run smoothly.&lt;br /&gt;
&lt;br /&gt;
== CentOS versions ==&lt;br /&gt;
&lt;br /&gt;
These instructions have been amended to cover:&lt;br /&gt;
&lt;br /&gt;
* CentOS-6.9 (64-bit)&lt;br /&gt;
* CentOS-7.? (64-bit)&lt;br /&gt;
&lt;br /&gt;
== Initial configuration ==&lt;br /&gt;
&lt;br /&gt;
Set up general build stuff that you need. The RPM packages you need are listed here. Using &#039;&#039;yum&#039;&#039; (&#039;&#039;sudo yum install &amp;lt;package&amp;gt;&#039;&#039;) is the easiest way to install these packages on CentOS/RedHat. The package names for Ubuntu are a bit different, but are easy to figure out. Our CI builds are done on Ubuntu 14 (as of Nov 2017), so it&#039;s certainly possible to build there:&lt;br /&gt;
* java-1.7.0-openjdk&lt;br /&gt;
* java-1.7.0-openjdk-devel&lt;br /&gt;
* ant&lt;br /&gt;
* ant-junit&lt;br /&gt;
* junit&lt;br /&gt;
* git &lt;br /&gt;
* gcc-c++ &lt;br /&gt;
* flex &lt;br /&gt;
* bison &lt;br /&gt;
* autoconf &lt;br /&gt;
* automake &lt;br /&gt;
* libtool &lt;br /&gt;
* emacs &lt;br /&gt;
* openssl-devel &lt;br /&gt;
* libuuid-devel &lt;br /&gt;
* readline-devel &lt;br /&gt;
* zlib-devel &lt;br /&gt;
* bzip2, bzip2-devel &lt;br /&gt;
* libjpeg-devel &lt;br /&gt;
* libxml2-devel &lt;br /&gt;
* curl-devel &lt;br /&gt;
* libicu-devel&lt;br /&gt;
* vim&lt;br /&gt;
* bc&lt;br /&gt;
&lt;br /&gt;
If you&#039;re feeling lucky, you can put all of the packages on a single line&lt;br /&gt;
:&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel vim bc&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039; &lt;br /&gt;
*&#039;&#039;Java 1.7, Ant and CentOS 6&#039;&#039;. I found that ant 1.7 (the default with CentOS 6) would not work with Java 1.8. To get our code to build with Java 1.7, I used &#039;&#039;alternatives --config java&#039;&#039; to configure 1.7 and then &#039;&#039;export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75.x86_64&#039;&#039;. I could not compile the olfs otherwise. &lt;br /&gt;
*&#039;&#039;7 June 2016 - CentOS 7 RPM Build&#039;&#039;. I had to add &#039;&#039;&#039;bzip2-devel&#039;&#039;&#039;, &#039;&#039;&#039;libicu-devel&#039;&#039;&#039;, and &#039;&#039;&#039;bc&#039;&#039;&#039; to the set of packages to get the RPM to build on CentOS 7. It may be the case this was true of CentOS 6 as well and it just slipped by.&lt;br /&gt;
*&#039;&#039;11 Nov 2017&#039;&#039; - The latest versions of CentOS 6 and 7 had no problems using the packages above. I did not test Java 8 or Java 9, but Java 8 has no problems in development configurations. Tomcat7, 8, and 9 from RPMs all work as well, at least on my development machines.&lt;br /&gt;
&lt;br /&gt;
==== Autotools ====&lt;br /&gt;
The autotools with CentOS 6 should be fine - the scripts will complain if otherwise. However, the newer autoconf/make support some nice features, so installing these newer version is not a waste. On a Test machine, this should not be done. If you don&#039;t install the new versions, make sure to use yum to install autoconf, automake and libtool. That is&lt;br /&gt;
:&#039;&#039;yum install autoconf automake libtool&#039;&#039;&lt;br /&gt;
If you don&#039;t want to use RPM for these, then:&lt;br /&gt;
* download the latest versions of autoconf, automake, and libtool from GNU: http://ftp.gnu.org/gnu/&lt;br /&gt;
* ./configure, make, make install&lt;br /&gt;
&lt;br /&gt;
==== RPM Construction Tools ====&lt;br /&gt;
* &#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Hyrax specific configuration ==&lt;br /&gt;
Set up things that are specific to Hyrax&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to use as much of the RPM &#039;ecosystem&#039; as possible because this is what will be on other people&#039;s computers; using newer stuff, like the lastest HDF5 library is only going to cause incompatibilities. But to do that for Hyrax, you need to get beyond the stock set of repositories that &#039;&#039;yum&#039;&#039; searches. &lt;br /&gt;
&lt;br /&gt;
==== Add the EPEL EL repo to yum ====&lt;br /&gt;
* Information about EPEL/EL is here: https://fedoraproject.org/wiki/EPEL.&lt;br /&gt;
* For CentOS 6, you likely want the rpm package here: http://mirror.pnl.gov/epel/6/i386/repoview/epel-release.html&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note&#039;&#039;&#039; Use CentOS 6 if possible for Hyrax at this time (Sept 2014). We&#039;ll be moving to combined v.6 and v.7 support soon; v.5 is no longer supported. Some CentOS 5 information is included here because this was initially written back when it was the latest version.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Centos 5.x =====&lt;br /&gt;
But don&#039;t use this unless you really have too...&lt;br /&gt;
&lt;br /&gt;
* google EPEL/EL5 and &lt;br /&gt;
* find &amp;amp; download &#039;&#039;epel-release-5.4.noarch.rpm&#039;&#039;&lt;br /&gt;
* install it: &#039;&#039;rpm -i epel-release-5.4.noarch.rpm&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Centos 6.x =====&lt;br /&gt;
Use this until we start supporting CentOS 7&lt;br /&gt;
&lt;br /&gt;
* google EPEL/EL6 and &lt;br /&gt;
* find &amp;amp; download &#039;&#039;epel-release-6.5.noarch.rpm&#039;&#039;&lt;br /&gt;
* install it: &#039;&#039;rpm -i epel-release-6.5.noarch.rpm&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Data type dependencies: NetCDF, HDF4, HDF5 ====&lt;br /&gt;
* &#039;&#039;yum install netcdf-devel&#039;&#039; (note: On CentOS-6.2 you&#039;ll get netcdf-4 and on CentOS-5.3 you&#039;ll get netcdf-3)&lt;br /&gt;
* &#039;&#039;yum install hdf-devel&#039;&#039; (note: &#039;hdf&#039;, not &#039;hdf4&#039;)&lt;br /&gt;
* &#039;&#039;yum install hdf5-devel&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Other dependencies ====&lt;br /&gt;
* &#039;&#039;yum install libicu-devel&#039;&#039;&lt;br /&gt;
* &#039;&#039;yum install cfitsio-devel&#039;&#039;&lt;br /&gt;
* &#039;&#039;yum install cppunit-devel&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== ... If you&#039;re feeling lucky ====&lt;br /&gt;
As with the &#039;build packages,&#039; here are all of the &#039;hyrax-specific&#039; packages so you can use just one Yum command&lt;br /&gt;
:&#039;&#039;netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;.&lt;br /&gt;
Note that you&#039;ll still need to set up the EPEL repository.&lt;br /&gt;
&lt;br /&gt;
== VMware configuration tips ==&lt;br /&gt;
It&#039;s best if you enable a shared directory so that you can pass stuff back and forth between the host OS and the Guest OS (i.e., the Virtual machine). That will only work if you have the &#039;&#039;VMware tools&#039;&#039; installed in/on the guest.&lt;br /&gt;
&lt;br /&gt;
* Install VMware-tools. This process varies, but it&#039;s pretty easy for all platforms. On VMware Fusion, look under the &#039;&#039;Virtual Machine&#039;&#039; menu for the item that says &#039;&#039;Install VMware Tools&#039;&#039;. This will download lump of code and, for CentOS, mount it on &#039;/media/VMware Tools&#039; (yes, there&#039;s a space in the directory name). Copy the *.tar.gz file to some place like your home directory, unpack it and read the INSTALL file. For an initial installation, the typical process is to run &#039;&#039;vmware-install.pl&#039;&#039;.&lt;br /&gt;
* Under the configuration/options menu (the little wrench thing in Fusion), choose &#039;&#039;Sharing&#039;&#039;. Make a folder with an obvious name (e.g., &#039;&#039;vmware&#039;&#039;) and turn sharing on. Now, anything you put in there when on either the OS will be available to the other OS. On linux, this directory is located at &#039;&#039;/mnt/hgfs/&amp;lt;&amp;lt;name&amp;gt;&amp;gt;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Support for DEB packages ==&lt;br /&gt;
It is possible to use &#039;&#039;fpm&#039;&#039; to build debian packages from RPM packages. See [https://ask.fedoraproject.org/en/question/52141/how-to-convert-rpm-package-to-deb/ how-to-convert-rpm-package-to-deb] for an explanation. In summary, make a few directories to hold parts of the RPM, load files from the RPM into them and then use &#039;&#039;fpm&#039;&#039; to build the debian package. In addition to these steps, extract the package description text to a file and pass that into &#039;&#039;fpm&#039;&#039; and look at the dependencies for the RPMs, find the corresponding Ubuntu dependencies and provide them to &#039;&#039;fpm&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== problems not addressed ==&lt;br /&gt;
* There is no JUnit for the OLFS build&lt;br /&gt;
* There is no graphviz so the &#039;&#039;doc&#039;&#039; targets for libdap and bes will fail&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=ConfigureCentos&amp;diff=13314</id>
		<title>ConfigureCentos</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=ConfigureCentos&amp;diff=13314"/>
		<updated>2022-01-20T16:47:29Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: Removed the CentOS 8 stuff, it is now in the hyrax source build&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[HowTo_guides|&amp;lt;&amp;lt; back to HowTo Guides]]&lt;br /&gt;
&lt;br /&gt;
This describes how to set up a vanilla CentOS computer so that we can build RPM binaries for the Hyrax data server. This was taken from notes describing how I configured a machine with a fresh install of CentOS 5.3 to build Hyrax. Augmented for CentOS 6. &lt;br /&gt;
&lt;br /&gt;
If you&#039;re installing this on a &#039;&#039;virtual&#039;&#039; host using VMware, see the section at the end of this document for some tips on making that VM run smoothly.&lt;br /&gt;
&lt;br /&gt;
== CentOS versions ==&lt;br /&gt;
&lt;br /&gt;
These instructions have been amended to cover:&lt;br /&gt;
&lt;br /&gt;
* CentOS-6.9 (64-bit)&lt;br /&gt;
* CentOS-7.? (64-bit)&lt;br /&gt;
* CentOS-8   (64-bit)&lt;br /&gt;
&lt;br /&gt;
== Initial configuration ==&lt;br /&gt;
&lt;br /&gt;
Set up general build stuff that you need. The RPM packages you need are listed here. Using &#039;&#039;yum&#039;&#039; (&#039;&#039;sudo yum install &amp;lt;package&amp;gt;&#039;&#039;) is the easiest way to install these packages on CentOS/RedHat. The package names for Ubuntu are a bit different, but are easy to figure out. Our CI builds are done on Ubuntu 14 (as of Nov 2017), so it&#039;s certainly possible to build there:&lt;br /&gt;
* java-1.7.0-openjdk&lt;br /&gt;
* java-1.7.0-openjdk-devel&lt;br /&gt;
* ant&lt;br /&gt;
* ant-junit&lt;br /&gt;
* junit&lt;br /&gt;
* git &lt;br /&gt;
* gcc-c++ &lt;br /&gt;
* flex &lt;br /&gt;
* bison &lt;br /&gt;
* autoconf &lt;br /&gt;
* automake &lt;br /&gt;
* libtool &lt;br /&gt;
* emacs &lt;br /&gt;
* openssl-devel &lt;br /&gt;
* libuuid-devel &lt;br /&gt;
* readline-devel &lt;br /&gt;
* zlib-devel &lt;br /&gt;
* bzip2, bzip2-devel &lt;br /&gt;
* libjpeg-devel &lt;br /&gt;
* libxml2-devel &lt;br /&gt;
* curl-devel &lt;br /&gt;
* libicu-devel&lt;br /&gt;
* vim&lt;br /&gt;
* bc&lt;br /&gt;
&lt;br /&gt;
If you&#039;re feeling lucky, you can put all of the packages on a single line&lt;br /&gt;
:&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel vim bc&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039; &lt;br /&gt;
*&#039;&#039;Java 1.7, Ant and CentOS 6&#039;&#039;. I found that ant 1.7 (the default with CentOS 6) would not work with Java 1.8. To get our code to build with Java 1.7, I used &#039;&#039;alternatives --config java&#039;&#039; to configure 1.7 and then &#039;&#039;export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75.x86_64&#039;&#039;. I could not compile the olfs otherwise. &lt;br /&gt;
*&#039;&#039;7 June 2016 - CentOS 7 RPM Build&#039;&#039;. I had to add &#039;&#039;&#039;bzip2-devel&#039;&#039;&#039;, &#039;&#039;&#039;libicu-devel&#039;&#039;&#039;, and &#039;&#039;&#039;bc&#039;&#039;&#039; to the set of packages to get the RPM to build on CentOS 7. It may be the case this was true of CentOS 6 as well and it just slipped by.&lt;br /&gt;
*&#039;&#039;11 Nov 2017&#039;&#039; - The latest versions of CentOS 6 and 7 had no problems using the packages above. I did not test Java 8 or Java 9, but Java 8 has no problems in development configurations. Tomcat7, 8, and 9 from RPMs all work as well, at least on my development machines.&lt;br /&gt;
&lt;br /&gt;
==== Autotools ====&lt;br /&gt;
The autotools with CentOS 6 should be fine - the scripts will complain if otherwise. However, the newer autoconf/make support some nice features, so installing these newer version is not a waste. On a Test machine, this should not be done. If you don&#039;t install the new versions, make sure to use yum to install autoconf, automake and libtool. That is&lt;br /&gt;
:&#039;&#039;yum install autoconf automake libtool&#039;&#039;&lt;br /&gt;
If you don&#039;t want to use RPM for these, then:&lt;br /&gt;
* download the latest versions of autoconf, automake, and libtool from GNU: http://ftp.gnu.org/gnu/&lt;br /&gt;
* ./configure, make, make install&lt;br /&gt;
&lt;br /&gt;
==== RPM Construction Tools ====&lt;br /&gt;
* &#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Hyrax specific configuration ==&lt;br /&gt;
Set up things that are specific to Hyrax&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to use as much of the RPM &#039;ecosystem&#039; as possible because this is what will be on other people&#039;s computers; using newer stuff, like the lastest HDF5 library is only going to cause incompatibilities. But to do that for Hyrax, you need to get beyond the stock set of repositories that &#039;&#039;yum&#039;&#039; searches. &lt;br /&gt;
&lt;br /&gt;
==== Add the EPEL EL repo to yum ====&lt;br /&gt;
* Information about EPEL/EL is here: https://fedoraproject.org/wiki/EPEL.&lt;br /&gt;
* For CentOS 6, you likely want the rpm package here: http://mirror.pnl.gov/epel/6/i386/repoview/epel-release.html&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note&#039;&#039;&#039; Use CentOS 6 if possible for Hyrax at this time (Sept 2014). We&#039;ll be moving to combined v.6 and v.7 support soon; v.5 is no longer supported. Some CentOS 5 information is included here because this was initially written back when it was the latest version.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Centos 5.x =====&lt;br /&gt;
But don&#039;t use this unless you really have too...&lt;br /&gt;
&lt;br /&gt;
* google EPEL/EL5 and &lt;br /&gt;
* find &amp;amp; download &#039;&#039;epel-release-5.4.noarch.rpm&#039;&#039;&lt;br /&gt;
* install it: &#039;&#039;rpm -i epel-release-5.4.noarch.rpm&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Centos 6.x =====&lt;br /&gt;
Use this until we start supporting CentOS 7&lt;br /&gt;
&lt;br /&gt;
* google EPEL/EL6 and &lt;br /&gt;
* find &amp;amp; download &#039;&#039;epel-release-6.5.noarch.rpm&#039;&#039;&lt;br /&gt;
* install it: &#039;&#039;rpm -i epel-release-6.5.noarch.rpm&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Data type dependencies: NetCDF, HDF4, HDF5 ====&lt;br /&gt;
* &#039;&#039;yum install netcdf-devel&#039;&#039; (note: On CentOS-6.2 you&#039;ll get netcdf-4 and on CentOS-5.3 you&#039;ll get netcdf-3)&lt;br /&gt;
* &#039;&#039;yum install hdf-devel&#039;&#039; (note: &#039;hdf&#039;, not &#039;hdf4&#039;)&lt;br /&gt;
* &#039;&#039;yum install hdf5-devel&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Other dependencies ====&lt;br /&gt;
* &#039;&#039;yum install libicu-devel&#039;&#039;&lt;br /&gt;
* &#039;&#039;yum install cfitsio-devel&#039;&#039;&lt;br /&gt;
* &#039;&#039;yum install cppunit-devel&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== ... If you&#039;re feeling lucky ====&lt;br /&gt;
As with the &#039;build packages,&#039; here are all of the &#039;hyrax-specific&#039; packages so you can use just one Yum command&lt;br /&gt;
:&#039;&#039;netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;.&lt;br /&gt;
Note that you&#039;ll still need to set up the EPEL repository.&lt;br /&gt;
&lt;br /&gt;
== VMware configuration tips ==&lt;br /&gt;
It&#039;s best if you enable a shared directory so that you can pass stuff back and forth between the host OS and the Guest OS (i.e., the Virtual machine). That will only work if you have the &#039;&#039;VMware tools&#039;&#039; installed in/on the guest.&lt;br /&gt;
&lt;br /&gt;
* Install VMware-tools. This process varies, but it&#039;s pretty easy for all platforms. On VMware Fusion, look under the &#039;&#039;Virtual Machine&#039;&#039; menu for the item that says &#039;&#039;Install VMware Tools&#039;&#039;. This will download lump of code and, for CentOS, mount it on &#039;/media/VMware Tools&#039; (yes, there&#039;s a space in the directory name). Copy the *.tar.gz file to some place like your home directory, unpack it and read the INSTALL file. For an initial installation, the typical process is to run &#039;&#039;vmware-install.pl&#039;&#039;.&lt;br /&gt;
* Under the configuration/options menu (the little wrench thing in Fusion), choose &#039;&#039;Sharing&#039;&#039;. Make a folder with an obvious name (e.g., &#039;&#039;vmware&#039;&#039;) and turn sharing on. Now, anything you put in there when on either the OS will be available to the other OS. On linux, this directory is located at &#039;&#039;/mnt/hgfs/&amp;lt;&amp;lt;name&amp;gt;&amp;gt;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Support for DEB packages ==&lt;br /&gt;
It is possible to use &#039;&#039;fpm&#039;&#039; to build debian packages from RPM packages. See [https://ask.fedoraproject.org/en/question/52141/how-to-convert-rpm-package-to-deb/ how-to-convert-rpm-package-to-deb] for an explanation. In summary, make a few directories to hold parts of the RPM, load files from the RPM into them and then use &#039;&#039;fpm&#039;&#039; to build the debian package. In addition to these steps, extract the package description text to a file and pass that into &#039;&#039;fpm&#039;&#039; and look at the dependencies for the RPMs, find the corresponding Ubuntu dependencies and provide them to &#039;&#039;fpm&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== problems not addressed ==&lt;br /&gt;
* There is no JUnit for the OLFS build&lt;br /&gt;
* There is no graphviz so the &#039;&#039;doc&#039;&#039; targets for libdap and bes will fail&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13313</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13313"/>
		<updated>2022-01-20T16:45:40Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: /* Setup CentOS-8 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;For CentOS 8 you will need the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you run through the rest of the hyrax build make sure to run &#039;&#039;&#039;make gdal&#039;&#039;&#039; and &#039;&#039;&#039;make hdf4&#039;&#039;&#039; inside the hyrax-dependencies&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13312</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13312"/>
		<updated>2022-01-20T16:44:47Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;For CentOS 8 you will need the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you run through the rest of the hyrax build make sure to run &#039;&#039;&#039;make gdal&#039;&#039;&#039; and &#039;&#039;&#039;make hdf4&#039;&#039;&#039; inside of hyrax-dependencies&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13311</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13311"/>
		<updated>2022-01-20T16:42:46Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;For CentOS 8 you will need the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you run through the rest of the hyrax build make sure to run make gdal and make hdf4 inside of hyrax-dependencies&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13310</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13310"/>
		<updated>2022-01-20T16:41:55Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;For CentOS 8 you will need the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Once you run through the rest of the hyrax build make sure to run make gdal and make hdf4 inside of hyrax-dependencies&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13309</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13309"/>
		<updated>2022-01-20T16:40:10Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;For CentOS 8 you will need the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Tell the machine where to find the tirpc libraries&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;export CPPFLAGS=-I/usr/include/tirpc LDADD=-ltirpc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Once you run through the rest of the hyrax build make sure to run make gdal and make hdf4 inside of hyrax-dependencies&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13308</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13308"/>
		<updated>2022-01-20T16:31:19Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;You will need to enable power-tools for this setup&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum config-manager --set-enabled powertools&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;For CentOS 8 you will need the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13307</id>
		<title>Hyrax GitHub Source Build</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=Hyrax_GitHub_Source_Build&amp;diff=13307"/>
		<updated>2022-01-20T16:29:17Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: Adding CentOS 8 build steps&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to get and build Hyrax from our GitHub repositories. Hyrax is a data server that implements the DAP2 and DAP4 protocols, works with a number of different data formats and supports a wide variety of customization options from tailoring the look of the server&#039;s web pages to complex server-side processing operations. This page describes how to build the server&#039;s source code. If you&#039;re working on a Linux or OS/X computer, the process is similar so we describe only the linux case; we do not support building the server on Windows operating systems.&lt;br /&gt;
&lt;br /&gt;
To build and install the server, you need to perform three steps:&lt;br /&gt;
# Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)&lt;br /&gt;
# Build the C++ DAP library (&#039;&#039;libdap4&#039;&#039;) and the Hyrax BES daemon&lt;br /&gt;
# Build the Hyrax OLFS web application&lt;br /&gt;
&lt;br /&gt;
Quick links if you already know the process:&lt;br /&gt;
* [https://github.com/opendap/hyrax new all-in-one repo that uses shell scripts]&lt;br /&gt;
* [https://github.com/opendap/libdap libdap git repo]&lt;br /&gt;
* [https://github.com/opendap/bes BES git repo]&lt;br /&gt;
* [https://github.com/opendap/olfs OLFS git repo]&lt;br /&gt;
* [https://github.com/opendap/hyrax-dependencies Hyrax dependencies]&lt;br /&gt;
&lt;br /&gt;
= Set up a CentOS machine to build code =&lt;br /&gt;
== Setup CentOS-7 ==&lt;br /&gt;
Note that I don&#039;t like clicking around to different pages to follow simple directions, so what follows is a short version of the CentOS 6 configuration information we&#039;ve compiled for people that help us by building RPM packages for Hyrax. You can use this to extrapolate how to configure Ubuntu and OSX (We routinely build on those platforms as well). The complete instructions are in [[ConfigureCentos | Configure CentOS]] and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:&lt;br /&gt;
&lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Load a basic software development environment:&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit&#039;&#039;&#039;&amp;lt;/tt&amp;gt; (it&#039;s likely that you can use more recent versions of Java)&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; The whole thing, with java-1.8.0&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you&#039;re going to build RPMs&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Optional&lt;br /&gt;
:Download, unpack, build and install the GNU autotools (&#039;&#039;but &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; do this unless the versions installed using yum don&#039;t work&#039;&#039;)&lt;br /&gt;
* autoconf &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* automake &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt; &lt;br /&gt;
* libtool &amp;lt;tt&amp;gt;&#039;&#039;&#039;[http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz]&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
:build them (&amp;lt;tt&amp;gt;&#039;&#039;&#039;&#039;&#039;./configure; make; sudo make install &#039;&#039;&#039;&#039;&#039;&amp;lt;/tt&amp;gt; - this should take no more than three minutes).&lt;br /&gt;
&lt;br /&gt;
== Setup CentOS-8 ==&lt;br /&gt;
The CentOS-8 setup is very similar to CentOS-7, but there are some minor differences.&lt;br /&gt;
 &lt;br /&gt;
;Update the VM&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum -y update&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Use java-1.8.0 instead of java-1.7.0 if possible.&lt;br /&gt;
;For CentOS 8 you will need the additional packages of openjpeg2-devel, jasper-devel, and libtirpc-devel&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison cmake autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel cppunit cppunit-devel vim bc openjpeg2-devel jasper-devel libtirpc-devel&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= A semi-automatic build =&lt;br /&gt;
&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the short instructions in the README file.&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summarized here, those instructions are:&lt;br /&gt;
;use bash: The shell scripts in this repo assume you are using bash.&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development: &#039;&#039;source spath.sh&#039;&#039;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies: &#039;&#039;./hyrax_clone.sh -v&#039;&#039;&lt;br /&gt;
;build the code, including the dependencies: &#039;&#039;./hyrax_build.sh -v&#039;&#039;&lt;br /&gt;
;test the server: Start the BES using  &#039;&#039;besctl start&#039;&#039;&lt;br /&gt;
:Start the OLFS using&#039;&#039;./build/apache-tomcat-7.0.57/bin/startup.sh&#039;&#039;&lt;br /&gt;
:Test the server by loooking at &#039;&#039;&amp;lt;nowiki&amp;gt;http://localhost:8080/opendap&amp;lt;/nowiki&amp;gt;&#039;&#039; in a browser. You should see a directory named &#039;&#039;data&#039;&#039; and following that link should lead to more data. The server will be accessible to clients other than a web browser.&lt;br /&gt;
:To test the BES function independently of the front end, use &#039;&#039;bescmdln&#039;&#039; and give it the &#039;&#039;show version;&#039;&#039; command, you should see output about different components and their versions. &lt;br /&gt;
:Use &#039;&#039;exit&#039;&#039; to leave the command line test client.&lt;br /&gt;
&lt;br /&gt;
As described in the README file that is part of the &#039;&#039;hyrax&#039;&#039; repo, there are some other scripts in the repo and some options to the &#039;&#039;clone&#039;&#039; and &#039;&#039;build&#039;&#039; script that you can investigate by using -h (help).&lt;br /&gt;
&lt;br /&gt;
= The manual build = &lt;br /&gt;
&lt;br /&gt;
In the following, we describe only the build process for CentOS; the one for OS/X is similar and we note the differences where they are significant.&lt;br /&gt;
&lt;br /&gt;
== Get Hyrax from GitHub ==&lt;br /&gt;
Use git to clone the https://github.com/opendap/hyrax project and follow the instructions on this page (which differ a bit from ones in the project&#039;s README)&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;tt&amp;gt;git clone https://github.com/opendap/hyrax&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the &#039;&#039;hyrax&#039;&#039; project cloned:&lt;br /&gt;
;set up some environment variables so the server will build an install locally, something that streamlines development&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;source spath.sh&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;clone the three code repos for the server plus the hyrax dependencies&lt;br /&gt;
:&amp;lt;tt&amp;gt;&#039;&#039;&#039;./hyrax_clone.sh -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
;proceed with the rest of the build as described in the following sections of this page&lt;br /&gt;
&lt;br /&gt;
== Important Note ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Many of the problems people have with the build stem from not setting the shell correctly for the build.&amp;lt;/font&amp;gt;&lt;br /&gt;
In the above section, &#039;&#039;make sure&#039;&#039; you run &#039;&#039;&#039;source spath.sh&#039;&#039;&#039; before you run any of the building/compiling/testing commands that use the source code or build files. While the &#039;&#039;$prefix&#039;&#039; and &#039;&#039;$PATH&#039;&#039; environment variables are simple to set up, they are needed by most users. When you exit a terminal window and then open a new one, make sure to (re)source the &#039;&#039;spath.sh&#039;&#039; file in the new shell. You don&#039;t have to source spath.sh every time you enter the &#039;&#039;hyrax&#039;&#039; directory, but you must run it for every new instance of the shell.&lt;br /&gt;
&lt;br /&gt;
== Compile the Hyrax dependencies ==&lt;br /&gt;
Use git to clone the hyrax-dependencies:&lt;br /&gt;
  git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
And then build it. Unlike many source packages, there is no need to run a configure script, just &#039;&#039;make&#039;&#039; will do. However, the Makefile in this package expects &#039;&#039;$prefix&#039;&#039; to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called &#039;&#039;deps&#039;&#039;. To build the dependencies for building RPMs, use &#039;&#039;make -j9 for-static-rpm&#039;&#039;.&lt;br /&gt;
;(make sure you&#039;re in the directory set to &#039;&#039;$prefix&#039;&#039;)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
;git clone https://github.com/opendap/hyrax-dependencies&lt;br /&gt;
; cd hyrax-dependencies&lt;br /&gt;
; make --jobs=9&lt;br /&gt;
: &#039;&#039;The --jobs=N runs a parallel build with at most N simultaneous compile operations. This will result in a huge performance improvement on multi-core machines. &#039;&#039;&#039;-jN&#039;&#039;&#039; is the short form for the option.&#039;&#039;&lt;br /&gt;
;cd ..: &#039;&#039;Go back up to &#039;&#039;&#039;$prefix&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You can get some of the &#039;&#039;dependencies&#039;&#039; for Hyrax like &#039;&#039;netCDF&#039;&#039; from the EPEL repository, but the versions are often older than Hyrax needs. Contact us if you want information about using EPEL. At the risk of throwing people a curve ball, here&#039;s a synopsis of the process. Don&#039;t do this unless you know EPEL well. Use [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using &#039;&#039;sudo yum install epel-release-6-8.noarch.rpm&#039;&#039;. Then install packages needed to read various file formats: &#039;&#039;yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Build &#039;&#039;libdap&#039;&#039; and the &#039;&#039;BES&#039;&#039; daemon ==&lt;br /&gt;
&lt;br /&gt;
==== Get and build libdap4 ====&lt;br /&gt;
;WARNING: If you have &#039;&#039;libdap&#039;&#039; already, uninstall it before proceeding.&lt;br /&gt;
Build, test and install libdap4 into $prefix:&lt;br /&gt;
;git clone https://github.com/opendap/libdap4&lt;br /&gt;
;cd libdap4&lt;br /&gt;
;autoreconf -fiv&lt;br /&gt;
;./configure --prefix=$prefix --enable-developer &lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Get and build the BES and all of the modules shipped with Hyrax ====&lt;br /&gt;
Build, test and install the BES and its modules&lt;br /&gt;
;git clone https://github.com/opendap/bes: Clone the BES from GitHub&lt;br /&gt;
;cd bes&lt;br /&gt;
;git submodule update --init: This will clone some additional modules into the directory &#039;&#039;modules&#039;&#039;; you need to do this! (Previously it was an optional step). See [http://git-scm.com/docs/git-submodule git submodule] for information about all you can do with git&#039;s submodule command. Also note that this does not checkout a particular branch for the submodules; the modules are left in the &#039;detached head&#039; state. To checkout a particular branch like &#039;master&#039;, which is important if you&#039;ll be making changes to that code, use &#039;&#039;git submodule foreach &#039;git checkout master&#039; &#039;&#039;. &lt;br /&gt;
;autoreconf --force --install --verbose: You can use -fiv instead of the long options. These mean, when starting from a freshly cloned repo, run all of the autotools commands and install all of the needed scripts.&lt;br /&gt;
;./configure --prefix=$prefix  --with-dependencies=$prefix/deps --enable-developer&lt;br /&gt;
: Notes:&lt;br /&gt;
:* The --with-deps... is not needed if you load the dependencies from RPMs or otherwise have them installed an generally accessible on the build machine.&lt;br /&gt;
:* The  --enable-developer option will compile in all of the debugging code which may affect performance even if the debugging output is not enabled.&lt;br /&gt;
;make -j9&lt;br /&gt;
;make check -j9: Some tests may fail and adding &#039;&#039;-k&#039;&#039; ignores that and keeps make marching along. &#039;&#039;Note that you must run &#039;&#039;&#039;make&#039;&#039;&#039; before &#039;&#039;&#039;make check&#039;&#039;&#039; in the bes code&#039;&#039;.&lt;br /&gt;
;make install&lt;br /&gt;
;cd ..: Go back up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Test the BES ====&lt;br /&gt;
Start the BES and verify that all of the modules build correctly.&lt;br /&gt;
;besctl start: Start the BES. Given that &#039;&#039;$prefix/bin&#039;&#039; is on your &#039;&#039;$PATH&#039;&#039;, this should start the BES. You will not need to be root if you used the &#039;&#039;--enable-developer&#039;&#039; switch with configure (as shown above), otherwise you should run &#039;&#039;sudo besctl start&#039;&#039; with the caveat that as root &#039;&#039;$prefix/bin&#039;&#039; will probably not be n your &#039;&#039;$PATH&#039;&#039;.&lt;br /&gt;
:If there&#039;s an error (e.g., you tried to start as a regular user but need to be root), edit bes.conf to be a real user (yourself?) in a real group (use &#039;groups&#039; to see which groups you are in) and also check that the bes.log file is &#039;&#039;not&#039;&#039; owned by root. &lt;br /&gt;
:Restart.&lt;br /&gt;
;bescmdln: Now that the BES is running, start the BES testing tool&lt;br /&gt;
;show version;: Send the BES the version command to see if it&#039;s running&lt;br /&gt;
:Take a quick look at the output. There should be entries for libdap, bes and all of the modules.&lt;br /&gt;
;exit: Exit the testing tool&lt;br /&gt;
&lt;br /&gt;
Note that even though you have exited the &#039;&#039;bescmdln&#039;&#039; test tool, the BES is still running. That&#039;s fine - we&#039;ll use it in just a bit - but if you want to shut it down, use &#039;&#039;besctl stop&#039;&#039;, or &#039;&#039;besctl pids&#039;&#039; to see the daemon&#039;s processes. If the BES is not stopping, &#039;&#039;besctl kill&#039;&#039; will stop all BES processes without waiting for them to complete their current task.&lt;br /&gt;
&lt;br /&gt;
== Build the Hyrax &#039;&#039;OLFS&#039;&#039; web application ==&lt;br /&gt;
The OLFS is a java servlet built using ant. The OLFS is a java servlet web application and runs with Tomcat, Glassfish, etc. You need a copy of Tomcat, but our servlet does not work with the RPM version of Tomcat. Get [http://tomcat.apache.org/download-70.cgi Tomcat 7 from Apache]. Note that if you built the dependencies from source using the &#039;&#039;hyrac-dependencies-1.10.tar&#039;&#039; then there is a copy of Tomcat in the &#039;&#039;hyrax-dependecies/extra_downloads directory. You can unpack the Tomcat tar file in &#039;&#039;$prefix&#039;&#039;. I&#039;ll assume you have the Apache Tomcat tar file in &#039;&#039;$prefix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
;tar -xzf apache-tomcat-7.0.57.tar.gz: Expand the Tomcat tar ball&lt;br /&gt;
;git clone https://github.com/opendap/olfs: Get the OLFS source code&lt;br /&gt;
;cd olfs: change directory to the OLFS source&lt;br /&gt;
;ant server: Build it&lt;br /&gt;
;cp build/dist/opendap.war ../apache-tomcat-7.0.57/webapps/: Copy the opendap web archive to the tomcat webapps direcotry.&lt;br /&gt;
;cd ..: Go up to &#039;&#039;$prefix&#039;&#039;&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/startup.sh: Start Tomcat&lt;br /&gt;
&lt;br /&gt;
== Test the server ==&lt;br /&gt;
You can test the server several ways, but the most fun is to use a web browser. The URL &#039;&#039;http://&amp;lt;machine&amp;gt;:8080/opendap&#039;&#039; should return a page pointing to a collection of test datasets bundled with the server. You can also use &#039;&#039;curl&#039;&#039;, &#039;&#039;wget&#039;&#039; or any application that can read from OpenDAP servers (e.g., Matlab, Octave, ArcGIS, IDL, ...).&lt;br /&gt;
&lt;br /&gt;
== Stopping the server ==&lt;br /&gt;
Stop both the BES and Apache&lt;br /&gt;
&lt;br /&gt;
;besctl stop&lt;br /&gt;
;./apache-tomcat-7.0.57/bin/shutdown.sh&lt;br /&gt;
&lt;br /&gt;
Note that there is also a &#039;&#039;hyraxctl&#039;&#039; script that provides a way to start and stop Hyrax without you (or &#039;&#039;init.d&#039;&#039;) having to type separate commands for both the BES and OLFS. This script is part of the BES software you cloned from git.&lt;br /&gt;
&lt;br /&gt;
== Building select parts of the BES ==&lt;br /&gt;
Building just the BES and one of more of its handlers/modules is not at all hard to do with a checkout of code from git. In the above section on building the BES, simply skip the step where the submodules are cloned (&#039;&#039;git submodule update --init&#039;&#039;) and link configure.ac to &#039;&#039;configure_standard.ac&#039;&#039;. The rest of the process is as shown. The end result is a BES daemon without any of the standard Hyrax modules (but support for DAP will be built if &#039;&#039;libdap&#039;&#039; is found by the configure script).&lt;br /&gt;
&lt;br /&gt;
To build modules for the BES, simply go to &#039;&#039;$prefix&#039;&#039;, clone their git repo and build them, taking care to pass set &#039;&#039;$prefix&#039;&#039; when calling the module&#039;s &#039;&#039;configure&#039;&#039; script. &lt;br /&gt;
&lt;br /&gt;
Note that it is easy to combine the &#039;build it all&#039; and &#039;build just one&#039; processes so that a complete Hyrax BES can be built in one go and then a new module/handler not included in the BES git repo can be built and used. Each module we have on GitHub has a &#039;&#039;configure.ac&#039;&#039;, &#039;&#039;Makefile.am&#039;&#039;, etc., that will support both kinds of builds and [[Configuration of BES Modules]] explains how to take a module/handler that builds as a standalone module and tweak the build scripts so that it&#039;s fully integrated into the Hyrax BES build, too.&lt;br /&gt;
&lt;br /&gt;
= Building on Ubuntu =&lt;br /&gt;
This was tested using Xenial (Ubuntu 16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get update&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Packages needed:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;sudo apt-get install ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ant junit git flex bison autoconf automake libtool emacs openssl bzip2 libjpeg-dev libxml2-dev curl libicu-dev vim bc make cmake uuid-dev libcurl4-openssl-dev libicu-dev g++ zlib1g-dev libcppunit-dev libssl-dev&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
	<entry>
		<id>https://docs.opendap.org/index.php?title=ConfigureCentos&amp;diff=13303</id>
		<title>ConfigureCentos</title>
		<link rel="alternate" type="text/html" href="https://docs.opendap.org/index.php?title=ConfigureCentos&amp;diff=13303"/>
		<updated>2022-01-20T00:17:10Z</updated>

		<summary type="html">&lt;p&gt;Kneumiller: Added CentOS 8 instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[HowTo_guides|&amp;lt;&amp;lt; back to HowTo Guides]]&lt;br /&gt;
&lt;br /&gt;
This describes how to set up a vanilla CentOS computer so that we can build RPM binaries for the Hyrax data server. This was taken from notes describing how I configured a machine with a fresh install of CentOS 5.3 to build Hyrax. Augmented for CentOS 6. &lt;br /&gt;
&lt;br /&gt;
If you&#039;re installing this on a &#039;&#039;virtual&#039;&#039; host using VMware, see the section at the end of this document for some tips on making that VM run smoothly.&lt;br /&gt;
&lt;br /&gt;
== CentOS versions ==&lt;br /&gt;
&lt;br /&gt;
These instructions have been amended to cover:&lt;br /&gt;
&lt;br /&gt;
* CentOS-6.9 (64-bit)&lt;br /&gt;
* CentOS-7.? (64-bit)&lt;br /&gt;
* CentOS-8   (64-bit)&lt;br /&gt;
&lt;br /&gt;
== Initial configuration ==&lt;br /&gt;
&lt;br /&gt;
Set up general build stuff that you need. The RPM packages you need are listed here. Using &#039;&#039;yum&#039;&#039; (&#039;&#039;sudo yum install &amp;lt;package&amp;gt;&#039;&#039;) is the easiest way to install these packages on CentOS/RedHat. The package names for Ubuntu are a bit different, but are easy to figure out. Our CI builds are done on Ubuntu 14 (as of Nov 2017), so it&#039;s certainly possible to build there:&lt;br /&gt;
* java-1.7.0-openjdk&lt;br /&gt;
* java-1.7.0-openjdk-devel&lt;br /&gt;
* ant&lt;br /&gt;
* ant-junit&lt;br /&gt;
* junit&lt;br /&gt;
* git &lt;br /&gt;
* gcc-c++ &lt;br /&gt;
* flex &lt;br /&gt;
* bison &lt;br /&gt;
* autoconf &lt;br /&gt;
* automake &lt;br /&gt;
* libtool &lt;br /&gt;
* emacs &lt;br /&gt;
* openssl-devel &lt;br /&gt;
* libuuid-devel &lt;br /&gt;
* readline-devel &lt;br /&gt;
* zlib-devel &lt;br /&gt;
* bzip2, bzip2-devel &lt;br /&gt;
* libjpeg-devel &lt;br /&gt;
* libxml2-devel &lt;br /&gt;
* curl-devel &lt;br /&gt;
* libicu-devel&lt;br /&gt;
* vim&lt;br /&gt;
* bc&lt;br /&gt;
&lt;br /&gt;
If you&#039;re feeling lucky, you can put all of the packages on a single line&lt;br /&gt;
:&#039;&#039;yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant ant-junit junit git gcc-c++ flex bison autoconf automake libtool emacs openssl-devel libuuid-devel readline-devel zlib-devel bzip2 bzip2-devel libjpeg-devel libxml2-devel curl-devel libicu-devel vim bc&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039; &lt;br /&gt;
*&#039;&#039;Java 1.7, Ant and CentOS 6&#039;&#039;. I found that ant 1.7 (the default with CentOS 6) would not work with Java 1.8. To get our code to build with Java 1.7, I used &#039;&#039;alternatives --config java&#039;&#039; to configure 1.7 and then &#039;&#039;export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75.x86_64&#039;&#039;. I could not compile the olfs otherwise. &lt;br /&gt;
*&#039;&#039;7 June 2016 - CentOS 7 RPM Build&#039;&#039;. I had to add &#039;&#039;&#039;bzip2-devel&#039;&#039;&#039;, &#039;&#039;&#039;libicu-devel&#039;&#039;&#039;, and &#039;&#039;&#039;bc&#039;&#039;&#039; to the set of packages to get the RPM to build on CentOS 7. It may be the case this was true of CentOS 6 as well and it just slipped by.&lt;br /&gt;
*&#039;&#039;11 Nov 2017&#039;&#039; - The latest versions of CentOS 6 and 7 had no problems using the packages above. I did not test Java 8 or Java 9, but Java 8 has no problems in development configurations. Tomcat7, 8, and 9 from RPMs all work as well, at least on my development machines.&lt;br /&gt;
&lt;br /&gt;
==== Autotools ====&lt;br /&gt;
The autotools with CentOS 6 should be fine - the scripts will complain if otherwise. However, the newer autoconf/make support some nice features, so installing these newer version is not a waste. On a Test machine, this should not be done. If you don&#039;t install the new versions, make sure to use yum to install autoconf, automake and libtool. That is&lt;br /&gt;
:&#039;&#039;yum install autoconf automake libtool&#039;&#039;&lt;br /&gt;
If you don&#039;t want to use RPM for these, then:&lt;br /&gt;
* download the latest versions of autoconf, automake, and libtool from GNU: http://ftp.gnu.org/gnu/&lt;br /&gt;
* ./configure, make, make install&lt;br /&gt;
&lt;br /&gt;
==== RPM Construction Tools ====&lt;br /&gt;
* &#039;&#039;yum install rpm-devel rpm-build redhat-rpm-config&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Hyrax specific configuration ==&lt;br /&gt;
Set up things that are specific to Hyrax&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to use as much of the RPM &#039;ecosystem&#039; as possible because this is what will be on other people&#039;s computers; using newer stuff, like the lastest HDF5 library is only going to cause incompatibilities. But to do that for Hyrax, you need to get beyond the stock set of repositories that &#039;&#039;yum&#039;&#039; searches. &lt;br /&gt;
&lt;br /&gt;
==== Add the EPEL EL repo to yum ====&lt;br /&gt;
* Information about EPEL/EL is here: https://fedoraproject.org/wiki/EPEL.&lt;br /&gt;
* For CentOS 6, you likely want the rpm package here: http://mirror.pnl.gov/epel/6/i386/repoview/epel-release.html&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note&#039;&#039;&#039; Use CentOS 6 if possible for Hyrax at this time (Sept 2014). We&#039;ll be moving to combined v.6 and v.7 support soon; v.5 is no longer supported. Some CentOS 5 information is included here because this was initially written back when it was the latest version.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Centos 5.x =====&lt;br /&gt;
But don&#039;t use this unless you really have too...&lt;br /&gt;
&lt;br /&gt;
* google EPEL/EL5 and &lt;br /&gt;
* find &amp;amp; download &#039;&#039;epel-release-5.4.noarch.rpm&#039;&#039;&lt;br /&gt;
* install it: &#039;&#039;rpm -i epel-release-5.4.noarch.rpm&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Centos 6.x =====&lt;br /&gt;
Use this until we start supporting CentOS 7&lt;br /&gt;
&lt;br /&gt;
* google EPEL/EL6 and &lt;br /&gt;
* find &amp;amp; download &#039;&#039;epel-release-6.5.noarch.rpm&#039;&#039;&lt;br /&gt;
* install it: &#039;&#039;rpm -i epel-release-6.5.noarch.rpm&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Centos 8.x =====&lt;br /&gt;
* yum update&lt;br /&gt;
* yum config-manager --set-enabled powertools&lt;br /&gt;
* yum install openjpeg2-devel&lt;br /&gt;
* yum install jasper-devel&lt;br /&gt;
* yum install libtirpc-devel&lt;br /&gt;
* export CPPFLAGS=-I/usr/include/tirpc&lt;br /&gt;
* export LDADD=-ltirpc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Data type dependencies: NetCDF, HDF4, HDF5 ====&lt;br /&gt;
* &#039;&#039;yum install netcdf-devel&#039;&#039; (note: On CentOS-6.2 you&#039;ll get netcdf-4 and on CentOS-5.3 you&#039;ll get netcdf-3)&lt;br /&gt;
* &#039;&#039;yum install hdf-devel&#039;&#039; (note: &#039;hdf&#039;, not &#039;hdf4&#039;)&lt;br /&gt;
* &#039;&#039;yum install hdf5-devel&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Other dependencies ====&lt;br /&gt;
* &#039;&#039;yum install libicu-devel&#039;&#039;&lt;br /&gt;
* &#039;&#039;yum install cfitsio-devel&#039;&#039;&lt;br /&gt;
* &#039;&#039;yum install cppunit-devel&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== ... If you&#039;re feeling lucky ====&lt;br /&gt;
As with the &#039;build packages,&#039; here are all of the &#039;hyrax-specific&#039; packages so you can use just one Yum command&lt;br /&gt;
:&#039;&#039;netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build&#039;&#039;.&lt;br /&gt;
Note that you&#039;ll still need to set up the EPEL repository.&lt;br /&gt;
&lt;br /&gt;
== VMware configuration tips ==&lt;br /&gt;
It&#039;s best if you enable a shared directory so that you can pass stuff back and forth between the host OS and the Guest OS (i.e., the Virtual machine). That will only work if you have the &#039;&#039;VMware tools&#039;&#039; installed in/on the guest.&lt;br /&gt;
&lt;br /&gt;
* Install VMware-tools. This process varies, but it&#039;s pretty easy for all platforms. On VMware Fusion, look under the &#039;&#039;Virtual Machine&#039;&#039; menu for the item that says &#039;&#039;Install VMware Tools&#039;&#039;. This will download lump of code and, for CentOS, mount it on &#039;/media/VMware Tools&#039; (yes, there&#039;s a space in the directory name). Copy the *.tar.gz file to some place like your home directory, unpack it and read the INSTALL file. For an initial installation, the typical process is to run &#039;&#039;vmware-install.pl&#039;&#039;.&lt;br /&gt;
* Under the configuration/options menu (the little wrench thing in Fusion), choose &#039;&#039;Sharing&#039;&#039;. Make a folder with an obvious name (e.g., &#039;&#039;vmware&#039;&#039;) and turn sharing on. Now, anything you put in there when on either the OS will be available to the other OS. On linux, this directory is located at &#039;&#039;/mnt/hgfs/&amp;lt;&amp;lt;name&amp;gt;&amp;gt;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Support for DEB packages ==&lt;br /&gt;
It is possible to use &#039;&#039;fpm&#039;&#039; to build debian packages from RPM packages. See [https://ask.fedoraproject.org/en/question/52141/how-to-convert-rpm-package-to-deb/ how-to-convert-rpm-package-to-deb] for an explanation. In summary, make a few directories to hold parts of the RPM, load files from the RPM into them and then use &#039;&#039;fpm&#039;&#039; to build the debian package. In addition to these steps, extract the package description text to a file and pass that into &#039;&#039;fpm&#039;&#039; and look at the dependencies for the RPMs, find the corresponding Ubuntu dependencies and provide them to &#039;&#039;fpm&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== problems not addressed ==&lt;br /&gt;
* There is no JUnit for the OLFS build&lt;br /&gt;
* There is no graphviz so the &#039;&#039;doc&#039;&#039; targets for libdap and bes will fail&lt;/div&gt;</summary>
		<author><name>Kneumiller</name></author>
	</entry>
</feed>