Makefile.am 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
  2. AUTOMAKE_OPTIONS = subdir-objects
  3. @SET_MAKE@
  4. include MakeVariables.in
  5. # DOXYGEN SUPPORT
  6. include aminclude.am
  7. INSTALL_DIR = $(DESTDIR)$(datadir)/$(PACKAGE)
  8. EX_DIR = ./examples
  9. RESULT_DIR = ./result
  10. # the subdirectories of the project to go into
  11. #SUBDIRS =
  12. DIST_SUBDIRS= \
  13. doc/doc
  14. EXTRA_DIST = \
  15. $(EX_DIR)/src \
  16. $(EX_DIR)/include \
  17. $(EX_DIR)/Makefile \
  18. $(DX_CONFIG) \
  19. scripts
  20. # additional include pathes necessary to compile the C++ library
  21. AM_CXXFLAGS = $(CXXFLAGS_PVFMM)
  22. AM_LDFLAGS = -static $(LDFLAGS_PVFMM)
  23. ###############################################################################
  24. # THE LIBRARIES TO BUILD
  25. ###############################################################################
  26. # the library names to build (note we are building static libs only)
  27. pkglib_LIBRARIES = lib/libpvfmm.a
  28. # where to install the headers on the system
  29. lib_libfmm_adir = $(pkgincludedir)
  30. # the list of header files that belong to the library (to be installed later)
  31. lib_libfmm_a_HEADERS = \
  32. include/pvfmm_config.h \
  33. include/pvfmm_common.hpp \
  34. include/pvfmm.hpp \
  35. include/blas.h \
  36. include/cheb_node.hpp \
  37. include/cheb_utils.hpp \
  38. include/device_wrapper.hpp \
  39. include/dtypes.h \
  40. include/fft_wrapper.hpp \
  41. include/fmm_cheb.hpp \
  42. include/fmm_gll.hpp \
  43. include/fmm_node.hpp \
  44. include/fmm_pts.hpp \
  45. include/fmm_pts_gpu.hpp \
  46. include/fmm_tree.hpp \
  47. include/interac_list.hpp \
  48. include/kernel.hpp \
  49. include/lapack.h \
  50. include/legendre_rule.hpp \
  51. include/matrix.hpp \
  52. include/mat_utils.hpp \
  53. include/mem_mgr.hpp \
  54. include/mortonid.hpp \
  55. include/mpi_node.hpp \
  56. include/mpi_tree.hpp \
  57. include/ompUtils.h \
  58. include/parUtils.h \
  59. include/precomp_mat.hpp \
  60. include/profile.hpp \
  61. include/quad_utils.hpp \
  62. include/stacktrace.h \
  63. include/tree.hpp \
  64. include/tree_node.hpp \
  65. include/vector.hpp \
  66. include/cheb_node.txx \
  67. include/cheb_utils.txx \
  68. include/device_wrapper.txx \
  69. include/fmm_cheb.txx \
  70. include/fmm_node.txx \
  71. include/fmm_pts.txx \
  72. include/fmm_tree.txx \
  73. include/interac_list.txx \
  74. include/kernel.txx \
  75. include/matrix.txx \
  76. include/mat_utils.txx \
  77. include/mem_mgr.txx \
  78. include/mortonid.txx \
  79. include/mpi_node.txx \
  80. include/mpi_tree.txx \
  81. include/ompUtils.txx \
  82. include/parUtils.txx \
  83. include/precomp_mat.txx \
  84. include/quad_utils.txx \
  85. include/tree.txx \
  86. include/vector.txx
  87. #nodist_lib_libpvfmm_a_HEADERS = \
  88. # include/pvfmm_config.h
  89. # the sources to add to the library and to add to the source distribution
  90. lib_libpvfmm_a_SOURCES = \
  91. $(lib_libpvfmm_a_HEADERS) \
  92. src/device_wrapper.cpp \
  93. src/fmm_gll.cpp \
  94. src/legendre_rule.cpp \
  95. src/mem_mgr.cpp \
  96. src/mortonid.cpp \
  97. src/profile.cpp \
  98. src/tree_node.cpp
  99. if NVCC_OK
  100. lib_libpvfmm_a_SOURCES += src/fmm_pts_gpu.cu
  101. endif
  102. dist_noinst_SCRIPTS = autogen.sh
  103. core: $(pkglib_LIBRARIES)
  104. all: #all-docs all-examples
  105. ###############################################################################
  106. # COMPILE .cu FILES
  107. #------------------------------------------------------------------------------
  108. if NVCC_OK
  109. .cu.o :
  110. $(NVCC) $(NVCCFLAGS) ${INCLUDE_PVFMM} -c $< -o $@
  111. endif
  112. ###############################################################################
  113. # BUILD EXAMPLES
  114. #------------------------------------------------------------------------------
  115. all-examples: core
  116. cd $(EX_DIR) && $(MAKE);
  117. $(EX_DIR)/bin/%: core
  118. cd $(EX_DIR) && $(MAKE) bin/$(notdir $@)
  119. ###############################################################################
  120. # BUILD DOCUMENTATION
  121. #------------------------------------------------------------------------------
  122. pdf-doc:
  123. cd doc/doc && $(MAKE);
  124. all-docs: doxygen-doc pdf-doc
  125. ###############################################################################
  126. # INSTALL/UNINSTALL MakeVariables, pvfmm_config.h
  127. #------------------------------------------------------------------------------
  128. install-make-variables:
  129. $(MKDIR_P) $(INSTALL_DIR)
  130. sed -e 's/(TOP_SRCDIR_PVFMM)/(INSTALL_DIR_PVFMM)/' \
  131. -e "s/PKG_SUBDIR_PVFMM =/PKG_SUBDIR_PVFMM = \/$(PACKAGE)/" \
  132. MakeVariables > $(INSTALL_DIR)/MakeVariables
  133. uninstall-make-variables:
  134. $(RM) $(INSTALL_DIR)/MakeVariables
  135. ###############################################################################
  136. # INSTALL/UNINSTALL DOCS
  137. #------------------------------------------------------------------------------
  138. if DOXYGEN_OK
  139. install-doxygen-doc: doxygen-doc
  140. for doxygen_dir in $(srcdir)/doc/doxygen/*/ ; do \
  141. doxygen_dir=$${doxygen_dir%*/}; \
  142. dest_dir=$(INSTALL_DIR)/doc/$${doxygen_dir##*/}; \
  143. $(MKDIR_P) $${dest_dir}; \
  144. $(INSTALL_DATA) $${doxygen_dir}/* $${dest_dir}; done;
  145. uninstall-doxygen-doc:
  146. $(RM) -r $(INSTALL_DIR)/doc/*
  147. $(RM) -r $(INSTALL_DIR)/doc
  148. else
  149. install-doxygen-doc:
  150. uninstall-doxygen-doc:
  151. endif
  152. ###############################################################################
  153. # LOCAL INSTALL/UNINSTALL
  154. #------------------------------------------------------------------------------
  155. install: install-am
  156. @echo
  157. @echo '======================================================================='
  158. @echo 'You should add the following to your ~/.bashrc'
  159. @echo ' export PVFMM_DIR=$(INSTALL_DIR)'
  160. @echo
  161. @echo 'You will need to load $$(PVFMM_DIR)/MakeVariables in your Makefile and'
  162. @echo 'use the variables CXXFLAGS_PVFMM and LDFLAGS_PVFMM for compiling your code.'
  163. @echo '======================================================================='
  164. install-data-local: install-make-variables install-doxygen-doc
  165. cd doc/doc && $(MAKE) install;
  166. uninstall-local: uninstall-make-variables uninstall-doxygen-doc
  167. cd doc/doc && $(MAKE) uninstall;
  168. ###############################################################################
  169. # LOCAL CLEAN
  170. #------------------------------------------------------------------------------
  171. clean-doxygen:
  172. $(RM) -r $(DX_CLEANFILES)
  173. clean-local: clean-doxygen
  174. cd $(EX_DIR) && $(MAKE) clean;
  175. $(RM) -r $(RESULT_DIR)/*
  176. $(RM) *~ */*~ */*/*~
  177. $(RM) ./lib/*
  178. #------------------------------------------------------------------------------