From 4da847808136d28ad11e583f6e53e1de412576b5 Mon Sep 17 00:00:00 2001
From: Douglas Guptill <douglas.guptill@dal.ca>
Date: Sun, 31 May 2009 23:09:45 +0000
Subject: [PATCH] updates from p690

---
 Makefile       |  9 ++++-----
 Makefile.p690  | 21 +++++++++++----------
 NN/Makefile    | 33 +++++++++++++++++----------------
 NN/stack.c     | 10 +++++-----
 NN/stackpair.c | 10 +++++-----
 NN/volume.c    | 12 ++++++------
 flush.f        |  2 +-
 7 files changed, 49 insertions(+), 48 deletions(-)

diff --git a/Makefile b/Makefile
index 47a44265..fb40290f 100644
--- a/Makefile
+++ b/Makefile
@@ -43,6 +43,7 @@ do_leaf_measurements.o \
 embed_surface_in_octree.o \
 erosion.o \
 find_void_nodes.o \
+flush.o \
 heap.o \
 improve_osolve.o\
 initialize_temperature.o \
@@ -72,15 +73,13 @@ wsmp_setup.o\
 DOUAR.o \
 write_global_output.o vrm.o
 
-# Don't need this if we use -qextname
-# flush.o \
-
 
 all: $(BIN)
 $(BIN): subdirs $(OBJECTS)
+	echo "$(F90) $(FFLAGS) $(OPTIONS) $(OBJECTS) $(LIBS) -o $(BIN)" \
+ 1>$(BIN).link.stdout 2>$(BIN).link.stderr
 	$(F90) $(FFLAGS) $(OPTIONS) $(OBJECTS) $(LIBS) -o $(BIN) \
-1>$(BIN).link.stdout \
-2>$(BIN).link.stderr
+ 1>>$(BIN).link.stdout 2>>$(BIN).link.stderr
 	echo "--"
 	echo "compiler output...."
 	more $(COMPILE_OUT)
diff --git a/Makefile.p690 b/Makefile.p690
index dad0ed4b..38aada11 100644
--- a/Makefile.p690
+++ b/Makefile.p690
@@ -19,9 +19,9 @@ FLG64=
 
 # for 64 bit compile..................................
 #
-AR=ar -X 64
+AR =ar -X 64
 BITS=-q64
-OPTIONS = -b 64 -bmaxdata:0x80000000 -bhalt:0 -bnoquiet
+OPTIONS = -b64 -bmaxdata:0x80000000 -bhalt:0 -bnoquiet
 PGPLOT = /home/beaumnt1/software/pgplot-5.2.2-q64
 WSMP_LIB = -L$(WSMP_DIR) -lpwsmp64
 FLG64=-b64
@@ -44,7 +44,7 @@ FLG64=-b64
 # take -qextchk out for the final compile
 FFLAGS  = -g -O2 -qstrict -Q $(BITS) $(FLG64) -qarch=auto -qtune=auto \
 -qmaxmem=-1 \
--qcheck -qwarn64 -qextname \
+-qcheck -qwarn64  \
 -qfloat=nomaf:nofold:norsqrt:strictnmaf \
 -qflttrap=overflow:underflow:zerodivide:invalid:NANQ:enable \
 -qsigtrap \
@@ -90,13 +90,14 @@ COMPILE_OUT=$(NAME)$(BITS).compile
 # -lpthread 
 
 LIBS = \
--LOCTREE -lOctree$(BITS) \
--LCASCADE -lcascade$(BITS) \
--LRESAMPLE -lresample$(BITS) \
--LNN -lnn$(BITS) \
-$(WSMP_LIB) \
--L$(PGPLOT) -lpgplot \
--L/usr/lpp/X11 -lX11
+ -LOCTREE -lOctree$(BITS) \
+ -LNN -lnn_f$(BITS) \
+ -LNN -lnn_c$(BITS) \
+ -LCASCADE -lcascade$(BITS) \
+ -L$(PGPLOT) -lpgplot \
+ -L/usr/lpp/X11 -lX11 \
+ $(WSMP_LIB) \
+ -LRESAMPLE -lresample$(BITS)
 
 
 
