Compiling Custom Programs

After you write a custom program, you must compile it, using a C or C++ compiler. Refer to the following information to determine what minimum C++ compiler version to use for each platform:

Platform C++ Compiler
AIX

IBM® XL C/C++ for AIX, V11.1

Linux x86

g++ (GCC) 6.3.1

Linux S390 g++ (GCC) 4.4.7
Linux ppc64le g++ 4.8.5

Use the commands defined in the following table to compile a custom C++ program using the C++ API calls:

Platform C++ Compile Command
AIX
64-bit /usr/vacpp/bin/xlC -q64 -qinline -I../include -+ -o sdksample sdksample.C ../lib/ndmapi64.a -lbsd -ldl -lsrc -lpthreads
Linux x86
64-bit

g++ -I/usr/include/tirpc -I../include -O -DLINUX -o sdksample sdksample.C ../lib/ndmapi64.a -ldl -lstdc++ -ltirpc

Note: The libtirpc-devel package is required for compiling.
LinuxS390
64-bit

g++ -I/usr/include/tirpc -I../include -O -DLINUX -o sdksample sdksample.C ../lib/ndmapi64.a -ldl -lstdc++ -ltirpc

Note: The libtirpc-devel package is required for compiling.
Linux ppc64le
64-bit

g++ -I/usr/include/tirpc -I../include -O -DLINUX -o sdksample sdksample.C ../lib/ndmapi64.a -ldl -lstdc++ -ltirpc

Note: The libtirpc-devel package is required for compiling.

To build a C++ program using the C API calls, such as the apicheck.C sample program, replace the sdksample.C parameter with the name of the C++ program and rename the output file parameter, -o sdksample, to the name of the output file you want to create such as apicheck.

Use the commands defined in the following table to compile a C program:

Platform C Compile Command
AIX
64-bit /usr/vacpp/bin/xlc -q64 -I../include -+ -o apicheck apicheck.c ../lib/ndmapi64.a -lbsd -ldl -lsrc -lC -lpthreads
Linux x86
64-bit

gcc -I/usr/include/tirpc -I../include -O -DLINUX -o apicheck apicheck.c ../lib/ndmapi64.a -ldl -lstdc++ -ltirpc

Note: The libtirpc-devel package is required for compiling.
LinuxS390
64-bit

gcc -I/usr/include/tirpc -I../include -O -DLINUX -o apicheck apicheck.c ../lib/ndmapi64.a -ldl -lstdc++ -ltirpc

Note: The libtirpc-devel package is required for compiling.
Linux ppc64le
64-bit

gcc -I/usr/include/tirpc -I../include -O -DLINUX -o apicheck apicheck.c ../lib/ndmapi64.a -ldl -lstdc++ -ltirpc

Note: The libtirpc-devel package is required for compiling.