From 643faa9fb18cba3c4516eefba62d3b0431ad80a6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 20 Nov 2011 21:57:01 -0500 Subject: [PATCH] Rearranged Makefile. --- src/Makefile | 81 ++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/src/Makefile b/src/Makefile index 14b0d99096..cc5782e0a9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,58 +20,64 @@ DEBUG = no PROFILE = no OPTIMIZE = no USE_MPI = no -USE_OPENMP = no -USE_COARRAY = no #=============================================================================== -# Compiler Options -#=============================================================================== - # Intel Fortran compiler options +#=============================================================================== ifeq ($(COMPILER),intel) F90 = ifort F90FLAGS := -fpp -warn -assume byterecl LDFLAGS = + + # Debugging options + ifeq ($(DEBUG),yes) + F90FLAGS += -g -traceback -ftrapuv -fp-stack-check -check all + LDFLAGS += -g + endif + + # Profiling options + ifeq ($(PROFILE),yes) + F90FLAGS += -pg + LDFLAGS += -pg + endif + + # Optimization + ifeq ($(OPTIMIZE),yes) + F90FLAGS += -O3 # -ipo + endif endif +#=============================================================================== # GNU Fortran compiler options +#=============================================================================== ifeq ($(COMPILER),gfortran) F90 = gfortran F90FLAGS := -cpp -Wall LDFLAGS = -endif -# Set compiler flags for debugging - -ifeq ($(DEBUG),yes) - F90FLAGS += -g - LDFLAGS += -g - ifeq ($(COMPILER),intel) - F90FLAGS += -traceback -ftrapuv -fp-stack-check -check all - endif - ifeq ($(COMPILER),gfortran) - F90FLAGS += -pedantic -std=f2008 -fbacktrace -fbounds-check \ + # Debugging options + ifeq ($(DEBUG),yes) + F90FLAGS += -g -pedantic -std=f2008 -fbacktrace -fbounds-check \ -ffpe-trap=invalid,zero,overflow,underflow + LDFLAGS += -g + endif + + # Profiling options + ifeq ($(PROFILE),yes) + F90FLAGS += -pg + LDFLAGS += -pg + endif + + ifeq ($(OPTIMIZE),yes) + F90FLAGS += -O3 endif endif -# Set compiler flags for profiling - -ifeq ($(PROFILE),yes) - F90FLAGS += -pg - LDFLAGS += -pg -endif - -# Set compiler flags for high optimization - -ifeq ($(OPTIMIZE),yes) - F90FLAGS += -O3 - ifeq ($(COMPILER),intel) - F90FLAGS += -ipo - endif -endif +#=============================================================================== +# Miscellaneous compiler options +#=============================================================================== # Use MPI for parallelism @@ -81,19 +87,6 @@ ifeq ($(USE_MPI),yes) F90FLAGS += -DMPI endif -# Use OpenMP for shared-memory parallelism - -ifeq ($(USE_OPENMP),yes) - F90FLAGS += -openmp - LDFLAGS += -openmp -endif - -# Use Fortran 2008 Coarrays for parallelism - -ifeq ($(USE_COARRAY),yes) - F90FLAGS += -coarray -endif - #=============================================================================== # Targets #===============================================================================