English

How To: Compile ArcSDE 9.1 C API programs on UNIX

Summary

Instructions provided describe how to compile the ArcSDE 9.1 C API programs layer_test.c and util_lib.c into an executable called layer_test. An ANSI-compliant C compiler is needed for the specific platform to build ArcSDE C API programs.

layer_test.c
<a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31256' target='_blank'>layer_test.c</a>
util_lib.c
<a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31257' target='_blank'>util_lib.c</a>
util_lib.h
<a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31259' target='_blank'>util_lib.h</a>

Procedure

  1. Install the proper ArcSDE client. See the ArcSDE Installation Guide for more information. In this example the ArcSDE client is installed into the directory /esri3/users/test/sdehome.
  2. Set the environment variable SDEHOME to point to the directory where the ArcSDE client is installed. In this example, set SDEHOME to point to /esri3/users/test/sdehome.

    Code:
    setenv SDEHOME /esri3/users/test/sdehome

  3. Set the platform-specific library path variable to the $SDEHOME/lib directory.

    SUN, TRU4 & LINUX:

    Code:
    setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:$SDEHOME/lib


    AIX:

    Code:
    setenv LIBPATH $LIBPATH:$SDEHOME/lib


    HP-UX:

    Code:
    setenv SHLIB_PATH $SHLIB_PATH:$SDEHOME/lib


  4. Build the ArcSDE C API program using a standard ANSI-compliant C compiler. The build options are specific to each platform and the type of executable (32- or 64-bit) required. The following shell scripts list build options to compile an ArcSDE C API program layer_test.c into an executable called layer_test for each platform.

    Shell script for 32-bit executable on SunOS:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31264' target='_blank'>Sun_32_compile.sh</a>
    Shell script for 64-bit executable on SunOS:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31265' target='_blank'>Sun_64_compile.sh</a>
    Shell script for 32-bit executable on AIX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31266' target='_blank'>AIX_32_compile.sh</a>
    Shell script for 64-bit executable on AIX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31267' target='_blank'>AIX_64_compile.sh</a>
    Shell script for 32-bit executable on HP-UX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31268' target='_blank'>HPUX_32_compile.sh</a>
    Shell script for 64-bit executable on HP-UX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31269' target='_blank'>HPUX_64_compile.sh</a>
    Shell script for 32-bit executable on LINUX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31270' target='_blank'>[O] Linux_32_compile.sh</a>
    Shell script for 64-bit executable on Compaq Tru64:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31271' target='_blank'>tru64_compile.sh</a>

    Alternatively, the GNU make utility can be used and the attached makefile and options files:

    GNU makefile:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31272' target='_blank'>CAPI_makefile</a>
    Option file for 32-bit executable on SunOS:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31273' target='_blank'>SunOS_32.opt</a>
    Option file for 64-bit executable on SunOS:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31274' target='_blank'>SunOS_64.opt</a>
    Option file for 32-bit executable on AIX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31275' target='_blank'>AIX_32.opt</a>
    Option file for 64-bit executable on AIX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31276' target='_blank'>AIX_64.opt</a>
    Option file for 32-bit executable on HP-UX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31278' target='_blank'>HPUX_32.opt</a>
    Option file for 64-bit executable on HP-UX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31279' target='_blank'>HPUX_64.opt</a>
    Option file for 32-bit executable on LINUX:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31280' target='_blank'>[O] Linux.opt</a>
    Option file for 64-bit executable on Compaq Tru64:
    <a href='http://support.esri.com/en/knowledgebase/techarticles/detail/31281' target='_blank'>OSF1.opt</a>