From dcdb871374d9bb69863c9689abbbe26ecc352736 Mon Sep 17 00:00:00 2001
From: Dave Whipp <dwhipp@dal.ca>
Date: Tue, 8 Dec 2009 16:32:20 +0000
Subject: [PATCH] Code version with new isostasy boundary conditions

---
 Makefile.inc.mahone | 118 +++++++++++++++++++-------------------------
 1 file changed, 51 insertions(+), 67 deletions(-)

diff --git a/Makefile.inc.mahone b/Makefile.inc.mahone
index ba7696c7..c0c8eeb1 100644
--- a/Makefile.inc.mahone
+++ b/Makefile.inc.mahone
@@ -1,19 +1,46 @@
 # Define our compilers.................................
 #
-# The default - OpenMPI 1.2.7
-F90    = mpif90
-F77    = mpif77
-CC     = mpicc
-# wsmp wants mpich, so we try this
-# F90    = /usr/local/mpich.pgi.64/bin/mpif90
-# F77    = /usr/local/mpich.pgi.64/bin/mpif77
-# CC     = /usr/local/mpich.pgi.64/bin/mpicc
+# The default - OpenMPI
+MPI_HOME=/usr/local/openmpi
+F90    = $(MPI_HOME)/bin/mpif90
+F77    = $(MPI_HOME)/bin/mpif90
+CC     = $(MPI_HOME)/bin/mpicc
+
+AR=ar
+BITS=
+
+# Define FORTRAN compiler flags.......................
+#
+# For the PGI compiler
+F90FLAGS  = -O0 -Kieee -tp amd64
+F77FLAGS  = -O0 -Kieee -tp amd64
+#F90FLAGS  = -fast -Mipa=fast,inline -Kieee -tp amd64
+#F77FLAGS  = -fast -Mipa=fast,inline -Kieee -tp amd64
+#F90FLAGS  = -O2 -Kieee -tp amd64
+#F77FLAGS  = -O2 -Kieee -tp amd64
+
+# Define C compiler flags.............................
+#
+CFLAGS  = -O0 -I. -Kieee -tp amd64 
+#CFLAGS  = -fast -Mipa=fast,inline -Msmartalloc -I. -Kieee -tp amd64 
+#CFLAGS  = -O2 -I. -Kieee -tp amd64 
 
 # Libraries................
+SCALAPACK  = -L/usr/local/scalapack/lib -lscalapack
+
+# Blacs
+#
+BLACSCINIT = /usr/local/blacs/LIB/blacsCinit_MPI-LINUX-0.a
+BLACSFINIT = /usr/local/blacs/LIB/blacsF77init_MPI-LINUX-0.a
+BLACSL     = /usr/local/blacs/LIB/blacs_MPI-LINUX-0.a
+BLACSC = $(BLACSCINIT) $(BLACSL) $(BLACSCINIT)
+BLACSF = $(BLACSFINIT) $(BLACSL) $(BLACSFINIT)
+BLACS  = $(BLACSC) $(BLACSF)
+# MPI
 #
-# PGPLOT=/home/dguptill/software/pgplot-5.2.2
-# -L$(PGPLOT) -lpgplot \
-# -L/usr/X11R6/lib64 -lX11 \
+MPI    = -L$(MPI_HOME)/lib -lmpi
+
+WSMP   = /home/dwhipp/software/wsmp/WSMP-Linux64-OpenMPI
 
 LIBS = \
  -LOCTREE -lOctree$(BITS) \
@@ -21,71 +48,28 @@ LIBS = \
  -LNN -lnn_c$(BITS) \
  -LCASCADE -lcascade$(BITS) \
  -LRESAMPLE -lresample$(BITS) \
- $(WSMP_LIB) \
- -lpthread -lacml
+ -L$(WSMP) -lpwsmpOPT64 \
+  $(SCALAPACK) $(BLACS) -lacml $(MPI) -lpthread
 
 # The Makefiles look at compile output with this
