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

Sun Solaris

Sun C++ 5.12

HP-Itanium

aCC: HP ANSI C++ B3910B A.06.07

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
Sun
64-bit /opt/SUNWspro/bin/CC -m64 -DBSD_COMP -I../include -o sdksample sdksample.C ../lib/ndmapi64.a

-L/usr/ucblib/sparcv9 -L/usr/lib/sparcv9

-lsocket -lrpcsoc -lnsl -lelf -ldl

-R/usr/ucblib/sparcv9

HP-Itanium
64-bit /opt/aCC/bin/aCC +DD64 -I../include -o sdksample sdksample.C ../lib/ndmapi64.a -L/usr/lib/hpux64 -lrpcsvc -lnsl -ldld -Wl,+s -lunwind
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
Sun
64-bit /opt/SUNWspro/bin/cc -m64 -DBSD_COMP -I../include -o apicheck apicheck.c ../lib/ndmapi64.a

-L/usr/ucblib/sparcv9 -L/usr/lib/sparcv9

-lsocket -lCstd -lCrun -lrpcsoc -lnsl -lelf -ldl

-lCrun -R/usr/ucblib/sparcv9

HP-Itanium
64-bit /opt/ansic/bin/cc +DD64 -I../include -o apicheck apicheck.c ../lib/ndmapi64.a -L/usr/lib/hpux64 -lrpcsvc -lnsl -ldld -Wl,+s -lcl -lstd_v2 -lCsup -lunwind
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.