diff --git a/NN/Makefile b/NN/Makefile
index 78897ae5..8a75ca85 100644
--- a/NN/Makefile
+++ b/NN/Makefile
@@ -1,29 +1,30 @@
 NAME=nn
 include ../Makefile.p690
-LIBFILE=lib$(NAME)$(BITS).a
+LIBFILE_f=lib$(NAME)_f$(BITS).a
+LIBFILE_c=lib$(NAME)_c$(BITS).a
 
-OBJECTS_NN = \
-delaun.o \
-del_sub.o \
-nn.o \
-nnplot.o \
-qhullf_dummy.o \
-stack.o \
-stackpair.o \
-volume.o
+OBJECTS_NN_f = delaun.o del_sub.o nn.o nnplot.o qhullf_dummy.o
+OBJECTS_NN_c = stack.o stackpair.o volume.o
 
-all: $(LIBFILE)
-$(LIBFILE): $(OBJECTS_NN)
-	$(AR) -rv $(LIBFILE) $(OBJECTS_NN) >$(LIBFILE).ar
+all: $(LIBFILE_f) $(LIBFILE_c)
+$(LIBFILE_f): $(OBJECTS_NN_f)
+	$(AR) -rv $(LIBFILE_f) $(OBJECTS_NN_f) >$(LIBFILE_f).ar
+	mv -f $(COMPILE_OUT) $(COMPILE_OUT)_f
 	echo "--"
 	echo "compiler output...."
-	more $(COMPILE_OUT)
+	more $(COMPILE_OUT)_f
+$(LIBFILE_c): $(OBJECTS_NN_c)
+	$(AR) -rv $(LIBFILE_c) $(OBJECTS_NN_c) >$(LIBFILE_c).ar
+	mv -f $(COMPILE_OUT) $(COMPILE_OUT)_c
+	echo "--"
+	echo "compiler output...."
+	more $(COMPILE_OUT)_c
 
 .PHONY: objclean
 objclean:
-	rm -f *.o $(COMPILE_OUT)
+	rm -f *.o $(COMPILE_OUT)_f $(COMPILE_OUT)_c
 
 .PHONY: clean
 clean: objclean
-	rm -f $(LIBFILE)
+	rm -f $(LIBFILE_f) $(LIBFILE_c)
 
diff --git a/NN/stack.c b/NN/stack.c
index f5f2ba2b..498e33da 100644
--- a/NN/stack.c
+++ b/NN/stack.c
@@ -5,7 +5,7 @@
 	static struct node *head, *z, *t;
 
 /*        stackinit_() {stackinit();} */
-	stackinit() 
+        void stackinit() 
 	   {
 	     head = (struct node *) malloc(sizeof *head);
 	     z = (struct node *) malloc(sizeof *z);
@@ -15,7 +15,7 @@
 	   }
 
 /*        push_(p) int *p; {push(p);} */
-	push(p)
+	void push(p)
            int *p;
 	   {
 	     int v;
@@ -26,7 +26,7 @@
 	   }
 
 /*        pop_(x) int *x; {pop(x);} */
-	pop(x)
+	void pop(x)
            int *x;
 	   {
 	     t = head->next; head->next = t->next;
@@ -35,7 +35,7 @@
 	   }
 
 /*        stackempty_(i) int *i; {stackempty(i);} */
-	stackempty(i)
+	void stackempty(i)
           int *i;
 	  { 
 	    *i = 0;
@@ -43,7 +43,7 @@
           }
 
 /*        stackflush_() {stackflush();} */
