IDA DEPLOYUDX command

The IDA DEPLOYUDX CLPPlus command builds a library and registers one UDX that uses that library.

This command:
  • Creates a project directory on the database server under user home and uploads the compressed file containing the UDX source files to the project directory.
  • Unpacks the compressed file into the project directory.
  • For a UDX written in C++, compiles all source files to create object files.
  • For a UDX written in C++, links the object files to create a library file.
  • Promotes the library file and other files that are used by the library to the release directory.
  • Registers one UDX that uses the library file.

You can specify the parameters that control the deployment action in the command string, in an IDA parameter file, or in both (see IDA parameter file).

Note: All UDX functions work only in fenced mode.

Invocation

You must run this command from the CLPPlus interface.

Authorization

None.

Required connection

CLPPlus must be connected to the database.

Command syntax

IDA DEPLOYUDX

Read syntax diagramSkip visual syntax diagram IDA DEPLOYUDX PARAMFILEparameter_file SOURCEcompressed_file PROJECTname_of_compressed_file PROJECTproject REPLACEPROMPT REPLACEYES REPLACENO PROMOTEfile_name PROMOTE",file_name"LANGCPPC++ parametersLANGLUALua parametersLANGPYTHONPython parametersLANGRR parameters
C++ parameters
Read syntax diagramSkip visual syntax diagram CLASSclass SIGNATURE signature RETURN data_type ENVIRONMENTvariables BINDIRbin BINDIRdir DETERMINISTICYES DETERMINISTICNO CALLEDONNULLINPUTNO[for a UDSF or UDTF] CALLEDONNULLINPUTYES[for a UDAF] CALLEDONNULLINPUTNO CALLEDONNULLINPUTYES ALLOWPARALLELYES[for a UDSF or UDAF] ALLOWPARALLELNO[for a UDTF] ALLOWPARALLELYES ALLOWPARALLELNO LIBRARY lib name_of_project LIBRARYlibrary LIBRARY library(,file)USELIBRARY project_nameUSELIBRARYproject_name:library.so UDXLIBRARY name_specified_for_LIBRARY_parameter.so UDXLIBRARYname INCLUDEDIRECTORIESdirectory INCLUDEDIRECTORIES",directory"
Python parameters
Read syntax diagramSkip visual syntax diagram SIGNATURE signature RETURN data_type ENVIRONMENTvariables DETERMINISTICYES DETERMINISTICNO CALLEDONNULLINPUTNO[for a UDSF or UDTF] CALLEDONNULLINPUTYES[for a UDAF] CALLEDONNULLINPUTNO CALLEDONNULLINPUTYES ALLOWPARALLELYES[for a UDSF or UDAF] ALLOWPARALLELNO[for a UDTF] ALLOWPARALLELYES ALLOWPARALLELNO
R parameters
Read syntax diagramSkip visual syntax diagram SIGNATURE signature RETURN data_type ENVIRONMENTvariables DETERMINISTICYES DETERMINISTICNO CALLEDONNULLINPUTNO[for a UDSF or UDTF] CALLEDONNULLINPUTYES[for a UDAF] CALLEDONNULLINPUTNO CALLEDONNULLINPUTYES ALLOWPARALLELYES[for a UDSF or UDAF] ALLOWPARALLELNO[for a UDTF] ALLOWPARALLELYES ALLOWPARALLELNO

Command parameters

PARAMFILE
The name of an IDA parameter file that determines the default values of any parameters that are not explicitly specified for this command (see IDA parameter file). Any mandatory parameters for which there is no default and that are not specified explicitly in the command string must be specified by means of an IDA parameter file.
SOURCE | SRC
The fully-qualified name of a compressed file that contains all the source files that are needed by the UDX that is to be deployed.
PROJECT | PROJ
The name of the project directory that is to be created for the specified set of source files. The name can contain only alphanumeric characters (A-Z, a-z, 0-9) and underscore characters (_). The default is the name, without the extension, of the file specified for the SOURCE parameter.
REPLACE
If a project with the specified name already exists, whether to:
YES
Delete the existing project and replace it with the new one.
NO
Cancel the command and take no action.
PROMPT
Prompt the user to specify whether to:
  • Continue with the command and delete and replace the existing project.
  • Cancel the command and take no action.
PROMOTE
A comma-separated list of files that, in addition to the generated library (and for UDXs written in C++, in addition to the files specified for the library parameter) are to be promoted to the release directory.
LANGUAGE | LANG
The language in which the UDX is written:
CPP
For C++.
LUA
For Lua.
PYTHON
For Python.
R
For R.
If this parameter is not specified, the command automatically determines the language based on the extensions of the files contained in the compressed input file. Specify this parameter only if the input file contains more than one type of UDX source file (for example, both .cpp and .nzl files).
Depending on the language of the UDX, parameters belonging to one of the following groups can or must be specified:
  • C++ parameters
  • Lua parameters
  • Python parameters
  • R parameters
