Newer
Older
Kurt A. O'Hearn
committed
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
Kurt A. O'Hearn
committed
AC_INIT([PuReMD], [1.0], [ohearnku@msu.edu hma@msu.edu])
Kurt A. O'Hearn
committed
AM_INIT_AUTOMAKE([1.15 -Wall -Werror])
# Enable silent build rules by default.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY],[1])])
Kurt A. O'Hearn
committed
LT_PREREQ([2.2])
LT_INIT([dlopen])
AC_CONFIG_MACRO_DIR([m4])
AC_DEFUN([AC_PROG_PDFLATEX],
[AC_ARG_VAR([PDFLATEX], [LaTeX PDF generation program])dnl
AC_CHECK_PROGS([PDFLATEX], [pdflatex])
m4_ifval([$1],,
[if test -z "$PDFLATEX"; then
AC_MSG_WARN([pdflatex not found. Unable to build documentation. Continuing...])
fi])])
Kurt A. O'Hearn
committed
AC_ARG_ENABLE([serial],
[AS_HELP_STRING([--enable-serial],
[enable serial support @<:@default: no@:>@])],
[pack_serial_enabled=${enableval}], [pack_serial_enabled=no])
Kurt A. O'Hearn
committed
AC_ARG_ENABLE([openmp],
[AS_HELP_STRING([--enable-openmp],
[enable OpenMP support @<:@default: yes@:>@])],
[pack_openmp_enabled=${enableval}], [pack_openmp_enabled=yes])
Kurt A. O'Hearn
committed
AC_ARG_ENABLE([mpi-old],
[AS_HELP_STRING([--enable-mpi-old],
Kurt A. O'Hearn
committed
[enable MPI support (old) @<:@default: no@:>@])],
Kurt A. O'Hearn
committed
[pack_mpi_old_enabled=${enableval}], [pack_mpi_old_enabled=no])
AC_ARG_ENABLE([gpu],
[AS_HELP_STRING([--enable-gpu],
[enable CUDA (single GPU) support @<:@default: no@:>@])],
[pack_gpu_enabled=${enableval}], [pack_gpu_enabled=no])
Kurt A. O'Hearn
committed
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING([--enable-mpi],
Kurt A. O'Hearn
committed
[enable MPI support @<:@default: no@:>@])],
Kurt A. O'Hearn
committed
[pack_mpi_enabled=${enableval}], [pack_mpi_enabled=no])
AC_ARG_ENABLE([mpi-gpu],
[AS_HELP_STRING([--enable-mpi-gpu],
Kurt A. O'Hearn
committed
[enable MPI+CUDA (multi GPU) support @<:@default: no@:>@])],
[pack_mpi_gpu_enabled=${enableval}], [pack_mpi_gpu_enabled=no])
Kurt A. O'Hearn
committed
if test "x${pack_serial_enabled}" = "xyes" || test "x${pack_openmp_enabled}" = "xyes" || test "x${pack_gpu_enabled}" = "xyes"; then
Kurt A. O'Hearn
committed
AC_CONFIG_SUBDIRS([sPuReMD])
if test "x${pack_serial_enabled}" = "xyes" || test "x${pack_openmp_enabled}" != "xyes"; then
Kurt A. O'Hearn
committed
export BUILD_OPENMP="no"
else
if test "x${pack_gpu_enabled}" = "xyes"; then
export BUILD_GPU="yes"
else
export BUILD_OPENMP="yes"
fi
Kurt A. O'Hearn
committed
fi
fi
AM_CONDITIONAL([BUILD_S_OMP], [test "x${pack_serial_enabled}" = "xyes" || test "x${pack_openmp_enabled}" = "xyes"])
AM_CONDITIONAL([BUILD_GPU], [test "x${pack_gpu_enabled}" = "xyes"])
Kurt A. O'Hearn
committed
if test "x${pack_mpi_old_enabled}" = "xyes"; then
Kurt A. O'Hearn
committed
AC_CONFIG_SUBDIRS([PuReMD])
fi
Kurt A. O'Hearn
committed
AM_CONDITIONAL([BUILD_MPI], [test "x${pack_mpi_old_enabled}" = "xyes"])
if test "x${pack_mpi_enabled}" = "xyes" || test "x${pack_mpi_gpu_enabled}" = "xyes"; then
Kurt A. O'Hearn
committed
AC_CONFIG_SUBDIRS([PG-PuReMD])
Kurt A. O'Hearn
committed
if test "x${pack_mpi_enabled}" = "xyes" || test "x${pack_mpi_gpu_enabled}" != "xyes"; then
export BUILD_GPU="no"
else
export BUILD_GPU="yes"
fi
Kurt A. O'Hearn
committed
fi
Kurt A. O'Hearn
committed
AM_CONDITIONAL([BUILD_MPI_GPU], [test "x${pack_mpi_enabled}" = "xyes" || test "x${pack_mpi_gpu_enabled}" = "xyes"])
Kurt A. O'Hearn
committed
# Provides debug compilation mode.
AC_ARG_ENABLE([debug],
Kurt A. O'Hearn
committed
[AS_HELP_STRING([--enable-debug],
[enable debug support @<:@default: no@:>@])],
[DEBUG=${enableval}], [DEBUG=no]
)
Kurt A. O'Hearn
committed
if test "x${DEBUG}" = "xyes"
Kurt A. O'Hearn
committed
# #TODO: fix exporting to subdirs
# # See: http://stackoverflow.com/questions/34124337/changing-flags-in-configure-ac-vs-caching-with-subprojects
Kurt A. O'Hearn
committed
export BUILD_DEBUG="yes"
fi
# gprof flags.
AC_ARG_ENABLE([gprof],
Kurt A. O'Hearn
committed
[AS_HELP_STRING([--enable-gprof],
[enable support for profiling with gprof @<:@default: no@:>@])],
Kurt A. O'Hearn
committed
# GNU
export BUILD_GPROF="true"
export GPROF_FLAGS="-pg"
Kurt A. O'Hearn
committed
# Intel
export BUILD_GPROF="true"
export GPROF_FLAGS="-p"
;;
no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-gprof (only yes, gnu or intel are possible)]) ;;
esac],
Kurt A. O'Hearn
committed
[]
)
# Timing measurements.
AC_ARG_ENABLE([timing],
Kurt A. O'Hearn
committed
[AS_HELP_STRING([--enable-timing],
[enable timing measurements and reporting @<:@default: no@:>@])],
[timing_enabled=${enableval}], [timing_enabled=no]
if test "x${timing_enabled}" = "xyes"
Kurt A. O'Hearn
committed
export BUILD_TIMING="yes"
AC_ARG_WITH([superlu-mt],
[AS_HELP_STRING([--with-superlu-mt],
Kurt A. O'Hearn
committed
[enable usage of SuperLU MT for preconditioning @<:@default: no@:>@])],
[package_superlu_mt=${withval}], [package_superlu_mt=no])
if test "x${package_superlu_mt}" != "xno"
then
export BUILD_SUPERLU_MT="${package_superlu_mt}"
fi
Kurt A. O'Hearn
committed
AC_ARG_ENABLE([doc],
[AS_HELP_STRING([--enable-doc],
[enable documentation generation @<:@default: no@:>@])],
[pack_doc_enabled=${enableval}], [pack_doc_enabled=no])
Kurt A. O'Hearn
committed
AM_CONDITIONAL([BUILD_DOC], [test "x${pack_doc_enabled}" = "xyes" && test "x${PDFLATEX}" != "x"])
if test "x${pack_doc_enabled}" = "xyes"; then
AC_CONFIG_SUBDIRS([doc])
fi
Kurt A. O'Hearn
committed
AC_CONFIG_FILES([Makefile])
AC_OUTPUT