DB2CI application compile and link options (Linux)
The compile and link options in this topic are recommended for building DB2CI applications with the GNU/Linux gcc compiler.
You can find the following options in the DB2DIR/samples/db2ci/bldapp batch file, where DB2DIR is the location where your Db2® copy is installed.
- Compile options:
- The C compiler.
- Contains one of the following:
-m31on Linux® for zSeries only, to build a 32-bit library;-m32on Linux for x86, x64 and POWER®, to build a 32-bit library;-m64on Linux for zSeries, POWER, x64, to build a 64-bit library; or- No value on Linux for IA64, to build a 64-bit library.
- Specify the location of the Db2 include files. For example: $HOME/sqllib/include
- Perform compile only; no link. Compile and link are separate steps.
gcc$EXTRA_C_FLAGS-I$DB2PATH/include-c
- Link options:
- Use the compiler as a front end for the linker.
- Contains one of the following:
-m31on Linux for zSeries only, to build a 32-bit library;-m32on Linux for x86, x64 and POWER, to build a 32-bit library;-m64on Linux for zSeries, POWER, x64, to build a 64-bit library; or- No value on Linux for IA64, to build a 64-bit library.
- Specify the executable.
- Include the program object file.
- Include the utility object file for error checking.
- For 32-bit it contains the value "-Wl,-rpath,$DB2PATH/lib32", and for 64-bit it contains the value "-Wl,-rpath,$DB2PATH/lib64".
- Specify the location of the Db2 static and shared libraries at link-time. For example, for 32-bit: $HOME/sqllib/lib32, and for 64-bit: $HOME/sqllib/lib64.
- Link with the DB2CI library.
gcc$EXTRA_C_FLAGS-o $1$1.outilci.o$EXTRA_LFLAG-L$DB2PATH/$LIB-ldb2ci