diff --git a/.gitignore b/.gitignore index 35c960c..3e66280 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ cgnslib_2.5-4.tar.gz usersguide.pdf /cgnslib_2.5-5.tar.gz +/cgnslib_3.1.3-4.tar.gz diff --git a/cgnslib-2.5-4-set-so.patch b/cgnslib-2.5-4-set-so.patch deleted file mode 100644 index cfe9d2a..0000000 --- a/cgnslib-2.5-4-set-so.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -up cgnslib_2.5/configure.so cgnslib_2.5/configure ---- cgnslib_2.5/configure.so 2008-07-11 05:47:50.000000000 +0530 -+++ cgnslib_2.5/configure 2010-07-15 23:47:56.101811596 +0530 -@@ -2048,8 +2048,8 @@ if test $shared = yes; then - shared=no - else - CFGFLAGS="-fPIC $CFGFLAGS" -- AR="\$(CC) -shared $SYSCFLAGS -Wl,-rpath,$cgnsdir/\$(SYSTEM)" -- LIBEXT=so -+ AR="\$(CC) -shared $SYSCFLAGS -Wl,-soname,libcgns.so.1.0 -Wl,-rpath,$cgnsdir/\$(SYSTEM)" -+ LIBEXT=so.1.0 - fi - fi - if test $shared = yes; then -diff -up cgnslib_2.5/Makefile.in.so cgnslib_2.5/Makefile.in ---- cgnslib_2.5/Makefile.in.so 2008-01-19 09:15:16.000000000 +0530 -+++ cgnslib_2.5/Makefile.in 2010-07-15 23:47:56.102811387 +0530 -@@ -50,6 +50,7 @@ $(CGNSLIB) : $(OBJDIR) $(CGNSOBJS) $(ADF - -@$(RM) $@ - $(AR) $(AROUT)$@ $(CGNSOBJS) $(ADFOBJS) $(F2COBJS) - $(RANLIB) $@ -+ cd $(SYSTEM); ln -sf libcgns.so.1.0 libcgns.so - - $(OBJDIR) : - -$(MKDIR) $(OBJDIR) -diff -up cgnslib_2.5/tests/Makefile.in.so cgnslib_2.5/tests/Makefile.in ---- cgnslib_2.5/tests/Makefile.in.so 2010-07-15 23:48:18.602061430 +0530 -+++ cgnslib_2.5/tests/Makefile.in 2010-07-15 23:49:26.214822351 +0530 -@@ -7,7 +7,7 @@ CGNSLIB = $(CGNSDIR)/$(LIBCGNS) - - COPTS = $(CFLAGS) -I$(CGNSDIR) -I$(CGNSDIR)/$(ADFDIR) - FOPTS = $(FFLAGS) -I$(CGNSDIR) --LDLIBS = $(CGNSLIB) $(HDF5LIB) $(SZIPLIB) $(ZLIBLIB) -+LDLIBS = $(CGNSLIB) $(HDF5LIB) $(SZIPLIB) $(ZLIBLIB) -L$(CGNSDIR)/$(SYSTEM) -lcgns -Wl,-rpath,$(CGNSDIR)/$(SYSTEM) - - #---------- - diff --git a/cgnslib-2.5-5-replace-exit-to-return.patch b/cgnslib-2.5-5-replace-exit-to-return.patch deleted file mode 100644 index a4a9e05..0000000 --- a/cgnslib-2.5-5-replace-exit-to-return.patch +++ /dev/null @@ -1,926 +0,0 @@ -diff -up cgnslib_2.5/adf_cond.c.exit cgnslib_2.5/adf_cond.c ---- cgnslib_2.5/adf_cond.c.exit 2011-02-27 12:07:23.715838333 +0530 -+++ cgnslib_2.5/adf_cond.c 2011-02-27 12:08:06.693837993 +0530 -@@ -383,7 +383,7 @@ static void ErrorExit( char *ermsg, int - ADF_Error_Message(ErrStat,input) ; - fprintf(stderr,"%s\n",input) ; - } -- exit(1) ; -+ return 1; - } - - #if defined (__cplusplus) -diff -up cgnslib_2.5/adfh/adf2hdf.c.exit cgnslib_2.5/adfh/adf2hdf.c ---- cgnslib_2.5/adfh/adf2hdf.c.exit 2011-02-27 12:08:29.448837989 +0530 -+++ cgnslib_2.5/adfh/adf2hdf.c 2011-02-27 12:09:33.466838263 +0530 -@@ -57,7 +57,7 @@ static int is_ADF_file(char *fname) { - - if ((fp = fopen(fname, "rb")) == NULL) { - fprintf(stderr, "couldn't open %s for reading\n", fname); -- exit (1); -+ return 1; - } - fread (header, sizeof(char), 32, fp); - fclose (fp); -@@ -75,7 +75,7 @@ static void ErrorExit() - ADFH_Database_Close (OutputRootID, &ErrStat); - if (TempFile[0]) - unlink(TempFile); -- exit(1) ; -+ return 1; - } - - /*-------------------------------------------------------------------*/ -@@ -288,22 +288,22 @@ int main (int argc, char **argv) - IncludeLink = 1; - else { - fprintf(stderr, "unknown option %s\n", argv[n]); -- exit (1); -+ return 1; - } - } - - if (n >= argc) { - fprintf (stderr, "usage: adf2hdf [-links] [-print] InputFile [OutputFile]\n"); -- exit (1); -+ return 1; - } - inpfile = argv[n++]; - if (stat (inpfile, &inpst)) { - fprintf (stderr, "can't stat %s\n", inpfile); -- exit (1); -+ return 1; - } - if (!is_ADF_file(inpfile)) { - fprintf (stderr, "%s is not an ADF file\n", inpfile); -- exit (1); -+ return 1; - } - - /* output to temporary file */ -@@ -337,12 +337,12 @@ int main (int argc, char **argv) - unlink (outfile); - if (rename (TempFile, outfile)) { - fprintf (stderr, "rename %s -> %s failed", TempFile, outfile); -- exit (1); -+ return 1; - } - - if (stat (outfile, &outst)) { - fprintf (stderr, "can't stat %s\n", outfile); -- exit (1); -+ return 1; - } - - printf ("ADF file size = %ld bytes\n", (long)inpst.st_size); -diff -up cgnslib_2.5/adfh/ADFH.c.exit cgnslib_2.5/adfh/ADFH.c ---- cgnslib_2.5/adfh/ADFH.c.exit 2011-02-27 12:10:18.980838002 +0530 -+++ cgnslib_2.5/adfh/ADFH.c 2011-02-27 12:10:31.599837848 +0530 -@@ -254,7 +254,7 @@ static void set_error(int errcode, int * - char errmsg[ADF_MAX_ERROR_STR_LENGTH+1]; - ADFH_Error_Message(errcode, errmsg); - fprintf(stderr, "ERROR:%s\n", errmsg); -- exit(1); -+ return 1; - } - *err = errcode; - } -diff -up cgnslib_2.5/adfh/hdf2adf.c.exit cgnslib_2.5/adfh/hdf2adf.c ---- cgnslib_2.5/adfh/hdf2adf.c.exit 2011-02-27 12:10:50.686838060 +0530 -+++ cgnslib_2.5/adfh/hdf2adf.c 2011-02-27 12:11:36.300837824 +0530 -@@ -59,7 +59,7 @@ static void ErrorExit() - ADF_Database_Close (OutputRootID, &ErrStat); - if (TempFile[0]) - unlink(TempFile); -- exit(1) ; -+ return 1; - } - - /*-------------------------------------------------------------------*/ -@@ -254,22 +254,22 @@ int main (int argc, char **argv) - IncludeLink = 1; - else { - fprintf(stderr, "unknown option %s\n", argv[n]); -- exit (1); -+ return 1; - } - } - - if (n >= argc) { - fprintf (stderr, "usage: hdf2adf [-links] [-print] InputFile [OutputFile]\n"); -- exit (1); -+ return 1; - } - inpfile = argv[n++]; - if (stat (inpfile, &inpst)) { - fprintf (stderr, "can't stat %s\n", inpfile); -- exit (1); -+ return 1; - } - if (H5Fis_hdf5(inpfile) <= 0) { - fprintf (stderr, "%s is not a HDF5 file\n", inpfile); -- exit (1); -+ return 1; - } - - /* output to temporary file */ -@@ -303,12 +303,12 @@ int main (int argc, char **argv) - unlink (outfile); - if (rename (TempFile, outfile)) { - fprintf (stderr, "rename %s -> %s failed", TempFile, outfile); -- exit (1); -+ return 1; - } - - if (stat (outfile, &outst)) { - fprintf (stderr, "can't stat %s\n", outfile); -- exit (1); -+ return 1; - } - - printf ("HDF5 file size = %ld bytes\n", (long)inpst.st_size); -diff -up cgnslib_2.5/cgns_error.c.exit cgnslib_2.5/cgns_error.c ---- cgnslib_2.5/cgns_error.c.exit 2011-02-27 12:11:58.917837916 +0530 -+++ cgnslib_2.5/cgns_error.c 2011-02-27 12:12:11.536837970 +0530 -@@ -63,7 +63,7 @@ CGNSDLL void cg_error_exit() { - (*cgns_error_handler)(-1, cgns_error_mess); - else - fprintf(stderr,"%s\n",cgns_error_mess); -- exit(1); -+ return 1; - } - - CGNSDLL void cg_error_print() { -diff -up cgnslib_2.5/cgns_internals.c.exit cgnslib_2.5/cgns_internals.c ---- cgnslib_2.5/cgns_internals.c.exit 2011-02-27 12:12:31.017837953 +0530 -+++ cgnslib_2.5/cgns_internals.c 2011-02-27 12:12:46.601837676 +0530 -@@ -87,7 +87,7 @@ void *cgi_malloc(int cnt, int size) { - void *buf = calloc(cnt, size); - if (buf == NULL) { - cgi_error("calloc failed for %d values of size %d", cnt, size); -- exit (1); -+ return 1; - } - return buf; - } -@@ -96,7 +96,7 @@ void *cgi_realloc(void *oldbuf, unsigned - void *buf = realloc(oldbuf, bytes); - if (buf == NULL) { - cgi_error("realloc failed for %d bytes", bytes); -- exit (1); -+ return 1; - } - return buf; - } -diff -up cgnslib_2.5/tests/adflist.c.exit cgnslib_2.5/tests/adflist.c ---- cgnslib_2.5/tests/adflist.c.exit 2011-02-27 12:13:13.669838000 +0530 -+++ cgnslib_2.5/tests/adflist.c 2011-02-27 12:13:55.925837996 +0530 -@@ -35,7 +35,7 @@ static void err_exit (char *name, int er - fflush (stdout); - ADF_Error_Message (errcode, errmsg); - fprintf (stderr, "error in %s:%s\n", name, errmsg); -- exit (1); -+ return 1; - } - - static void print_node (double node_id) -@@ -108,7 +108,7 @@ static void print_children (double paren - - if (leader_len + indent > MAX_LEADER) { - fprintf (stderr, "nesting is too deep\n"); -- exit (1); -+ return 1; - } - leader_len += indent; - for (nc = 0; nc < indent; nc++) -@@ -168,7 +168,7 @@ int main (int argc, char *argv[]) - indent = atoi (argarg); - if (indent < 1) { - fprintf (stderr, "indent must be > 0\n"); -- exit (1); -+ return 1; - } - break; - case 'f': -@@ -230,7 +230,7 @@ int main (int argc, char *argv[]) - ADF_Database_Close (root_id, &err); - if (err > 0) - err_exit ("ADF_Database_Close", err); -- exit (0); -+ - return 0; /* prevent compiler warning */ - } - -diff -up cgnslib_2.5/tests/dbtest.c.exit cgnslib_2.5/tests/dbtest.c ---- cgnslib_2.5/tests/dbtest.c.exit 2011-02-27 12:14:14.159838006 +0530 -+++ cgnslib_2.5/tests/dbtest.c 2011-02-27 12:14:33.517837953 +0530 -@@ -30,7 +30,7 @@ int main (int argc, char **argv) - - if (argc < 3 || argc > 4) { - fprintf (stderr, "usage: dbtest numzones numvalues [CGNSfile]\n"); -- exit (1); -+ return 1; - } - numzones = atoi(argv[1]); - numvalues = atoi(argv[2]); -@@ -40,7 +40,7 @@ int main (int argc, char **argv) - values = (float *) malloc (numvalues * sizeof(float)); - if (values == NULL) { - perror ("malloc"); -- exit (-1); -+ return -1; - } - for (i = 0; i < numvalues; i++) - values[i] = (float)i; -diff -up cgnslib_2.5/tests/getargs.c.exit cgnslib_2.5/tests/getargs.c ---- cgnslib_2.5/tests/getargs.c.exit 2011-02-27 12:15:43.827838065 +0530 -+++ cgnslib_2.5/tests/getargs.c 2011-02-27 12:16:13.621838359 +0530 -@@ -22,7 +22,7 @@ char **usgmsg, *errmsg; - fprintf (stderr, "ERROR: %s\n", errmsg); - for (n = 0; NULL != usgmsg[n]; n++) - fprintf (stderr, "%s\n", usgmsg[n]); -- exit (NULL != errmsg); -+ return (NULL != errmsg); - } - - /*---------- getargs --------------------------------------------------- -@@ -80,7 +80,7 @@ char **argv, *ostr; - (oli = strchr (ostr, argopt)) == NULL) { - if (argerr) { - fprintf (stderr, "invalid option - `%c'\n", argopt); -- exit (-1); -+ return -1; - } - return (argopt); - } -@@ -106,7 +106,7 @@ char **argv, *ostr; - if (++argind >= argc) { - if (!argerr) return (':'); - fprintf (stderr, "missing argument for option `%c'\n", argopt); -- exit (1); -+ return 1; - } - place = argv[argind]; - } -diff -up cgnslib_2.5/tests/open_cgns.c.exit cgnslib_2.5/tests/open_cgns.c ---- cgnslib_2.5/tests/open_cgns.c.exit 2011-02-27 12:16:34.752838017 +0530 -+++ cgnslib_2.5/tests/open_cgns.c 2011-02-27 12:16:44.360837993 +0530 -@@ -9,7 +9,7 @@ int main (int argc, char **argv) - - if (argc < 2 || argc > 3) { - fprintf (stderr, "open_cgns [-m] CGNSfile\n"); -- exit (1); -+ return 1; - } - if (argc > 2) { - mode = CG_MODE_MODIFY; -diff -up cgnslib_2.5/tests/test_exts.c.exit cgnslib_2.5/tests/test_exts.c ---- cgnslib_2.5/tests/test_exts.c.exit 2011-02-27 12:17:01.206837984 +0530 -+++ cgnslib_2.5/tests/test_exts.c 2011-02-27 12:17:54.612838570 +0530 -@@ -10,12 +10,12 @@ - - float coord[NUM_SIDE*NUM_SIDE*NUM_SIDE]; - --#define CHECK(L,B) if(!(B)){fprintf(stderr,"mismatch in %s\n",L);exit(1);} -+#define CHECK(L,B) if(!(B)){fprintf(stderr,"mismatch in %s\n",L);return 1;} - - void error_exit (char *where) - { - fprintf (stderr, "ERROR:%s:%s\n", where, cg_get_error()); -- exit (1); -+ return 1; - } - - int main (int argc, char **argv) -diff -up cgnslib_2.5/tests/test_goto.c.exit cgnslib_2.5/tests/test_goto.c ---- cgnslib_2.5/tests/test_goto.c.exit 2011-02-27 12:18:09.398837889 +0530 -+++ cgnslib_2.5/tests/test_goto.c 2011-02-27 12:18:26.502838016 +0530 -@@ -10,13 +10,13 @@ - - float coord[NUM_SIDE*NUM_SIDE*NUM_SIDE]; - --#define CHECK(L,B) if(!(B)){fprintf(stderr,"mismatch in %s\n",L);exit(1);} -+#define CHECK(L,B) if(!(B)){fprintf(stderr,"mismatch in %s\n",L);return 1;} - - void error_exit (int iserr, char *msg) - { - if (iserr) { - printf ("ERROR:%s\n", msg); -- exit (1); -+ return 1; - } - else - printf ("WARNING:%s\n", msg); -diff -up cgnslib_2.5/tests/write_array.c.exit cgnslib_2.5/tests/write_array.c ---- cgnslib_2.5/tests/write_array.c.exit 2011-02-27 12:18:54.147838008 +0530 -+++ cgnslib_2.5/tests/write_array.c 2011-02-27 12:19:04.971837897 +0530 -@@ -24,7 +24,7 @@ int main (int argc, char **argv) - array = (float *) malloc (arraysize * sizeof(float)); - if (NULL == array) { - fprintf (stderr, "malloc failed\n"); -- exit (1); -+ return 1; - } - for (na = 0; na < arraysize; na++) - array[na] = (float)na; -diff -up cgnslib_2.5/tests/write_rind.c.exit cgnslib_2.5/tests/write_rind.c ---- cgnslib_2.5/tests/write_rind.c.exit 2011-02-27 12:19:22.165838102 +0530 -+++ cgnslib_2.5/tests/write_rind.c 2011-02-27 12:19:31.710838097 +0530 -@@ -59,7 +59,7 @@ int main () - nmap = (int *) malloc((num_coord + 8 * num_element) * sizeof(int)); - if (NULL == xcoord || NULL == nmap) { - fprintf(stderr, "malloc failed for data\n"); -- exit(1); -+ return 1; - } - ycoord = xcoord + num_coord; - zcoord = ycoord + num_coord; -diff -up cgnslib_2.5/tests/write_test.c.exit cgnslib_2.5/tests/write_test.c ---- cgnslib_2.5/tests/write_test.c.exit 2011-02-27 12:19:51.497837996 +0530 -+++ cgnslib_2.5/tests/write_test.c 2011-02-27 12:21:17.861838016 +0530 -@@ -57,7 +57,7 @@ void write_mixed(), write_mismatched(); - void error_exit (char *where) - { - fprintf (stderr, "ERROR:%s:%s\n", where, cg_get_error()); -- exit (1); -+ return 1; - } - - int main () -@@ -83,7 +83,7 @@ void init_data() - xcoord = (float *) malloc (6 * num_coord * sizeof(float)); - if (NULL == xcoord) { - fprintf(stderr, "malloc failed for coordinates\n"); -- exit(1); -+ return 1; - } - ycoord = xcoord + 2 * num_coord; - zcoord = ycoord + 2 * num_coord; -@@ -103,7 +103,7 @@ void init_data() - solution = (float *) malloc (max_sol * sizeof(float)); - if (NULL == solution) { - fprintf(stderr, "malloc failed for solution\n"); -- exit(1); -+ return 1; - } - for (n = 0; n < max_sol; n++) - solution[n] = (float)(n + 1); -@@ -114,7 +114,7 @@ void init_data() - elements = (int *) malloc (8 * num_element * sizeof(int)); - if (NULL == elements) { - fprintf(stderr, "malloc failed for elements"); -- exit(1); -+ return 1; - } - for (n = 0, k = 1; k < NUM_SIDE; k++) { - for (j = 1; j < NUM_SIDE; j++) { -@@ -140,7 +140,7 @@ void init_data() - parent = (int *) malloc (4 * num_face * sizeof(int)); - if (NULL == faces || NULL == parent) { - fprintf(stderr, "malloc failed for elements"); -- exit(1); -+ return 1; - } - for (n = 0; n < 4*num_face; n++) - parent[n] = 0; -@@ -231,7 +231,7 @@ void init_data() - pts = (int *) malloc (12 * npts * sizeof(int)); - if (NULL == pts) { - fprintf(stderr, "malloc failed for connectivity points"); -- exit(1); -+ return 1; - } - d_pts = pts + 6 * npts; - -@@ -240,7 +240,7 @@ void init_data() - interp = (float *) malloc (6 * npts * sizeof(float)); - if (NULL == interp) { - fprintf(stderr, "malloc failed for interpolate array"); -- exit(1); -+ return 1; - } - } - -diff -up cgnslib_2.5/tools/cgnscheck.c.exit cgnslib_2.5/tools/cgnscheck.c ---- cgnslib_2.5/tools/cgnscheck.c.exit 2011-02-27 12:21:37.497838028 +0530 -+++ cgnslib_2.5/tools/cgnscheck.c 2011-02-27 12:26:46.501837845 +0530 -@@ -157,7 +157,7 @@ static void error_exit(char *func) - if (func != NULL && *func) - printf("%s:", func); - printf("%s\n", cg_get_error()); -- exit(1); -+ return 1; - } - - /*----------------------------------------------------------------------*/ -@@ -173,7 +173,7 @@ static void create_names (int cnt, int * - names = (CGNSNAME *) malloc (cnt * sizeof(CGNSNAME)); - if (names == NULL) { - fprintf (stderr, "malloc failed for cgns name list\n"); -- exit (1); -+ return 1; - } - *maxcnt = cnt; - *namelist = names; -@@ -242,7 +242,7 @@ static void go_absolute (char *dsname, . - num = va_arg (arg, int); - if (goDepth == MAX_GOTO_DEPTH) { - fprintf (stderr, "maximum depth of goto exceeded\n"); -- exit (1); -+ return 1; - } - strncpy (goLabel[goDepth], name, 32); - goLabel[goDepth][32] = 0; -@@ -273,7 +273,7 @@ static void go_relative (char *dsname, . - else if (strcmp (name, ".")) { - if (goDepth == MAX_GOTO_DEPTH) { - fprintf (stderr, "maximum depth of goto exceeded\n"); -- exit (1); -+ return 1; - } - strncpy (goLabel[goDepth], name, 32); - goLabel[goDepth][32] = 0; -@@ -356,7 +356,7 @@ static char *temporary_file (void) - strcpy (temp, "cgnsXXXXXX"); - if (mktemp (temp) == NULL) { - fprintf (stderr, "failed to create temporary filename\n"); -- exit (1); -+ return 1; - } - return temp; - } -@@ -370,12 +370,12 @@ static void copy_file (char *oldfile, ch - - if (NULL == (oldfp = fopen (oldfile, "rb"))) { - fprintf (stderr, "error opening input file for reading\n"); -- exit (1); -+ return 1; - } - if (NULL == (newfp = fopen (newfile, "w+b"))) { - fclose (oldfp); - fprintf (stderr, "error opening output file for writing\n"); -- exit (1); -+ return 1; - } - while (EOF != (c = getc (oldfp))) - putc (c, newfp); -@@ -424,7 +424,7 @@ static char *update_version (char *cgnsf - unlink (outfile); - if (rename (tempfile, outfile)) { - fprintf (stderr, "rename %s -> %s failed\n", tempfile, outfile); -- exit (1); -+ return 1; - } - return outfile; - } -@@ -660,7 +660,7 @@ static void read_zone (int nz) - z->sets = (ELEMSET *) malloc (nsets * sizeof(ELEMSET)); - if (NULL == z->sets) { - fprintf (stderr, "malloc failed for element sets\n"); -- exit (1); -+ return 1; - } - - /* read element sets */ -@@ -678,14 +678,14 @@ static void read_zone (int nz) - es->elements = (int *) malloc (nn * sizeof(int)); - if (NULL == es->elements) { - fprintf (stderr, "malloc failed for elements\n"); -- exit (1); -+ return 1; - } - es->parent = NULL; - if (hasparent) { - es->parent = (int *) malloc (4 * nelem * sizeof(int)); - if (NULL == es->parent) { - fprintf (stderr, "malloc failed for elemset parent data\n"); -- exit (1); -+ return 1; - } - } - if (cg_elements_read (cgnsfn, cgnsbase, nz, ns, es->elements, -@@ -792,7 +792,7 @@ static void read_zone (int nz) - z->faces = HashCreate (nn, compare_faces, hash_face); - if (z->faces == NULL) { - fprintf (stderr, "malloc failed for face hash table\n"); -- exit (1); -+ return 1; - } - - for (es = z->sets, ns = 0; ns < nsets; ns++, es++) { -@@ -839,7 +839,7 @@ static void read_zone (int nz) - pf = (FACE *) malloc (sizeof(FACE)); - if (NULL == pf) { - fprintf (stderr, "malloc failed for new face\n"); -- exit (1); -+ return 1; - } - pf->e1 = es->is + ne; - pf->f1 = j + 1; -@@ -869,7 +869,7 @@ static void read_zone (int nz) - nodes = (int *) calloc (maxnode, sizeof(int)); - if (nodes == NULL) { - fprintf (stderr, "malloc failed for zone nodes\n"); -- exit (1); -+ return 1; - } - HashList (z->faces, get_extnodes, nodes); - for (nn = 0, n = 0; n < z->nnodes; n++) { -@@ -879,7 +879,7 @@ static void read_zone (int nz) - z->extnodes = (int *) malloc (nn * sizeof(int)); - if (z->extnodes == NULL) { - fprintf (stderr, "malloc failed for zone exterior nodes\n"); -- exit (1); -+ return 1; - } - for (nn = 0, n = 0; n < z->nnodes; n++) { - if (nodes[n]) z->extnodes[nn++] = n + 1; -@@ -1081,7 +1081,7 @@ static int read_exponents (float exps[9] - } - else { - fprintf (stderr, "invalid data type for exponents\n"); -- exit (1); -+ return 1; - } - if (ierr) { - if (ierr != CG_NODE_NOT_FOUND) -@@ -1908,7 +1908,7 @@ static void check_coordinates (int ng) - } - if (NULL == (coord = (float *) malloc (np * sizeof(float)))) { - fprintf (stderr, "malloc failed for %d coordinate values\n", np); -- exit (1); -+ return 1; - } - if (z->maxnode < np) z->maxnode = np; - -@@ -2295,7 +2295,7 @@ static int check_interface (ZONE *z, Poi - p = (int *) malloc (np * z->idim * sizeof(int)); - if (p == NULL) { - fprintf (stderr, "malloc failed for point/element list\n"); -- exit (1); -+ return 1; - } - n = 0; - if (z->idim == 1) { -@@ -2509,7 +2509,7 @@ static void check_BCdata (BCType_t bctyp - pts = (int *) malloc (z->idim * npnts * sizeof(int)); - if (NULL == pts) { - fprintf (stderr, "malloc failed for BCDataSet points\n"); -- exit (1); -+ return 1; - } - if (cg_ptset_read (pts)) error_exit("cg_ptset_read"); - if (ptype == PointRange || ptype == ElementRange) { -@@ -2685,7 +2685,7 @@ static void check_BC (int nb, int parcla - pts = (int *) malloc (z->idim * npts * sizeof(int)); - if (NULL == pts) { - fprintf (stderr, "malloc failed for BC points\n"); -- exit (1); -+ return 1; - } - nrmllist = NULL; - if (nrmlflag && LibraryVersion < 2200) { -@@ -2693,7 +2693,7 @@ static void check_BC (int nb, int parcla - nrmllist = (void *) malloc (nrmlflag * n); - if (nrmllist == NULL) { - fprintf (stderr, "malloc failed for BC normals\n"); -- exit (1); -+ return 1; - } - } - if (cg_boco_read (cgnsfn, cgnsbase, cgnszone, nb, pts, nrmllist)) -@@ -3314,7 +3314,7 @@ static void check_conn (int nc) - dpts = (int *) malloc (dnpts * dz->idim * sizeof(int)); - if (NULL == pts || NULL == dpts) { - fprintf (stderr, "malloc failed for connectivity points\n"); -- exit (1); -+ return 1; - } - if (cg_conn_read (cgnsfn, cgnsbase, cgnszone, nc, pts, Integer, dpts)) - error_exit("cg_conn_read"); -@@ -3476,7 +3476,7 @@ static void check_hole (int nh) - int *pnts = (int *) malloc (np * z->idim * sizeof(int)); - if (pnts == NULL) { - fprintf (stderr, "malloc failed for hole data\n"); -- exit (1); -+ return 1; - } - if (cg_hole_read (cgnsfn, cgnsbase, cgnszone, nh, pnts)) - error_exit("cg_hole_read"); -@@ -3790,7 +3790,7 @@ static void check_zone_iter (void) - desc = (char *) malloc (size); - if (desc == NULL) { - fprintf (stderr, "malloc failed for zone iter data\n"); -- exit (1); -+ return 1; - } - if (cg_array_read (n, desc)) error_exit("cg_array_read"); - ierr = 0; -@@ -4637,7 +4637,7 @@ static void check_base_iter (void) - icnt = (int *) malloc (NumSteps * sizeof(int)); - if (icnt == NULL) { - fprintf (stderr, "malloc failed for number of families\n"); -- exit (1); -+ return (1); - } - if (cg_array_read (nnf, icnt)) error_exit("cg_array_read"); - for (ns = 0; ns < NumSteps; ns++) { -@@ -4667,7 +4667,7 @@ static void check_base_iter (void) - desc = (char *) malloc (32 * nmax * NumSteps * sizeof(char)); - if (NULL == desc) { - fprintf (stderr, "malloc failed for family pointers\n"); -- exit (1); -+ return 1; - } - if (cg_array_read (nfp, desc)) error_exit("cg_array_read"); - for (ierr = 0, n = 0, ns = 0; ns < NumSteps; ns++) { -@@ -4717,7 +4717,7 @@ static void check_base_iter (void) - icnt = (int *) malloc (NumSteps * sizeof(int)); - if (icnt == NULL) { - fprintf (stderr, "malloc failed for number of zones\n"); -- exit (1); -+ return 1; - } - if (cg_array_read (nnz, icnt)) error_exit("cg_array_read"); - for (ns = 0; ns < NumSteps; ns++) { -@@ -4747,7 +4747,7 @@ static void check_base_iter (void) - desc = (char *) malloc (32 * nmax * NumSteps * sizeof(char)); - if (NULL == desc) { - fprintf (stderr, "malloc failed for zone pointers\n"); -- exit (1); -+ return 1; - } - if (cg_array_read (nzp, desc)) error_exit("cg_array_read"); - for (ierr = 0, n = 0, ns = 0; ns < NumSteps; ns++) { -@@ -4830,7 +4830,7 @@ static void check_base (void) - Zones = (ZONE *) malloc (NumZones * sizeof(ZONE)); - if (NULL == Zones) { - fprintf (stderr, "malloc failed for zones\n"); -- exit (1); -+ return 1; - } - MaxZones = NumZones; - } -@@ -5055,7 +5055,7 @@ int main (int argc, char *argv[]) - char *newfile = argind < argc ? argv[argind] : NULL; - cgnsfile = update_version (cgnsfile, newfile); - if (update == 'U') -- exit (0); -+ return 0; - } - - printf ("reading CGNS file %s\n", cgnsfile); -diff -up cgnslib_2.5/tools/cgnsdiff.c.exit cgnslib_2.5/tools/cgnsdiff.c ---- cgnslib_2.5/tools/cgnsdiff.c.exit 2011-02-27 12:27:28.312837991 +0530 -+++ cgnslib_2.5/tools/cgnsdiff.c 2011-02-27 12:28:18.609838002 +0530 -@@ -50,7 +50,7 @@ static void err_exit (char *msg, char *n - fprintf (stderr, "%s:", name); - fprintf (stderr, "%s\n", errmsg); - } -- exit (1); -+ return 1; - } - - static size_t data_size (char *type, int ndim, int *dims, int *size) -@@ -200,12 +200,12 @@ static void compare_data (char *name1, d - data1 = malloc (bytes); - if (data1 == NULL) { - fprintf (stderr, "%s:malloc failed for node data\n", name1); -- exit (1); -+ return 1; - } - data2 = malloc (bytes); - if (data2 == NULL) { - fprintf (stderr, "%s:malloc failed for node data\n", name2); -- exit (1); -+ return 1; - } - ADF_Read_All_Data (id1, data1, &err); - if (err > 0) -@@ -318,7 +318,7 @@ static void compare_nodes (char *name1, - children1 = (char *) malloc (33 * nc1); - if (children1 == NULL) { - fprintf (stderr, "%s:malloc failed for children names\n", name1); -- exit (1); -+ return 1; - } - ADF_Children_Names (id1, 1, nc1, 32, &nret, children1, &err); - if (err > 0) -@@ -334,7 +334,7 @@ static void compare_nodes (char *name1, - children2 = (char *) malloc (33 * nc2); - if (children2 == NULL) { - fprintf (stderr, "%s:malloc failed for children names\n", name2); -- exit (1); -+ return 1; - } - ADF_Children_Names (id2, 1, nc2, 32, &nret, children2, &err); - if (err > 0) -diff -up cgnslib_2.5/tools/cgnslist.c.exit cgnslib_2.5/tools/cgnslist.c ---- cgnslib_2.5/tools/cgnslist.c.exit 2011-02-27 12:28:36.637838000 +0530 -+++ cgnslib_2.5/tools/cgnslist.c 2011-02-27 12:29:10.814837992 +0530 -@@ -35,7 +35,7 @@ static void err_exit (char *name, int er - fflush (stdout); - ADF_Error_Message (errcode, errmsg); - fprintf (stderr, "error in %s:%s\n", name, errmsg); -- exit (1); -+ return 1; - } - - static void print_node (double node_id) -@@ -108,7 +108,7 @@ static void print_children (double paren - - if (leader_len + indent > MAX_LEADER) { - fprintf (stderr, "nesting is too deep\n"); -- exit (1); -+ return 1; - } - leader_len += indent; - for (nc = 0; nc < indent; nc++) -@@ -178,7 +178,7 @@ int main (int argc, char *argv[]) - indent = atoi (argarg); - if (indent < 1) { - fprintf (stderr, "indent must be > 0\n"); -- exit (1); -+ return 1; - } - break; - case 'f': -@@ -240,7 +240,7 @@ int main (int argc, char *argv[]) - ADF_Database_Close (root_id, &err); - if (err > 0) - err_exit ("ADF_Database_Close", err); -- exit (0); -+ - return 0; /* prevent compiler warning */ - } - -diff -up cgnslib_2.5/tools/cgnspack.c.exit cgnslib_2.5/tools/cgnspack.c ---- cgnslib_2.5/tools/cgnspack.c.exit 2011-02-27 12:29:37.108838039 +0530 -+++ cgnslib_2.5/tools/cgnspack.c 2011-02-27 12:30:25.830837897 +0530 -@@ -24,12 +24,12 @@ int main (int argc, char **argv) - - if (argc < 2 || argc > 3) { - fprintf (stderr, "usage: cgnspack CGNSfile [newCGNSfile]\n"); -- exit (1); -+ return 1; - } - inpfile = argv[1]; - if (stat (inpfile, &inpst)) { - fprintf (stderr, "can't stat %s\n", inpfile); -- exit (1); -+ return 1; - } - - if (argc == 3) -@@ -38,7 +38,7 @@ int main (int argc, char **argv) - outfile = (char *) malloc (strlen(inpfile) + 6); - if (NULL == outfile) { - fprintf (stderr, "malloc failed for temporary filename\n"); -- exit (1); -+ return 1; - } - sprintf (outfile, "%s.temp", inpfile); - } -@@ -48,13 +48,13 @@ int main (int argc, char **argv) - if (ierr > 0) { - ADF_Error_Message (ierr, errmsg); - fprintf (stderr, "ADF_Database_Open ERROR : %s\n", errmsg); -- exit (1); -+ return 1; - } - ADF_Database_Open (outfile, "NEW", "NATIVE", &outid, &ierr); - if (ierr > 0) { - ADF_Error_Message (ierr, errmsg); - fprintf (stderr, "ADF_Database_Open ERROR : %s\n", errmsg); -- exit (1); -+ return 1; - } - - ts = time (NULL); -@@ -65,7 +65,7 @@ int main (int argc, char **argv) - if (ierr > 0) { - ADF_Error_Message (ierr, errmsg); - fprintf (stderr, "ADF_Database_Close ERROR : %s\n", errmsg); -- exit (1); -+ return 1; - } - - /* output database closed in adf_cond() */ -@@ -74,14 +74,14 @@ int main (int argc, char **argv) - unlink (inpfile); - if (rename (outfile, inpfile)) { - fprintf (stderr, "rename %s -> %s failed", outfile, inpfile); -- exit (1); -+ return 1; - } - outfile = inpfile; - } - - if (stat (outfile, &outst)) { - fprintf (stderr, "can't stat %s\n", outfile); -- exit (1); -+ return 1; - } - - printf ("initial size = %ld bytes\n", (long)inpst.st_size); -diff -up cgnslib_2.5/tools/cgnsversion.c.exit cgnslib_2.5/tools/cgnsversion.c ---- cgnslib_2.5/tools/cgnsversion.c.exit 2011-02-27 12:30:43.097837993 +0530 -+++ cgnslib_2.5/tools/cgnsversion.c 2011-02-27 12:32:01.200838305 +0530 -@@ -100,7 +100,7 @@ static void error_exit (char *msg, int e - if (inproot >= 0.0) ADF_Database_Close (inproot, &ierr); - if (outroot >= 0.0) ADF_Database_Close (outroot, &ierr); - if (outfile != NULL) unlink (outfile); -- exit (1); -+ return 1; - } - - /*--------------------------------------------------------------------*/ -@@ -1082,7 +1082,7 @@ int main (int argc, char **argv) - if (FileVersion < 1200) { - fprintf (stderr, - "ADF incompatibilities do not allow versions prior to 1.2\n"); -- exit (1); -+ return 1; - } - - for (n = 0; n < nVersions; n++) { -@@ -1096,13 +1096,13 @@ int main (int argc, char **argv) - fprintf (stderr, ", %g", 0.001 * (float)VersionList[n]); - } - fprintf (stderr, " or %g\n", 0.001 * (float)LibraryVersion); -- exit (1); -+ return 1; - } - - inpfile = argv[argind++]; - if (access (inpfile, 0)) { - fprintf (stderr, "input file \"%s\" not found\n", inpfile); -- exit (1); -+ return 1; - } - - /* read the input file using the CGNS routines in order to -@@ -1118,13 +1118,13 @@ int main (int argc, char **argv) - cg_close (inpfn); - fprintf (stderr, - "file version is more recent than then CGNS library version\n"); -- exit (1); -+ return 1; - } - if (FileVersion == FromVersion) { - cg_close (inpfn); - fprintf (stderr, "file version is already at version %g\n", - FloatVersion); -- exit (1); -+ return 1; - } - - printf ("converting \"%s\" from version %g to %g\n", -@@ -1144,7 +1144,7 @@ int main (int argc, char **argv) - if (outfile == NULL) { - cg_close (inpfn); - fprintf (stderr, "failed to create a temporary file\n"); -- exit (1); -+ return 1; - } - printf ("writing output to temporary file \"%s\"\n", outfile); - -@@ -1173,7 +1173,7 @@ int main (int argc, char **argv) - unlink (inpfile); - if (rename (outfile, inpfile)) { - fprintf (stderr, "rename %s -> %s failed", outfile, inpfile); -- exit (1); -+ return 1; - } - - return 0; -diff -up cgnslib_2.5/tools/getargs.c.exit cgnslib_2.5/tools/getargs.c ---- cgnslib_2.5/tools/getargs.c.exit 2011-02-27 12:32:19.764837995 +0530 -+++ cgnslib_2.5/tools/getargs.c 2011-02-27 12:32:41.894837916 +0530 -@@ -22,7 +22,7 @@ char **usgmsg, *errmsg; - fprintf (stderr, "ERROR: %s\n", errmsg); - for (n = 0; NULL != usgmsg[n]; n++) - fprintf (stderr, "%s\n", usgmsg[n]); -- exit (NULL != errmsg); -+ return (NULL != errmsg); - } - - /*---------- getargs --------------------------------------------------- -@@ -80,7 +80,7 @@ char **argv, *ostr; - (oli = strchr (ostr, argopt)) == NULL) { - if (argerr) { - fprintf (stderr, "invalid option - `%c'\n", argopt); -- exit (-1); -+ return -1; - } - return (argopt); - } -@@ -106,7 +106,7 @@ char **argv, *ostr; - if (++argind >= argc) { - if (!argerr) return (':'); - fprintf (stderr, "missing argument for option `%c'\n", argopt); -- exit (1); -+ return 1; - } - place = argv[argind]; - } diff --git a/cgnslib.spec b/cgnslib.spec index 77d2b9c..4a3362a 100644 --- a/cgnslib.spec +++ b/cgnslib.spec @@ -2,18 +2,16 @@ %global debug_package %{nil} Name: cgnslib -Version: 2.5 -Release: 6.r2%{?dist} +Version: 3.1 +Release: 3.r4%{?dist} Summary: Computational Fluid Dynamics General Notation System Group: Development/Libraries License: zlib URL: http://www.cgns.org/ -Source: http://downloads.sourceforge.net/project/cgns/%{name}_%{version}/Release%204/%{name}_%{version}-5.tar.gz -Source1: http://www.grc.nasa.gov/WWW/cgns/user/usersguide.pdf -Patch0: cgnslib-2.5-4-set-so.patch -Patch1: cgnslib-2.5-5-replace-exit-to-return.patch +Source: http://sourceforge.net/projects/cgns/files/%{name}_%{version}/%{name}_%{version}.3-4.tar.gz +Source1: http://www.grc.nasa.gov/WWW/cgns/CGNS_docs_current/user/usersguide.pdf BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -21,7 +19,8 @@ BuildRequires: hdf5-devel >= 1.8 BuildRequires: zlib-devel BuildRequires: gcc-gfortran BuildRequires: chrpath -Requires: hdf5 +BuildRequires: cmake +Requires: hdf5 = %{_hdf5_version} %description The Computational Fluid Dynamics General Notation System (CGNS) provides @@ -44,53 +43,23 @@ The %{name}-devel package contains the header files for %{name} package. %prep -%setup -q -n %{name}_%{version} -%patch0 -p1 -b .so -%patch1 -p1 -b .exit +%setup -q -n %{name}_%{version}.3 -%{__sed} -i -e "s|LIBDIR.*= @LIBDIR@|LIBDIR = \$(DESTDIR)@LIBDIR@|" \ - -e "s|INCLUDEDIR.*= @INCLUDEDIR@|INCLUDEDIR = \$(DESTDIR)@INCLUDEDIR@|" \ - make.defs.in - -%{__sed} -i "s|dbtest|./dbtest|" tests/rundbtest +sed -i "s|\${CMAKE_INSTALL_PREFIX}/lib|\${CMAKE_INSTALL_PREFIX}/\${LIB_INSTALL_DIR}|" CMakeLists.txt +sed -i "s|DESTINATION lib|DESTINATION \${LIB_INSTALL_DIR}|" src/CMakeLists.txt -%{__cp} %{SOURCE1} %{_builddir}/%{name}_%{version} +%{__cp} %{SOURCE1} %{_builddir}/%{name}_%{version}.3 %build -%configure --enable-gcc \ - --enable-shared \ - --enable-lfs \ - --with-zlib \ -%ifarch x86_64 ppc64 sparc64 - --enable-64bit \ -%endif - --with-hdf5 - +%cmake . -DCMAKE_SKIP_RPATH:BOOL=YES %{__make} %{?_smp_mflags} %install -%{__rm} -rf %{buildroot} -%{__mkdir} -p %{buildroot}%{_libdir} -%{__mkdir} -p %{buildroot}%{_includedir} -%{__mkdir} -p %{buildroot}%{_docdir} -%{__make} INSTALL="install -p" install DESTDIR=%{buildroot} - -chrpath --delete %{buildroot}%{_libdir}/libcgns.so.1.0 -chmod 0755 %{buildroot}%{_libdir}/libcgns.so.1.0 - - -%ifarch x86_64 ppc64 sparc64 -%{__cp} -pP LINUX64/libcgns.so %{buildroot}%{_libdir} -%else -%{__cp} -pP LINUX/libcgns.so %{buildroot}%{_libdir} -%endif +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT - -%check -cd tests -%{__make} -./rundbtest +find $RPM_BUILD_ROOT -name libcgns.a -exec rm -f {} \; %post -p /sbin/ldconfig @@ -101,18 +70,38 @@ cd tests %files %defattr(-,root,root,-) -%doc LICENSE README -%{_libdir}/libcgns.so.1.0 +%doc readme.lyx +%{_bindir}/cgnames +%{_bindir}/cgnscheck +%{_bindir}/cgnsconvert +%{_bindir}/cgnsdiff +%{_bindir}/cgnslist +%{_bindir}/cgnsupdate +%{_bindir}/cgnsversion +%{_libdir}/libcgns.so.3.1 %files devel %defattr(-,root,root,-) %doc usersguide.pdf +%{_includedir}/cgns_io.h %{_includedir}/cgnslib.h %{_includedir}/cgnslib_f.h +%{_includedir}/cgnstypes.h +%{_includedir}/cgnstypes_f.h %{_includedir}/cgnswin_f.h %{_libdir}/libcgns.so %changelog +* Wed Aug 15 2012 Shakthi Kannan 3.1-3.r4 +- Updated to 3.1.3-4 + +* Wed Jul 18 2012 Fedora Release Engineering - 2.5-8.r2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue May 15 2012 Orion Poplawski - 2.5-7.rc2 +- Rebuild for hdf5 +- Explicitly require version of hdf5 built with + * Thu Jan 12 2012 Fedora Release Engineering - 2.5-6.r2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild diff --git a/sources b/sources index 723798e..be145bc 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -ae2a2e79b99d41c63e5ed5f661f70fd9 cgnslib_2.5-5.tar.gz -453788d1d9f7f383f76fde08c022a9a6 usersguide.pdf +442bba32b576f3429cbd086af43fd4ae cgnslib_3.1.3-4.tar.gz +abe3915398bcd0f8d46a77aa14aa01de usersguide.pdf