-        stackflush()
+        void stackflush()
            {
              free(head);
              free(z);
diff --git a/NN/stackpair.c b/NN/stackpair.c
index 600c89d3..4fcc910d 100644
--- a/NN/stackpair.c
+++ b/NN/stackpair.c
@@ -6,7 +6,7 @@
 	static struct node *headb, *zb, *tb;
 
 /*        stackpairinit_() {stackpairinit();} */
-	stackpairinit () 
+	void stackpairinit () 
 	   {
 	     heada = (struct node *) malloc(sizeof *heada);
 	     za = (struct node *) malloc(sizeof *za);
@@ -22,7 +22,7 @@
 	   }
 
 /*        stackpairflush_() {stackpairflush();} */
-	stackpairflush () 
+	void stackpairflush () 
 	   {
              free(heada);
              free(headb);
@@ -31,7 +31,7 @@
 	   }
 
 /*        pushpair_(pa, pb)  int *pa; int *pb; {pushpair(pa, pb);} */
-	pushpair (pa, pb)
+	void pushpair (pa, pb)
              int *pa;
              int *pb;
 	   {
@@ -49,7 +49,7 @@
 	   }
 
 /*        poppair_(xa,xb)  int *xa; int *xb; {poppair(xa,xb);} */
-	poppair (xa,xb)
+	void poppair (xa,xb)
              int *xa;
              int *xb;
 	   {
@@ -62,7 +62,7 @@
 	   }
 
 /*        stackpairempty_(i) int *i; {stackpairempty(i);} */
-	stackpairempty (i)
+	void stackpairempty (i)
             int *i;
 	  { 
 	    *i = 0;
diff --git a/NN/volume.c b/NN/volume.c
index 1a0d09e8..79a606b3 100644
--- a/NN/volume.c
+++ b/NN/volume.c
@@ -224,7 +224,7 @@ volume_(a,b,m,n,mmax,nmax,result)
   volume (a,b,m,n,mmax,nmax,result);
 }
 
-volume (a,b,m,n,mmax,nmax,result)
+void volume (a,b,m,n,mmax,nmax,result)
      int   *n, *m, *mmax, *nmax;
      float *a, *b;
      float *result; 
@@ -442,7 +442,7 @@ volumeb_ (a,b,m,n,mmax,nmax,opt,volume,dvdb)
   volumeb(a,b,m,n,mmax,nmax,opt,volume,dvdb);
 }
 
-volumeb (a,b,m,n,mmax,nmax,opt,volume,dvdb)
+void volumeb (a,b,m,n,mmax,nmax,opt,volume,dvdb)
 
 int   *n, *m, *mmax, *nmax, *opt;
 float *a, *b;
@@ -677,7 +677,7 @@ volumebj_ (a,b,m,n,mmax,nmax,con,volume,dvdb)
   volumebj(a,b,m,n,mmax,nmax,con,volume,dvdb);
 }
 
-volumebj (a,b,m,n,mmax,nmax,con,volume,dvdb)
+void volumebj (a,b,m,n,mmax,nmax,con,volume,dvdb)
 
 int   *n, *m, *mmax, *nmax,*con;
 float *a, *b;
@@ -1055,7 +1055,7 @@ dvda_ (a,b,m,n,mmax,nmax,idim,result,code)
   dvda(a,b,m,n,mmax,nmax,idim,result,code);
 }
 
-dvda (a,b,m,n,mmax,nmax,idim,result,code)
+void dvda (a,b,m,n,mmax,nmax,idim,result,code)
 
 int   *n, *m, *mmax, *nmax, *idim, *code;
 float *a, *b;
@@ -1258,7 +1258,7 @@ volumef_ (a,b,m,n,mmax,nmax,volume)
   volumef(a,b,m,n,mmax,nmax,volume);
 }
 
-volumef (a,b,m,n,mmax,nmax,volume)
+void volumef (a,b,m,n,mmax,nmax,volume)
 
 int   *n, *m, *mmax, *nmax;
 float *a, *b;
@@ -1637,7 +1637,7 @@ dvdaf_ (a,b,m,n,mmax,nmax,idim,dvda,code)
   dvdaf(a,b,m,n,mmax,nmax,idim,dvda,code);
 }
 
-dvdaf (a,b,m,n,mmax,nmax,idim,dvda,code)
+void dvdaf (a,b,m,n,mmax,nmax,idim,dvda,code)
 
 int   *n, *m, *mmax, *nmax, *idim, *code;
 float *a, *b;
diff --git a/flush.f b/flush.f
index dce6c5d4..91b71979 100644
--- a/flush.f
+++ b/flush.f
@@ -7,7 +7,7 @@ c     Author: Douglas Guptill
 c     2009-05-23: new
 
       integer unit
-      call flush_(unit)
+c      call flush_(unit)
       return
       end
 
-- 
GitLab