Using the Linux Binary Distributions for Ice 3.6.0

This page provides important information for users of the Ice binary distributions on Linux platforms. You can obtain these distributions at the ZeroC web site.

On this page:

Overview of the Ice Binary Distributions for Linux

DEB Packages

ZeroC provides the following DEB packages for Ubuntu:

PackageDescription
zeroc-ice-all-runtimeMeta package that installs all run-time packages, servers and utilities
zeroc-ice-all-devMeta package that installs all development packages

zeroc-ice-slice

Slice files
libzeroc-ice3.6C++ run-time libraries
libzeroc-ice-devC++ header files, libraries, and Slice compiler for C++
libzeroc-ice-javaJava development kit, including JAR files and Slice compiler for Java
php5-zeroc-icePHP extension and run time files
php5-zeroc-ice-devSlice compiler for PHP development
zeroc-ice-utilsUtilities necessary for administering an Ice installation
zeroc-ice-utils-javaAdditional utilities that require Java, such as the IceGrid Admin GUI
zeroc-iceboxIceBox server for C++
zeroc-icegridIceGrid service
libzeroc-icestorm3.6IceStorm service
zeroc-glacier2Glacier2 service
zeroc-icepatch2IcePatch2 executable
libzeroc-freeze3.6Freeze for C++ run-time libraries

RPM Packages

ZeroC provides the following RPMs for Red Hat Enterprise Linux, SuSE Linux Enterprise Server, and Amazon Linux:

RPMDescription
ice-all-runtimeMeta package that installs all run-time packages, servers and utilities
ice-all-develMeta package that installs all development packages

ice-slice

Slice files
libice3.6-c++C++ run-time libraries
libice-c++-develC++ header files, libraries, and Slice compiler for C++
libice-javaJava development kit, including JAR files and Slice compiler for Java
php-icePHP extension and run time files
php-ice-develSlice compiler for PHP development
ice-utilsUtilities necessary for administering an Ice installation
ice-utils-javaAdditional utilities that require Java, such as the IceGrid Admin GUI
iceboxIceBox server for C++
icegridIceGrid service
libicestorm3.6IceStorm service
glacier2Glacier2 service
icepatch2IcePatch2 executable
libfreeze3.6-c++Freeze for C++ run-time libraries

ZeroC also supplies RPMs for the following third-party packages:

RPM

Description

db53

Berkeley DB 5.3.28 C and C++ run time libraries

db53-devel

C++ development files for Berkeley DB 5.3.28

db53-java

Berkeley DB 5.3.28 Java run time

db53-utils

Berkeley DB 5.3.28 command-line utilities

mcpp-devel

MCPP C++ preprocessor library

The db53 packages are only necessary on SuSE Linux Enterprise Server, Amazon Linux and Red Hat Enterprise Linux 6; Berkeley DB 5.3 is already available in the standard Red Hat Enterprise Linux 7 repository as libdb.

The db53-devel and the mcpp-devel RPMs are only necessary for building Ice from source.

 

Bi-Arch Support

Recent Linux releases such as RHEL 7 are moving away from separate 64-bit and 32-bit distributions and migrating to a single 64-bit release that includes support for 32-bit packages. On these systems, all of the Ice packages listed above are provided for the x86_64 architecture, along with a limited subset of packages for the x86 architecture. The subset includes C++ run-time and development libraries, along with 32-bit versions of the IceBox server and IceStorm service. The 32-bit IceBox package installs the executables as icebox32 and icebox32++11; the latter is used for IceBox services built in C++11 mode, as described in the C++ section below.

For development purposes, you will still need to install the 64-bit development kit packages: the 32-bit development kit packages complement these 64-bit packages.

On other systems, such as Amazon Linux and SLES 12, we only provide packages for the x86_64 architecture.

Installing the Linux Distributions

This section describes how to install Ice binary packages for all of the supported Linux platforms.

Installing Ice on Ubuntu 15

Follow the instructions below to install Ice on Ubuntu.

1. Install ZeroC's key to avoid warnings with unsigned packages:

wget https://zeroc.com/download/GPG-KEY-zeroc-release
sudo apt-key add GPG-KEY-zeroc-release

2. Add the Ice repository to your system: 

sudo apt-add-repository "deb http://zeroc.com/download/apt/ubuntu15.04 stable main"

3. Update the package list and install:

sudo apt-get update
sudo apt-get install zeroc-ice-all-runtime zeroc-ice-all-dev

Refer to the package summary if you would like to install fewer packages.

The metapackages zeroc-ice-all-runtime and zeroc-ice-all-dev reference the required Berkeley DB dependencies from the Universe repository. You will need to install db5.3-util separately to perform admin tasks such as hot backups on your Berkeley DB databases with command-line utilities:

sudo apt-get install db5.3-util