UDXLIBRARY | UDXLIB
This parameter depends on the language in which the UDX is written:
C++
If the library file that is to be registered is different from the library file that was created by the link step, use this parameter to specify the full name, including the path from the project directory and the extension, of that file. The extension must be .so. The default is a file in the release directory with the name that was specified for the LIBRARY parameter or, if none was specified, the default value of that parameter, followed by .so, for example release/libudx77.so.
Lua
If the compressed file that contains the source files contains more than one file with the extension .nzl, use this parameter to specify which file to be used for the UDX. The extension must be .nzl.
Python
If the compressed file that contains the source files contains more than one file with the extension .py, use this parameter to specify which file to be used for the UDX. The extension must be .py.
R
If the compressed file that contains the source files contains more than one file with the extension .R, use this parameter to specify which file to be used for the UDX. The extension must be .R.
CLASS
The class (that is, the label of the entry point in the shared library) of the UDX.
SIGNATURE | SIG
The signature of the UDX. For example:
UDX Type Signature Description
UDSF udx42(VARCHAR,CHAR) A UDSF with the name udx42 that accepts two input arguments (one VARCHAR and one CHAR).
UDTF "sig=UDTFONEINT(integer)" A UDTF with the name UDTFONEINT that accepts one input argument (an integer).
UDAF "sandd(int,int) aggregate with (int,int)" A UDAF with the name sandd that accepts two input arguments (both integers).
RETURN
The data type of the data that is returned by the UDX:
  • For a UDSF or UDAF, this is a simple data type such as int or char.
  • For a UDTF, this is a string of the form "TABLE(<name> <data_type>)". For example, "TABLE(t1 integer)" indicates that the returned data is in a table with the name t1 that contains one column of integer data.
ENVIRONMENT | ENV
A string containing a comma-separated list of the environment variables that are to be used during UDX registration. For example:
ENV "'USD_TO_INR'='60','EUR_TO_INR'='80'"
DETERMINISTIC | DET
Whether the UDX is to be deterministic.
CALLEDONNULLINPUT | NULLCALL
Whether the UDX is to be called when one or more of the input values is NULL.
ALLOWPARALLEL | PARALLEL
Whether the UDX is to allow parallel processing. The value YES can be specified only for a UDSF or UDAF, not a UDTF.
LIBRARY | LIB
The name that is to be assigned to the generated library file, including the extension. The default is a name of the form lib<project>.so. For example, if the project name is udx77, the default name of the generated library will be libudx77.so.

If additional object files (.o files), static libraries (.a files), or shared libraries (.so files) are to be included in the link step and promoted to the release directory, these can be specified in a comma-separated list following the specified library name. The DEPLOYUDX operation will search for the files in the directories specified by the LIBRARYDIRECTORIES parameter, so the names are not to contain path information. The file names must include the file extension. For example: mylib.so(obj1.o,obj2.o,lib25.so,lib50.a).

USELIBRARY | USELIB
A comma-separated list of <project>[:<library>] entries which are UDSLs that the build library depends on. Passed to IDA REST API call. Available only for C++. The library part defaults to lib<project>.so. Any library referenced in the list results in a symbolic link to it in the release/DEPS folder.
INCLUDEDIRECTORIES | INCLUDEDIRS
A comma-separated list of subdirectories relative to the project directory that contain files to be included during compilation. For example:
INCLUDEDIRS "inc/sub2,myincludes"
BINARYDIRECTORY | BINDIR
The name of the subdirectory of the project directory in which the object files created during compilation are to be stored.

IDA parameter file

A IDA parameter file contains settings for one or more command parameters. You can use a parameter file to set values for mandatory parameters (so that they do not have to be specified in the command string) and to set or change default values for optional parameters.

Parameter syntax is the same regardless of whether a parameter is specified in a command string or parameter file. A parameter that is specified explicitly in a command string overrides the corresponding parameter setting in a parameter file. If a parameter file specifies a parameter that does not apply (for example, if it specifies the CLASS parameter for a UDX written in a language other than C++), the parameter is ignored.

The following example shows a parameter file that specifies values for all parameters:
LANG CPP
SRC udxin7.tar
PROJ proj7
SIG udx7(int,char,char)
RETURN int
PROMOTE "ab.xml,x77.txt"
ENV "'USD_TO_INR'='60','EUR_TO_INR'='80'"
DET YES  
NULLCALL YES
PARALLEL YES
REPLACE PROMPT
CLASS UDcf
LIB mylib.so(obj1.o,obj2.o,lib25.so,lib50.a)
LIBDIRS "libs/a22,temp"
UDXLIB udxseven
INCLUDEDIRS "inc/sub2,myincludes"
DEBUG YES
The following example shows a parameter file that specifies values for only a few parameters:
INCLUDEDIRS "inc/sub2,myincludes"

PARALLEL YES

Examples

The following command specifies all of its parameters by means of a parameter file with the name pf1.txt:
SQL> IDA DEPLOYUDX PARAMFILE pf1.txt
The following command overwrites some of the parameters specified in pf1.txt.
SQL> IDA DEPLOYUDX PARAMFILE pf1.txt SRC udxin4.tar UDXLIB x11
The following command does not specify a parameter file; all parameters are specified in the command string. Defaults are used for all unspecified parameters.
SQL> IDA DEPLOYUDX SRC C:\udxdev\udx1.tar SIG udx1(int,int) CLASS ABin RETURN char