Compiling ACE.a 5.4.4 for VxWorks and Linux (eg. Fedora Core 3, gcc 3.4) See also ACE-INSTALL and TAO-INSTALL files in $ACE_ROOT and $TAO_ROOT respectively. For CLARAty, $ACE_ROOT is something like: /afs/jpl.nasa.gov/group/claraty/pkgs/ACE/ACE_wrappers/build/ 1. Untar ACE. CLARAty also uses some TAO functionality so you will want the tarball of both ACE and TAO. You can download the latest ACE from http://www.cs.wustl.edu/%7eschmidt/ACE.html Or More directly: http://deuce.doc.wustl.edu/Download.html It's usually best to chose the lates "bug fix only release". It is usually numbered x.y.1 and is available for download at the bottom of the page. $ tar -zxvf ACE+TAO.tar.gz This creates the directory: ACE_wrappers/ BE PATIENT, it takes a LONG time. 2. Make target-specific build areas: NOTE: This procedure uses the traditional method of building ACE. ACE now supports autoconf, EXCEPT on VxWorks. We do not use it because it creates a different directory structure for the binary installation (standard unix /bin, /include etc) and would therefore differ for VxWorks vs Linux, which would require special handling in CLARAty SiteDefs). Building the traditional way puts all object/binaries in the same directory as the source code, which is what CLARAty expects. $ cd ACE_wrappers $ ./bin/create_ace_build ix86_vx5.5_gcc2.95 $ ./bin/create_ace_build ix86_linux_gcc3.4_glibc2.3 $ ./bin/create_ace_build sparc-solaris2.9-gcc3.4 BE PATIENT, it takes a LONG time. 3. Create the platform specific config.h and platform_macros.GNU files. NOTE: See the online ACE docs for details. config.h It's the central include file, located in the main directory 'ace': LINUX: $ cd ix86_linux_gcc3.4_glibc2.3/ace $ ln -s config-linux.h config.h SOLARIS (needed for host tools when cross-compiling): $ cd sparc-solaris2.9-gcc3.4/ace/config-sunos5.9.h $ ln -s config-sunos5.9.h config.h VXWORKS: $ cd ix86_vx5.5_gcc2.95/ace $ ln -s config-vxworks5.x.h config.h platform_macros.GNU We want to specify additonal options, to reduce the footprint of ACE/TAO libraries. So a simple symlink for platform_macros.GNU is not enough. $ cd ../include/makeinclude Create the file "platform_macros.GNU" in your favorite editor and put this in it: LINUX, SOLARIS & VXWORKS: --- CUT HERE --- # Do not generate debug information: debug = 0 # If you do not hunt for performance (especially on # development only boxes) optimizing for size is probably # better: OCFLAGS = -Os # Remove version strings from object files safes some more bytes: CPPFLAGS = -DACE_USE_RCSID=0 # TAO specific stuff # We want to reduce the number of compiled ace components. # This will compile everything that is needed, if we # compile ACE for usage by TAO. If no TAO is needed, we # probably can reduce the set of ACE components further: ACE_COMPONENTS = FOR_TAO # If we compile TAO, we probably also want to restrict the # build to the CORBA services we actually use: TAO_ORBSVCS = Naming Notify --- CUT HERE --- LINUX only: Include the platform specific macros file: --- CUT HERE --- include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU --- CUT HERE --- SOLARIS only: Include the platform specific macros file: --- CUT HERE --- include $(ACE_ROOT)/include/makeinclude/platform_sunos5_g++.GNU --- CUT HERE --- VXWORKS only: For VXWORKS, you additionally need to define some WIND_xxx symbols for the platform_macros.GNU file, and so a simple symlink is not enough. Also, a couple of TAO flags are needed to point to the host (Solaris) tools. --- CUT HERE --- WIND_HOST_TYPE=sun4-solaris2 WIND_BASE=/afs/jpl.nasa.gov/group/wind/t22_x86 CPU=PENTIUM TOOL=gnu TAO_IDL := $(ACE_ROOT_HOST)/bin/tao_idl TAO_IDLFLAGS := -g $(ACE_ROOT_HOST)/bin/gperf -I$(ACE_ROOT_HOST)/TAO include $(ACE_ROOT)/include/makeinclude/platform_vxworks5.5.x.GNU --- CUT HERE --- Set the path to WIND_BASE as appropriate. You could of course define these symbolos outside this file, but putting them here also documents exactly what ACE was built against. 4. Build each target. Set your ACE_ROOT environment variable to one of the build directories: $ setenv ACE_ROOT /afs/jpl.nasa.gov/group/claraty/pkgs/ACE/ACE_wrappers/build/ix86-linux-gcc3.4-glibc2.3 $ setenv ACE_ROOT /afs/jpl.nasa.gov/group/claraty/pkgs/ACE/ACE_wrappers/build/ix86-vx5.5-gcc2.95 $ setenv ACE_ROOT /afs/jpl.nasa.gov/group/claraty/pkgs/ACE/ACE_wrappers/build/sparc-solaris2.9-gcc3.4 ACE is HUGE. It comes with a large set of tests and examples, which take FOREVER to build. You may want to only build the core 'ace' and 'tests' stuff. $ cd $ACE_ROOT/ace $ gmake |& tee build.log $ cd $ACE_ROOT/tests $ gmake |& tee build.log The TAO IDL compiler optionally uses the ACE gperf tool: $ cd $ACE_ROOT/apps/gperf $ gmake |& tee build.log TAO is also HUGE and comes with a large set of tests and examples, so you probably only want to build the IDL compiler, the core (tao), and ORB services (orbsvcs). First, set TAO_ROOT: $ setenv TAO_ROOT $ACE_ROOT/TAO LINUX & SOLARIS: $ cd $TAO_ROOT/TAO_IDL $ gmake |& tee build.log $ cd $TAO_ROOT/tao $ gmake |& tee build.log $ cd $TAO_ROOT/orbsvcs/orbsvcs $ gmake |& tee build.log BE PATIENT, this takes a REALLY LONG time. VXWORKS: Some extra care is needed to build TAO for VxWorks. First, make sure that ACE and the TAO IDL compiler were built for the host (Solaris) machine (the IDL compiler doesn't need to run on VxWorks; instead, the makefiles run the IDL compiler to generate C++ code that is compiled for VxWorks; and the IDL compiler uses the ACE library). To point to the host installation: $ setenv ACE_ROOT_HOST /afs/jpl.nasa.gov/group/claraty/pkgs/ACE/ACE_wrappers/build/sparc-solaris2.9-gcc3.4 Next, the VxWorks bin directory needs some links to the host tools: $ cd $ACE_ROOT/bin $ ln -s $ACE_ROOT_HOST/bin/gperf gperf $ ln -s $ACE_ROOT_HOST/bin/tao_idl tao_idl And the TAO IDL compiler needs to find the host-compiled ACE libraries: $ setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:$ACE_ROOT_HOST/lib Modify the $ACE_ROOT/ace/config-g++-common.h file to support native exceptions in CLARAty code and not in ACE+TAO (see notes below). The following 3 lines should replace similar existing lines: --- CUT HERE --- #if defined (__EXCEPTIONS) && !defined (ACE_HAS_EXCEPTIONS) && !defined (ACE_HAS_NO_EXCEPTIONS) # define ACE_HAS_EXCEPTIONS #endif /* __EXCEPTIONS && ! ACE_HAS_EXCEPTIONS && ! ACE_HAS_NO_EXCEPTIONS */ --- CUT HERE --- Finally, run the appropriate VxWorks script (e.g. tr22_x86). Then the core and ORB services can be built: $ cd $TAO_ROOT/tao $ gmake |& tee build.log $ cd $TAO_ROOT/orbsvcs/orbsvcs $ gmake |& tee build.log BE PATIENT, this takes a REALLY LONG time. Also, the compiler may crash on some of the source files (internal compiler error). This seems to be an issue with optimization. So each time you get this crash, just run the same compile command line, but with the -O flag removed. Native exceptions in CLARAty code: $ACE_ROOT/ace/config-g++-common.h was modified to support native exceptions in CLARAty user code, when they are not used in ACE+TAO. Details: ACE was built with native exceptions for UNIX, and without for VxWorks. The version of VxWorks currently in use by CLARAty does not support native exceptions to the level at which they are used by TAO (I tried, but the code would crash at run time). The ACE config file config-g++-common.h assumed that the ACE+TAO libraries were built with native exceptions whenever the -fexeceptions flag was used to compile user code. However, this is not always true. So, a new flag ACE_HAS_NO_EXCEPTIONS was created and added to config-g++-common.h so that an ACE library without native exceptions can be used even when CLARAty code used native exceptions. 5. Try running some tests. If all went well, you will have ACE builds and the tests for each platform. VXWORKS: For VXWORKS, you can automate the testing somewhat. Set up a target server (eg. in "launch") and source the appropriate CLARAty script to set up WIND_BASE etc. This must be done from a Solaris host (eg. chesapeake or susquehanna) $ klog $ source /afs/jpl/group/claraty/pkgs/yam_lite/latest/config/sourceme/jpl/CLARAty $ fidolab (will set up for FIDO benchtop - do what makes sense here) $ setenv ACE_ROOT /home/guineau/CLARAty/ACE/ACE_wrappers/build/ix86_vx5.5_gcc2.95 $ cd $ACE_ROOT/tests You need to set up some environment variables to make the auto-generated VxWorks test perl script happy: $ setenv ACE_RUN_WINDSH `which windsh` $ setenv ACE_RUN_VX_TGTSVR fdbench2 # again, use the correct target name $ setenv ACE_RUN_VX_TGTSVR_ROOT $ACE_ROOT Run the ACE tests perl script to get a VxWorks script: $ ./run_test.pl -v -o run_test.vxworks Start windsh and source the script: $ windsh fdbench2 -> < run_test.vxworks > run_test.log The tests take awhile to run. You can see the output on the target's console and can monitor the test progress via the run_test.log file. When the tests complete, you can look through run_test.log for the results. You may want to trim the run_test.vxworks file (generated above) to get rid of tests you are not interested in. LINUX: $ setenv ACE_ROOT /home/guineau/CLARAty/ACE/ACE_wrappers/build/ix86_linux_gcc3.4_glibc2.3 $ cd $ACE_ROOT/tests You'll probably also need to set LD_LIBRARY_PATH: $ setenv LD_LIBRARY_PATH $ACE_ROOT/lib:$ACE_ROOT/ace:$LD_LIBRARY_PATH Note that for the lates betas, the libraries are no longer collected in $ACE_ROOT/ace but in $ACE_ROOT/lib. If you use an ACE version above 5.4.1, please correct your LD_LIBRARY_PATH. The just run the tests: $ ./run_test.pl You can get a summary of the results with: $ ./run_tests.check *.log log/* 6. Create links for recognized build directories VXWORKS: cd /home/guineau/CLARAty/ACE/ACE_wrappers/build/ix86_vx5.5_gcc2.95 ln ./ix86_vx5.5_gcc2.95 ./ix86_vx_gcc ln ./ix86_vx5.5_gcc2.95 ./ix86-vx5.5-gcc2.95 LINUX: cd /home/guineau/CLARAty/ACE/ACE_wrappers/build/ix86_linux_gcc3.4_glibc2.3 ln ./ix86_linux_gcc3.4_glibc2.3 ./ix86_linux_gcc ln ./ix86_linux_gcc3.4_glibc2.3 ./ix86-linux-gcc3.4-glibc2.3