4. Install the source package (optional):

sudo apt-get source zeroc-ice3.6

Installing Ice on Ubuntu 14

Follow the instructions below to install Ice on Ubuntu.

1. Install ZeroC's key to avoid warnings with unsigned packages:

wget https://zeroc.com/download/GPG-KEY-zeroc-release
sudo apt-key add GPG-KEY-zeroc-release

2. Add the Ice repository to your system: 

sudo apt-add-repository "deb http://zeroc.com/download/apt/ubuntu14.04 stable main"

3. Update the package list and install:

sudo apt-get update
sudo apt-get install zeroc-ice-all-runtime zeroc-ice-all-dev

Refer to the package summary if you would like to install fewer packages.

The metapackages zeroc-ice-all-runtime and zeroc-ice-all-dev reference the required Berkeley DB dependencies from the Universe repository. You will need to install db5.3-util separately to perform admin tasks such as hot backups on your Berkeley DB databases with command-line utilities:

sudo apt-get install db5.3-util

4. Install the source package (optional):

sudo apt-get source zeroc-ice3.6

Installing Ice on Red Hat Enterprise Linux 7

Follow the instructions below to install Ice on RHEL 7:

1. Install ZeroC's key to avoid warnings with unsigned packages:

wget https://zeroc.com/download/GPG-KEY-zeroc-release
sudo rpm --import GPG-KEY-zeroc-release

2. Add the Ice repositories to your system: 

cd /etc/yum.repos.d
sudo wget https://zeroc.com/download/rpm/el7/zeroc-ice-el7.repo

3. Install Ice:

sudo yum install ice-all-runtime ice-all-devel

Refer to the package summary if you would like to install fewer packages.

The yum documentation provides more information about installing packages on RHEL 7.

Notes:

  • Although RHEL 7 is a 64-bit operating system, we continue to support 32-bit applications by providing i686 versions of IceBox, IceStorm, C++ run-time libraries, and C++ development libraries, for example:

    sudo yum install libzeroc-ice-dev.i686
    
  • This distribution depends on the Berkeley DB packages included with RHEL 7:

    sudo yum list 'libdb*'
    

    You will need to install libdb-utils to perform admin tasks such as hot backups on your Berkeley DB databases with command-line utilities:

    sudo yum install libdb-utils
    

Installing Ice on Red Hat Enterprise Linux 6

Follow the instructions below to install Ice on RHEL 6:

1. Install ZeroC's key to avoid warnings with unsigned packages:

wget https://zeroc.com/download/GPG-KEY-zeroc-release
sudo rpm --import GPG-KEY-zeroc-release

2. Add the Ice repositories to your system: 

cd /etc/yum.repos.d
sudo wget https://zeroc.com/download/rpm/el6/zeroc-ice-el6.repo

3. Install Ice:

sudo yum install ice-all-runtime ice-all-devel

Refer to the package summary if you would like to install fewer packages.

The yum documentation provides more information about installing packages on RHEL 6.

Notes:

  • This distribution depends on Berkeley DB packages included in our third-party repository:

    sudo yum list 'db53*'
    

    You will need to install db53-utils to perform admin tasks such as hot backups on your Berkeley DB databases with command-line utilities:

    sudo yum install db53-utils
    

Installing Ice on Amazon Linux 2015.03

Follow the instructions below to install Ice on Amazon Linux:

1. Install ZeroC's key to avoid warnings with unsigned packages:

wget https://zeroc.com/download/GPG-KEY-zeroc-release
sudo rpm --import GPG-KEY-zeroc-release

2. Add the Ice repositories to your system: 

cd /etc/yum.repos.d
sudo wget https://zeroc.com/download/rpm/amzn1/2015.03/zeroc-ice-amzn1.repo

3. Install Ice:

sudo yum install ice-all-runtime ice-all-devel

Refer to the package summary if you would like to install fewer packages.

The EC2 documentation provides more information about installing packages on Amazon Linux.

Notes:

  • This distribution depends on Berkeley DB packages included in our third-party repository:

    sudo yum list 'db53*'
    

    You will need to install db53-utils to perform admin tasks such as hot backups on your Berkeley DB databases with command-line utilities:

    sudo yum install db53-utils
    

Installing Ice on SuSE Enterprise Server 12

Follow the instructions below to install Ice on SLES 12:

1. Install ZeroC's key to avoid warnings with unsigned packages:

wget https://zeroc.com/download/GPG-KEY-zeroc-release
sudo rpm --import GPG-KEY-zeroc-release

2. Add the Ice repositories to your system: 

wget https://zeroc.com/download/rpm/sles12/zeroc-ice-sles12.repo
sudo zypper addrepo zeroc-ice-sles12.repo

3. Install Ice:

sudo zypper install ice-all-runtime ice-all-devel

