configure.ac 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. AC_PREREQ([2.61])
  2. AC_INIT([PvFMM],[1.0.0],[dmalhotra@ices.utexas.edu])
  3. AC_CONFIG_MACRO_DIR([m4])
  4. AC_CONFIG_AUX_DIR([build-aux])
  5. AM_INIT_AUTOMAKE([-Wall no-define])
  6. AC_CONFIG_SRCDIR([src/tree_node.cpp])
  7. AM_CONFIG_HEADER([config.h]) # prep config.h from config.h.in
  8. AX_PREFIX_CONFIG_H([include/pvfmm_config.h]) # prep include/pvfmm_config.h from it..
  9. # Set language to C++
  10. AC_LANG([C++])
  11. # Checks for programs.
  12. AX_PROG_CXX_MPI(,[CXX=$MPICXX],[])
  13. AX_MPI([CXX=$MPICXX; CC=$MPICC; CFLAGS=$CFLAGS],
  14. [AC_MSG_ERROR([Cannot find mpicxx. Make sure that MPI is installed and location of compiler is in PATH.])])
  15. AX_COMPILER_VENDOR
  16. AC_PROG_AWK
  17. AC_PROG_F77
  18. AC_PROG_INSTALL
  19. AC_PROG_MKDIR_P
  20. AC_PROG_LN_S
  21. AC_PROG_MAKE_SET
  22. #AC_PROG_RANLIB
  23. ##AM_PROG_AR
  24. # automake 1.12 seems to require AM_PROG_AR, but automake 1.11 doesn't
  25. # recognize it
  26. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  27. LT_INIT
  28. AC_PROG_LIBTOOL
  29. # Check for CUDA
  30. AX_CHECK_CUDA
  31. # Checks for documentation build tools
  32. AC_CHECK_PROG([doxygen_ok], [doxygen], [yes], [no])
  33. AC_CHECK_PROG([pdflatex_ok], [pdflatex], [yes], [no])
  34. AC_CHECK_PROG([latex_ok], [latex], [yes], [no])
  35. AC_CHECK_PROG([dvips_ok], [dvips], [yes], [no])
  36. AC_CHECK_PROG([gs_ok], [gs], [yes], [no])
  37. if test "x$enable_html_doc" != xno; then
  38. test "x$doxygen_ok" != xyes && enable_html_doc=no
  39. test "x$latex_ok" != xyes && enable_html_doc=no
  40. test "x$dvips_ok" != xyes && enable_html_doc=no
  41. test "x$gs_ok" != xyes && enable_html_doc=no
  42. AC_PATH_PROG([PERL], [perl], [])
  43. fi
  44. AM_CONDITIONAL([LATEX_OK], [test "x$latex_ok" = xyes])
  45. AM_CONDITIONAL([PDFLATEX_OK], [test "x$pdflatex_ok" = xyes])
  46. AM_CONDITIONAL([HTML_DOC], [test "x$enable_html_doc" = xyes])
  47. AM_CONDITIONAL([DOXYGEN_OK], [test "x$doxygen_ok" = xyes])
  48. DX_HTML_FEATURE(ON)
  49. DX_CHM_FEATURE(OFF)
  50. DX_CHI_FEATURE(OFF)
  51. DX_MAN_FEATURE(OFF)
  52. DX_RTF_FEATURE(OFF)
  53. DX_XML_FEATURE(OFF)
  54. DX_PDF_FEATURE(OFF)
  55. DX_PS_FEATURE(OFF)
  56. DX_INIT_DOXYGEN($PACKAGE_NAME, Doxyfile, doc/doxygen)
  57. AX_CXX_DEF_TEMPLATE_ARG
  58. CHECK_QUAD_PRECISION
  59. # Check for math libs
  60. AC_CHECK_LIB([m],[cos])
  61. AC_CHECK_LIB([imf],[cos])
  62. # Check for X11
  63. AC_PATH_X
  64. if test "$no_x" = yes; then
  65. AC_MSG_WARN([Cannot find X Window System include files and libraries.
  66. Please specify their location using --x-includes=dir and --x-libraries=dir])
  67. else
  68. if test "$x_includes" != ""; then
  69. X_INCLUDES="-I$x_includes"
  70. fi
  71. if test "$x_libraries" != ""; then
  72. X_LIBS="-L$x_libraries"
  73. fi
  74. X_LIBS="$X_LIBS -lX11"
  75. AC_SUBST(X_INCLUDES)
  76. AC_SUBST(X_LIBS)
  77. fi
  78. # Check for libstdc++, libdl
  79. AC_CHECK_LIB(stdc++,main)
  80. AC_CHECK_LIB(dl,dlopen)
  81. # Check for OpenMP
  82. #AC_LANG_WERROR([on])
  83. #if $USE_OPENMP; then
  84. # AC_ARG_WITH(openmp_flag,
  85. # [AS_HELP_STRING([--with-openmp-flag="FLAGS"],
  86. # [FLAGS to enable OpenMP])],
  87. # [OPENMP_FLAG="-$withval"],
  88. # [OPENMP_FLAG=""])
  89. #
  90. # # Check if OpenMP flag is already specified.
  91. # CHECK_OPENMP($OPENMP_FLAG)
  92. #
  93. # # Check for all common OpenMP flags.
  94. # if test "$cv_openmp" = no; then
  95. # case "$ax_cv_cxx_compiler_vendor" in
  96. # gnu)
  97. # CHECK_OPENMP(-fopenmp)
  98. # ;;
  99. # intel)
  100. # CHECK_OPENMP(-openmp)
  101. # ;;
  102. # pgi)
  103. # CHECK_OPENMP(-mp)
  104. # ;;
  105. # msdosmsvc)
  106. # ## FIXME is this the right flag for MSVC?
  107. # CHECK_OPENMP(-openmp)
  108. # ;;
  109. # ## Add other compilers supporting OpenMP here
  110. # esac
  111. # fi
  112. #
  113. # # Error: OpenMP not available.
  114. # if test "$cv_openmp" = no; then
  115. # AC_MSG_ERROR([Don't know how to enable OpenMP.
  116. # Please specify the OpenMP flag using: --with-openmp-flag=<flag>.]);
  117. # fi
  118. #fi
  119. #AC_LANG_WERROR([off])
  120. # Check for Intel Xeon Phi
  121. CHECK_INTEL_OFFLOAD
  122. # Check for FFTW
  123. AC_CHECK_FFTW
  124. AC_CHECK_FFTWF
  125. #Check for BLAS LAPACK
  126. #AM_CONDITIONAL(BLAS_EQ_MKL, test "$BLAS" = "MKL")
  127. #AM_CONDITIONAL(BLAS_EQ_GSL, test "$BLAS" = "GSL")
  128. #if (test -r $PETSC_DIR/$PETSC_ARCH/conf/petscvariables) ; then
  129. # PETSC_BLASLAPACK_LIB=`grep "BLASLAPACK_LIB" $PETSC_DIR/$PETSC_ARCH/conf/petscvariables | sed -e 's/.*BLASLAPACK_LIB = //'`
  130. # if test "x$PETSC_BLASLAPACK_LIB" != x ; then
  131. # if test "x$with_blas" != "x" -a "$with_blas" != "$PETSC_BLASLAPACK_LIB" ; then
  132. # AC_MSG_WARN([BLAS flags specified by --with-blas appear to disagree with PETSc BLAS/LAPACK flags; using PETSc settings])
  133. # fi
  134. # if test "x$with_lapack" != "x" -a "$with_lapack" != "$PETSC_BLASLAPACK_LIB" ; then
  135. # AC_MSG_WARN([LAPACK flags specified by --with-lapack appear to disagree with PETSc BLAS/LAPACK flags; using PETSc settings])
  136. # fi
  137. # echo "using PETSc BLAS/LAPACK library flags: $PETSC_BLASLAPACK_LIB"
  138. # with_blas="$PETSC_BLASLAPACK_LIB"
  139. # with_lapack=""
  140. # fi
  141. # PETSC_BLASLAPACK_INCLUDE=`grep "BLASLAPACK_INCLUDE" $PETSC_DIR/$PETSC_ARCH/conf/petscvariables | sed -e 's/.*BLASLAPACK_INCLUDE = //'`
  142. # if test "x$PETSC_BLASLAPACK_INCLUDE" != x ; then
  143. # CPPFLAGS="${PETSC_BLASLAPACK_INCLUDE} $CPPFLAGS"
  144. # fi
  145. #fi
  146. #CFLAGS_save=$CFLAGS
  147. #CXXFLAGS_save=$CXXFLAGS
  148. #CFLAGS=""
  149. #CXXFLAGS=""
  150. #AX_BLAS(acx_blas_ok=yes, AC_MSG_ERROR([Cannot find BLAS library.
  151. # Please specify the location of the library using: --with-blas=LIB]))
  152. #AX_LAPACK(acx_lapack_ok=yes, AC_MSG_ERROR([Cannot find LAPACK library.
  153. # Please specify the location of the library using: --with-lapack=LIB]))
  154. #CFLAGS=$CFLAGS_save
  155. #CXXFLAGS=$CXXFLAGS_save
  156. #AC_SUBST(LAPACK_LIBS)
  157. #AC_SUBST(BLAS_LIBS)
  158. #AC_SUBST(FLIBS)
  159. # Checks for header files.
  160. AC_CHECK_HEADERS([stdint.h cstdlib cstddef])
  161. # Checks for typedefs, structures, and compiler characteristics.
  162. AC_HEADER_STDBOOL
  163. AC_HEADER_STAT
  164. AC_C_INLINE
  165. AC_TYPE_INT32_T
  166. AC_TYPE_UINT16_T
  167. AC_TYPE_UINT8_T
  168. AC_TYPE_SIZE_T
  169. # Checks for library functions.
  170. AC_FUNC_ERROR_AT_LINE
  171. AC_FUNC_MALLOC
  172. AC_FUNC_STRTOD
  173. AC_CHECK_FUNCS([floor memset pow sqrt strtol strtoul])
  174. AX_CHECK_SVML
  175. # Path for precomputed data files.
  176. AC_ARG_WITH(precomp-dir,
  177. [AS_HELP_STRING([--with-precomp-dir=DIR], [set directory for precomputed data files to DIR])],
  178. [PRECOMP_DIR="$withval"; AX_NORMALIZE_PATH([PRECOMP_DIR], ["/"]) ])
  179. AC_DEFINE_UNQUOTED(PRECOMP_DATA_PATH,"$PRECOMP_DIR",[Path for precomputed data files.])
  180. #AC_CONFIG_FILES([Makefile doc/doc/Makefile])
  181. AC_CONFIG_FILES([Makefile
  182. MakeVariables
  183. doc/doc/Makefile])
  184. AC_OUTPUT
  185. echo "
  186. ------------------------------------------------------------------------------
  187. $PACKAGE-$VERSION library configuration:
  188. ------------------------------------------------------------------------------
  189. External libs:
  190. - BLAS ........... : ${acx_blas_ok}
  191. - LAPACK ......... : ${acx_lapack_ok}
  192. - FFTW ........... : ${acx_fftw_ok}
  193. Compiler/linker flags/libs/defs:
  194. - MPICXX ......... : ${MPICXX}
  195. - CXXFLAGS ....... : ${CXXFLAGS}
  196. - LDFLAGS ........ : ${LDFLAGS}
  197. - LIBS ........... : ${LIBS}
  198. - BLAS ......... : ${BLAS_LIBS}
  199. - FFTW ......... : ${FFTW_LIB} ${FFTWF_LIB}
  200. - X11 .......... : ${X_LIBS}
  201. Documentation tools:
  202. - doxygen ........ : ${doxygen_ok}
  203. - latex .......... : ${latex_ok}
  204. - dvips .......... : ${dvips_ok}
  205. - ghostscript .... : ${gs_ok}
  206. "