op_mkso
A utility that builds shared object libraries from object files.
Description
op_mkso is used to build:
- Shared object libraries for use with internal execution ETS scripts
- Simulation repositories, which allow you to run simulations without a compiler
- Design actions
- Network visualization libraries
- Antenna pattern libraries (for the optional Wireless functionality)
- Propagation models (for the optional Terrain Modeling Module functionality)
The inputs for an op_mkso build can be any object file, but are usually object files that have been created with the op_mko utility.
The “kernel_type”, “m32”, “m64”, and “mt” preferences specify which simulation kernel to build for. For example, for shared objects that can use either the development or optimized simulation kernel (such as repositories and TMM propagation models), use “kernel_type” to specify which type of shared object to build.
For variables and functions in one library to be visible in other libraries, they must be declared with DLLEXPORT, as shown in the following examples:
DLLEXPORT int x;
DLLEXPORT void eth_mac_gen();
Under Windows, for an object library to use a variable that has been declared in another library, the reference must be declared with IMPORT_GLOBAL:
extern IMPORT_GLOBAL int x;
Declarations using IMPORT_GLOBAL will have no unusual effects under Linux.
Preferences
This program supports the following preference sets:
- “Standard Preferences”
- “Diagnostics” preferences
- “Development” preferences
This program also supports the following additional preferences.
all
Specifies that op_mkso should build all files of the specified type. This preference applies only for design actions (type = da).
| Type | Default Value |
|---|---|
| boolean | FALSE |
c
Forces recompilation of the listed model files. Models to be recompiled can be in either binary (.m) or XML (.xml) form.
| Type | Default Value |
|---|---|
| boolean | FALSE |
c_exclude_standard_models
Specifies that standard models should be excluded from a forced model recompilation. When both this and the c preference are TRUE, all model files within the Modeler installation directory tree (<install_dir>) will be excluded from the forced recompile.
| Type | Default Value |
|---|---|
| boolean | FALSE |
ets_files
List of ETS object files. “ALL” is interpreted as all files of this type.
| Type | Default Value |
|---|---|
| string list | <empty> |
ex_files
List of external object files. “ALL” is interpreted as all files of this type.
| Type | Default Value |
|---|---|
| string list | <empty> |
explicit_exports
When TRUE causes all functions and variables in the current library to be exported. This may cause larger file sizes and degrade simulation performance.
| Type | Default Value |
|---|---|
| boolean | FALSE |
export_funcs
List of functions being exported by the library. This preference can be used on Windows machines only.
| Type | Default Value |
|---|---|
| string list | <empty> |
f
Required list of object files that will be bound together into a library. File names with full extensions are required.
| Type | Default Value |
|---|---|
| string list | <empty> |
gui
Specifies whether op_mkso should generate a network visualization mapping library for execution in the OPNET GUI (when TRUE) or during discrete event simulation (when FALSE).
Note: This preference, when TRUE, causes op_mkso to ignore the kernel_type preference and generate a library that is linked with the necessary libraries for use in the GUI. The simulation kernel is not linked against; thus, you cannot use Kernel Procedures in code that will create a “gui” library.
| Type | Default Value |
|---|---|
| boolean | FALSE |
m
Output library file name, with extensions. The extensions are not required for repositories (type = repos).
| Type | Default Value |
|---|---|
| string list | ” “ |
num_err
Specifies how many lines of error and warning messages to display.
| Type | Default Value |
|---|---|
| integer | 10 |
pff_files
List of packet field conversion files. “ALL” is interpreted as all files of this type.
| Type | Default Value |
|---|---|
| string list | <empty> |
pfp_files
List of packet conversion files. “ALL” is interpreted as all files of this type.
| Type | Default Value |
|---|---|
| string list | <empty> |
pr_files
List of process models. “ALL” is interpreted as all files of this type.
| Type | Default Value |
|---|---|
| string list | <empty> |
ps_files
List of pipeline models. “ALL” is interpreted as all files of this type.
| Type | Default Value |
|---|---|
| string list | <empty> |
raw_err
Specifies how compiler output should be handled. When FALSE, compiler output is parsed and displayed in tabular form. When TRUE, the raw compiler output is displayed.
This preference can be entered only from the command line.
| Type | Default Value |
|---|---|
| boolean | FALSE |
type
Model type.
Table 22: Model Types Supported by op_mkso
| Type | Used to Create |
|---|---|
| ets | ETS programs |
| repos | simulation repositories |
| da | design actions |
| nvism | network visualization mapping library |
| antn | antenna pattern libraries (Wireless functionality required) |
| tmm | propagation models (Terrain Modeling Module functionality required) |
| terrain | terrain models (Terrain Modeling Module functionality required) |
| Type | Default Value |
|---|---|
| string | “ets” |
verbose_exports
During compilation prints a list of all functions and variables being exported. This preference can be used on Windows machines only.
| Type | Default Value |
|---|---|
| boolean | FALSE |
wdomain_files
List of wireless domain models. “ALL” is interpreted as all files of this type. (This preference requires the Wireless functionality.)
| Type | Default Value |
|---|---|
| string list | <empty> |
Example Usage
% op_mkso -type ets -f test_event.ex.o test_dialog.ex.o test_interface.ex.o
-m example_library.so
-----------------------------------------------------
op_mkso: Shared library (example_library.so) produced
-----------------------------------------------------
%