bidesh23

Makefile_pvfmm1

Dec 10th, 2021 (edited)
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 2.09 KB | None | 0 0
  1. #********************Makefile********************#
  2. ifndef PVFMM_DIR
  3.     PVFMM_DIR=./..
  4.     endif
  5.    
  6.     -include $(PVFMM_DIR)/MakeVariables
  7.    
  8.     ifndef CXX_PVFMM
  9.     $(error Cannot find file: MakeVariables)
  10.     endif
  11.    
  12.     # FC=$(FC_PVFMM) # TODO: for now, FC must be provided by user
  13.     # CC=$(CC_PVFMM) # TODO: for now, CC must be provided by user
  14.     CXX=$(CXX_PVFMM)
  15.     CXXFLAGS=$(CXXFLAGS_PVFMM)
  16.     LDLIBS=$(LDLIBS_PVFMM)
  17.    
  18.     RM = rm -f
  19.     MKDIRS = mkdir -p
  20.    
  21.     BINDIR = ./bin
  22.     SRCDIR = ./src
  23.     OBJDIR = ./obj
  24.     INCDIR = ./include
  25.    
  26.     TARGET_BIN = \
  27.            $(BINDIR)/example1 \
  28.            $(BINDIR)/example2 \
  29.            $(BINDIR)/example-sctl \
  30.            $(BINDIR)/fmm_pts \
  31.            $(BINDIR)/fmm_cheb
  32.    
  33.     all : $(TARGET_BIN)
  34.    
  35.     $(BINDIR)/%: $(SRCDIR)/%.f90
  36.         -@$(MKDIRS) $(dir $@)
  37.         $(PVFMM_DIR)/libtool --mode=link --tag=FC $(FC) $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -o $@
  38. ...
  39.  
  40. #********************New Makefile********************#
  41. ifndef PVFMM_DIR
  42. PVFMM_DIR=./..
  43. endif
  44.  
  45. -include $(PVFMM_DIR)/MakeVariables
  46.  
  47. ifndef CXX_PVFMM
  48. $(error Cannot find file: MakeVariables)
  49. endif
  50.  
  51. FC_PVMM = mpif90
  52. FC = mpif90
  53.  
  54. FC=$(FC_PVFMM) # TODO: for now, FC must be provided by user
  55. CC=$(CC_PVFMM) # TODO: for now, CC must be provided by user
  56. CXX=$(CXX_PVFMM)
  57. CXXFLAGS=$(CXXFLAGS_PVFMM)
  58. LDLIBS=$(LDLIBS_PVFMM)
  59.  
  60. RM = rm -f
  61. MKDIRS = mkdir -p
  62.  
  63. BINDIR = ./bin
  64. SRCDIR = ./src
  65. OBJDIR = ./obj
  66. INCDIR = ./include
  67.  
  68. all : $(project_final)
  69.  
  70. project_final: $(project)
  71.     $(PVFMM_DIR)/libtool --mode=link --tag=FC mpif90 $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -o $@
  72.  
  73. project: example-f.o
  74.     cd ./src && $(MAKE)
  75.  
  76. example-f.o: $(SRCDIR)/example-f.f90
  77.     $(PVFMM_DIR)/libtool --mode=link --tag=FC mpif90 $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -c $@
  78. ...
  79.  
  80. #********************Error message********************#
  81. cd ./examples && make;
  82. make[1]: Entering directory '/home/bidesh/Coding/FMM/pvfmm-1.3.0/examples'
  83. make[1]: Nothing to be done for 'all'.
  84. make[1]: Leaving directory '/home/bidesh/Coding/FMM/pvfmm-1.3.0/examples'
Add Comment
Please, Sign In to add comment