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.
If you're installing this on a virtual host using VMware, see the section at the end of this document for some tips on making that VM run smoothly.
- 1 CentOS versions
- 2 Initial configuration
- 3 Hyrax specific configuration
- 4 VMware configuration tips
- 5 Support for DEB packages
- 6 problems not addressed
1 CentOS versions
These instructions have been amended to cover:
- CentOS-6.9 (64-bit)
- CentOS-7.? (64-bit)
2 Initial configuration
Set up general build stuff that you need:
- yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel *see note below about Java, Ant and CentOS 6
- yum install ant
- yum install git
- yum install gcc-c++
- yum install flex
- yum install bison
- yum install curl-devel
- yum install libxml2-devel
- yum install libjpeg-devel
- yum install zlib-devel (this provides both 'compress' and 'gzip' support)
- yum install bzip2-devel (this provides 'bzip2' support)
- yum install readline-devel
- yum install libuuid-devel
- yum install openssl-devel
- Not having emacs is a problem for some... yum install emacs
If you're feeling lucky, you can put all of the packages on a single line
- yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel ant git gcc-c++ flex bison openssl-devel libuuid-devel readline-devel zlib-devel bzip2-devel libicu-devel libjpeg-devel libxml2-devel curl-devel emacs
- Java 1.7, Ant and CentOS 6. 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 alternatives --config java to configure 1.7 and then export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-188.8.131.52.x86_64. I could not compile the olfs otherwise.
- 7 June 2016 - CentOS 7 RPM Build. I had to add bzip2-devel and libicu-devel 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.
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't install the new versions, make sure to use yum to install autoconf, automake and libtool. That is
- yum install autoconf automake libtool
If you don't want to use RPM for these, then:
- download the latest versions of autoconf autoconf-2.69.tar.gz, automake automake-1.14.1.tar.gz and libtool libtool-2.4.2.tar.gz
- ./configure, make, make install
2.2 RPM Construction Tools
- yum install rpm-devel rpm-build redhat-rpm-config
3 Hyrax specific configuration
Set up things that are specific to Hyrax
It's best to use as much of the RPM 'ecosystem' as possible because this is what will be on other people'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 yum searches.
3.1 Add the EPEL EL repo to yum
- Information about EPEL/EL is here: https://fedoraproject.org/wiki/EPEL.
- For CentOS 6, you likely want the rpm package here: http://mirror.pnl.gov/epel/6/i386/repoview/epel-release.html
Note Use CentOS 6 if possible for Hyrax at this time (Sept 2014). We'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.
3.1.1 Centos 5.x
But don't use this unless you really have too...
- google EPEL/EL5 and
- find & download epel-release-5.4.noarch.rpm
- install it: rpm -i epel-release-5.4.noarch.rpm
3.1.2 Centos 6.x
Use this until we start supporting CentOS 7
- google EPEL/EL6 and
- find & download epel-release-6.5.noarch.rpm
- install it: rpm -i epel-release-6.5.noarch.rpm
3.2 Data type dependencies: NetCDF, HDF4, HDF5
- yum install netcdf-devel (note: On CentOS-6.2 you'll get netcdf-4 and on CentOS-5.3 you'll get netcdf-3)
- yum install hdf-devel (note: 'hdf', not 'hdf4')
- yum install hdf5-devel
3.3 Other dependencies
- yum install libicu-devel
- yum install cfitsio-devel
- yum install cppunit-devel
3.4 ... If you're feeling lucky
As with the 'build packages,' here are all of the 'hyrax-specific' packages so you can use just one Yum command
- netcdf-devel hdf-devel hdf5-devel libicu-devel cfitsio-devel cppunit-devel rpm-devel rpm-build.
Note that you'll still need to set up the EPEL repository.
4 VMware configuration tips
It'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 VMware tools installed in/on the guest.
- Install VMware-tools. This process varies, but it's pretty easy for all platforms. On VMware Fusion, look under the Virtual Machine menu for the item that says Install VMware Tools. This will download lump of code and, for CentOS, mount it on '/media/VMware Tools' (yes, there'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 vmware-install.pl.
- Under the configuration/options menu (the little wrench thing in Fusion), choose Sharing. Make a folder with an obvious name (e.g., vmware) 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 /mnt/hgfs/<<name>>.
5 Support for DEB packages
It is possible to use fpm to build debian packages from RPM packages. See 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 fpm to build the debian package. In addition to these steps, extract the package description text to a file and pass that into fpm and look at the dependencies for the RPMs, find the corresponding Ubuntu dependencies and provide them to fpm.
6 problems not addressed
- There is no JUnit for the OLFS build
- There is no graphviz so the doc targets for libdap and bes will fail