op_mkema

A utility that compiles and links an application program that invokes functions from the External Model Access (EMA) library.

Description

EMA is a library of procedures, supplied with the OPNET release, which are useful for creating or querying models from an external program (EMA is described in detail later in this manual). EMA-based applications are programs which make calls to the EMA library in order to access models. For proper construction of such applications, the following are required: (1) the application C code must be compiled with access to EMA-related header files (that is, opnet.h, ema.h, opnet_emadefs.h, and opnet_constants.h, contained in <reldir>/sys/include); (2) the compiled form of the application must be linked with the EMA library (which is named <reldir>/sys/<arch>/lib/libm3ema.so). The op_mkema utility is provided to conveniently prepare EMA applications so that they meet these requirements.

The op_mkema utility is passed the name of an EMA application without the file type suffix, and it performs the following tasks:

  • adds the .em.c file type suffix to the name and locates the file in the model directories
  • compiles the application’s C file into an object code file, with the file type suffix .em.o
  • links the generated object code file with the EMA library, thereby producing a complete program executable with the file type suffix .em.x

This process of compilation and linking is presented with greater detail in “External Model Access” on page 1.

op_mkema only compiles one C code file of an application, but additional object code files or libraries can be linked into the application executable by referencing them in the bind_libs preference. op_mkema can be conveniently used in a makefile context.

Note: To use External Model Access in Windows, you must ensure that <reldir>/sys/pc_intel_win32/bin is the first directory listed in your PATH environment.

Preferences

This program supports the following preference sets:

This program also supports the following additional preferences.

m

Specifies the base name of the Ema application to be compiled and linked. The file path or file type suffix should not be included in the value of this preference. The specified Ema-based application source code file must be located in the model directories.

This preference is required and can be entered only from the command line.

Type Default Value
string none

num_err

Specifies the maximum number of error and/or warning messages to display on standard output. op_mkema enters any error or warning messages in the log files cc_err (compilation messages) and bind_err (linking messages), which are located in your op_admin/tmp directory. This preference provides a mechanism for viewing any messages generated by the current operation.

This preference can be entered only from the command line.

Type Default Value
integer 0

Example Usage

% op_mkema -m ring_build

--- op_mkema issued the following command: ---

/bin/sh -c "bind_gcc OP bind
	IF /riverbed/18.6/models/std/ema_samp/ring_build.i1.em.o
	OF /riverbed/18.6/models/std/ema_samp/ring_build.i1.em.x FL::
	LD /riverbed/18.6/sys/pc_intel_linux/lib LB -lema -lsup -lvos
	-lmdutl -lmdtab -lmdhdl -lobj -lorb
	-lprg :: >/user/op_admin/tmp/bind_err 2>&1"

---------------------------------------------------------

Ema executable program (ring_build.i1.em.x) produced.

---------------------------------------------------------

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com