rtlink


Name

rtlink — link a user-defined process with the SmartSockets rtipc, rtipcl, and rtutil libraries.

Synopsis

On UNIX:
rtlink [ -echo ] [ -help ] [ -64bit ] [ -verbose ] [ -static_link ] 
       [ -check ] [ -optimized ] [ -Olevel ] [ -cxx | -cpp ]  
       [ compiler_options ] files 
On OpenVMS:
rtlink  [ -echo ] [ -help ] [ -verbose ] [ -cxx | -cpp ]  
        [ link_options ] files 

Arguments

-echo — show what the compile and link look like but do not actually do it

-help — print a brief synopsis of the valid command-line arguments and exit

-64bit — link with 64 bit client libraries and compile with 64 bit compiler flags on supported platforms

-verbose — show the compile and link as they are being performed

-static_link — link with SmartSockets static archive libraries instead of shared libraries

-check — link with SmartSockets debug libraries

-optimized — Link with SmartSockets optimized libraries and compile with compiler optimized flags

-Olevel — compile using optimization; link with SmartSockets optimized libraries

-cxx | -cpp — also link with one of the SmartSockets C++ class libraries, either -cxx for the cxxipc library or -cpp for the sscpp library on supported platforms

compiler_options — any valid compiler option

files — list of source, object, executable, and library files

link_options — any valid options to the OpenVMS linker

Return Values

On UNIX, rtlink returns 0 if successful, and a non-zero value otherwise. On OpenVMS, rtlink returns an odd value (usually, but not always 1) if successful, and an even value otherwise.

Description

The rtlink script builds an executable image by linking source and object files with the SmartSockets rtipc, rtipcl, and rtutil libraries. On UNIX platforms, rtlink compiles any source files and links the resulting object files with any specified object files. When compiling on UNIX, rtlink uses the compiler specified in the CC environment variable or the cc command if the environment variable CC is not set. On OpenVMS platforms, rtlink performs a link only.

When supported, use of the shared libraries is the default. To disable the use of shared libraries on UNIX specify the -static_link option. To disable the use of shared libraries on OpenVMS, define the RTSHARE logical to anything but YES (note upper case). Use of shared libraries usually results in faster link times and smaller executable image sizes, but adds additional run-time dependencies and may decrease performance if only a few SmartSockets processes are running on a node.

Debug libraries are supplied on all UNIX platforms. These are SmartSockets libraries that have increased internal error checking. In many cases, the use of the debug libraries can provide increased diagnostic output helpful for troubleshooting problems. To link with these libraries, specify the -check argument.

Specifying the -cxx option adds the rtcxxipc SmartSockets C++ class library to the list of libraries. Specifying the -cpp option adds the rtsscpp SmartSockets C++ class library to the list of libraries. When compiling on UNIX, rtlink -cxx | -cpp uses the compiler specified in the CC environment variable, or the vendor’s C++ compiler if the environment variable CC is not set. For example, on Solaris 2.8 rtlink executes CC; however, on AIX rtlink executes xlC_r.

Caution

On OpenVMS, rtlink only performs a link; there is no compilation done.

If the -cxx, -cpp, -echo, -help, -static_link, or -verbose arguments are not the first arguments on the command line, an error is generated.

If the -O argument is specified, the SmartSockets optimized libraries must be installed.

See Also

None

Examples

UNIX examples:

/* This compiles the C program "myprog.c" and produces the custom executable "a.out" */ 
$ rtlink myprog.c 
$ echo $? 
0 
 
/* This produces the custom executable "myprog.x" */ 
$ rtlink myprog.c -o myprog.x 
$ echo $? 
0 
 
/* A bad file name is passed to rtlink */ 
$ rtlink foo.c 
cpp: foo.c: No such file or directory 
$ echo $? 
2 
 
/* This shows the result of a bad command-line argument */ 
$ rtlink -junk myprog.c 
cc: Warning: Option -junk passed to ld 
ld: -j: bad flag 
$ echo $? 
4 
 
/* This compiles myprog.c and myfunc.c with the default flag set and creates the custom executable 
myprog.x */ 
$ rtlink -check myprog.c myfunc.c -o myprog.x 
myprog.c: 
myfunc.c: 
Linking: 
$ echo $? 
0 

OpenVMS examples:

/* On OpenVMS the compilation needs to be performed as a separate step */ 
$ cc myprog 
$ rtlink myprog 
$ show sym $status 
$STATUS == "%X10000001" 
 
/* Arguments must be separated by commas; white spaces do not work */ 
$ cc myfunc.c 
$ rtlink myprog myfunc 
%DCL-W-MAXPARM, too many parameters - reenter command with fewer 
parameters \MYFUNC\ 
$ rtlink myprog, myfunc 
 
/* If rtshare defined to "no", it does not use the shared libraries */ 
$ define rtshare "no" 
%DCL-I-SUPERSEDE, previous value of RTSHARE has been superseded 
$ rtlink myprog 
/* This example shows how command-line arguments can be passed to the linker */ 
$ rtlink myprog /exe=ss_app.exe 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com