When compiling and linking CPI-C applications on Unix and Linux systems, you must observe the following:
Every CPI-C program requires the following header file for compilation:
#include <upic.h>
The header file is located in the
include
subdirectory of the UPIC installation directory.A CPI-C program consists of a set of modules which must be linked as a program using the C compiler of your system. The following object modules are essential for linking:
main program of the user
user modules
For programs which use PCMX:
the system libraries
nsl.so
,dl.so
,socket.so
(not on every system) andcmx.so
The librarycmx.so
must be linked in before the librarynls.so
.the library
libupiccmx
which can be found in the upic-dir/sys/
directory.
For programs which do not use PCMX:
the system libraries
nsl.so and dl.so.
On a few systemssocket.so
alsothe library
libupicsoc
which can be found in the upic-dir/sys/
directory.
For programs which do not use PCMX and use multi-threading:
the system libraries
nsl.so
,dl.so
andsocket.so
the library
libupicsocmt
which can be found in the upic-dir/sys/
directory.
An example showing all necessary library and link options can be found in the makefile for the sample program
uptac.c
in the upic-dir/sample
directory.A CPI-C program is started just like any other program in Unix and Linux systems by entering the program name (note that the UTM application must be started beforehand).