Refer to the package summary if you would like to install fewer packages.

Notes:

  • This distribution depends on Berkeley DB packages included in our third-party repository:

    sudo zypper search 'db53*'
    

    You will need to install db53-utils to perform admin tasks such as hot backups on your Berkeley DB databases with command-line utilities:

    sudo zypper install db53-utils
    

Installing Ice on SuSE Enterprise Server 11

Follow the instructions below to install Ice on SLES 11:

1. Install ZeroC's key to avoid warnings with unsigned packages:

wget https://zeroc.com/download/GPG-KEY-zeroc-release
sudo rpm --import GPG-KEY-zeroc-release

2. Add the Ice repositories to your system: 

wget https://zeroc.com/download/rpm/sles11.3/zeroc-ice-sles11.3.repo
sudo zypper addrepo zeroc-ice-sles11.3.repo

3. Install Ice:

sudo zypper install ice-all-runtime ice-all-devel

Refer to the package summary if you would like to install fewer packages.

Notes:

  • This distribution depends on Berkeley DB packages included in our third-party repository:

    sudo zypper search 'db53*'
    

    You will need to install db53-utils to perform admin tasks such as hot backups on your Berkeley DB databases with command-line utilities:

    sudo zypper install db53-utils
    

Setting up your Linux environment to use Ice

After installing Ice, read the relevant language-specific sections below to learn how to configure your environment and start programming with Ice.

C++

A C++ program needs to link with at least libIce and libIceUtil, so a typical link command would look like this:

$ c++ -o myprogram myprogram.o -pthread -lIce -lIceUtil

Additional libraries are necessary if you are using an Ice service such as IceGrid or Glacier2.

Always use the -pthread option when compiling and linking your Ice applications.

If you build your C++ program in C++11 or C++14 mode (with -std=c++0x-std=gnu++0x-std=c++11-std=gnu++11-std=c++14, -std=gnu++14), you need to link with the C++11 libraries included in your binary distribution. For 32-bit  programs:

$ c++ -std=c++11 -o myprogram myprogram.o -pthread -L/usr/lib/c++11 -lIce -lIceUtil

For 64-bit programs:

$ c++ -std=c++11 -o myprogram myprogram.o -pthread -L/usr/lib64/c++11 -lIce -lIceUtil

Java

The Ice for Java package (libice-java or libzeroc-ice-java depending on your Linux distribution) is a development kit. A production-quality Java application that uses Ice for Java is expected to incorporate all the Ice JAR files it needs; it should not depend on the Ice for Java package.

JAR Files

The preferred way to develop with Ice for Java is to configure your build environment to fetch the build artifacts from the ZeroC Maven repository located at:

http://repo.zeroc.com/nexus/content/repositories/releases

The Maven package ids are as follows:

  • groupId=com.zeroc, version=3.6.0, artifactId=ice, 
  • groupId=com.zeroc, version=3.6.0, artifactId=freeze
  • groupId=com.zeroc, version=3.6.0, artifactId=glacier2
  • groupId=com.zeroc, version=3.6.0, artifactId=icebox
  • groupId=com.zeroc, version=3.6.0, artifactId=icediscovery
  • groupId=com.zeroc, version=3.6.0, artifactId=icegrid
  • groupId=com.zeroc, version=3.6.0, artifactId=icelocatordiscovery
  • groupId=com.zeroc, version=3.6.0, artifactId=icepatch2
  • groupId=com.zeroc, version=3.6.0, artifactId=icestorm

If you cannot fetch the Ice for Java artifacts from the ZeroC Maven repository, the Ice JAR files are also installed locally in /usr/share/java. The files are named as follows:

  • ice-3.6.0.jar
  • freeze-3.6.0.jar
  • glacier2-3.6.0.jar
  • icebox-3.6.0.jar
  • icediscovery-3.6.0.jar
  • icegrid-3.6.0.jar
  • icelocatordiscovery-3.6.0.jar
  • icepatch2-3.6.0.jar
  • icestorm-3.6.0.jar

Freeze and Berkeley DB

In order to use Freeze for Java, you need to add both freeze-3.6.0.jar and the Berkeley DB JAR file (db.jar) to your build path. db.jar is installed alongside the Ice JAR files in /usr/share/java.

To use Freeze, the JVM also requires that the directory containing Berkeley DB's native libraries be listed in java.library.path, therefore you must add this directory to your LD_LIBRARY_PATH. Assuming you are using ZeroC's distribution of Berkeley DB, the bash command is shown below:

$ export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH                 (RHEL, SLES, Amazon)
$ export LD_LIBRARY_PATH=/usr/lib/i386-linux-gnu:$LD_LIBRARY_PATH  (Ubuntu)

On an x86_64 system with a 64-bit JVM, the 64-bit Berkeley DB libraries are installed in a different directory:

