From c5d8037b85d9c3baae7c591f06f11ba109282ed2 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Fri, 8 May 2020 00:06:44 +0000 Subject: [PATCH] build: Move PRRTE to a 3rd-party package With Open MPI 5.0, the decision was made to stop building 3rd-party packages, such as Libevent, HWLOC, PMIx, and PRRTE as MCA components and instead 1) start relying on external libraries whenever possible and 2) Open MPI builds the 3rd party libraries (if needed) as independent libraries, rather than linked into libopen-pal. This patch moves the prrte submodule from the top-level to the 3rd-party directory, to match the behavior of other 3rd-party packages like Libevent and PMIx. Since Open MPI does not support building with an external PRRTE, that functionality is skipped in this patch. Signed-off-by: Brian Barrett --- .gitmodules | 2 +- 3rd-party/prrte | 1 + Makefile.am | 7 -- autogen.pl | 24 ++-- config/ompi_deprecated_options.m4 | 34 ------ config/ompi_setup_prrte.m4 | 190 ++++++++++++++++-------------- configure.ac | 14 +-- prrte | 1 - 8 files changed, 116 insertions(+), 157 deletions(-) create mode 160000 3rd-party/prrte delete mode 100644 config/ompi_deprecated_options.m4 delete mode 160000 prrte diff --git a/.gitmodules b/.gitmodules index 83dd507df0..81400e0d6d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "prrte"] - path = prrte + path = 3rd-party/prrte url = https://github.com/openpmix/prrte branch = master [submodule "openpmix"] diff --git a/3rd-party/prrte b/3rd-party/prrte new file mode 160000 index 0000000000..545863e6dc --- /dev/null +++ b/3rd-party/prrte @@ -0,0 +1 @@ +Subproject commit 545863e6dc055233456116da6dc85be2b307f8e2 diff --git a/Makefile.am b/Makefile.am index 93f9916a5c..3062d5adc1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,14 +23,7 @@ # SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_SUBDIRS) test -if OMPI_WANT_PRRTE -SUBDIRS += prrte -endif - DIST_SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_DIST_SUBDIRS) test -if OMPI_WANT_PRRTE -DIST_SUBDIRS += prrte -endif EXTRA_DIST = README INSTALL VERSION Doxyfile LICENSE autogen.pl README.JAVA.txt AUTHORS include examples/Makefile.include diff --git a/autogen.pl b/autogen.pl index 23b7ab455b..1beb7f7a93 100755 --- a/autogen.pl +++ b/autogen.pl @@ -1179,10 +1179,6 @@ if (! -e "ompi") { $no_ompi_arg = 1; debug "No ompi subdirectory found - will not build MPI layer\n"; } -if (! -e "prrte") { - $no_prrte_arg = 1; - debug "No prrte subdirectory found - will not build PRRTE\n"; -} if (! -e "oshmem") { $no_oshmem_arg = 1; debug "No oshmem subdirectory found - will not build OSHMEM\n"; @@ -1415,9 +1411,6 @@ $m4 .= "dnl Separate m4 define for each project\n"; foreach my $p (@$projects) { $m4 .= "m4_define([project_$p->{name}], [1])\n"; } -if (!$no_prrte_arg) { - $m4 .= "m4_define([project_prrte], [1])\n"; -} $m4 .= "\ndnl Project names m4_define([project_name_long], [$project_name_long]) @@ -1490,6 +1483,19 @@ if ("pmix" ~~ @disabled_3rdparty_packages) { verbose "--- PMIx enabled\n"; } +verbose "=== PRRTE\n"; +if ("prrte" ~~ @disabled_3rdparty_packages) { + verbose "--- PRRTE disabled\n"; +} else { + # sanity check prrte files exist + if (! -f "3rd-party/prrte/configure.ac") { + my_die("Could not find pmix files\n"); + } + push(@subdirs, "3rd-party/prrte/"); + $m4 .= "m4_define([package_prrte], [1])\n"; + verbose "--- PRRTE enabled\n"; +} + $m4 .= "\n"; #--------------------------------------------------------------------------- @@ -1511,10 +1517,6 @@ if (!$no_ompi_arg) { ++$step; verbose "\n$step. Processing autogen.subdirs directories\n"; -if (!$no_prrte_arg) { - process_autogen_subdirs("."); -} - if ($#subdirs >= 0) { foreach my $d (@subdirs) { process_subdir($d); diff --git a/config/ompi_deprecated_options.m4 b/config/ompi_deprecated_options.m4 deleted file mode 100644 index 8dd042613c..0000000000 --- a/config/ompi_deprecated_options.m4 +++ /dev/null @@ -1,34 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2020 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -AC_DEFUN([OMPI_CHECK_DEPRECATED_OPTIONS],[ - OPAL_VAR_SCOPE_PUSH([enable_orterun_prefix_given]) - - # --enable-orterun-prefix-by-default was deprecated in v5 in favor of --enable-prte-prefix-by-default - AC_ARG_ENABLE([orterun-prefix-by-default], - [AC_HELP_STRING([--enable-orterun-prefix-by-default], - [*DEPRECATED* Please use --enable-prte-prefix-by-default in the future)])], - [enable_orterun_prefix_given=yes]) - AC_ARG_ENABLE([mpirun-prefix-by-default], - [AC_HELP_STRING([--enable-mpirun-prefix-by-default], - [*DEPRECATED* Please use --enable-prte-prefix-by-default in the future])], - [enable_orterun_prefix_given=yes]) - - if test "$enable_orterun_prefix_given" = "yes"; then - AC_MSG_WARN([Open MPI no longer uses the ORTE environment - it has been]) - AC_MSG_WARN([replaced by PRRTE. Accordingly, the "--enable-orterun-prefix-by-default"]) - AC_MSG_WARN([and "--enable-mpirun-prefix-by-default" options have been replaced]) - AC_MSG_WARN([by "--enable-prte-prefix-by-default". We will do the translation for]) - AC_MSG_WARN([you now, but these older options are deprecated and will be removed]) - AC_MSG_WARN([in a later release, so please update your build scripts.]) - fi - - OPAL_VAR_SCOPE_POP -]) diff --git a/config/ompi_setup_prrte.m4 b/config/ompi_setup_prrte.m4 index 132f115e39..1d9348dbe5 100644 --- a/config/ompi_setup_prrte.m4 +++ b/config/ompi_setup_prrte.m4 @@ -25,67 +25,99 @@ # $HEADER$ # +# Check for / configure PRRTE package. Unlike the other 3rd party +# packages, prrte is either internal or not used (since prrte is a +# pmix server, we don't need to link against it or such in the +# external case). So we don't have to do some of the complex steps we +# do for pmix or hwloc in terms of external hunting. +# +# This macro will not change the environment. +# +# A Makefile conditional OMPI_WANT_PRRTE will be defined based on the +# results of the build. Unless --disable-internal-rte is specified, +# the top-level configure will abort if the PRRTE configure fails. AC_DEFUN([OMPI_SETUP_PRRTE],[ - OPAL_VAR_SCOPE_PUSH([opal_prrte_save_CPPFLAGS opal_prrte_save_CFLAGS opal_prrte_save_LDFLAGS opal_prrte_save_LIBS opal_prrte_args opal_prrte_save_enable_dlopen opal_prrte_save_enable_mca_dso opal_prrte_save_enable_mca_static opal_prrte_extra_libs opal_prrte_extra_ltlibs opal_prrte_extra_ldflags]) + OPAL_VAR_SCOPE_PUSH([internal_prrte_build]) - opal_prrte_save_CFLAGS=$CFLAGS - opal_prrte_save_CPPFLAGS=$CPPFLAGS - opal_prrte_save_LDFLAGS=$LDFLAGS - opal_prrte_save_LIBS=$LIBS - opal_prrte_save_enable_dlopen=enable_dlopen - opal_prrte_save_enable_mca_dso=enable_mca_dso - opal_prrte_save_enable_mca_static=enable_mca_static + internal_prrte_build=0 + m4_ifdef([package_prrte], + [OMPI_SETUP_PRRTE_INTERNAL([internal_prrte_build=1], [internal_prrte_build=0])]) + + AM_CONDITIONAL([OMPI_WANT_PRRTE], [test "$internal_prrte_build" = "1"]) + + OPAL_VAR_SCOPE_POP +]) + +AC_DEFUN([OMPI_SETUP_PRRTE_INTERNAL], [ + OPAL_VAR_SCOPE_PUSH([internal_prrte_args internal_prrte_extra_libs internal_prrte_happy deprecated_prefix_by_default print_prrte_warning]) + + opal_show_subtitle "Configuring PRRTE" AC_ARG_ENABLE([internal-rte], [AC_HELP_STRING([--enable-internal-rte], [Enable internal runtime support and provide mpiexec/mpirun (default: enabled)])]) - AC_ARG_WITH([prrte-platform], - [AC_HELP_STRING([--with-prrte-platform], - [Platform file to use when building the internal PRRTE runtime support])]) - + # This is really a PRTE option that should not be in Open MPI, but + # there is not a great way to support the orterun/mpirun checks + # without this argument. AC_ARG_ENABLE([prte-prefix-by-default], [AC_HELP_STRING([--enable-prte-prefix-by-default], - [Make "mpirun ..." behave exactly the same as "mpirun --prefix \$prefix" (where \$prefix is the value given to --prefix in configure) (default:enabled)])]) + [Make "mpirun ..." behave exactly the same as "mpirun --prefix \$prefix", where \$prefix is the value given to --prefix in configure (default:enabled)])]) - AC_MSG_CHECKING([if RTE support is enabled]) - AS_IF([test "$enable_internal_rte" != "no"], - [AC_MSG_RESULT([yes]) - ompi_want_prrte=yes - opal_prrte_extra_libs= - opal_prrte_extra_ltlibs= + AC_ARG_ENABLE([orterun-prefix-by-default], + [AC_HELP_STRING([--enable-orterun-prefix-by-default], + [*DEPRECATED* Please use --enable-prte-prefix-by-default in the future.])], + [print_prrte_warning="yes" + deprecated_prefix_by_default=$orterun_prefix_by_default]) - AS_IF([test "$opal_libevent_mode" = "internal"], - [opal_prrte_extra_libs="$opal_prrte_extra_libs $opal_libevent_LIBS" - opal_prrte_extra_ltlibs="$opal_prrte_extra_ltlibs $opal_libevent_LIBS" + AC_ARG_ENABLE([mpirun-prefix-by-default], + [AC_HELP_STRING([--enable-mpirun-prefix-by-default], + [*DEPRECATED* Please use --enable-prte-prefix-by-default in the future.])], + [print_prrte_warning="yes" + deprecated_prefix_by_default=$mpirun_prefix_by_default]) - AS_IF([test ! -z "$opal_libevent_header"] - [opal_prrte_libevent_arg="--with-libevent-header=$opal_libevent_header"])], - [opal_prrte_libevent_arg="--with-libevent=$with_libevent" - AS_IF([test ! -z "$with_libevent_libdir"], - [opal_prrte_libevent_arg="$opal_prrte_libevent_arg --with-libevent-libdir=$with_libevent_libdir"])]) + AS_IF([test "$print_prrte_warning" = "yes"], [ + AC_MSG_WARN([Open MPI no longer uses the ORTE environment - it has been]) + AC_MSG_WARN([replaced by PRRTE. Accordingly, the "--enable-orterun-prefix-by-default"]) + AC_MSG_WARN([and "--enable-mpirun-prefix-by-default" options have been replaced]) + AC_MSG_WARN([by "--enable-prte-prefix-by-default". We will do the translation for]) + AC_MSG_WARN([you now, but these older options are deprecated and will be removed]) + AC_MSG_WARN([in a later release, so please update your build scripts.])]) - AS_IF([test "$opal_hwloc_mode" = "internal"], - [opal_prrte_extra_libs="$opal_prrte_extra_libs $opal_hwloc_LIBS" - opal_prrte_extra_ltlibs="$opal_prrte_extra_ltlibs $opal_hwloc_LIBS" + AS_IF([test -n "$prte_prefix_by_default" -a -n "$deprecated_prefix_by_default"], + [AC_MSG_ERROR([--enable-prte-prefix-by-default cannot be used with --enable-mpirun-prefix-by-default or --enable-orterun-prefix-by-default. Please only specify --enable-prte-prefix-by-default.])]) - AS_IF([test ! -z "$opal_hwloc_header"], - [opal_prrte_hwloc_arg="--with-hwloc-header=$opal_hwloc_header"])], - [opal_prrte_hwloc_arg="--with-hwloc=$with_hwloc" - AS_IF([test ! -z "$with_hwloc_libdir"], - [opal_prrte_hwloc_arg="$opal_prrte_hwloc_arg --with-hwloc-libdir=$with_hwloc_libdir"])]) + internal_prrte_happy="yes" + AS_IF([test "$enable_internal_rte" = "no"], + [internal_prrte_happy="no"]) - AS_IF([test "$opal_pmix_mode" = "internal"], - [opal_prrte_extra_libs="$opal_prrte_extra_libs $opal_pmix_LIBS" - opal_prrte_extra_ltlibs="$opal_prrte_extra_ltlibs $opal_pmix_LIBS" + internal_prrte_args="--with-proxy-version-string=$OPAL_VERSION --with-proxy-package-name=\"Open MPI\" --with-proxy-bugreport=\"https://www.open-mpi.org/community/help/\"" + internal_prrte_libs= - AS_IF([test ! -z "$opal_pmix_header"], - [opal_prrte_pmix_arg="--with-pmix-header=$opal_pmix_header"])], - [OPAL_VAR_SCOPE_PUSH([opal_prrte_CPPFLAGS_save]) - opal_prrte_CPPFLAGS_save=$CPPFLAGS + # Set --enable-prte-prefix-by-default to the deprecated options, + # if they were specified. Otherwise, set it to enabled if the + # user did not specify an option. PRTE defaults to not enabling + # prefix-by-default, but open mpi wants that behavior. + AS_IF([test -n "$deprecated_prefix_by_default"], + [internal_prrte_args="internal_prrte_args --enable-prte-prefix-by-default=$deprecated_prefix_by_default"], + [test -z "$enable_prte_prefix_by_default"], + [internal_prrte_args="$internal_prrte_args --enable-prte-prefix-by-default"]) - AC_MSG_CHECKING([if external PMIx version is 3.0.0 or greater]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + AS_IF([test "$opal_libevent_mode" = "internal"], + [internal_prrte_args="$internal_prrte_args --with-libevent-header=$opal_libevent_header" + internal_prrte_libs="$internal_prrte_libs $opal_libevent_LIBS"]) + + AS_IF([test "$opal_hwloc_mode" = "internal"], + [internal_prrte_args="$internal_prrte_args --with-hwloc-header=$opal_hwloc_header" + internal_prrte_libs="$internal_prrte_libs $opal_hwloc_LIBS"]) + + AS_IF([test "$opal_pmix_mode" = "internal"], + [internal_prrte_args="$internal_prrte_args --with-pmix-header=$opal_pmix_header" + internal_prrte_libs="$internal_prrte_libs $opal_pmix_LIBS"]) + + AS_IF([test "$internal_prrte_happy" = "yes"], + [AC_MSG_CHECKING([if PMIx version is 4.0.0 or greater]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ #if PMIX_VERSION_MAJOR < 4L #error "pmix API version is less than 4.0.0" @@ -99,58 +131,36 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[ AC_MSG_WARN([version of PMIx for strictly direct-launch purposes - e.g., using)]) AC_MSG_WARN([Slurm's srun to launch the job - by configuring with the]) AC_MSG_WARN([--disable-internal-rte option.]) - AC_MSG_ERROR([Cannot continue])]) + AC_MSG_ERROR([Cannot continue])])]) - CPPFLAGS=$opal_prrte_CPPFLAGS_save +dnl AS_IF([test ! -z $with_prrte_platform && test "$with_prrte_platform" != "yes"], +dnl [internal_prrte_args="$internal_prrte_args --with-platform=$with_prrte_platform"]) - OPAL_VAR_SCOPE_POP + # add the extra libs + internal_prrte_args="$internal_prrte_args --with-prte-extra-lib=\"$internal_prrte_libs\" --with-prte-extra-ltlib=\"$internal_prrte_libs\"" - opal_prrte_pmix_arg="--with-pmix=$with_pmix" - AS_IF([test ! -z "$with_pmix_libdir"], - [opal_prrte_pmix_arg="$opal_prrte_pmix_arg --with-pmix-libdir=$with_pmix_libdir"])]) + # Pass all our compiler/linker flags to PRRTE, so that it + # picks up how to build an internal HWLOC, libevent, and PMIx, plus + # picks up any user-specified compiler flags from the master + # configure run. + export CFLAGS CPPFLAGS LDFLAGS + PAC_CONFIG_SUBDIR_ARGS([3rd-party/prrte], [$internal_prrte_args], + [[--with-libevent=internal], [--with-hwloc=internal], + [--with-libevent=external], [--with-hwloc=external], + [--with-pmix=internal], [--with-pmix=external], + [--with-platform=.*]], + [], [internal_prrte_happy="no"]) + OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS prrte" - if test -z $enable_prte_prefix_by_default || test "$enable_prte_prefix_by_default" = "yes" || - test "$enable_orterun_prefix_given" = "yes"; then - opal_prrte_prefix_arg="--enable-prte-prefix-by-default" - else - opal_prrte_prefix_arg= - fi + AS_IF([test "$internal_prrte_happy" = "no" -a "$enable_internal_rte" != "no"], + [AC_MSG_ERROR([PRRTE configuration failed. Cannot continue.])]) - opal_prrte_args="--prefix=$prefix --with-proxy-version-string=$OPAL_VERSION --with-proxy-package-name=\"Open MPI\" --with-proxy-bugreport=\"https://www.open-mpi.org/community/help/\" $opal_prrte_prefix_arg $opal_prrte_libevent_arg $opal_prrte_hwloc_arg $opal_prrte_pmix_arg" - AS_IF([test "$enable_debug" = "yes"], - [opal_prrte_args="--enable-debug $opal_prrte_args" - CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"], - [opal_prrte_args="--disable-debug $opal_prrte_args" - CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS"]) - AS_IF([test "$with_devel_headers" = "yes"], - [opal_prrte_args="--with-devel-headers $opal_prrte_args"]) - if test ! -z $with_prrte_platform && test "$with_prrte_platform" != "yes"; then - opal_prrte_args="$opal_prrte_args --with-platform=$with_prrte_platform" - fi - # add the extra libs - opal_prrte_args="$opal_prrte_args --with-prte-extra-lib=\"$opal_prrte_extra_libs\" --with-prte-extra-ltlib=\"$opal_prrte_extra_ltlibs\"" + AS_IF([test "$internal_prrte_happy" = "yes"], + [OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS prrte" + $1], + [$2]) - AC_MSG_CHECKING([final prrte configure args]) - AC_MSG_RESULT([$opal_prrte_args]) - - CPPFLAGS="-I$OPAL_TOP_SRCDIR -I$OPAL_TOP_BUILDDIR -I$OPAL_TOP_SRCDIR/opal/include -I$OPAL_TOP_BUILDDIR/opal/include $CPPFLAGS" - OPAL_CONFIG_SUBDIR([prrte], - [$opal_prrte_args $opal_subdir_args 'CFLAGS=$CFLAGS' 'CPPFLAGS=$CPPFLAGS'], - [opal_prrte_happy=1], [opal_prrte_happy=0]) - - OPAL_SUMMARY_ADD([[Miscellaneous]],[[PRRTE]],[prrte],[yes])], - [OPAL_SUMMARY_ADD([[Miscellaneous]],[[PRRTE]],[prrte],[no (disabled)]) - AC_MSG_RESULT([no (disabled)]) - ompi_want_prrte=no]) - - CFLAGS=$opal_prrte_save_CFLAGS - CPPFLAGS=$opal_prrte_save_CPPFLAGS - LDFLAGS=$opal_prrte_save_LDFLAGS - LIBS=$opal_prrte_save_LIBS - enable_dlopen=$opal_prrte_save_enable_dlopen - enable_mca_dso=$opal_prrte_save_enable_mca_dso - enable_mca_static=$opal_prrte_save_enable_mca_static + OPAL_SUMMARY_ADD([[Miscellaneous]], [[PRRTE]], [prrte], [$internal_prrte_happy]) OPAL_VAR_SCOPE_POP - ]) diff --git a/configure.ac b/configure.ac index 285517bb46..b6bfd7166e 100644 --- a/configure.ac +++ b/configure.ac @@ -198,7 +198,6 @@ fi # Check for deprecated/deleted options OMPI_CHECK_DELETED_OPTIONS -OMPI_CHECK_DEPRECATED_OPTIONS # Setup the top of the opal/include/opal_config.h file @@ -1111,6 +1110,7 @@ OPAL_3RDPARY_DISTCLEAN_DIRS= OPAL_CONFIG_LIBEVENT OPAL_CONFIG_HWLOC OPAL_CONFIG_PMIX +OMPI_SETUP_PRRTE AC_SUBST(OPAL_3RDPARTY_SUBDIRS) AC_SUBST(OPAL_3RDPARTY_DIST_SUBDIRS) @@ -1269,18 +1269,6 @@ AC_SUBST(OPAL_DYN_LIB_SUFFIX) # Need the libtool executable before the rpathify stuff LT_OUTPUT -################################## -# PRRTE support -################################## - -opal_show_title "Setup PRRTE support" - -m4_ifdef([project_prrte], - [OMPI_SETUP_PRRTE], - [OPAL_SUMMARY_ADD([[Miscellaneous]],[[PRRTE]],[prrte],[no (disabled)]) - ompi_want_prrte=no]) -AM_CONDITIONAL(OMPI_WANT_PRRTE, test "$ompi_want_prrte" = "yes") - ############################################################################ # final compiler config ############################################################################ diff --git a/prrte b/prrte deleted file mode 160000 index c75d976772..0000000000 --- a/prrte +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c75d9767728337eb55e0e4b7e826177022514985