howto compile for linux x86_64

Patrice Dumas pertusus at FREE.FR
Fri Apr 20 04:25:14 EDT 2007


On Fri, Apr 20, 2007 at 08:18:31AM +0000, Kristian Nilssen wrote:
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
>   <meta content="text/html;charset=us-ascii" http-equiv="Content-Type">
>   <title></title>
> </head>
> <body bgcolor="#ffffff" text="#000000">
> I installed the fedora rpm via yum but it was lacking the lats stuff
> which I needed, hence my need to compile.<br>

Indeed lats support is among the legally problematic code.

In that case, an other possibility for you is to rebuild the grads rpm
using the unchanged source from COLA (instead of the source without
problematic file which is in the srpm), in the %configure invocation,
remove --without-gui --without-lats, and replace the
grads_dap-no_lats.patch patch with the attached patch.

You may still have issues with libsx, I don't remember exactly, but
maybe you can use --without-gui in that case.

--
Pat
-------------- next part --------------
diff -Naur grads-1.9b4/src/fgbds.c grads-1.9b4_new/src/fgbds.c
--- grads-1.9b4/src/fgbds.c   2004-10-12 18:04:38.000000000 +0000
+++ grads-1.9b4_new/src/fgbds.c 2005-11-03 11:33:43.000000000 +0000
@@ -11,6 +11,7 @@
 #define _POSIX_SOURCE 1
 #include <math.h>
 #include <float.h>
+#include <string.h>
 #include "fgrib.h"
 #include "grads.h"
 /*
@@ -222,7 +223,7 @@
   ref=ibm2flt(ibmfloat);
   if(VERB) printf("amin = %e ref = %e rc=%d \n",amin,ref,rc);

-  strncpy(&bds->bds[6],ibmfloat,4);
+  strncpy((char *) &bds->bds[6], (char *) ibmfloat,4);

   bds->nb=nbits;
   bds->bds[10]=bds->nb;
diff -Naur grads-1.9b4/src/gacfg.c grads-1.9b4_new/src/gacfg.c
--- grads-1.9b4/src/gacfg.c   2005-05-18 14:29:17.000000000 +0000
+++ grads-1.9b4_new/src/gacfg.c 2005-11-03 13:18:45.000000000 +0000
@@ -32,6 +32,7 @@
  */

 #include <stdio.h>
+#include <string.h>
 #include "grads.h"
 #include "buildinfo.h"

diff -Naur grads-1.9b4/src/gaexpr.c grads-1.9b4_new/src/gaexpr.c
--- grads-1.9b4/src/gaexpr.c  2005-05-18 14:48:36.000000000 +0000
+++ grads-1.9b4_new/src/gaexpr.c        2005-11-03 11:22:27.000000000 +0000
@@ -13,6 +13,7 @@
 #endif

 #include <stdio.h>
+#include <string.h>
 #include <math.h>
 #include "grads.h"

diff -Naur grads-1.9b4/src/gagui.c grads-1.9b4_new/src/gagui.c
--- grads-1.9b4/src/gagui.c   2002-10-28 19:08:33.000000000 +0000
+++ grads-1.9b4_new/src/gagui.c 2005-11-03 11:30:25.000000000 +0000
@@ -342,7 +342,7 @@

 /*
  * CB_Load() - Callback function for the load button.  This just calls
- *          GetFile() to get a file name. In case of "open" or "sdfopen",
+ *          SimpleGetFile() to get a file name. In case of "open" or "sdfopen",
  *          the file becomes the default and the user is asked to select a
  *          variable from this file.
  */
@@ -356,7 +356,7 @@
   else if(strstr(data,"exec"))    last_path = last_path_exec;
   else if(strstr(data,"run"))     last_path = last_path_run;
   else                            last_path = NULL;