$ export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH                 (RHEL, SLES, Amazon)
$ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH  (Ubuntu)

Bzip2

Ice for Java supports protocol compression using the bzip2 classes included with ant. Compression is automatically enabled if these classes are present in your CLASSPATH. You can either add ant.jar to your CLASSPATH, or download only the bzip2 classes from http://www.kohsuke.org/bzip2.

You can also retrieve this bzip2 JAR file from ZeroC's Maven repository located at http://repo.zeroc.com/nexus/content/repositories/thirdparty.

The Maven package id for the bzip2 JAR file is as follows:

  • groupId=org.apache.tools, version=1.0, artifactId=bzip2

These classes are a pure Java implementation of the bzip2 algorithm and therefore add significant latency to Ice requests.

PHP

The Ice extension for PHP is loaded automatically when the interpreter loads the contents of the file /etc/php.d/ice.ini (on Red Hat Enterprise Linux and Amazon Linux) or /etc/php5/conf.d/ice.ini (on SuSE Linux Enterprise Server and Ubuntu). This file contains the line shown below:

extension=IcePHP.so

You can modify this file to include additional configuration directives.

At run time, the PHP interpreter requires the Ice shared libraries.

You can verify that the Ice extension is installed properly by examining the output of the php -m command, or by calling the phpinfo() function from a script.

Your application will also need to include at least some of the Ice for PHP run-time source files (installed in /usr/share/php on RHEL, Amazon Linux, and Ubuntu, and in /usr/share/php5 on SLES). This installation directory is included in PHP's default include path, which you can verify by executing the following command:

% php -i | grep include_path

If the installation directory is listed, no further action is necessary to make the run-time source files available to your application. Otherwise, you can modify the include_path setting in php.ini to add the installation directory:

include_path = /usr/share/php:...

Another option is to modify the include path from within your script prior to including any Ice run-time file:

PHP
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '/usr/share/php');
require 'Ice.php'; // Load the core Ice run time definitions.

SELinux Notes (for Red Hat Enterprise Linux users)

SELinux augments the traditional Unix permissions with a number of new features. In particular, SELinux can prevent the httpd daemon from opening network connections and reading files without the proper SELinux types.

If you suspect that your PHP application does not work due to SELinux restrictions, we recommend that you first try it with SELinux disabled. As root, run:

# setenforce 0

to disable SELinux until the next reboot of your computer.

If you want to run httpd with the Ice extension and SELinux enabled, you must do the following:

  1. Allow httpd to open network connections:

    # setsebool httpd_can_network_connect=1
    

    You can add the -P option to make this setting persistent across reboots.
     

  2. Make sure any .ice file used by your PHP scripts can be read by httpd. The enclosing directory also needs to be accessible. For example:

    # chcon -R -t httpd_sys_content_t /opt/MyApp/slice
    

For more information on SELinux in Red Hat Enterprise Linux, refer to this Red Hat document.

Using the sample programs on Linux

Sample programs for all programming languages are available in a separate GitHub repository. Simply clone this repository and use its 3.6 branch:

git clone -b 3.6 https://github.com/zeroc-ice/ice-demos.git
cd ice-demos

Starting IceGrid Admin on Linux

You can launch IceGrid Admin with the icegridgui command. IceGrid Admin is a Java program and requires JRE 7u6 or later.

Startup scripts for IceGrid and Glacier2 services

All distributions include the following service configuration files:

  • /etc/icegridregistry.conf
  • /etc/icegridnode.conf
  • /etc/glacier2router.conf

Distributions which use sysvinit or upstart contain the following sample scripts:

  • /etc/init.d/icegridregistry 
  • /etc/init.d/icegridnode 
  • /etc/init.d/glacier2router 

Distributions which use systemd contain the following services:

  • icegridregistry.service
  • icegridnode.service
  • glacier2router.service

The installation also creates a user account and group for running these services (account ice and group ice), and data directories for icegridregistry and icegridnode (/var/lib/ice/icegrid/registry and /var/lib/ice/icegrid/node1).

By default, all these services are off at all runlevels. You need to manually switch on one or more runlevels, for example:

#
# On a Red Hat Enterprise Linux 6 system, configure the icegridregistry
# to start at runlevel 3 and 5:
#
sudo chkconfig --level 35 icegridregistry on

#
# On a SuSE Linux Enterprise Server 11 system, configure the
# icegridregistry to start at runlevel 3 and 5:
#
sudo chkconfig icegridregistry 35
 
#
# On an Ubuntu system, configure the icegridregistry to start at the
# default run levels:
#
sudo update-rc.d icegridregistry defaults
 
#
# On systems using systemd, start icegridregistry with the multi-user target
#
sudo systemctl enable icegridregistry.service

Before doing so, please review the script itself and its associated configuration file.