Advertisement
naigner

Makefile

Nov 14th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. # linux = RedHat Linux box, Intel icc, MPICH2, FFTW
  2.  
  3. SHELL = /bin/sh
  4.  
  5. # ---------------------------------------------------------------------
  6. # compiler/linker settings
  7. # specify flags and libraries needed for your compiler
  8.  
  9. CC = mpicxx
  10. CCFLAGS = -O2 -openmp
  11. DEPFLAGS = -M
  12. LINK = mpicxx
  13. LINKFLAGS = -O2 -openmp
  14. LIB = -lstdc++
  15. ARCHIVE = ar
  16. ARFLAGS = -rc
  17. SIZE = size
  18.  
  19. # ---------------------------------------------------------------------
  20. # LAMMPS-specific settings
  21. # specify settings for LAMMPS features you will use
  22. # if you change any -D setting, do full re-compile after "make clean"
  23.  
  24. # LAMMPS ifdef settings, OPTIONAL
  25. # see possible settings in doc/Section_start.html#2_2 (step 4)
  26.  
  27. LMP_INC = -DLAMMPS_GZIP
  28.  
  29. # MPI library, REQUIRED
  30. # see discussion in doc/Section_start.html#2_2 (step 5)
  31. # can point to dummy MPI library in src/STUBS as in Makefile.serial
  32. # INC = path for mpi.h, MPI compiler settings
  33. # PATH = path for MPI library
  34. # LIB = name of MPI library
  35.  
  36. MPI_INC = -DMPICH_SKIP_MPICXX
  37. MPI_PATH =
  38. MPI_LIB = -lmpich -lpthread
  39.  
  40. # FFT library, OPTIONAL
  41. # see discussion in doc/Section_start.html#2_2 (step 6)
  42. # can be left blank to use provided KISS FFT library
  43. # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
  44. # PATH = path for FFT library
  45. # LIB = name of FFT library
  46.  
  47. FFT_INC = -DFFT_FFTW3
  48. FFT_PATH =
  49. FFT_LIB = -lfftw3
  50.  
  51. # JPEG library, OPTIONAL
  52. # see discussion in doc/Section_start.html#2_2 (step 7)
  53. # only needed if -DLAMMPS_JPEG listed with LMP_INC
  54. # INC = path for jpeglib.h
  55. # PATH = path for JPEG library
  56. # LIB = name of JPEG library
  57.  
  58. JPG_INC =
  59. JPG_PATH =
  60. JPG_LIB =
  61.  
  62. # ---------------------------------------------------------------------
  63. # build rules and dependencies
  64. # no need to edit this section
  65.  
  66. include Makefile.package.settings
  67. include Makefile.package
  68.  
  69. EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
  70. EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
  71. EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
  72.  
  73. # Link target
  74.  
  75. $(EXE): $(OBJ)
  76. $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE)
  77. $(SIZE) $(EXE)
  78.  
  79. # Library target
  80.  
  81. lib: $(OBJ)
  82. $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
  83.  
  84. # Compilation rules
  85.  
  86. %.o:%.cpp
  87. $(CC) $(CCFLAGS) $(EXTRA_INC) -c $<
  88.  
  89. %.d:%.cpp
  90. $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
  91.  
  92. # Individual dependencies
  93.  
  94. DEPENDS = $(OBJ:.o=.d)
  95. sinclude $(DEPENDS)
  96.  
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement