Skip to content
Snippets Groups Projects
Makefile.inc.geodyncomp 2.8 KiB
Newer Older
  • Learn to ignore specific revisions
  • # Define our compilers.................................
    #
    # on geodyncomp, the defaults are OpenMPI (1.4.3), 
    # built with the GNU compilers
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # F90 = mpif90
    # F77 = mpif90
    # cc  = mpicc
    # on geodyncomp, we also have an intel compiler
    F90 = ifort
    F77 = ifort
    cc = icc
    
    
    # we take the standard ar
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # AR=ar
    AR=xiar
    
    
    # There are no BITS
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    BITS=-ifort-dbg-openmpi
    
    
    # no MKL
    # IMKL = /scinet/gpc/intel/Compiler/11.1/056/mkl/include
    # IMKL = /scinet/gpc/intel/Compiler/11.1/072/mkl/include
    # INCLUDE=-I$(IMKL)
    
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # Define MPI include files for ifort.
    # these should match the build of wsmp; see below.
    # for openmpi, these work
    MPI_INC=-I /opt/openmpi/include
    MPI_LIB=-L/opt/openmpi/lib -lmpi -lmpi_f77 -lmpi_f90
    # for mpich2
    # MPI_INC=-I /opt/mpich2/gnu/include
    # MPI_LIB=-L/opt/mpich2/gnu/lib -lmpichf90 -lfmpich -lmpich
    
    INCLUDE = $(MPI_INC)
    
    
    # Define FORTRAN compiler flags.......................
    #
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    GFORTRAN_FLAGS = -ffree-line-length-0
    # This gives us, at run time,
    # error while loading shared libraries: libimf.so: cannot open shared object file
    # No such file or directory
    # IFORT_FLAGS = -O2 -fp-model strict -mcmodel=large -shared-intel
    # IFORT_FLAGS = -fast
    IFORT_FLAGS = -O2
    IFORT_DEBUG = -g -warn all -check all -debug all
    # IFORT_DEBUG =
    F90FLAGS = ${IFORT_FLAGS} ${IFORT_DEBUG}
    F77FLAGS = ${IFORT_FLAGS} ${IFORT_DEBUG}
    FFLAGS=${F90FLAGS}
    
    # Define C compiler flags.............................
    #
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    ICC_FLAGS = 
    CFLAGS = -O2 ${ICC_FLAGS}
    
    
    # no Intel MKL library
    #
    # LMKL = /scinet/gpc/intel/Compiler/11.1/056/mkl/lib
    # LMKL = /scinet/gpc/intel/Compiler/11.1/072/mkl/lib
    
    # MPI libraries
    # (use the default)
    
    # WSMP Library
    #
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # wsmp, with gnu and openMPI
    
    WSMP = -L/opt/wsmp/wsmp-Linux64/lib/GNU/openmpi -lpwsmp64
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    # wsmp, with intel and mpich2
    # WSMP = -L/opt/wsmp/wsmp-Linux64/lib/Intel/mpich2 -lpwsmp64
    
    
    # Not using Google's TCMalloc
    # TCML   = /home/dwhipp/software/tcml
    
    LIBS = \
     -LOCTREE -lOctree$(BITS) \
     -LNN -lnn_f$(BITS) \
     -LNN -lnn_c$(BITS) \
     -LCASCADE -lcascade$(BITS) \
     -LRESAMPLE -lresample$(BITS) \
    
    Douglas Guptill's avatar
    Douglas Guptill committed
     $(WSMP) -lblas \
     $(MPI_LIB) \
     -lpthread
    
    
    # The Makefiles look at compile output with this
    PAGER=more
    
    # compile rules.......................................
    #
    COMPILE_OUT=$(NAME)$(BITS).compile
    .SUFFIXES:
    .SUFFIXES: .o .c .f .f90
    .f90.o:
    	@echo "--"                                   >>$(COMPILE_OUT) 2>&1
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    	@echo "$(F90) $(F90FLAGS) $(INCLUDE) -c $<" >>$(COMPILE_OUT) 2>&1
    	$(F90) $(F90FLAGS) $(INCLUDE) -c $<         >>$(COMPILE_OUT) 2>&1
    
    
    .f.o:
    	@echo "--"                                   >>$(COMPILE_OUT) 2>&1
    
    Douglas Guptill's avatar
    Douglas Guptill committed
    	@echo "$(F77) $(F77FLAGS) $(INCLUDE) -c $<" >>$(COMPILE_OUT) 2>&1
    	$(F77) $(F77FLAGS) $(INCLUDE) -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