-  fname = GetFile(last_path);
+  fname = SimpleGetFile(last_path);

   if(fname)
     {
@@ -979,7 +979,7 @@
   WinInfo *wi=(WinInfo *)arg;
   char *fname;

-  fname = GetFile(wi->cur_path);
+  fname = SimpleGetFile(wi->cur_path);
   if (fname)
    {
      SetTextWidgetText(wi->text_widget, fname, TRUE);
@@ -1126,7 +1126,7 @@


   fname = (char *) data;
-  if ( !strcmp(fname,"NULL") ) fname = GetFile(NULL);
+  if ( !strcmp(fname,"NULL") ) fname = SimpleGetFile(NULL);
   if ( !fname ) return;

   this = MakeWindow("GrADS Text Viewer", SAME_DISPLAY, NONEXCLUSIVE_WINDOW);
@@ -1151,7 +1151,7 @@
   WinInfo *wi;

   fname = (char *)data;
-  if ( !strcmp(fname,"NULL") ) fname = GetFile(NULL);
+  if ( !strcmp(fname,"NULL") ) fname = SimpleGetFile(NULL);
   if ( !fname ) return;

   this = MakeWindow("GrADS Text Editor", SAME_DISPLAY, NONEXCLUSIVE_WINDOW);
diff -Naur grads-1.9b4/src/gaimg.c grads-1.9b4_new/src/gaimg.c
--- grads-1.9b4/src/gaimg.c   2003-09-26 18:32:02.000000000 +0000
+++ grads-1.9b4_new/src/gaimg.c 2005-11-03 13:11:16.000000000 +0000
@@ -223,7 +223,7 @@
 #if GRADS_HP64
 #include <api.h>
 #endif
-#include <magick.h>
+#include <ImageMagick.h>
 #include "grads.h"

 extern Display       *display;    /* defined in gxX.c */
@@ -267,6 +267,7 @@
 img_write ( char *filename )
 {
    Image      *image;
+   XImportInfo xinfo;
    ImageInfo  image_info;
    char       msg[512], fname[512];
    unsigned int status;
@@ -277,8 +278,9 @@
    if ( strchr(fname,'.') == NULL ) strcat(fname,".gif");

    GetImageInfo(&image_info);  /* initializes image info */
+   XGetImportInfo(&xinfo);

-   image = XGetWindowImage(display, win, 0, 0); /* retrieve image */
+   image = XImportImage(&image_info, &xinfo); /* retrieve image */
    if ( image == (Image *) NULL ) {
         gaprnt(0,"IMG Error: failed to get X image!\n");
         return 1;
diff -Naur grads-1.9b4/src/gaio.c grads-1.9b4_new/src/gaio.c
--- grads-1.9b4/src/gaio.c    2005-05-23 17:59:01.000000000 +0000
+++ grads-1.9b4_new/src/gaio.c  2005-11-03 11:37:35.000000000 +0000
@@ -22,6 +22,7 @@
 #include "grads.h"
 #include <math.h>
 #include <stdio.h>
+#include <string.h>
 #if USESDF == 1
 #include <netcdf.h>
 #if USEHDF == 1
diff -Naur grads-1.9b4/src/gasdf.c grads-1.9b4_new/src/gasdf.c
--- grads-1.9b4/src/gasdf.c   2005-05-18 14:29:17.000000000 +0000
+++ grads-1.9b4_new/src/gasdf.c 2005-11-04 10:02:05.000000000 +0000
@@ -5785,7 +5785,11 @@
   /* Turn off automatic error handling. */
   ncopts = 0;

+#if USEHDF == 1
   if (ncattname (cdfid, varid, attnum, name) == -1) {
+#else
+  if (nc_inq_attname(cdfid, varid, attnum, name) == -1) {
+#endif
     ncopts = oldncopts ;
     return Failure;
   }
@@ -5813,10 +5817,23 @@
   /* Turn off automatic error handling. */
   ncopts = 0;

+#if USEHDF == 1
   if (ncattinq (cdfid, varid, aname, atype, alen) == -1) {
     ncopts = oldncopts ;
     return Failure;
   }
+#else
+  if (nc_inq_atttype(cdfid, varid, aname, atype) != NC_NOERR) {
+    ncopts = oldncopts ;
+    return Failure;
+  }
+  size_t templen;
+  if (nc_inq_attlen(cdfid, varid, aname, &templen) != NC_NOERR) {
+    ncopts = oldncopts ;
+    return Failure;
+  }
+  *alen = (int) templen;
+#endif

   /* Allocate space for values. */
   if ((*atype == NC_BYTE) || (*atype == NC_CHAR))  {
@@ -5831,6 +5848,7 @@
     *adata = (double *) malloc (sizeof (double) * *alen);
   }  else {
     ncopts = oldncopts ;
+    printf("UNKNOWN TYPE HERE !\n");
     return Failure;
   }

@@ -5840,10 +5858,65 @@
   }

   /* Retrieve values. */
+#if USEHDF == 1
   if (ncattget (cdfid, varid, aname, (void *) (*adata)) == -1) {
     ncopts = oldncopts ;
     return Failure;
   }
+#else
+  switch (*atype)
+  {
+     case NC_BYTE:
+       if (nc_get_att_uchar(cdfid, varid, aname, (unsigned char *) *adata) != NC_NOERR)
+       {
+         ncopts = oldncopts ;
+         return Failure;
+       }
+       break;
+     case NC_CHAR:
+       if (nc_get_att_text(cdfid, varid, aname, (char *) *adata) != NC_NOERR)
+       {
+         ncopts = oldncopts ;
+         return Failure;
+       }
+       break;
+     case NC_SHORT:
+       if (nc_get_att_short(cdfid, varid, aname, (short *) *adata) != NC_NOERR)
+       {
+         ncopts = oldncopts ;
+         return Failure;
+       }
+       break;
+     case NC_LONG:
+       if (nc_get_att_int(cdfid, varid, aname, (int *) *adata) != NC_NOERR)
+       {
+         ncopts = oldncopts ;
+         return Failure;
+       }
+       break;
+     case NC_FLOAT:
+       if (nc_get_att_float(cdfid, varid, aname, (float *) *adata) != NC_NOERR)
+       {
+         ncopts = oldncopts ;
+         return Failure;
+       }
+       break;
+     case NC_DOUBLE:
+       if (nc_get_att_double(cdfid, varid, aname, (double *) *adata) != NC_NOERR)
+       {
+         ncopts = oldncopts ;
+         return Failure;
+       }
+       break;
+     default:
+       if (nc_get_att_text(cdfid, varid, aname, (char *) *adata) != NC_NOERR)
+       {
+         ncopts = oldncopts ;
+         return Failure;
+       }
+       break;
+  }
+#endif

   /* If character, set last byte to null. */
   if (*atype == NC_CHAR)  {
diff -Naur grads-1.9b4/src/gxdxwd.c grads-1.9b4_new/src/gxdxwd.c
--- grads-1.9b4/src/gxdxwd.c  2002-10-28 19:08:33.000000000 +0000
+++ grads-1.9b4_new/src/gxdxwd.c        2005-11-03 13:37:45.000000000 +0000
@@ -7,6 +7,7 @@
 #endif

 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>

 #include <X11/Xos.h>
@@ -22,8 +23,6 @@
  *              writting.
  */

-char *calloc();
-
 #include "X11/XWDFile.h"


@@ -92,6 +91,7 @@
     int bw;
     Window dummywin;
     XWDFileHeader header;
+    char mytmp[64];


     /*
@@ -232,7 +232,8 @@
      * Write out the color maps, if any
      */

-    if (debug) outl("xwd: Dumping %d colors.\n", ncolors);
+    sprintf(mytmp, "xwd: Dumping %d colors.\n", ncolors);
+    if (debug) outl(mytmp);
 /*
     {
     int icineca=0;
diff -Naur grads-1.9b4/src/gxeps.c grads-1.9b4_new/src/gxeps.c
--- grads-1.9b4/src/gxeps.c   2004-02-27 14:42:11.000000000 +0000
+++ grads-1.9b4_new/src/gxeps.c 2005-11-03 14:45:16.000000000 +0000
@@ -6,6 +6,8 @@
 #include <config.h>
 #endif

+#include <stdlib.h>
+
 /***********************************************************
  * GXEPS a grads metafile to PostScript converter
  * Copyright (c) 1999 - 2001 Matthias Munnich
diff -Naur grads-1.9b4/src/gxhpng.c grads-1.9b4_new/src/gxhpng.c
--- grads-1.9b4/src/gxhpng.c  2004-03-12 16:14:04.000000000 +0000
+++ grads-1.9b4_new/src/gxhpng.c        2005-11-03 11:56:53.000000000 +0000
@@ -6,7 +6,6 @@
 #include <config.h>
 #endif

-
 /* Rasterize current metafile buffer via gd library.  Loosly based
    on the gxpng utility:

@@ -377,8 +376,6 @@
   return (retcod);
 }

-int gdCompareInt(const void *a, const void *b);
-
 /* Version of gdImageFilledPolygon to invoke my local
    version of gdImageLne.  Nothing else changed... B.Doty 5/31/01 */

@@ -455,7 +452,7 @@
                                im->polyInts[ints++] = (y-y1) * (x2-x1) / (y2-y1) + x1;
                        }
                }
-             qsort(im->polyInts, ints, sizeof(int), gdCompareInt);
+               qsort(im->polyInts, ints, sizeof(int), (void *) gdCompareInt);

                for (i=0; (i < (ints)); i+=2) {
                        gdImageLne(im, im->polyInts[i], y,
diff -Naur grads-1.9b4/src/gxmeta.c grads-1.9b4_new/src/gxmeta.c
--- grads-1.9b4/src/gxmeta.c  2005-05-18 14:29:17.000000000 +0000
+++ grads-1.9b4_new/src/gxmeta.c        2005-11-03 11:57:03.000000000 +0000
@@ -691,6 +691,12 @@
 }

 #if GXPNG==1
+
+int gdCompareInt(void * a, void * b)
+{
+    return (*(const int *)a) - (*(const int *)b);
+}
+
 #include "gxhpng.c"
 #endif
 #ifdef PRINT_EPS
diff -Naur grads-1.9b4/src/gxX.c grads-1.9b4_new/src/gxX.c
--- grads-1.9b4/src/gxX.c     2005-05-18 14:29:17.000000000 +0000
+++ grads-1.9b4_new/src/gxX.c   2005-11-03 11:28:15.000000000 +0000
@@ -270,7 +270,7 @@

   /* Set up icon pixmap */

-  icon_pixmap = XCreateBitmapFromData(display, win, icon_bitmap_bits,
+  icon_pixmap = XCreateBitmapFromData(display, win, (char *) icon_bitmap_bits,
                 icon_bitmap_width, icon_bitmap_height);

   /* Set standard properties */
@@ -402,7 +402,7 @@
   if (xfnam) flist = XListFonts (display, xfnam, 1, &i);
   else flist = NULL;
   if (flist==NULL) {
-    flist = XListFonts (display, "-adobe-helvetica-bold-r-normal--??-100*", 1, &i);
+    flist = XListFonts (display, "-adobe-helvetica-bold-r-normal-*-100*", 1, &i);
   }
   if (flist==NULL) {
     flist = XListFonts (display, "-adobe-helvetica-bold-r-normal-*-120*", 1, &i);
@@ -418,7 +418,7 @@
   if (xfnam) flist = XListFonts (display, xfnam, 1, &i);
   else flist = NULL;
   if (flist==NULL) {
-    flist = XListFonts (display, "-adobe-helvetica-bold-o-normal--??-100*", 1, &i);
+    flist = XListFonts (display, "-adobe-helvetica-bold-o-normal-*-100*", 1, &i);
   }
   if (flist==NULL) {
     flist = XListFonts (display, "-adobe-helvetica-bold-o-normal-*-120*", 1, &i);
@@ -3267,7 +3267,7 @@
   }

   if (typ>1) {
-    stipple_pixmap = XCreateBitmapFromData(display, win, bitmap_bits,
+    stipple_pixmap = XCreateBitmapFromData(display, win, (char *) bitmap_bits,
                     bitmap_width, bitmap_height);
     XSetStipple(display, gc, stipple_pixmap);
     XSetFillStyle(display, gc, FillStippled);
diff -Naur grads-1.9b4/src/lats.c grads-1.9b4_new/src/lats.c
--- grads-1.9b4/src/lats.c    2002-10-28 19:08:33.000000000 +0000
+++ grads-1.9b4_new/src/lats.c  2005-11-03 11:31:57.000000000 +0000
@@ -6,6 +6,7 @@
 #include <config.h>
 #endif

+#include <string.h>
 /* -*-Mode: C;-*-
  * Module:      LATS user API
  *
diff -Naur grads-1.9b4/src/latsnc.c grads-1.9b4_new/src/latsnc.c
--- grads-1.9b4/src/latsnc.c  2002-10-28 19:08:33.000000000 +0000
+++ grads-1.9b4_new/src/latsnc.c        2005-11-03 13:31:09.000000000 +0000
@@ -6,6 +6,9 @@
 #include <config.h>
 #endif

+#include <string.h>
+#include <stdio.h>
+
 /* -*-Mode: C;-*-
  * Module:      LATS netCDF functions
  *
diff -Naur grads-1.9b4/src/latstime.c grads-1.9b4_new/src/latstime.c
--- grads-1.9b4/src/latstime.c        2002-10-28 19:08:33.000000000 +0000
+++ grads-1.9b4_new/src/latstime.c      2005-11-03 11:32:26.000000000 +0000
@@ -6,6 +6,7 @@
 #include <config.h>
 #endif

+#include <string.h>
 /* -*-Mode: C;-*-
  * Module:      LATS time functions
  *


More information about the gradsusr mailing list