OGDI Build Instructions

Requirements

Some basic build instructions are at: http://ogdi.sourceforge.net/build.html

   1 module load icc # Load the Intel Compilers
   2 module load expat
   3 module load proj
   4 
   5 wget http://sourceforge.net/projects/ogdi/files/ogdi/3.1.6/ogdi-3.1.6.tar.gz/download
   6 tar -xzvf ogdi-3.1.6.tar.gz
   7 cd ogdi-3.1.6

Patches

Modify config/unix.mak by replacing the CC, LD and SHLIB_LD with icc. Apply the patches from the annex section of this page.

Build

   1 export TOPDIR=`pwd`
   2 autoconf
   3 CFLAGS='-xSSE4.2 -fPIC' ./configure --prefix=/u/software/intel/ogdi/ogdi-3.1.6
   4 make

Anexes

Ogdi format

for gdal integration:

   1 --- ogdi-3.1.6/contrib/gdal/gdalbridge.c.orig   2001-05-04 05:13:35.000000000 +0200
   2 +++ ogdi-3.1.6/contrib/gdal/gdalbridge.c        2012-09-29 17:39:38.079579102 +0200
   3 @@ -124,7 +124,7 @@
   4  
   5          if( pfnTest == NULL )
   6          {
   7 -            sprintf( szPath, papszSOFilenames[iSOFile] );
   8 +            strcpy( szPath, papszSOFilenames[iSOFile] );
   9              pfnTest = GBGetSymbol( szPath, "GDALOpen" );
  10          }
  11      }

