Skip to content
Snippets Groups Projects
Makefile.inc.mahone 2.61 KiB
Newer Older
  • Learn to ignore specific revisions
  • Douglas Guptill's avatar
    Douglas Guptill committed
    # Define our compilers.................................
    #
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # The default - OpenMPI 1.2.7
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    F90    = mpif90
    F77    = mpif77
    CC     = mpicc
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # 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
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    
    
    # Libraries................
    #
    # PGPLOT=/home/dguptill/software/pgplot-5.2.2
    # -L$(PGPLOT) -lpgplot \
    # -L/usr/X11R6/lib64 -lX11 \
    
    LIBS = \
     -LOCTREE -lOctree$(BITS) \
     -LNN -lnn_f$(BITS) \
     -LNN -lnn_c$(BITS) \
     -LCASCADE -lcascade$(BITS) \
     -LRESAMPLE -lresample$(BITS) \
     $(WSMP_LIB) \
     -lpthread -lacml
    
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # The Makefiles look at compile output with this
    PAGER=less
    
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # wsmp lives here.
    #
    WSMP_DIR   = /home/dguptill/software/wsmp/wsmp-Linux/lib/X86_64/PGI
    
    
    # Miscellaneous things
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    #
    AR=ar
    OPTIONS=
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    WSMP_LIB=-L$(WSMP_DIR) -lpwsmp64
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    
    # Define FORTRAN compiler flags.......................
    #
    
    # Initial guess at flags:
    # Using these, douar works much as it does on grace.
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    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
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    
    # Define C compiler flags.............................
    #
    
    # Initial guess at flags:
    # Using these, douar works much as it does on grace.
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    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
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    
    # compile rules.......................................
    #
    COMPILE_OUT=$(NAME).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
    
    .f.o:
    	@echo "--"                      >>$(COMPILE_OUT) 2>&1
    	@echo "$(F90) $(FFLAGS) -c $<"  >>$(COMPILE_OUT) 2>&1
    	$(F90) $(FFLAGS) -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