Commit 747a466f authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Move grackle and subgrid options down into physics checks

parent e95331dd
......@@ -38,47 +38,6 @@ AX_CHECK_ENABLE_DEBUG
AC_PROG_CC
AM_PROG_CC_C_O
# Master subgrid options
# If you add a restriction (e.g. no cooling, chemistry or hydro)
# you will need to check for overwrite after reading the additional options.
# As an example for this, see the call to AC_ARG_WITH for cooling.
AC_ARG_WITH([subgrid],
[AS_HELP_STRING([--with-subgrid=<subgrid>],
[Master switch for subgrid methods. Inexperienced user should start from here @<:@none, GEAR, EAGLE default: none@:>@]
)],
[with_subgrid="$withval"],
[with_subgrid=none]
)
# Default values
with_subgrid_cooling=none
with_subgrid_chemistry=none
with_subgrid_hydro=none
case "$with_subgrid" in
yes)
AC_MSG_ERROR([Invalid option. A subgrid model must be chosen.])
;;
none)
;;
GEAR)
with_subgrid_cooling=grackle
with_subgrid_chemistry=GEAR
with_subgrid_hydro=gadget2
;;
EAGLE)
with_subgrid_cooling=EAGLE
with_subgrid_chemistry=EAGLE
with_subgrid_hydro=gadget2
;;
*)
AC_MSG_ERROR([Unknown subgrid choice: $with_subgrid])
;;
esac
# If debug is selected then we also define SWIFT_DEVELOP_MODE to control
# any developer code options.
if test "x$ax_enable_debug" != "xno"; then
......@@ -561,42 +520,6 @@ AH_VERBATIM([__STDC_FORMAT_MACROS],
#define __STDC_FORMAT_MACROS 1
#endif])
# Check for grackle.
have_grackle="no"
AC_ARG_WITH([grackle],
[AS_HELP_STRING([--with-grackle=PATH],
[root directory where grackle is installed @<:@yes/no@:>@]
)],
[with_grackle="$withval"],
[with_grackle="no"]
)
if test "x$with_grackle" != "xno"; then
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
if test "x$with_grackle" != "xyes" -a "x$with_grackle" != "x"; then
GRACKLE_LIBS="-L$with_grackle/lib -lgrackle"
GRACKLE_INCS="-I$with_grackle/include"
else
GRACKLE_LIBS="-lgrackle"
GRACKLE_INCS=""
fi
have_grackle="yes"
AC_CHECK_LIB(
[grackle],
[initialize_chemistry_data],
[AC_DEFINE([HAVE_GRACKLE],1,[The GRACKLE library appears to be present.])
AC_DEFINE([CONFIG_BFLOAT_8],1,[Use doubles in grackle])
],
[AC_MSG_ERROR(Cannot find grackle library!)],
[$GRACKLE_LIBS $GRACKLE_INCS $FCLIBS]
)
fi
AC_SUBST([GRACKLE_LIBS])
AC_SUBST([GRACKLE_INCS])
AM_CONDITIONAL([HAVEGRACKLE],[test -n "$GRACKLE_LIBS"])
# Check for FFTW. We test for this in the standard directories by default,
# and only disable if using --with-fftw=no or --without-fftw. When a value
# is given GSL must be found.
......@@ -956,6 +879,46 @@ fi
# Various package configuration options.
# Master subgrid options
# If you add a restriction (e.g. no cooling, chemistry or hydro)
# you will need to check for overwrite after reading the additional options.
# As an example for this, see the call to AC_ARG_WITH for cooling.
AC_ARG_WITH([subgrid],
[AS_HELP_STRING([--with-subgrid=<subgrid>],
[Master switch for subgrid methods. Inexperienced user should start from here @<:@none, GEAR, EAGLE default: none@:>@]
)],
[with_subgrid="$withval"],
[with_subgrid=none]
)
# Default values
with_subgrid_cooling=none
with_subgrid_chemistry=none
with_subgrid_hydro=none
case "$with_subgrid" in
yes)
AC_MSG_ERROR([Invalid option. A subgrid model must be chosen.])
;;
none)
;;
GEAR)
with_subgrid_cooling=grackle
with_subgrid_chemistry=GEAR
with_subgrid_hydro=gadget2
;;
EAGLE)
with_subgrid_cooling=EAGLE
with_subgrid_chemistry=EAGLE
with_subgrid_hydro=gadget2
;;
*)
AC_MSG_ERROR([Unknown subgrid choice: $with_subgrid])
;;
esac
# Hydro scheme.
AC_ARG_WITH([hydro],
[AS_HELP_STRING([--with-hydro=<scheme>],
......@@ -1160,6 +1123,42 @@ case "$with_riemann" in
;;
esac
# Check for grackle.
have_grackle="no"
AC_ARG_WITH([grackle],
[AS_HELP_STRING([--with-grackle=PATH],
[root directory where grackle is installed @<:@yes/no@:>@]
)],
[with_grackle="$withval"],
[with_grackle="no"]
)
if test "x$with_grackle" != "xno"; then
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
if test "x$with_grackle" != "xyes" -a "x$with_grackle" != "x"; then
GRACKLE_LIBS="-L$with_grackle/lib -lgrackle"
GRACKLE_INCS="-I$with_grackle/include"
else
GRACKLE_LIBS="-lgrackle"
GRACKLE_INCS=""
fi
have_grackle="yes"
AC_CHECK_LIB(
[grackle],
[initialize_chemistry_data],
[AC_DEFINE([HAVE_GRACKLE],1,[The GRACKLE library appears to be present.])
AC_DEFINE([CONFIG_BFLOAT_8],1,[Use doubles in grackle])
],
[AC_MSG_ERROR(Cannot find grackle library!)],
[$GRACKLE_LIBS $GRACKLE_INCS $FCLIBS]
)
fi
AC_SUBST([GRACKLE_LIBS])
AC_SUBST([GRACKLE_INCS])
AM_CONDITIONAL([HAVEGRACKLE],[test -n "$GRACKLE_LIBS"])
# Cooling function
AC_ARG_WITH([cooling],
[AS_HELP_STRING([--with-cooling=<function>],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment