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
includesubdirectory 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.soThe librarycmx.somust be linked in before the librarynls.so.the library
libupiccmxwhich 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.soalsothe library
libupicsocwhich 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.soandsocket.sothe library
libupicsocmtwhich 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.cin the upic-dir/sampledirectory.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).