A long time ago, I mentioned that ACE and most of TAO build and work
under OS X. Finding myself rewriting and rebuilding some WASP ADP
software, and wanting to test it under OS X, I thought I'd write
down the way I build it.
Requirements
System
Originally, this guide was written with "Developer Tools 2002" and OS X 10.2 (Jaguar).
Currently, I'm running the latest developer tools (gcc 4.0.1) and OS X 10.4.9 (Tiger).
So, from this, any reasonably recent version of OS X should work, but I
highly
recommend getting whatever the latest version of the Developer Tools installed.
Yes, this means upgrading whatever you already have...
dlcompat
You'll need the
dlcompat library
if you're on Mac OS X 10.2.
Darwin Ports
sudo port install dlcompat
Fink
fink install dlcompat
Manual
Start with the project website, and go from there.
You should probably build it into a
/usr/local tree
unless you have something better in mind.
http://www.opendarwin.org/projects/dlcompat/
Obtaining and Unpacking
ACE and TAO releases have related version numbers, as they're released together.
TAO 1.x.y is released with ACE 5.x.y;
x and
y must match.
If you only need ACE, then just download ACE releases.
If you want TAO, download the bundled ACE and TAO releases;
don't try to download separate distributions of ACE and TAO.
Use the bundled releases instead. These typically have
names like
ACE+TAO-x.y.z with various archive suffixes.
You'll need version 5.5.2 or later. 5.5.1 and its "bugfix only"
releases
sort of work, but I don't recommend them.
Present, I've done the builds with 5.5.2 and 5.5.6; they work
as well as they can be expected (given the documented
incompatibilities between ACE and Apple's gcc hacks).
Although you
should be able to find releases on the main
ACE and TAO web pages, I've found that's not always the case.
When that happens, look for the "download previous versions" link
on those pages, and you'll be able to download newer versions, too!
(weird)
I've successfully downloaded releases straight from
http://download.dre.vanderbilt.edu/previous_versions/
Create the directory tree where it will live.
The tarfile will unpack under a top level
ACE_wrappers directory.
Once built, you'll need about 4.5 GB for ACE and TAO,
or just a couple hundred MB for ACE alone.
sudo mkdir /usr/local/ACE_wrappers
sudo chown YourLoginHere /usr/local/ACE_wrappers
Then, unpack the distribution; it ought to go something like this.
If you are only downloading and working with ACE, the filename
below won't have the
+TAO portion in it.
cd /usr/local
tar xjf .../ACE+TAO-x-y-z.tar.bz2
Configuring
I don't trust their autoconfig stuff yet.
For that matter, I don't trust autoconfig.
So, we'll go with the traditional configuration of ACE.
Don't worry, it's all spelled out in
http://www.cs.wustl.edu/~schmidt/ACE_wrappers/ACE-INSTALL.html
Set
ACE_ROOT in your environment to the absolute path to
the
ACE_wrappers directory you unpacked above (or, whatever
you might have renamed it to).
Set
DYLD_LIBRARY_PATH in your environment to the
lib and
bin
directories under
ACE_ROOT, separated with a colon. That is,
set that variable to
$ACE_ROOT/lib:$ACE_ROOT/bin
You should probably put these into your
.profile or
.cshrc
or what-have-you file.
config.h
In
$ACE_ROOT/ace you'll create a new file named
config.h
with a text editor.
If you're running Tiger (any of the Mac OS X 10.4 releases),
the file should contain
#include "ace/config-macosx-tiger.h"
Otherwise, if you're running Panther (any of the Mac OS X 10.3
releases), the file should contain
#include "ace/config-macosx-panther.h"
Otherwise, if you're running Jaguar (any of the Mac OS X 10.2
releases), the file should contain
#include "ace/config-macosx.h"
Otherwise, stop here, because you didn't read the requirements at
the beginning of this topic.
platform_macros.GNU
In
$ACE_ROOT/include/makeinclude you'll create a new file named
platform_macros.GNU with a text editor.
If you're running Tiger (any of the Mac OS X 10.4 releases),
the file should contain
include $(ACE_ROOT)/include/makeinclude/platform_macosx_tiger.GNU
Otherwise, if you're running Panther (any of the Mac OS X 10.3
releases), the file should contain
include $(ACE_ROOT)/include/makeinclude/platform_macosx_panther.GNU
Otherwise, if you're running Jaguar (any of the Mac OS X 10.2
releases), the file should contain
include $(ACE_ROOT)/include/makeinclude/platform_macosx.GNU
Optionally,
if you want to generate optimized builds of ACE and your own projects,
and don't want to remember to type
optimize=1 on the command line to
make every time, you can change the default behavior here as well.
The default, mind you, is to build with extra debugging information
present.
If you want to make this change, place
optimize=1 into the
file
above the include line. That is to say, set the optimize variable
before including the platform file for your system.
Building ACE
Rather than building everything, I find it easier to build ACE separately
from its tests.
After you've done the configuration, just do this to get a build of ACE
in place and ready to be used.
When I do this, I get
no errors, and the
only warnings I get
are that various reactors (QtReactor, FlReactor, XtReactor,
etc.)
aren't being built.
If you get any other warnings, or any errors,
be very suspect of your build.
cd $ACE_ROOT/ace
make
Testing ACE
If the build went well, you should build the various tests to make sure
that everything is working the way the ACE people think it should be working.
The last thing you want to do is debug and chase bugs in your code that are
really artifacts of a bad ACE build!
This will take a while; be patient.
cd $ACE_ROOT/tests
make
Then, run all the tests.
./run_test.pl
I get glitches from various tests; usually, as long as there aren't
too many failures, and they aren't too spectacular, I don't worry
about them. Yes, I know, you can punch me now.
Applications
Right now, the only app that really needs to be built within the
ACE framework is
gperf.
Yes, you might be able to use the
gperf that's distributed with OS X; sure.
But other ACE toolkits, like TAO, are tested with and pretty much expect
the version of gperf that ACE is shipped with, so... just build it, okay?
The build will automatically run its tests as well, so a successful
make here is all you need.
cd $ACE_ROOT/apps/gperf
make
This should build and test cleanly; if you get any errors,
stop and investigate.
Building TAO
With ACE built, this is easy. You could build particular pieces
of TAO, but it's easier to just "build everything" at the expense
of space and time. It will take approximately 3-4 hours to build
under PPC machines.
First, ensure that you've got
TAO_ROOT set in your environment.
It's value should be the TAO directory underneath your $ACE_ROOT
directory (use
$ACE_ROOT/TAO).
Then, simply enter the TAO directory and run
make.
cd $TAO_ROOT
make
This will take a long time to build. When it's done, you can start
looking into various tests. Parts of TAO run well under OS X;
other parts have trouble. This is not a production environment yet,
so "caveat scriptor".