This page provides important information for users of the Ice binary distribution for macOS.
On this page:
Ice for C++, Java, Objective-C, and PHP on macOS are provided through the Homebrew formulas.
This ice
formula includes the following components by default:
The php-ice
formula includes:
The ice
formula is available in two taps:
homebrew/core
, the default homebrew tapzeroc-ice/tap
, ZeroC's homebrew tapThe php-ice
and ice-builder-xcode
formulae are available in:
zeroc-ice/tap
, ZeroC's homebrew tapWhen a new version of Ice is released, |
Using Homebrew, you can install the distribution with this command:
brew install zeroc-ice/tap/ice [--with-java] [--without-xcode-sdk] |
The --with-java
option builds the Java components and the IceGrid Admin app. You can also install IceGrid GUI on its own by downloading IceGrid GUI.dmg.
The --without-xcode-sdk
option skips the Xcode SDKs.
If you want to install a binary bottle, as opposed to building everything from sources, do not specify any build option when installing |
You can install Ice for PHP with this command:
brew install zeroc-ice/tap/php-ice |
By default Ice for PHP is built with the php
formula (the latest PHP version).
After installing Ice, read the relevant language-specific sections below to learn how to configure your environment and start programming with Ice.
When compiling Ice for C++ programs, you must pass the -pthread
option. A typical compile command would look like this:
|
C++11
and C++98
in the tabs above correspond to the Ice C++ mapping you're using.
When linking a program you must link with at least the Ice library. A typical link command would look like this:
|
Additional libraries are necessary if you are using an Ice service such as IceGrid or Glacier2.
If you want to include Ice in your application bundle, you will need to copy the necessary Ice libraries to the Contents/Frameworks
subdirectory of your bundle and use @loader_path/../Frameworks
as the run path when linking the application.
Please refer to the dyld
man page on your macOS system to learn more about @loader_path
.
When compiling Ice for Objective-C programs, you must pass the -pthread
option. A typical compile command would look like this:
cc -c -pthread myprogram.m |
When linking a program you must link with libIceObjC
. A typical link command would look like this:
cc -o myprogram myprogram.o -lIceObjC -framework Foundation |
Additional libraries are necessary if you are using an Ice service such as IceGrid or Glacier2.
If you want to include Ice in your application bundle, you will need to copy the necessary Ice libraries to the Contents/Frameworks
subdirectory of your bundle and use @loader_path/../Frameworks
as the run path when linking the application.
Please refer to the dyld
man page on your macOS system to learn more about @loader_path
.
In order to use one of the Ice Xcode SDKs with your Xcode project, you need to:
/usr/local/opt/ice/sdk/$(PLATFORM_NAME).sdk
to your Additional SDKsC++11: -lIce++11 -liconv -lbz2
C++98: -lIce -liconv -lbz2
Objective-C: -ObjC -lIce -lIceObjC -lc++ -liconv -lbz2
iphoneos
and iphonesimulator
, link your application with CFNetwork.framework
and UIKit.framework
The following optional libraries are included in the Ice Xcode SDKs:
Name | Link your C++11 application with | Link your C++98 application with | Link your Objective-C | Additional dependencies |
---|---|---|---|---|
Glacier2 client library | -lGlacier2++11 | -lGlacier2 | -lGlacier2ObjC | |
IceDiscovery plug-in | -lIceDiscovery++11 | -lIceDiscovery | -lIceDiscovery | |
IceGrid client library | -lIceGrid++11 | -lIceGrid | -lIceGridObjC | |
IceIAP plug-in | -lIceIAP++11 | -lIceIAP | -lIceIAP -lIceIAPObjC | ExternalAccessory.framework |
IceLocatorDiscovery plug-in | -lIceLocatorDiscovery++11 | -lIceLocatorDiscovery | -lIceLocatorDiscovery | |
IceSSL plug-in | -lIceSSL++11 | -lIceSSL | -lIceSSL -lIceSSLObjC | Security.framework |
IceStorm client library | -lIceStorm++11 | -lIceStorm | -lIceStormObjC |
The Ice Xcode SDKs include only static libraries. |
We also recommend installing the Ice Builder for Xcode, which helps you compile Slice files to C++ and Objective-C within Xcode . The builder is not included in the ice
formula and must be installed separately with:
brew install zeroc-ice/tap/ice-builder-xcode |
The Ice extension for PHP is loaded automatically when the interpreter loads the contents of the file /usr/local/etc/php/{{version}}/php.d/ext-ice.ini
(generated on install). This file contains the following:
[ice] extension="/usr/local/opt/php{{version}}-ice/ice.so" include_path="/usr/local/opt/php{{version}}-ice" |
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.
Sample programs for all programming languages are available in a separate GitHub repository. Simply clone this repository:
git clone -b 3.7 https://github.com/zeroc-ice/ice-demos.git cd ice-demos |
You can launch IceGrid GUI with the IceGridGUI
application installed in your /Applications
directory. IceGrid GUI is a Java 8-based application.