for pic support:

   1 --- ogdi-3.1.6/ogdi/c-api/makefile.orig 2007-02-12 21:20:04.000000000 +0100
   2 +++ ogdi-3.1.6/ogdi/c-api/makefile      2007-02-20 01:10:44.766427128 +0100
   3 @@ -28,7 +28,7 @@
   4                 $(GRASS_INCLUDE) $(ZLIB_INCLUDE) $(PROJ_INCLUDE) \
   5                 $(EXPAT_INCLUDE)
   6  
   7 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) -DMODULES_PATH="\"$(INST_LIB)/ogdi/\""
   8 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS) -DMODULES_PATH="\"$(INST_LIB)/ogdi/\""
   9  
  10  LINK_LIBS= $(RPC_LINKLIB) $(ZLIB_LINKLIB) $(EXPAT_LINKLIB) $(WIN_LINKLIB) \
  11                 $(PROJ_STATICLIB) $(MATH_LINKLIB)
  12 --- ogdi-3.1.2/ogdi/datum_driver/canada/makefile.orig   2001-02-19 04:12:21.000000000 +0000
  13 +++ ogdi-3.1.2/ogdi/datum_driver/canada/makefile        2004-01-23 15:54:07.000000000 +0000
  14 @@ -17,7 +17,7 @@
  15  SOURCES = nadconv.c dtcanada.c
  16  
  17  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) $(PROJ_INCLUDE)
  18 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
  19 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
  20  
  21  LINK_LIBS= 
  22  
  23 --- ogdi-3.1.2/ogdi/datum_driver/usa/makefile.orig      2001-02-19 04:12:21.000000000 +0000
  24 +++ ogdi-3.1.2/ogdi/datum_driver/usa/makefile   2004-01-23 15:57:44.000000000 +0000
  25 @@ -17,7 +17,7 @@
  26  SOURCES = dtusa.c
  27  
  28  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) $(PROJ_INCLUDE)
  29 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
  30 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
  31  
  32  LINK_LIBS= $(PROJ_STATICLIB)
  33  
  34 --- ogdi-3.1.2/ogdi/driver/adrg/makefile.orig   2001-06-22 16:37:50.000000000 +0000
  35 +++ ogdi-3.1.2/ogdi/driver/adrg/makefile        2004-01-23 16:00:08.000000000 +0000
  36 @@ -18,7 +18,7 @@
  37  
  38  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) $(PROJ_INCLUDE)
  39  
  40 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
  41 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
  42  
  43  LINK_LIBS= $(OGDI_LINKLIB) $(GLUTIL_STATICLIB) 
  44  
  45 --- ogdi-3.1.2/ogdi/driver/dted/makefile.orig   2001-02-19 04:12:21.000000000 +0000
  46 +++ ogdi-3.1.2/ogdi/driver/dted/makefile        2004-01-23 16:04:23.000000000 +0000
  47 @@ -17,7 +17,7 @@
  48  SOURCES = dted.c utils.c object.c
  49  
  50  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) $(PROJ_INCLUDE)
  51 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
  52 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
  53  
  54  LINK_LIBS= $(OGDI_LINKLIB)  $(GLUTIL_STATICLIB) 
  55  
  56 --- ogdi-3.1.2/ogdi/driver/rpf/makefile.orig    2001-02-19 04:12:21.000000000 +0000
  57 +++ ogdi-3.1.2/ogdi/driver/rpf/makefile 2004-01-23 16:07:10.000000000 +0000
  58 @@ -19,7 +19,7 @@
  59  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) \
  60            $(GRASS_INCLUDE) $(PROJ_INCLUDE)
  61  
  62 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
  63 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
  64  
  65  LINK_LIBS= $(OGDI_LINKLIB) $(VPF_STATICLIB) $(GLUTIL_STATICLIB) $(WIN_LINKLIB) $(MATH_LINKLIB)
  66  
  67 --- ogdi-3.1.2/ogdi/driver/vrf/makefile.orig    2001-06-20 21:49:31.000000000 +0000
  68 +++ ogdi-3.1.2/ogdi/driver/vrf/makefile 2004-01-23 16:09:30.000000000 +0000
  69 @@ -17,7 +17,7 @@
  70  SOURCES = vrf.c utils.c feature.c object.c open.c swq.c vrfswq.c
  71  
  72  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) $(VPF_INCLUDE) $(PROJ_INCLUDE) $(GLUTIL_INCLUDE)
  73 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
  74 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
  75  
  76  LINK_LIBS= $(OGDI_LINKLIB) $(WIN_LINKLIB) $(VPF_STATICLIB) $(MATH_LINKLIB)
  77  
  78 --- ogdi-3.1.2/vpflib/makefile.orig     2001-02-20 04:25:20.000000000 +0000
  79 +++ ogdi-3.1.2/vpflib/makefile  2004-01-23 16:14:12.000000000 +0000
  80 @@ -30,7 +30,8 @@
  81  
  82  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(VPF_INCLUDE)
  83  
  84 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(UNIX_DEFINE) \
  85 +# static lib, but linked into shared module - needs PIC
  86 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(UNIX_DEFINE) $(SHLIB_CFLAGS) \
  87         -DSYS_BIG_ENDIAN=$(BIG_ENDIAN)
  88  
  89  include $(TOPDIR)/config/common.mak
  90 --- ogdi-3.1.2/ogdi/driver/skeleton/makefile.orig       2001-02-19 04:12:21.000000000 +0000
  91 +++ ogdi-3.1.2/ogdi/driver/skeleton/makefile    2004-01-23 16:16:58.000000000 +0000
  92 @@ -18,7 +18,7 @@
  93  
  94  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) $(GLUTIL_INCLUDE) $(PROJ_INCLUDE)
  95  
  96 -CFLAGS         = $(INCLUDES) $(MACHINE) $(COMMON_CFLAGS)
  97 +CFLAGS         = $(INCLUDES) $(MACHINE) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
  98  
  99  LINK_LIBS= $(OGDI_LINKLIB) $(GLUTIL_STATICLIB)
 100  
 101 --- ogdi-3.1.2/ogdi/tcl_interface/makefile.orig 2001-02-19 04:12:21.000000000 +0000
 102 +++ ogdi-3.1.2/ogdi/tcl_interface/makefile      2004-01-23 16:20:42.000000000 +0000
 103 @@ -17,7 +17,7 @@
 104  SOURCES = ecs_tcl.c
 105  
 106  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(TCL_INCLUDE) $(OGDI_INCLUDE) $(PROJ_INCLUDE)
 107 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
 108 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
 109  
 110  LINK_LIBS= $(OGDI_LINKLIB) $(TCL_LINKLIB) $(MATH_LINKLIB)
 111  
 112 --- ogdi-3.1.2/contrib/gdal/makefile.orig       2001-05-04 03:13:35.000000000 +0000
 113 +++ ogdi-3.1.2/contrib/gdal/makefile    2004-01-23 16:23:46.000000000 +0000
 114 @@ -11,7 +11,7 @@
 115  
 116  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) \
 117         $(PROJ_INCLUDE)
 118 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
 119 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
 120  
 121  LINK_LIBS= $(OGDI_LINKLIB) $(GUTIL_LINKLIB)
 122  
 123 --- ogdi-3.1.2/ogdi/attr_driver/odbc/makefile.orig      2001-02-19 04:12:21.000000000 +0000
 124 +++ ogdi-3.1.2/ogdi/attr_driver/odbc/makefile   2004-01-23 16:26:58.000000000 +0000
 125 @@ -18,7 +18,7 @@
 126  
 127  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) \
 128            $(OGDI_INCLUDE) $(PROJ_INCLUDE)
 129 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
 130 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
 131  
 132  LINK_LIBS= $(ODBC_LINKLIB)
 133  
 134 --- ogdi-3.1.2/ogdi/driver/network/makefile.orig        2001-02-19 05:12:21.000000000 +0100
 135 +++ ogdi-3.1.2/ogdi/driver/network/makefile     2004-01-23 18:26:57.148973268 +0100
 136 @@ -17,7 +17,7 @@
 137  SOURCES = remote.c ecs_clnt.c 
 138  
 139  INCLUDES = $(CURRENT_INCLUDE) $(GENERAL_INCLUDE) $(OGDI_INCLUDE) $(GRASS_INCLUDE) $(PROJ_INCLUDE)
 140 -CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS)
 141 +CFLAGS         = $(INCLUDES) $(COMMON_CFLAGS) $(SHLIB_CFLAGS)
 142  
 143  LINK_LIBS= $(OGDI_LINKLIB) $(RPC_LINKLIB) $(WIN_LINKLIB)  

