Skip to content

Commit

Permalink
Require that configure is run from MOOSE_DIR
Browse files Browse the repository at this point in the history
This moves `configure` from the framework directory into the root package
directory and then checks during its invocation whether its being run
from the root. If not, it errors.

Closes idaholab#15868
  • Loading branch information
lindsayad committed Sep 30, 2020
1 parent 321d58a commit 82fef0e
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 13 deletions.
File renamed without changes.
File renamed without changes.
23 changes: 17 additions & 6 deletions framework/configure → configure
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,17 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
srcdir=`dirname $0`
top_srcdir=`dirname $0`

test -n "$top_srcdir" &&
ac_top_srcdir_ls_di=`cd "$top_srcdir" && ls -di .` ||
as_fn_error $? "top source directory cannot be determined"

ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"

test "X$ac_top_srcdir_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "MOOSE configure must be run from the root directory"

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ---------------------------------------------" >&5
$as_echo "---------------------------------------------" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ----------- Configuring MOOSE ---------------" >&5
Expand All @@ -1698,11 +1709,11 @@ $as_echo "---------------------------------------------" >&6; }


# Create a temporary file with e.g. SPARSE_AD
ac_config_headers="$ac_config_headers include/base/MooseConfig.h.tmp:include/base/MooseConfig.h.in"
ac_config_headers="$ac_config_headers framework/include/base/MooseConfig.h.tmp:framework/include/base/MooseConfig.h.in"

# Prefixes everything in the temporary file with MOOSE_, e.g. MOOSE_SPARSE_AD

ac_config_commands="$ac_config_commands include/base/MooseConfig.h"
ac_config_commands="$ac_config_commands framework/include/base/MooseConfig.h"



Expand Down Expand Up @@ -2612,8 +2623,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"include/base/MooseConfig.h.tmp") CONFIG_HEADERS="$CONFIG_HEADERS include/base/MooseConfig.h.tmp:include/base/MooseConfig.h.in" ;;
"include/base/MooseConfig.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/base/MooseConfig.h" ;;
"framework/include/base/MooseConfig.h.tmp") CONFIG_HEADERS="$CONFIG_HEADERS framework/include/base/MooseConfig.h.tmp:framework/include/base/MooseConfig.h.in" ;;
"framework/include/base/MooseConfig.h") CONFIG_COMMANDS="$CONFIG_COMMANDS framework/include/base/MooseConfig.h" ;;
"conf_vars.mk") CONFIG_FILES="$CONFIG_FILES conf_vars.mk" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
Expand Down Expand Up @@ -3165,12 +3176,12 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
"include/base/MooseConfig.h":C) ac_prefix_conf_OUT=`echo include/base/MooseConfig.h`
"framework/include/base/MooseConfig.h":C) ac_prefix_conf_OUT=`echo framework/include/base/MooseConfig.h`
ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"`
ac_prefix_conf_PKG=`echo MOOSE`
ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"`
ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e "y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:" -e "/^[0123456789]/s/^/_/"`
ac_prefix_conf_INP=`echo "include/base/MooseConfig.h.tmp" | sed -e 's/ *//'`
ac_prefix_conf_INP=`echo "framework/include/base/MooseConfig.h.tmp" | sed -e 's/ *//'`
if test ".$ac_prefix_conf_INP" = "."; then
for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
case "$ac_file" in
Expand Down
15 changes: 13 additions & 2 deletions framework/configure.ac → configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ AC_PREREQ([2.69])
srcdir=`dirname $0`
top_srcdir=`dirname $0`

test -n "$top_srcdir" &&
ac_top_srcdir_ls_di=`cd "$top_srcdir" && ls -di .` ||
as_fn_error $? "top source directory cannot be determined"

ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"

test "X$ac_top_srcdir_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "MOOSE configure must be run from the root directory"

AC_MSG_RESULT(---------------------------------------------)
AC_MSG_RESULT(----------- Configuring MOOSE ---------------)
AC_MSG_RESULT(---------------------------------------------)

AC_CONFIG_MACRO_DIR([m4])

# Create a temporary file with e.g. SPARSE_AD
AC_CONFIG_HEADER(include/base/MooseConfig.h.tmp:include/base/MooseConfig.h.in)
AC_CONFIG_HEADER(framework/include/base/MooseConfig.h.tmp:framework/include/base/MooseConfig.h.in)
# Prefixes everything in the temporary file with MOOSE_, e.g. MOOSE_SPARSE_AD
AX_PREFIX_CONFIG_H(include/base/MooseConfig.h,MOOSE,include/base/MooseConfig.h.tmp)
AX_PREFIX_CONFIG_H(framework/include/base/MooseConfig.h,MOOSE,framework/include/base/MooseConfig.h.tmp)

AC_ARG_WITH(derivative-type,
AS_HELP_STRING([--with-derivative-type=sparse,nonsparse],[Specify the derivative type to use]),
Expand Down
2 changes: 1 addition & 1 deletion framework/include/base/MooseConfig.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* include/base/MooseConfig.h.in. Generated from configure.ac by autoheader. */
/* framework/include/base/MooseConfig.h.in. Generated from configure.ac by autoheader. */

/* The size of the derivative backing array */
#undef AD_MAX_DOFS_PER_ELEM
Expand Down
6 changes: 3 additions & 3 deletions framework/include/base/MooseDefaultConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#pragma once

/* include/base/MooseConfig.h. Generated automatically at end of configure. */
/* include/base/MooseConfig.h.tmp. Generated from MooseConfig.h.in by configure. */
/* include/base/MooseConfig.h.in. Generated from configure.ac by autoheader. */
/* framework/include/base/MooseConfig.h. Generated automatically at end of configure. */
/* framework/include/base/MooseConfig.h.tmp. Generated from MooseConfig.h.in by configure. */
/* framework/include/base/MooseConfig.h.in. Generated from configure.ac by autoheader. */

/* The size of the derivative backing array */
#ifndef MOOSE_AD_MAX_DOFS_PER_ELEM
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion modules/doc/content/getting_started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ your application is ready to be further developed.
## Customizing MOOSE configuration

MOOSE can be customized by running a `configure` script in
`$MOOSE_DIR/framework`. Below we summarize the configuration options available:
`$MOOSE_DIR`. Note that the `configure` script *must* be invoked from
`$MOOSE_DIR`. Below we summarize the configuration options available:

### Automatic differentiation

Expand Down

0 comments on commit 82fef0e

Please sign in to comment.