From 2787d993a9a7656b95158cef6552427fbe0c393e Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Fri, 16 Sep 2005 04:51:09 +0000 Subject: [PATCH] * Add checks for fork/execve/setpgid for slurm components so that they automagically don't build on platforms without such things * Fix for mistaken use of cache variable in assembly setup * one more cached test hits the books This commit was SVN r7404. --- acinclude.m4 | 1 + config/ompi_check_slurm.m4 | 50 +++++++++++++++++++++++++++++++++ config/ompi_config_asm.m4 | 25 ++++++++++------- orte/mca/pls/slurm/configure.m4 | 35 +++++++++++++++++++++++ orte/mca/ras/slurm/configure.m4 | 35 +++++++++++++++++++++++ 5 files changed, 136 insertions(+), 10 deletions(-) create mode 100644 config/ompi_check_slurm.m4 create mode 100644 orte/mca/pls/slurm/configure.m4 create mode 100644 orte/mca/ras/slurm/configure.m4 diff --git a/acinclude.m4 b/acinclude.m4 index a801520fea..72bb215197 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -59,6 +59,7 @@ m4_include(config/ompi_check_bproc.m4) m4_include(config/ompi_check_mvapi.m4) m4_include(config/ompi_check_openib.m4) m4_include(config/ompi_check_package.m4) +m4_include(config/ompi_check_slurm.m4) m4_include(config/ompi_check_tm.m4) m4_include(config/ompi_check_xgrid.m4) m4_include(config/ompi_config_subdir.m4) diff --git a/config/ompi_check_slurm.m4 b/config/ompi_check_slurm.m4 new file mode 100644 index 0000000000..f8e6994536 --- /dev/null +++ b/config/ompi_check_slurm.m4 @@ -0,0 +1,50 @@ +# -*- shell-script -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# OMPI_CHECK_SLURM(prefix, [action-if-found], [action-if-not-found]) +# -------------------------------------------------------- +AC_DEFUN([OMPI_CHECK_SLURM],[ + AC_ARG_WITH([slurm], + [AC_HELP_STRING([--with-slurm], + [Build SLURM scheduler component (default: yes)])]) + + if test "with_slurm" = "no" ; then + ompi_check_slurm_happy="no" + else + ompi_check_slurm_happy="yes" + fi + + AS_IF([test "$ompi_check_slurm_happy" = "yes"], + [AC_CHECK_FUNC([fork], + [ompi_check_slurm_happy="yes"], + [ompi_check_slurm_happy="no"])]) + + AS_IF([test "$ompi_check_slurm_happy" = "yes"], + [AC_CHECK_FUNC([execve], + [ompi_check_slurm_happy="yes"], + [ompi_check_slurm_happy="no"])]) + + AS_IF([test "$ompi_check_slurm_happy" = "yes"], + [AC_CHECK_FUNC([setpgid], + [ompi_check_slurm_happy="yes"], + [ompi_check_slurm_happy="no"])]) + + AS_IF([test "$ompi_check_slurm_happy" = "yes"], + [$2], + [$3]) +]) diff --git a/config/ompi_config_asm.m4 b/config/ompi_config_asm.m4 index 4b51dc2304..99c954c785 100644 --- a/config/ompi_config_asm.m4 +++ b/config/ompi_config_asm.m4 @@ -260,10 +260,9 @@ AC_DEFUN([OMPI_CHECK_ASM_ALIGN_LOG],[ AC_REQUIRE([OMPI_CHECK_ASM_LABEL_SUFFIX]) AC_REQUIRE([AC_PROG_NM]) - ompi_cv_asm_align_log=0 - asm_result="no" - AC_MSG_CHECKING([if .align directive takes logarithmic value]) - OMPI_TRY_ASSEMBLE([ $ompi_cv_asm_text + AC_CACHE_CHECK([if .align directive takes logarithmic value], + [ompi_cv_asm_align_log], + [ OMPI_TRY_ASSEMBLE([ $ompi_cv_asm_text .align 4 $ompi_cv_asm_global foo .byte 1 @@ -275,13 +274,19 @@ foo$ompi_cv_asm_label_suffix # test for both 16 and 10 (decimal and hex notations) echo "configure: .align test address offset is $ompi_asm_addr" >& AC_FD_CC if test "$ompi_asm_addr" = "16" -o "$ompi_asm_addr" = "10" ; then - ompi_cv_asm_align_log=1 - asm_result="yes" + ompi_cv_asm_align_log="yes" + else + ompi_cv_asm_align_log="no" + fi]) + + if test "$ompi_cv_asm_align_log" = "yes" -o "$ompi_cv_asm_align_log" = "1" ; then + ompi_asm_align_log_result=1 + else + ompi_asm_align_log_result=0 fi - AC_MSG_RESULT([$asm_result]) AC_DEFINE_UNQUOTED([OMPI_ASM_ALIGN_LOG], - [$ompi_cv_asm_align_log], + [$asm_align_log_result], [Assembly align directive expects logarithmic value]) unset omp_asm_addr asm_result @@ -859,8 +864,8 @@ asm_format="${ompi_asm_arch_config}" asm_format="${asm_format}-${ompi_cv_asm_text}-${ompi_cv_asm_global}" asm_format="${asm_format}-${ompi_cv_asm_label_suffix}-${ompi_cv_asm_gsym}" asm_format="${asm_format}-${ompi_cv_asm_lsym}" -asm_format="${asm_format}-${ompi_cv_asm_type}-${ompi_cv_asm_size}" -asm_format="${asm_format}-${ompi_cv_asm_align_log}" +asm_format="${asm_format}-${ompi_cv_asm_type}-${ompi_asm_size}" +asm_format="${asm_format}-${ompi_asm_align_log_result}" if test "$ompi_cv_asm_arch" = "POWERPC32" -o "$ompi_cv_asm_arch" = "POWERPC64" ; then asm_format="${asm_format}-${ompi_cv_asm_powerpc_r_reg}" else diff --git a/orte/mca/pls/slurm/configure.m4 b/orte/mca/pls/slurm/configure.m4 new file mode 100644 index 0000000000..611b81c583 --- /dev/null +++ b/orte/mca/pls/slurm/configure.m4 @@ -0,0 +1,35 @@ +# -*- shell-script -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# MCA_pls_slurm_CONFIG([action-if-found], [action-if-not-found]) +# ----------------------------------------------------------- +AC_DEFUN([MCA_pls_slurm_CONFIG],[ + OMPI_CHECK_SLURM([pls_slurm], [pls_slurm_good=1], [pls_slurm_good=0]) + + # if check worked, set wrapper flags if so. + # Evaluate succeed / fail + AS_IF([test "$pls_slurm_good" = "1"], + [pls_slurm_WRAPPER_EXTRA_LDFLAGS="$pls_slurm_LDFLAGS" + pls_slurm_WRAPPER_EXTRA_LIBS="$pls_slurm_LIBS" + $1], + [$2]) + + # set build flags to use in makefile + AC_SUBST([pls_slurm_CPPFLAGS]) + AC_SUBST([pls_slurm_LDFLAGS]) + AC_SUBST([pls_slurm_LIBS]) +])dnl diff --git a/orte/mca/ras/slurm/configure.m4 b/orte/mca/ras/slurm/configure.m4 new file mode 100644 index 0000000000..84ce8f4217 --- /dev/null +++ b/orte/mca/ras/slurm/configure.m4 @@ -0,0 +1,35 @@ +# -*- shell-script -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# MCA_ras_slurm_CONFIG([action-if-found], [action-if-not-found]) +# ----------------------------------------------------------- +AC_DEFUN([MCA_ras_slurm_CONFIG],[ + OMPI_CHECK_SLURM([ras_slurm], [ras_slurm_good=1], [ras_slurm_good=0]) + + # if check worked, set wrapper flags if so. + # Evaluate succeed / fail + AS_IF([test "$ras_slurm_good" = "1"], + [ras_slurm_WRAPPER_EXTRA_LDFLAGS="$ras_slurm_LDFLAGS" + ras_slurm_WRAPPER_EXTRA_LIBS="$ras_slurm_LIBS" + $1], + [$2]) + + # set build flags to use in makefile + AC_SUBST([ras_slurm_CPPFLAGS]) + AC_SUBST([ras_slurm_LDFLAGS]) + AC_SUBST([ras_slurm_LIBS]) +])dnl