For PROJ 4.8.0 support:

   1 Index: ogdi-dfsg/configure.in
   2 ===================================================================
   3 --- ogdi-dfsg.orig/configure.in
   4 +++ ogdi-dfsg/configure.in
   5 @@ -81,13 +81,13 @@
   6  if test "$with_proj" = "yes" ; then
   7  
   8    AC_CHECK_LIB(proj,pj_init,PROJ_SETTING=external,PROJ_SETTING=missing,)
   9 -  AC_CHECK_HEADERS(projects.h)
  10 +  AC_CHECK_HEADERS(proj_api.h)
  11  
  12    if test $PROJ_SETTING = missing ; then
  13      AC_MSG_ERROR([Unable to find external PROJ.4 library, give path or use default internal library.])
  14    fi
  15    if test "$ac_cv_header_projects_h" = no ; then
  16 -    AC_MSG_ERROR([Unable to find external PROJ.4 projects.h file, give path or use default internal library.])
  17 +    AC_MSG_ERROR([Unable to find external PROJ.4 proj_api.h file, give path or use default internal library.])
  18    fi
  19  
  20    PROJ_SETTING=external
  21 @@ -95,11 +95,11 @@
  22  
  23  elif test "$with_proj" != "no" -a "$with_proj" != "" ; then
  24    
  25 -  if test -r $with_proj/include/projects.h ; then
  26 -    echo "checking for $with_proj/include/projects.h ... found"
  27 +  if test -r $with_proj/include/projapi.h ; then
  28 +    echo "checking for $with_proj/include/proj_api.h ... found"
  29      PROJ_INCLUDE=-I$with_proj/include
  30    else
  31 -    AC_MSG_ERROR([Unable to find $with_proj/include/projects.h])
  32 +    AC_MSG_ERROR([Unable to find $with_proj/include/proj_api.h])
  33    fi
  34  
  35    if test -r $with_proj/lib/libproj.so ; then
  36 Index: ogdi-dfsg/ogdi/c-api/client.c
  37 ===================================================================
  38 --- ogdi-dfsg.orig/ogdi/c-api/client.c
  39 +++ ogdi-dfsg/ogdi/c-api/client.c
  40 @@ -1576,7 +1576,7 @@
  41    char *error_message;
  42    ecs_CtlPoints *cpts;
  43    ecs_Result *res;
  44 -  PJ *tempproj;
  45 +  projPJ tempproj;
  46  
  47    if (multiblock != 0) {
  48      res = &cln_dummy_result;
  49 @@ -1598,7 +1598,7 @@
  50    /* Check if the projection is valid */
  51  
  52    if (strncmp(projection,PROJ_LONGLAT,13) != 0) {
  53 -    tempproj = (PJ *) cln_ProjInit(projection);
  54 +    tempproj = (projPJ) cln_ProjInit(projection);
  55      if(tempproj == NULL) {
  56        res = &cln_dummy_result;
  57        ecs_SetError(res,1,"This projection string is invalid");
  58 @@ -1775,7 +1775,7 @@
  59    ecs_Result *res;
  60    register ecs_Client *cln;
  61    char *server_proj;
  62 -  PJ *oldtarget,*oldsource;
  63 +  projPJ oldtarget,oldsource;
  64    ecs_Region oldreg;
  65    int oldisprojequal;
  66    int oldisTargetLL;
  67 @@ -1874,7 +1874,7 @@
  68  
  69    if (strncmp(projection,PROJ_LONGLAT,13) != 0) {
  70      cln->isTargetLL = FALSE;
  71 -    cln->target = (PJ *) cln_ProjInit(projection);
  72 +    cln->target = (projPJ) cln_ProjInit(projection);
  73      if(cln->target == NULL) {
  74        goto setprojerror;
  75      }
  76 @@ -1920,7 +1920,7 @@
  77  
  78    if (strncmp(server_proj,PROJ_LONGLAT,13) != 0) {
  79      cln->isSourceLL = FALSE;
  80 -    cln->source = (PJ *) cln_ProjInit(server_proj);
  81 +    cln->source = (projPJ) cln_ProjInit(server_proj);
  82      if(cln->source == NULL) {
  83        goto setprojerror;
  84      }
  85 @@ -2328,13 +2328,13 @@
  86   *     char *d: Projection name
  87   *
  88   *  OUT
  89 - *     return PJ *: New projection structure. If NULL, the operation
  90 + *     return projPJ: New projection structure. If NULL, the operation
  91   *     is a failure.
  92   *
  93   *----------------------------------------------------------------------
  94   */
  95  
  96 -PJ *cln_ProjInit(d)
  97 +projPJ cln_ProjInit(d)
  98       char *d;
  99  {
 100    int i,n;
 101 @@ -2343,7 +2343,7 @@
 102    char *l;
 103    int longueur;
 104    char *c;
 105 -  PJ *retour;
 106 +  projPJ retour;
 107    
 108    if ((c = (char *) malloc(strlen(d)+3)) == NULL) {
 109      return NULL;
 110 @@ -2378,7 +2378,7 @@
 111      n++;
 112    }
 113  
 114 -  retour = (PJ *) pj_init(n, (char **) tableau);
 115 +  retour = (projPJ) pj_init(n, (char **) tableau);
 116    free(c);
 117    free(tableau);
 118  
 119 Index: ogdi-dfsg/ogdi/c-api/ecsgeo.c
 120 ===================================================================
 121 --- ogdi-dfsg.orig/ogdi/c-api/ecsgeo.c
 122 +++ ogdi-dfsg/ogdi/c-api/ecsgeo.c
 123 @@ -310,7 +310,7 @@
 124       char *projection;
 125       double X1,Y1,X2,Y2;
 126  {
 127 -  PJ *proj;
 128 +  projPJ proj;
 129    char **argv;
 130    int argc;
 131    double lon1,lat1,lon2,lat2;
 132 Index: ogdi-dfsg/ogdi/datum_driver/usa/dtusa.c
 133 ===================================================================
 134 --- ogdi-dfsg.orig/ogdi/datum_driver/usa/dtusa.c
 135 +++ ogdi-dfsg/ogdi/datum_driver/usa/dtusa.c
 136 @@ -26,7 +26,12 @@
 137    ********************************************************************/
 138  
 139  #include "ecs.h"
 140 -#include "projects.h"
 141 +#include "proj_api.h"
 142 +
 143 +/* Definition from Proj.4 */
 144 +projUV nad_cvt(projUV, int, struct CTABLE *);
 145 +struct CTABLE *nad_init(projCtx ctx, char *);
 146 +void nad_free(struct CTABLE *);
 147  
 148  typedef struct {
 149    struct CTABLE *dtptr;
 150 @@ -124,7 +129,7 @@
 151      strcat(pathfile,"/");  
 152      strcat(pathfile,table);  
 153  
 154 -    ptr->dtptr = nad_init(pathfile);
 155 +    ptr->dtptr = nad_init(pj_get_default_ctx(), pathfile);
 156      if (ptr->dtptr == NULL) {
 157        ptr->count--;
 158        return FALSE;
 159 Index: ogdi-dfsg/ogdi/include/ecs_util.h
 160 ===================================================================
 161 --- ogdi-dfsg.orig/ogdi/include/ecs_util.h
 162 +++ ogdi-dfsg/ogdi/include/ecs_util.h
 163 @@ -105,12 +105,7 @@
 164  #include <sys/types.h>
 165  #include <sys/stat.h>
 166  
 167 -#include "projects.h"
 168 -
 169 -/* Ensure we are compatible with PROJ.4.4.x and PROJ.4.3.x */
 170 -#ifndef USE_PROJUV
 171 -#  define projUV UV
 172 -#endif
 173 +#include "proj_api.h"
 174  
 175  #include "ecs.h"
 176  
 177 @@ -1054,8 +1049,8 @@
 178       ecs_Family currentSelectionFamily: Current layer selection type
 179       char *tclprocname: attribute callback procedure for tcl
 180       char *target_proj: Projection descriptor
 181 -     PJ *target: target (c interface) projection descriptors
 182 -     PJ *source: source (driver) projection descriptors
 183 +     projPJ target: target (c interface) projection descriptors
 184 +     projPJ source: source (driver) projection descriptors
 185       ecs_Datum targetdatum: target datum information
 186       ecs_Datum sourcedatum: source datum information
 187       void *dthandle: Handle to the datum driver
 188 @@ -1092,8 +1088,8 @@
 189    ecs_Family currentSelectionFamily; /* Current layer selection type */
 190    char *tclprocname;      /* attribute callback procedure for tcl */
 191    char *target_proj;
 192 -  PJ *target;             /* source and target projection descriptors */
 193 -  PJ *source;
 194 +  projPJ target;             /* source and target projection descriptors */
 195 +  projPJ source;
 196    int isSourceLL;         /* flags to avoid unnecessary computation */
 197    int isTargetLL;
 198    int isProjEqual;
 199 @@ -1165,7 +1161,7 @@
 200  
 201  /* Projection conversion functions */
 202  
 203 -PJ *cln_ProjInit                     _ANSI_ARGS_((char *d));
 204 +projPJ cln_ProjInit                     _ANSI_ARGS_((char *d));
 205  int cln_CompareProjections           _ANSI_ARGS_((int ClientID));
 206  int cln_UpdateMaxRegion              _ANSI_ARGS_((int ClientID, double x, double y, ecs_Region *gr, int sens, int first));
 207  int cln_ConvRegion                   _ANSI_ARGS_((int ClientID, ecs_Region *gr, int sens));
 208 Index: ogdi-dfsg/contrib/ogdi_import/ogdi_import.c
 209 ===================================================================
 210 --- ogdi-dfsg.orig/contrib/ogdi_import/ogdi_import.c
 211 +++ ogdi-dfsg/contrib/ogdi_import/ogdi_import.c
 212 @@ -63,12 +63,7 @@
 213  #include "ecs.h"
 214  #include "shapefil.h"
 215  #include <assert.h>
 216 -#include "projects.h"
 217 -
 218 -#ifndef PJ_VERSION
 219 -#define projPJ PJ*
 220 -#define projUV UV
 221 -#endif
 222 +#include "proj_api.h"
 223  
 224  static int     ClientID = -1;
 225  static int      bNoDict = FALSE;
 226 Index: ogdi-dfsg/contrib/ogdi_info/ogdi_info.c
 227 ===================================================================
 228 --- ogdi-dfsg.orig/contrib/ogdi_info/ogdi_info.c
 229 +++ ogdi-dfsg/contrib/ogdi_info/ogdi_info.c
 230 @@ -63,7 +63,7 @@
 231   */
 232  
 233  #include "ecs.h"
 234 -#include "projects.h"
 235 +#include "proj_api.h"
 236  
 237  static int     ClientID = -1;
 238  static int      bNoDict = FALSE;
 239 @@ -214,7 +214,7 @@
 240  /*                          DumpGlobalRegion()                          */
 241  /************************************************************************/
 242  
 243 -static int DumpGlobalRegion( ecs_Region * region, PJ * proj_defn )
 244 +static int DumpGlobalRegion( ecs_Region * region, projPJ proj_defn )
 245  
 246  {
 247      ecs_Result *result;
 248 @@ -398,7 +398,7 @@
 249  
 250  {
 251      ecs_Result *result;
 252 -    PJ        *proj_defn = NULL;
 253 +    projPJ     proj_defn = NULL;
 254  
 255  /* -------------------------------------------------------------------- */
 256  /*      Close old client if there is one active.                        */

InfraGRID/Staff/Software/OgdiBuild (last edited 2013-01-18 11:03:18 by MarianNeagul)