Hyrax GitHub Source Build: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
mNo edit summary
Line 15: Line 15:


== Set up a CentOS machine to build code ==
== Set up a CentOS machine to build code ==
See [[ConfigureCentos | Configure CentOS]] to set up a CentOS 6 machine to build software. Note that if you do ''all'' of the steps for CentOS 6 listed there - and it's not that hard - including setting up the EPEL ''yum'' repo, then you can install all of the deps except ''gdal'' and ''gridfields'' using RPMs. With this you can skip the [[#Get the dependencies if you need them | Get the dependencies if you need them]] step below.
Note that I don't like clicking around to different pages to follow simple directions, so what follows is a short version of the ContOS 6 configuration information we've compiled for people that help us by building RPM packages for Hyrax. 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:


Note that I don't like clicking around to different pages to follow simple directions, so here's a short version of the ContOS 6 configuration:
;Load a basic software development environment:''yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel ant git gcc-c++ flex bison openssl-devel libuuid-devel readline-devel zlib-devel libjpeg-devel libxml2-devel curl-devel emacs''
;Get GNU autotools:''download autoconf [http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz autoconf-2.69.tar.gz], automake [http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz automake-1.14.1.tar.gz] and libtool [http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz libtool-2.4.2.tar.gz] and build them (./configure; make; sudo make install - this should take no more than three minutes).''


''yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel ant git gcc-c++ flex bison openssl-devel libuuid-devel readline-devel zlib-devel libjpeg-devel libxml2-devel curl-devel emacs''
Choice point: You either need to get and build the Hyrax dependencies from source (see [[#Compile the Hyrax dependencies | Compile the Hyrax dependencies]]) ''or'' install EPEL for CentOS and then use ''yum'' to install them, with the caveat that as of Hyrax 1.10, EPEL does not have a recent enough version of GDAL or Gridfields to build our code, so those parts of Hyrax won't build if you got the EPEL route. Neither way is too hard.
;EPEL: Get [http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm epel-release-6-8.noarch.rpm] and install it using ''sudo yum install epel-release-6-8.noarch.rpm''. Then install packages needed to read various file formats: ''yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build''
;or, Compile the dependencies: See the instructions below...


==== set up a build directory ====
==== Compile the Hyrax dependencies ====
In a new directory, set a new environment variable ''prefix'' to the CWD (''export prefix=`pwd`) and set ''PATH'' so that ''$prefix/bin'' is at the head of PATH (export ''PATH=$prefix/bin:$PATH'')
:Note: If you installed packages for netcdf, etc., using EPEL as decribed above, skip this step.
 
Get the tar ball hyrax-dependencies and build it. Unlike many source packages, there is no need to run a configure script, just ''make'' will do. However, the Makefile in this package expects ''$prefix'' to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called ''deps''. Get the latest tarball from http://www.opendap.org/pub/source/, currently [http://www.opendap.org/pub/source/hyrax-dependencies-1.10.tar hyrax-dependencies-1.10.tar]
==== Get the dependencies if you need them ====
# (make sure you're in the directory set to ''$prefix'')
Get the tar ball hyrax-dependencies and build it. The Makefile in this package expects ''$prefix'' to be set as describe above. It will put all of the Hyrax server dependencies in a subdirectory called ''deps''. Get the latest tarball from http://www.opendap.org/pub/source/hyrax-dependencies-1.9.5.tar
# wget http://www.opendap.org/pub/source/hyrax-dependencies-1.10.tar
: ''The Makefile should be modified to test for and create as needed the src directory so that everything will unpack correctly. [[User:Ndp|ndp]] ([[User talk:Ndp|talk]])''
# tar -xzf hyrax-dependencies-1.10.tar
: What this means is that until we make a new deps tar ball, run ''mkdir src'' in the directory the tar ball makes once it's unpacked. Not a big deal, just something we forgot when we built the tar ball from a fresh git checkout. [[User:Jimg|Jimg]] ([[User talk:Jimg|talk]]) 06:38, 19 December 2014 (UTC)
# cd hyrax-dependencies
: Note that if the deps are loaded from RPMs (as per the first step on this page) then there is no need to build them here, too. It won't hurt to build these, and in fact some parts of the server will build with these that won't build with the RPM-based deps, but you don't absolutely have to have the deps built from source if you have the RPMs installed to get 90% of the server's capabilities. The parts that will be missing are those parts that use ''gdal'' and ''gridfields''.
# make


== Build ''libdap'' and the Hyrax BES daemon ==
== Build ''libdap'' and the Hyrax BES daemon ==

Revision as of 05:25, 23 December 2014

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's web pages to complex server-side processing operations. This page describes how to build the server's source code. If you're working on a Linux or OS/X computer, the process is simple; we do not support building the server on Windows operating systems.

To build and install the server, you need to perform three steps:

  1. Set up the computer to build source code (Install a Java compiler; install a C/C++ compiler; add some other tools)
  2. Build the C++ DAP library (libdap) and the Hyrax BES daemon
  3. Build the Hyrax OLFS web application

Quick links if you already know the process:

In the following, we describe the build process for CentOS because the one for OS/X is so similar. We note the differences where they are significant.

Set up a CentOS machine to build code

Note that I don't like clicking around to different pages to follow simple directions, so what follows is a short version of the ContOS 6 configuration information we've compiled for people that help us by building RPM packages for Hyrax. The complete instructions are in Configure CentOS and describe how to to set up a CentOS 6 machine to build software. What follows is the condensed version:

Load a basic software development environment
yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel ant git gcc-c++ flex bison openssl-devel libuuid-devel readline-devel zlib-devel libjpeg-devel libxml2-devel curl-devel emacs
Get GNU autotools
download autoconf autoconf-2.69.tar.gz, automake automake-1.14.1.tar.gz and libtool libtool-2.4.2.tar.gz and build them (./configure; make; sudo make install - this should take no more than three minutes).

Choice point: You either need to get and build the Hyrax dependencies from source (see Compile the Hyrax dependencies) or install EPEL for CentOS and then use yum to install them, with the caveat that as of Hyrax 1.10, EPEL does not have a recent enough version of GDAL or Gridfields to build our code, so those parts of Hyrax won't build if you got the EPEL route. Neither way is too hard.

EPEL
Get epel-release-6-8.noarch.rpm and install it using sudo yum install epel-release-6-8.noarch.rpm. Then install packages needed to read various file formats: yum install netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build
or, Compile the dependencies
See the instructions below...

Compile the Hyrax dependencies

Note: If you installed packages for netcdf, etc., using EPEL as decribed above, skip this step.

Get the tar ball hyrax-dependencies and build it. Unlike many source packages, there is no need to run a configure script, just make will do. However, the Makefile in this package expects $prefix to be set as described above. It will put all of the Hyrax server dependencies in a subdirectory called deps. Get the latest tarball from http://www.opendap.org/pub/source/, currently hyrax-dependencies-1.10.tar

  1. (make sure you're in the directory set to $prefix)
  2. wget http://www.opendap.org/pub/source/hyrax-dependencies-1.10.tar
  3. tar -xzf hyrax-dependencies-1.10.tar
  4. cd hyrax-dependencies
  5. make

Build libdap and the Hyrax BES daemon

Get and build libdap

Build, test and install libdap into $prefix:

git clone https://github.com/opendap/libdap
autoreconf -fiv
./configure --prefix=$prefix --enable-developer
make -j9
make check -j9
make install

Get and build the BES and all of the modules shipped with Hyrax

Build, test and install the BES and its modules

git clone https://github.com/opendap/bes
Clone the BES from GitHub
git checkout modules
Checkout the modules branch of the BES Use the master branch as of 12/15/14
git submodule init
does some init thing
git submodule update
This will clone each of the N modules into the directory modules. There's lots of ways to do this; this is just one. [1]
autoreconf -vif
./configure --prefix=$prefix --enable-developer --with-dependencies=$prefix/deps
Note that 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.
make -j9
make check -k
Some tests may fail and -k ignores that and keeps make marching along
  • Removed the -j9 option from the make check command because it can cause some tests to break. - ndp
  • fileout_json is failing right now 12/2/14 - jhrg
make install

Test the BES

Start the BES and verify that all of the modules build correctly.

besctl start
Given that $prefix/bin is on your $PATH, this should start the BES. You will not need to be root if you used the --enable-developer switch with configure (as shown above), otherwise you should run sudo besctl start with the caveat that as root $prefix/bin will probably not be n your $PATH.
If there'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 'groups' to see which groups you are in) and also check that the bes.log file is not owned by root.
Restart.
bescmdln
Start the simple command line client
show version;
Take a quick look at the output. There should be entries for libdap, bes and all of the modules.
exit
Leave the client

Build the Hyrax OLFS web application

The OLFS is a java servlet built using ant.