-PAGER=less
-
-# wsmp lives here.
-#
-WSMP_DIR   = /home/dguptill/software/wsmp/wsmp-Linux/lib/X86_64/PGI
-
-# Miscellaneous things
-#
-AR=ar
-OPTIONS=
-WSMP_LIB=-L$(WSMP_DIR) -lpwsmp64
-
-# Define FORTRAN compiler flags.......................
-#
-# Initial guess at flags:
-# Using these, douar works much as it does on grace.
-FFLAGS=-fastsse -pc 64 -Kieee -tp amd64
-# These might be better
-FFLAGS=-gopt -O2 -fastsse -Kieee
-# Some debugging options; trying for a failure like on the p690
-# We get a consistent crash where make_cut calls itself.
-# "Error: floating point exception, integer divide by zero"
-FFLAGS=-gopt -O0 -Kieee -Ktrap=inv,divz,ovf -mcmodel=medium \
--Mnofprelaxed -Mbounds -Mchkstk -Mnofpapprox \
--Mchkptr -Mnoonetrip -Mrecursive
-# trying these; we get less information from the debugger.
-# FFLAGS=-O2 -fastsse -gopt -Kieee -Ktrap=inv,divz,ovf -mcmodel=medium -Mbounds
-
-#-traceback
-
-# Define C compiler flags.............................
-#
-# Initial guess at flags:
-# Using these, douar works much as it does on grace.
-CFLAGS=-fastsse -pc 64 -Kieee -tp amd64
-# These might be better
-CFLAGS=-fastsse -Kieee
-# Some debugging options; trying for a failure like on the p690
-CFLAGS=-gopt -O0 -Kieee -Ktrap=inv,divz,ovf -mcmodel=medium \
--Mnofprelaxed -Mbounds -Mchkstk -Mnofpapprox \
--Mzerotrip
-# CFLAGS=-O2 -fastsse -gopt -Kieee -Ktrap=inv,divz,ovf -mcmodel=medium -Mbounds
+PAGER=more
 
 # compile rules.......................................
 #
-COMPILE_OUT=$(NAME).compile
+COMPILE_OUT=$(NAME)$(BITS).compile
 .SUFFIXES:
 .SUFFIXES: .o .c .f .f90
 .f90.o:
-	@echo "--"                      >>$(COMPILE_OUT) 2>&1
-	@echo "$(F90) $(FFLAGS) -c $<"  >>$(COMPILE_OUT) 2>&1
-	$(F90) $(FFLAGS) -c $<          >>$(COMPILE_OUT) 2>&1
+	@echo "--"                                   >>$(COMPILE_OUT) 2>&1
+	@echo "$(F90) $(F90FLAGS) $(INCLUDES) -c $<" >>$(COMPILE_OUT) 2>&1
+	$(F90) $(F90FLAGS) $(INCLUDES) -c $<         >>$(COMPILE_OUT) 2>&1
 
 .f.o:
-	@echo "--"                      >>$(COMPILE_OUT) 2>&1
-	@echo "$(F90) $(FFLAGS) -c $<"  >>$(COMPILE_OUT) 2>&1
-	$(F90) $(FFLAGS) -c $<          >>$(COMPILE_OUT) 2>&1
+	@echo "--"                                   >>$(COMPILE_OUT) 2>&1
+	@echo "$(F77) $(F77FLAGS) $(INCLUDES) -c $<" >>$(COMPILE_OUT) 2>&1
+	$(F77) $(F77FLAGS) $(INCLUDES) -c $<         >>$(COMPILE_OUT) 2>&1
 
 .c.o:
-	@echo "--"                     >>$(COMPILE_OUT) 2>&1
-	@echo "$(CC) $(CFLAGS) -c $<"  >>$(COMPILE_OUT) 2>&1
-	$(CC) $(CFLAGS) -c $<          >>$(COMPILE_OUT) 2>&1
-
-
+	@echo "--"                                 >>$(COMPILE_OUT) 2>&1
+	@echo "$(CC) $(CFLAGS) -c $<"              >>$(COMPILE_OUT) 2>&1
+	$(CC) $(CFLAGS) -c $<                      >>$(COMPILE_OUT) 2>&1
\ No newline at end of file
-- 
GitLab