OpenModel and OpenAlias are available on either IRIX or AIX systems. Below are the requirements and information on each supported operating system.
Note that OpenModel and OpenAlias can only be built on machines running at least Irix 6.2with at least version 7.1 of the C++ compiler. Use the 'versions -b -n compiler_eoe' command to see which version of the compiler is installed. Both OpenModel and OpenAlias must use the C++ linker.
The standard OpenModel and OpenAlias libraries as well as Alias the interactive package are built using the o32 compilers. As a result, both OpenModel and OpenAlias code linking with these libraries must be built with the o32 compiler. On some SGI workstations, the compiler defaults to compiling code as n32. Specify the -32 compiler and linker flag to force the use of the o32 compiler.
To determine what type of plug-in or OpenModel application you are building use the file command.
# o32: summer-cal% file /usr/lib/libc.so /usr/lib/libc.so: ELF 32-bit MSB mips-2 dynamic lib MIPS - version 1 # n32: summer-cal% file /usr/lib32/libc.so /usr/lib32/libc.so: ELF N32 MSB mips-3 dynamic lib MIPS - version 1
An n32 version of the OpenModel libraries is also available. These libraries are located in:
You will need to set the LD_LIBRARYN32_PATH environment variable if you are using the n32 DSOs.
For Alias OpenModel also ensure that the library path for the linker (in LFLAGS) includes either this area:
-L$(ALIAS_LOCATION)/ODS/OpenModel/lib
or for the dynamic libraries, ensure that the library path includes this area:
In addition, the LFLAGS variable should contain the options:
-lalias_api -lapi_memory -lm -lsun
The Makefiles in OpenModel/examples and OpenAlias/examples demonstrate how all this is done, and it is recommended that you study them before creating new Makefiles.
As well, if developing with the dynamic libraries of Alias OpenModel ensure that LD_LIBRARY_PATH is set to reference the Alias library directory. For example,
setenv LD_LIBRARY_PATH $ALIAS_LOCATION/lib
If the n32 libraries are being used, then set the LD_LIBRARYN32_PATH environment variable and also use the -n32 compiler and link flags.
Plug-ins are compiled using the same compile flags as OpenModel applications.
A plug-in is linked using the `-shared -all' options of CC. For example, if the plug-in is composed of the object files obj1.o obj2.o obj3.o then the plug-in would be linked by the following command:
CC -32 -shared -all obj1.o obj2.o obj3.o -o output_name.plugin
To prevent the listing of unresolved OpenAlias symbols, you can also include the shared object $(ALIAS_LOCATION)/lib/libLiveData.so.
The linking line would become:
CC -32 -shared -all obj1.o obj2.o obj3.o -o output_name.plugin -L $(ALIAS_LOCATION)/ lib/libLiveData.so
Warning: do not use `ld' to link plug-ins otherwise global variables may not be correctly initialized and static constructors/destructors will not be executed.
C Set ++ V3 for AIX is required for developing plug-ins under AIX 4.1. The CSet++ utility makeC++SharedLibrary is used to produce the final plug-in binary. This utility is required for the proper handling of static constructors and destructors. Please read the "Working with Shared Libraries" chapter of the "CSet++ for AIX User's Guide" for further details.
Currently, OpenModel links libraries statically under AIX. The library path for the linker should be set to
-L$(ALIAS_LOCATION)/ODS/OpenModel/lib
In addition, the LFLAGS should contain the options:
-lalias_api -lapi_memory -lapi_image -lm -lodm -lcfg
The Makefiles in OpenModel/examples and OpenAlias/examples provide an example on how to create AIX OpenModel and OpenAlias Makefiles.
Plug-ins under AIX 4.1 require the makeC++SharedLib utility included with CSet++ Version 3. In addition, the exports list file of OpenAlias must be included in the options of makeC++SharedLib. The OpenAlias specific exports list file of Alias is called OpenAlias.exp and is distributed in the $ALIAS_LOCATION/ODS/OpenAlias/examples directory.
makeC++SharedLib -p 10 -I $ALIAS_LOCATION/ODS/OpenAlias/examples/OpenAlias.exp -n plugin_glue -o output_name.plugin obj1.o obj2.o ...
The -p option sets the priority level of the static constructor initialization and allows plug-ins with static classes to initialize properly when the plug-in is called. The entry point is currently set to a function (plugin_glue) located in the pluginGlue.o file as will be described next.
Shared libraries under AIX 4.1 have one entry point. Plug-ins require two standard entry points ( plugin_init and plugin_exit ) that are called from Alias. The file pluginGlue.o contains the single entry point of the shared library (or plug-in) and is used to return the plugin_init and plugin_exit entry points back to Alias.
Plug-ins under AIX require an exports list. This list is located in $ALIAS_LOCATION/ODS/OpenAlias/examples/OpenAlias.exp and is specified with the Import option to makeC++SharedLib. This file contains the API symbols that are exported from Alias for plug-ins to use and the name of the binary that exports the symbols. The name of the binary is set to .Alias. Plug-ins will fail to load if the Alias binary is renamed to something other than .Alias. A message will be written to the error log in this situation.
The Makefile in $ALIAS_LOCATION/ODS/OpenAlias/examples can be used as the basis for building other AIX 4.1 specific Makefiles.