diff --git a/.gitignore b/.gitignore index 646e12659e0..21ab8f5ddcc 100644 --- a/.gitignore +++ b/.gitignore @@ -313,7 +313,7 @@ opal/tools/wrappers/opalCC-wrapper-data.txt opal/tools/wrappers/opal_wrapper opal/tools/wrappers/opal.pc -opal/util/show_help_lex.c +opal/util/show_help_content.c opal/util/keyval/keyval_lex.c test/monitoring/aggregate_profile.pl diff --git a/ompi/Makefile.am b/ompi/Makefile.am index d5a74b3b35d..f855492ef15 100644 --- a/ompi/Makefile.am +++ b/ompi/Makefile.am @@ -21,6 +21,7 @@ # Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. # Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights # reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -153,7 +154,7 @@ lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \ headers = noinst_LTLIBRARIES = include_HEADERS = -dist_ompidata_DATA = +EXTRA_DIST = lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers) # Conditionally install the header files diff --git a/ompi/communicator/Makefile.am b/ompi/communicator/Makefile.am index 675d9bad881..e1d25ad1026 100644 --- a/ompi/communicator/Makefile.am +++ b/ompi/communicator/Makefile.am @@ -15,6 +15,7 @@ # Copyright (c) 2014 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -39,4 +40,4 @@ lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ communicator/ft/comm_ft.c communicator/ft/comm_ft_reliable_bcast.c communicator/ft/comm_ft_propagator.c communicator/ft/comm_ft_detector.c communicator/ft/comm_ft_revoke.c endif # WANT_FT_MPI -dist_ompidata_DATA += communicator/help-comm.txt +EXTRA_DIST += communicator/help-comm.txt diff --git a/ompi/dpm/Makefile.am b/ompi/dpm/Makefile.am index 002b050b568..02562525b9f 100644 --- a/ompi/dpm/Makefile.am +++ b/ompi/dpm/Makefile.am @@ -2,6 +2,7 @@ # # Copyright (c) 2015-2020 Intel, Inc. All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -11,11 +12,10 @@ # This makefile.am does not stand on its own - it is included from ompi/Makefile.am -dist_ompidata_DATA += dpm/help-dpm.txt +EXTRA_DIST += dpm/help-dpm.txt headers += \ dpm/dpm.h lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ dpm/dpm.c - diff --git a/ompi/errhandler/Makefile.am b/ompi/errhandler/Makefile.am index 6f7264135c2..9f94623a9ff 100644 --- a/ompi/errhandler/Makefile.am +++ b/ompi/errhandler/Makefile.am @@ -12,6 +12,7 @@ # All rights reserved. # Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -21,7 +22,7 @@ # This makefile.am does not stand on its own - it is included from ompi/Makefile.am -dist_ompidata_DATA += errhandler/help-mpi-errors.txt +EXTRA_DIST += errhandler/help-mpi-errors.txt headers += \ errhandler/errcode.h \ diff --git a/ompi/mca/bml/r2/Makefile.am b/ompi/mca/bml/r2/Makefile.am index a37dba65668..0fdb3e636f3 100644 --- a/ompi/mca/bml/r2/Makefile.am +++ b/ompi/mca/bml/r2/Makefile.am @@ -9,6 +9,7 @@ # All rights reserved. # Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -21,7 +22,7 @@ r2_sources = \ bml_r2.h \ bml_r2_component.c -dist_ompidata_DATA = help-mca-bml-r2.txt +EXTRA_DIST = help-mca-bml-r2.txt if MCA_BUILD_ompi_bml_r2_DSO component_noinst = diff --git a/ompi/mca/coll/base/Makefile.am b/ompi/mca/coll/base/Makefile.am index bf98e476411..5c164d579e0 100644 --- a/ompi/mca/coll/base/Makefile.am +++ b/ompi/mca/coll/base/Makefile.am @@ -9,6 +9,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -16,7 +17,7 @@ # $HEADER$ # -dist_ompidata_DATA = base/help-mca-coll-base.txt +EXTRA_DIST = base/help-mca-coll-base.txt headers += \ base/base.h \ @@ -51,4 +52,3 @@ if WANT_FT_MPI libmca_coll_la_SOURCES += \ base/coll_base_agree_noft.c endif # WANT_FT_MPI - diff --git a/ompi/mca/coll/xhc/Makefile.am b/ompi/mca/coll/xhc/Makefile.am index 0dab908bc75..9351e214200 100644 --- a/ompi/mca/coll/xhc/Makefile.am +++ b/ompi/mca/coll/xhc/Makefile.am @@ -1,6 +1,7 @@ # # Copyright (c) 2021-2024 Computer Architecture and VLSI Systems (CARV) # Laboratory, ICS Forth. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -8,7 +9,7 @@ # $HEADER$ # -dist_opaldata_DATA = help-coll-xhc.txt +EXTRA_DIST = help-coll-xhc.txt sources = \ coll_xhc.h \ diff --git a/ompi/mca/hook/base/Makefile.am b/ompi/mca/hook/base/Makefile.am index 29ac5246be5..c89bdfeec55 100644 --- a/ompi/mca/hook/base/Makefile.am +++ b/ompi/mca/hook/base/Makefile.am @@ -1,5 +1,6 @@ # # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -7,7 +8,7 @@ # $HEADER$ # -dist_ompidata_DATA = base/help-mca-hook-base.txt +EXTRA_DIST = base/help-mca-hook-base.txt headers += \ base/base.h diff --git a/ompi/mca/mtl/ofi/Makefile.am b/ompi/mca/mtl/ofi/Makefile.am index 7f374868149..5842abd3018 100644 --- a/ompi/mca/mtl/ofi/Makefile.am +++ b/ompi/mca/mtl/ofi/Makefile.am @@ -10,6 +10,7 @@ # Copyright (c) 2020 Triad National Security, LLC. All rights # reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -18,6 +19,7 @@ # EXTRA_DIST = post_configure.sh \ + help-mtl-ofi.txt \ $(generated_source_modules) MAINTAINERCLEANFILES = \ @@ -25,8 +27,6 @@ MAINTAINERCLEANFILES = \ AM_CPPFLAGS = $(mtl_ofi_CPPFLAGS) -dist_ompidata_DATA = help-mtl-ofi.txt - generated_source_modules = \ mtl_ofi_send_opt.pm \ mtl_ofi_isend_opt.pm \ diff --git a/ompi/mca/mtl/psm2/Makefile.am b/ompi/mca/mtl/psm2/Makefile.am index 741c65e4638..8b889bf726a 100644 --- a/ompi/mca/mtl/psm2/Makefile.am +++ b/ompi/mca/mtl/psm2/Makefile.am @@ -13,8 +13,9 @@ # Copyright (c) 2015 Intel, Inc. All rights reserved # Copyright (c) 2017 Los Alamos National Security, LLC. # All rights reserved. -# +# # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -22,11 +23,12 @@ # $HEADER$ # -EXTRA_DIST = post_configure.sh +EXTRA_DIST = \ + post_configure.sh \ + help-mtl-psm2.txt AM_CPPFLAGS = $(mtl_psm2_CPPFLAGS) -dist_ompidata_DATA = help-mtl-psm2.txt mtl_psm2_sources = \ mtl_psm2.c \ diff --git a/ompi/mca/pml/ob1/Makefile.am b/ompi/mca/pml/ob1/Makefile.am index b2cd3152d39..38487f5a2e6 100644 --- a/ompi/mca/pml/ob1/Makefile.am +++ b/ompi/mca/pml/ob1/Makefile.am @@ -14,6 +14,7 @@ # Copyright (c) 2012 NVIDIA Corporation. All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -21,11 +22,10 @@ # $HEADER$ # -dist_ompidata_DATA = \ +EXTRA_DIST = \ + post_configure.sh \ help-mpi-pml-ob1.txt -EXTRA_DIST = post_configure.sh - ob1_sources = \ pml_ob1.c \ pml_ob1.h \ diff --git a/ompi/mpi/Makefile.am b/ompi/mpi/Makefile.am index 388076307c9..3d22f4755dc 100644 --- a/ompi/mpi/Makefile.am +++ b/ompi/mpi/Makefile.am @@ -12,6 +12,7 @@ # Copyright (c) 2006-2018 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -19,7 +20,6 @@ # $HEADER$ # -EXTRA_DIST = \ - mpi/fortran/configure-fortran-output-bottom.h - -dist_ompidata_DATA += mpi/help-mpi-api.txt +EXTRA_DIST += \ + mpi/fortran/configure-fortran-output-bottom.h \ + mpi/help-mpi-api.txt diff --git a/ompi/mpiext/ftmpi/c/Makefile.am b/ompi/mpiext/ftmpi/c/Makefile.am index b93fdd5e590..8a1a1a165a2 100644 --- a/ompi/mpiext/ftmpi/c/Makefile.am +++ b/ompi/mpiext/ftmpi/c/Makefile.am @@ -3,6 +3,7 @@ # Copyright (c) 2016-2022 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -37,7 +38,7 @@ libmpiext_ftmpi_c_la_SOURCES = \ libmpiext_ftmpi_c_la_LIBADD = \ profile/libpmpiext_ftmpi_c.la -dist_ompidata_DATA = help-mpi-ft.txt +EXTRA_DIST = help-mpi-ft.txt ompidir = $(ompiincludedir)/mpiext/ ompi_HEADERS = $(headers) diff --git a/ompi/runtime/Makefile.am b/ompi/runtime/Makefile.am index 2a31779b9fd..957045ed116 100644 --- a/ompi/runtime/Makefile.am +++ b/ompi/runtime/Makefile.am @@ -12,6 +12,7 @@ # Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2014-2019 Intel, Inc. All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -21,7 +22,7 @@ # This makefile.am does not stand on its own - it is included from ompi/Makefile.am -dist_ompidata_DATA += runtime/help-mpi-runtime.txt +EXTRA_DIST += runtime/help-mpi-runtime.txt headers += \ runtime/mpiruntime.h \ diff --git a/ompi/tools/mpirun/Makefile.am b/ompi/tools/mpirun/Makefile.am index e5e7836ded5..7167ccdf6dd 100644 --- a/ompi/tools/mpirun/Makefile.am +++ b/ompi/tools/mpirun/Makefile.am @@ -4,6 +4,7 @@ # Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # Copyright (c) 2021 Nanook Consulting. All rights reserved. # Copyright (c) 2022 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -15,7 +16,7 @@ if OMPI_WANT_PRRTE bin_PROGRAMS = mpirun -dist_ompidata_DATA = help-mpirun.txt +EXTRA_DIST = help-mpirun.txt mpirun_SOURCES = \ main.c diff --git a/opal/Makefile.am b/opal/Makefile.am index 1aad41b8ffb..100e91fccc1 100644 --- a/opal/Makefile.am +++ b/opal/Makefile.am @@ -15,6 +15,7 @@ # and Technology (RIST). All rights reserved. # Copyright (c) 2020-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. # Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -69,7 +70,7 @@ lib@OPAL_LIB_NAME@_la_LDFLAGS = -version-info @libopen_pal_so_version@ # included subdirectory Makefile.am's and appended-to variables headers = -dist_opaldata_DATA = +EXTRA_DIST = lib@OPAL_LIB_NAME@_la_SOURCES += $(headers) # Conditionally install the header files diff --git a/opal/mca/accelerator/base/Makefile.am b/opal/mca/accelerator/base/Makefile.am index 321f76dc3aa..91357b0ee8a 100644 --- a/opal/mca/accelerator/base/Makefile.am +++ b/opal/mca/accelerator/base/Makefile.am @@ -4,6 +4,7 @@ # Copyright (c) 2014 Intel, Inc. All rights reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. # All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -11,7 +12,7 @@ # $HEADER$ # -dist_opaldata_DATA = base/help-accelerator-base.txt +EXTRA_DIST = base/help-accelerator-base.txt headers += \ base/base.h diff --git a/opal/mca/accelerator/cuda/Makefile.am b/opal/mca/accelerator/cuda/Makefile.am index 2c533ece111..2c5260d8718 100644 --- a/opal/mca/accelerator/cuda/Makefile.am +++ b/opal/mca/accelerator/cuda/Makefile.am @@ -3,6 +3,7 @@ # Copyright (c) 2017 IBM Corporation. All rights reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. # All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -12,7 +13,7 @@ AM_CPPFLAGS = $(common_cuda_CPPFLAGS) -dist_opaldata_DATA = help-accelerator-cuda.txt +EXTRA_DIST = help-accelerator-cuda.txt sources = \ accelerator_cuda.h \ accelerator_cuda_component.c \ diff --git a/opal/mca/allocator/bucket/Makefile.am b/opal/mca/allocator/bucket/Makefile.am index 676ae96eef2..f868f7ed88f 100644 --- a/opal/mca/allocator/bucket/Makefile.am +++ b/opal/mca/allocator/bucket/Makefile.am @@ -11,6 +11,7 @@ # All rights reserved. # Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -18,7 +19,7 @@ # $HEADER$ # -dist_opaldata_DATA = help-mca-allocator-bucket.txt +EXTRA_DIST = help-mca-allocator-bucket.txt sources = \ allocator_bucket.c \ @@ -46,4 +47,3 @@ mca_allocator_bucket_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_NAME@.la noinst_LTLIBRARIES = $(component_noinst) libmca_allocator_bucket_la_SOURCES = $(sources) libmca_allocator_bucket_la_LDFLAGS = -module -avoid-version - diff --git a/opal/mca/base/Makefile.am b/opal/mca/base/Makefile.am index 2e4cd3f2f3f..c6f57e0283a 100644 --- a/opal/mca/base/Makefile.am +++ b/opal/mca/base/Makefile.am @@ -11,6 +11,7 @@ # All rights reserved. # Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2020 Google LLC. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -26,7 +27,7 @@ AM_CPPFLAGS = \ noinst_LTLIBRARIES = libmca_base.la -dist_opaldata_DATA = help-mca-base.txt help-mca-var.txt +EXTRA_DIST = help-mca-base.txt help-mca-var.txt # Source code files diff --git a/opal/mca/btl/base/Makefile.am b/opal/mca/btl/base/Makefile.am index 84b375f8ac9..7019bc1983a 100644 --- a/opal/mca/btl/base/Makefile.am +++ b/opal/mca/btl/base/Makefile.am @@ -11,6 +11,7 @@ # All rights reserved. # Copyright (c) 2021 Triad National Security, LLC. All rights reserved. # Copyright (c) 2021 Google, LLC. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -18,7 +19,7 @@ # $HEADER$ # -dist_opaldata_DATA = base/help-mpi-btl-base.txt +EXTRA_DIST = base/help-mpi-btl-base.txt headers += \ base/base.h \ diff --git a/opal/mca/btl/ofi/Makefile.am b/opal/mca/btl/ofi/Makefile.am index d0a72dfe622..271a93bed54 100644 --- a/opal/mca/btl/ofi/Makefile.am +++ b/opal/mca/btl/ofi/Makefile.am @@ -16,6 +16,7 @@ # Copyright (c) 2020 Triad National Security, LLC. All rights # reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -23,8 +24,6 @@ # $HEADER$ # -#dist_opaldata_DATA = help-mpi-btl-ofi.txt - AM_CPPFLAGS = $(btl_ofi_CPPFLAGS) sources = \ btl_ofi.h \ diff --git a/opal/mca/btl/smcuda/Makefile.am b/opal/mca/btl/smcuda/Makefile.am index 8ee37addf98..c0cdf788e8d 100644 --- a/opal/mca/btl/smcuda/Makefile.am +++ b/opal/mca/btl/smcuda/Makefile.am @@ -13,6 +13,7 @@ # Copyright (c) 2012 NVIDIA Corporation. All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -20,7 +21,7 @@ # $HEADER$ # -dist_opaldata_DATA = help-mpi-btl-smcuda.txt +EXTRA_DIST = help-mpi-btl-smcuda.txt libmca_btl_smcuda_la_sources = \ btl_smcuda.c \ diff --git a/opal/mca/btl/tcp/Makefile.am b/opal/mca/btl/tcp/Makefile.am index 2fcd95008ec..a2de9e77883 100644 --- a/opal/mca/btl/tcp/Makefile.am +++ b/opal/mca/btl/tcp/Makefile.am @@ -20,7 +20,7 @@ # $HEADER$ # -dist_opaldata_DATA = help-mpi-btl-tcp.txt +EXTRA_DIST = help-mpi-btl-tcp.txt sources = \ btl_tcp.c \ diff --git a/opal/mca/btl/usnic/Makefile.am b/opal/mca/btl/usnic/Makefile.am index ff98fd3c6e0..182ba93655b 100644 --- a/opal/mca/btl/usnic/Makefile.am +++ b/opal/mca/btl/usnic/Makefile.am @@ -19,6 +19,7 @@ # Copyright (c) 2019 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -28,9 +29,8 @@ AM_CPPFLAGS = $(btl_usnic_CPPFLAGS) -DOMPI_LIBMPI_NAME=\"$(OMPI_LIBMPI_NAME)\" -EXTRA_DIST = README.md README.test - -dist_opaldata_DATA = \ +EXTRA_DIST = \ + README.md README.test \ help-mpi-btl-usnic.txt test_sources = \ diff --git a/opal/mca/common/ofi/Makefile.am b/opal/mca/common/ofi/Makefile.am index 97fe84c7d58..81d2a88e40b 100644 --- a/opal/mca/common/ofi/Makefile.am +++ b/opal/mca/common/ofi/Makefile.am @@ -16,6 +16,7 @@ # reserved. # Copyright (c) 2019 Hewlett Packard Enterprise. All rights reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -32,7 +33,7 @@ AM_CPPFLAGS = $(common_ofi_CPPFLAGS) -dist_opaldata_DATA = help-common-ofi.txt +EXTRA_DIST = help-common-ofi.txt # Header files diff --git a/opal/mca/common/sm/Makefile.am b/opal/mca/common/sm/Makefile.am index 2522e5a6816..0c249088d37 100644 --- a/opal/mca/common/sm/Makefile.am +++ b/opal/mca/common/sm/Makefile.am @@ -12,6 +12,7 @@ # Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2010-2015 Los Alamos National Security, LLC. # All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -55,7 +56,7 @@ sources = \ # Help file -dist_opaldata_DATA = help-mpi-common-sm.txt +EXTRA_DIST = help-mpi-common-sm.txt # As per above, we'll either have an installable or noinst result. # The installable one should follow the same MCA prefix naming rules diff --git a/opal/mca/hwloc/base/Makefile.am b/opal/mca/hwloc/base/Makefile.am index 29790aac434..73341d53c68 100644 --- a/opal/mca/hwloc/base/Makefile.am +++ b/opal/mca/hwloc/base/Makefile.am @@ -1,6 +1,7 @@ # # Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2015-2020 Intel, Inc. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -8,7 +9,7 @@ # $HEADER$ # -dist_opaldata_DATA = base/help-opal-hwloc-base.txt +EXTRA_DIST += base/help-opal-hwloc-base.txt headers += \ base/base.h \ @@ -18,4 +19,3 @@ libmca_hwloc_la_SOURCES += \ base/hwloc_base_frame.c \ base/hwloc_base_util.c \ base/hwloc_base_maffinity.c - diff --git a/opal/mca/if/linux_ipv6/Makefile.am b/opal/mca/if/linux_ipv6/Makefile.am index cfa428ab5ff..3e9b8ef713a 100644 --- a/opal/mca/if/linux_ipv6/Makefile.am +++ b/opal/mca/if/linux_ipv6/Makefile.am @@ -1,5 +1,6 @@ # # Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -7,7 +8,7 @@ # $HEADER$ # -dist_opaldata_DATA = help-opal-if-linux-ipv6.txt +EXTRA_DIST = help-opal-if-linux-ipv6.txt noinst_LTLIBRARIES = libmca_if_linux_ipv6.la diff --git a/opal/mca/mpool/Makefile.am b/opal/mca/mpool/Makefile.am index 27501f794fc..961383c51d0 100644 --- a/opal/mca/mpool/Makefile.am +++ b/opal/mca/mpool/Makefile.am @@ -10,6 +10,7 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -31,7 +32,7 @@ opaldir = $(opalincludedir)/$(subdir) nobase_opal_HEADERS = $(headers) endif -dist_opaldata_DATA = +EXTRA_DIST = include base/Makefile.am distclean-local: diff --git a/opal/mca/mpool/base/Makefile.am b/opal/mca/mpool/base/Makefile.am index dd85a97fb6b..66b2bdbb668 100644 --- a/opal/mca/mpool/base/Makefile.am +++ b/opal/mca/mpool/base/Makefile.am @@ -12,6 +12,7 @@ # Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2015 Los Alamos National Security, LLC. All rights # reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -31,5 +32,5 @@ libmca_mpool_la_SOURCES += \ base/mpool_base_default.c \ base/mpool_base_basic.c -dist_opaldata_DATA += \ +EXTRA_DIST += \ base/help-mpool-base.txt diff --git a/opal/mca/rcache/base/Makefile.am b/opal/mca/rcache/base/Makefile.am index bd27121c93c..61df57f3f21 100644 --- a/opal/mca/rcache/base/Makefile.am +++ b/opal/mca/rcache/base/Makefile.am @@ -11,6 +11,7 @@ # All rights reserved. # Copyright (c) 2013-2016 Los Alamos National Security, LLC. All rights # reserved +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -32,5 +33,5 @@ libmca_rcache_la_SOURCES += \ base/rcache_base_vma_tree.c \ base/rcache_base_mem_cb.c -dist_opaldata_DATA = \ +EXTRA_DIST = \ base/help-rcache-base.txt diff --git a/opal/mca/shmem/mmap/Makefile.am b/opal/mca/shmem/mmap/Makefile.am index 7e5575f0337..e8c7a14b8fe 100644 --- a/opal/mca/shmem/mmap/Makefile.am +++ b/opal/mca/shmem/mmap/Makefile.am @@ -13,6 +13,7 @@ # Copyright (c) 2010-2011 Los Alamos National Security, LLC. # All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -38,7 +39,7 @@ component_install = endif # help file -dist_opaldata_DATA = help-opal-shmem-mmap.txt +EXTRA_DIST = help-opal-shmem-mmap.txt mcacomponentdir = $(opallibdir) mcacomponent_LTLIBRARIES = $(component_install) diff --git a/opal/mca/shmem/posix/Makefile.am b/opal/mca/shmem/posix/Makefile.am index eea4b8acf5c..a317e9236c1 100644 --- a/opal/mca/shmem/posix/Makefile.am +++ b/opal/mca/shmem/posix/Makefile.am @@ -13,6 +13,7 @@ # Copyright (c) 2010-2011 Los Alamos National Security, LLC. # All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -49,4 +50,4 @@ libmca_shmem_posix_la_SOURCES = $(sources) libmca_shmem_posix_la_LDFLAGS = -module -avoid-version # help file -dist_opaldata_DATA = help-opal-shmem-posix.txt +EXTRA_DIST = help-opal-shmem-posix.txt diff --git a/opal/mca/shmem/sysv/Makefile.am b/opal/mca/shmem/sysv/Makefile.am index eba92baf471..206573a39e4 100644 --- a/opal/mca/shmem/sysv/Makefile.am +++ b/opal/mca/shmem/sysv/Makefile.am @@ -13,6 +13,7 @@ # Copyright (c) 2010-2011 Los Alamos National Security, LLC. # All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -47,4 +48,4 @@ libmca_shmem_sysv_la_SOURCES = $(sources) libmca_shmem_sysv_la_LDFLAGS = -module -avoid-version # help file -dist_opaldata_DATA = help-opal-shmem-sysv.txt +EXTRA_DIST = help-opal-shmem-sysv.txt diff --git a/opal/mca/smsc/knem/Makefile.am b/opal/mca/smsc/knem/Makefile.am index 7f53f45124b..4694428f711 100644 --- a/opal/mca/smsc/knem/Makefile.am +++ b/opal/mca/smsc/knem/Makefile.am @@ -14,6 +14,7 @@ # reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. # Copyright (c) 2020-2021 Google, LLC. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -21,11 +22,12 @@ # $HEADER$ # -EXTRA_DIST = post_configure.sh +EXTRA_DIST = \ + post_configure.sh \ + help-smsc-knem.txt AM_CPPFLAGS = $(smsc_knem_CPPFLAGS) -dist_opaldata_DATA = help-smsc-knem.txt libmca_smsc_knem_la_sources = \ smsc_knem_component.c \ diff --git a/opal/mca/timer/linux/Makefile.am b/opal/mca/timer/linux/Makefile.am index 98e4e6358e2..df9074b8427 100644 --- a/opal/mca/timer/linux/Makefile.am +++ b/opal/mca/timer/linux/Makefile.am @@ -10,6 +10,7 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -17,7 +18,7 @@ # $HEADER$ # -dist_opaldata_DATA = help-opal-timer-linux.txt +EXTRA_DIST = help-opal-timer-linux.txt noinst_LTLIBRARIES = libmca_timer_linux.la diff --git a/opal/runtime/Makefile.am b/opal/runtime/Makefile.am index 5d28b4f3d6c..a475666b37c 100644 --- a/opal/runtime/Makefile.am +++ b/opal/runtime/Makefile.am @@ -15,6 +15,7 @@ # Copyright (c) 2014 Intel, Inc. All rights reserved # Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -28,8 +29,8 @@ AM_CFLAGS = \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" # Source code files -dist_opaldata_DATA += runtime/help-opal-runtime.txt \ - runtime/help-opal_info.txt +EXTRA_DIST += runtime/help-opal-runtime.txt \ + runtime/help-opal_info.txt headers += \ runtime/opal_progress.h \ diff --git a/opal/tools/wrappers/Makefile.am b/opal/tools/wrappers/Makefile.am index 70308b1b4b4..1164560e853 100644 --- a/opal/tools/wrappers/Makefile.am +++ b/opal/tools/wrappers/Makefile.am @@ -14,6 +14,7 @@ # Copyright (c) 2014 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -28,7 +29,7 @@ if OPAL_INSTALL_BINARIES bin_PROGRAMS = opal_wrapper -dist_opaldata_DATA = help-opal-wrapper.txt +EXTRA_DIST = help-opal-wrapper.txt # Only install the following for developer-level installs if WANT_INSTALL_HEADERS diff --git a/opal/util/Makefile.am b/opal/util/Makefile.am index 5888146cc09..03020fb31e9 100644 --- a/opal/util/Makefile.am +++ b/opal/util/Makefile.am @@ -20,6 +20,7 @@ # Copyright (c) 2020-2024 Amazon.com, Inc. or its affiliates. # All Rights reserved. # Copyright (c) 2021 Google, LLC. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -27,16 +28,16 @@ # $HEADER$ # +include $(top_srcdir)/Makefile.ompi-rules + SUBDIRS = \ json \ keyval -dist_opaldata_DATA = \ +EXTRA_DIST = \ help-opal-util.txt \ - json/help-json.txt - -AM_LFLAGS = -Popal_show_help_yy -LEX_OUTPUT_ROOT = lex.opal_show_help_yy + json/help-json.txt \ + convert-help-files-to-c-code.py noinst_LTLIBRARIES = libopalutil.la libopalutil_core.la @@ -76,7 +77,6 @@ headers = \ proc.h \ qsort.h \ show_help.h \ - show_help_lex.h \ stacktrace.h \ string_copy.h \ sys_limits.h \ @@ -121,12 +121,17 @@ libopalutil_core_la_SOURCES = \ qsort.c \ sha256.c \ show_help.c \ - show_help_lex.l \ + show_help_content.c \ stacktrace.c \ string_copy.c \ sys_limits.c \ uri.c +show_help_content.c: convert-help-files-to-c-code.py + $(OMPI_V_GEN) $(PYTHON) $(abs_srcdir)/convert-help-files-to-c-code.py \ + --root $(abs_top_srcdir) \ + --out show_help_content.c + if OPAL_COMPILE_TIMING libopalutil_core_la_SOURCES += timings.c endif @@ -138,12 +143,6 @@ libopalutil_core_la_DEPENDENCIES = \ json/libopalutil_json.la \ keyval/libopalutilkeyval.la -# flex prior to version 2.6.6 uses the POSIX extension fileno() -# without providing the proper feature test macro, so -# we add the _POSIX_C_SOURCE macro here. -# See https://github.com/westes/flex/issues/263 -libopalutil_core_la_CFLAGS = -D_POSIX_C_SOURCE=200809L - # Conditionally install the header files if WANT_INSTALL_HEADERS @@ -152,4 +151,4 @@ opal_HEADERS = $(headers) endif maintainer-clean-local: - rm -f show_help_lex.c + rm -f show_help_content.c diff --git a/opal/util/convert-help-files-to-c-code.py b/opal/util/convert-help-files-to-c-code.py new file mode 100755 index 00000000000..38489481371 --- /dev/null +++ b/opal/util/convert-help-files-to-c-code.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +import os +import sys +import argparse + +def find_help_files(root, verbose=False): + # Search for help-*.txt files across the source tree, skipping + # some directories (e.g., 3rd-party) + help_files = [] + skip_dirs = ['.git', '3rd-party'] + for root_dir, dirs, files in os.walk(root): + for sd in skip_dirs: + if sd in dirs: + dirs.remove(sd) + + for file in files: + if file.startswith("help-") and file.endswith(".txt"): + full_path = os.path.join(root_dir, file) + help_files.append(full_path) + if verbose: + print(f"Found: {full_path}") + return help_files + +def parse_ini_files(file_paths, verbose=False): + # Parse INI-style files, returning a dictionary with filenames as + # keys. Don't use the Python configparse module in order to + # reduce dependencies (i.e., so that we don't have to pip install + # anything to run this script). + data = {} + for file_path in file_paths: + sections = {} + current_section = None + with open(file_path) as file: + for line in file: + line = line.strip() + if line.startswith('#') or not line: + continue + if line.startswith('[') and line.endswith(']'): + current_section = line[1:-1] + sections[current_section] = list() + elif current_section is not None: + sections[current_section].append(line) + + data[os.path.basename(file_path)] = sections + + if verbose: + print(f"Parsed: {file_path} ({len(sections)} sections found)") + + return data + +def generate_c_code(parsed_data): + # Generate C code with an array of filenames and their + # corresponding INI sections. + c_code = f"""// THIS FILE IS GENERATED AUTOMATICALLY! EDITS WILL BE LOST! +// This file generated by {sys.argv[0]} + +""" + # Rather than escaping the C code {} in f strings, make this a + # separate (non-f-string) addition to c_code. + c_code += """#include +#include + +typedef struct { + const char *section; + const char *content; +} ini_entry; + +typedef struct { + const char *filename; + ini_entry *entries; +} file_entry; + +""" + + ini_arrays = [] + file_entries = [] + + for idx, (filename, sections) in enumerate(parsed_data.items()): + var_name = filename.replace('-', '_').replace('.', '_') + + ini_entries = [] + for section, content_list in sections.items(): + content = '\n'.join(content_list) + c_content = content.replace('"','\\"').replace("\n", '\\n"\n"') + ini_entries.append(f' {{ "{section}", "{c_content}" }}') + ini_entries.append(f' {{ NULL, NULL }}') + + ini_array_name = f"ini_entries_{idx}" + ini_arrays.append(f"static ini_entry {ini_array_name}[] = {{\n" + ",\n".join(ini_entries) + "\n};\n") + file_entries.append(f' {{ "{filename}", {ini_array_name} }}') + file_entries.append(f' {{ NULL, NULL }}') + + c_code += "\n".join(ini_arrays) + "\n" + c_code += "static file_entry help_files[] = {\n" + ",\n".join(file_entries) + "\n};\n" + + c_code += """ + +const char *opal_show_help_get_content(const char *filename, const char* topic) +{ + file_entry *fe; + ini_entry *ie; + + for (int i = 0; help_files[i].filename != NULL; ++i) { + fe = &(help_files[i]); + if (strcmp(fe->filename, filename) == 0) { + for (int j = 0; fe->entries[j].section != NULL; ++j) { + ie = &(fe->entries[j]); + if (strcmp(ie->section, topic) == 0) { + return ie->content; + } + } + } + } + + return NULL; +} +""" + + return c_code + +#------------------------------- + +def main(): + parser = argparse.ArgumentParser(description="Generate C code from help text INI files.") + parser.add_argument("--root", + required=True, + help="Root directory to search for help-*.txt files") + parser.add_argument("--out", + required=True, + help="Output C file") + parser.add_argument("--verbose", + action="store_true", + help="Enable verbose output") + args = parser.parse_args() + + if args.verbose: + print(f"Searching in: {args.root}") + + file_paths = find_help_files(args.root, args.verbose) + parsed_data = parse_ini_files(file_paths, args.verbose) + c_code = generate_c_code(parsed_data) + + if os.path.exists(args.out): + with open(args.out) as f: + existing_content = f.read() + + if existing_content == c_code: + if args.verbose: + print(f"Help string content has not changed; not re-writing {args.out}") + exit(0) + + with open(args.out, "w") as f: + f.write(c_code) + + if args.verbose: + print(f"Generated C code written to {args.out}") + +if __name__ == "__main__": + main() diff --git a/opal/util/show_help.c b/opal/util/show_help.c index 29e8a99b39d..33b912a19fb 100644 --- a/opal/util/show_help.c +++ b/opal/util/show_help.c @@ -16,6 +16,7 @@ * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * Copyright (c) 2018 Triad National Security, LLC. All rights * reserved. + * Copyright (c) 2025 Jeffrey M. Squyres. All Rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -38,7 +39,6 @@ #include "opal/util/output.h" #include "opal/util/printf.h" #include "opal/util/show_help.h" -#include "opal/util/show_help_lex.h" /* * Private variables @@ -53,10 +53,6 @@ static bool opal_help_want_aggregate = true; /* * Local functions */ -static int opal_show_vhelp_internal(const char *filename, const char *topic, int want_error_header, - va_list arglist); -static int opal_show_help_internal(const char *filename, const char *topic, int want_error_header, - ...); static void opal_show_help_finalize(void); typedef struct { @@ -65,9 +61,6 @@ typedef struct { char *msg; } opal_log_info_t; -opal_show_help_fn_t opal_show_help = opal_show_help_internal; -opal_show_vhelp_fn_t opal_show_vhelp = opal_show_vhelp_internal; - int opal_show_help_init(void) { opal_output_stream_t lds; @@ -178,8 +171,8 @@ static void local_delivery(const char *file, const char *topic, char *msg) { static void opal_show_help_error(const char *file, const char *topic) { char *msg; opal_asprintf(&msg, - "%sSorry! You were supposed to get help about:\n %s\nfrom the file:\n " - " %s\nBut I couldn't find that topic in the file. Sorry!\n%s", + "%sSorry! You were supposed to get help about:\n %s\nfrom topic:\n " + " %s\nBut I couldn't find that help topic. Sorry!\n%s", dash_line, topic ? topic : "(Not specified)", file ? file : "(Not specified)", dash_line); local_delivery(topic, file, msg); } @@ -232,183 +225,19 @@ static int array2string(char **outstring, int want_error_header, char **lines) return OPAL_SUCCESS; } -/* - * Find the right file to open - */ -static int open_file(const char *base, const char *topic) -{ - char *filename = NULL, *err_msg = NULL; - size_t base_len; - int i, rc = OPAL_SUCCESS; - - /* If no filename was supplied, use the default */ - if (NULL == base) { - base = default_filename; - } - - /* if this is called prior to someone initializing the system, - * then don't try to look - */ - if (NULL != search_dirs) { - /* Try to open the file. If we can't find it, try it with a .txt - * extension. - */ - for (i = 0; NULL != search_dirs[i]; i++) { - filename = opal_os_path(false, search_dirs[i], base, NULL); - if(filename) { - opal_show_help_yyin = fopen(filename, "r"); - if (NULL == opal_show_help_yyin) { - opal_asprintf(&err_msg, "%s: %s", filename, strerror(errno)); - base_len = strlen(base); - if (4 > base_len || 0 != strcmp(base + base_len - 4, ".txt")) { - free(filename); - opal_asprintf(&filename, "%s%s%s.txt", search_dirs[i], OPAL_PATH_SEP, base); - opal_show_help_yyin = fopen(filename, "r"); - } - } - if (NULL != opal_show_help_yyin) { - break; - } - } - } - } - - /* If we still couldn't open it, then something is wrong */ - if (NULL == opal_show_help_yyin) { - const char *file_ptr = NULL; - if(err_msg) { - file_ptr = err_msg; - } - else if(filename) { - file_ptr = filename; - } - else { - file_ptr = base; - } - opal_show_help_error(file_ptr, topic); - rc = OPAL_ERR_NOT_FOUND; - goto cleanup; - } - - /* Set the buffer */ - opal_show_help_init_buffer(opal_show_help_yyin); - -cleanup: - - if(filename) { - free(filename); - } - if(err_msg) { - free(err_msg); - } - - return rc; -} - -/* - * In the file that has already been opened, find the topic that we're - * supposed to output - */ -static int find_topic(const char *base, const char *topic) -{ - int token, ret; - char *tmp; - - /* Examine every topic */ - - while (1) { - token = opal_show_help_yylex(); - switch (token) { - case OPAL_SHOW_HELP_PARSE_TOPIC: - tmp = strdup(opal_show_help_yytext); - if (NULL == tmp) { - return OPAL_ERR_OUT_OF_RESOURCE; - } - tmp[strlen(tmp) - 1] = '\0'; - ret = strcmp(tmp + 1, topic); - free(tmp); - if (0 == ret) { - return OPAL_SUCCESS; - } - break; - - case OPAL_SHOW_HELP_PARSE_MESSAGE: - break; - - case OPAL_SHOW_HELP_PARSE_DONE: { - opal_show_help_error(topic, base); - return OPAL_ERR_NOT_FOUND; - } - default: - break; - } - } - - /* Never get here */ -} - -/* - * We have an open file, and we're pointed at the right topic. So - * read in all the lines in the topic and make a list of them. - */ -static int read_topic(char ***array) -{ - int token, rc; - - while (1) { - token = opal_show_help_yylex(); - switch (token) { - case OPAL_SHOW_HELP_PARSE_MESSAGE: - /* opal_argv_append_nosize does strdup(opal_show_help_yytext) */ - rc = opal_argv_append_nosize(array, opal_show_help_yytext); - if (rc != OPAL_SUCCESS) { - return rc; - } - break; - - default: - return OPAL_SUCCESS; - break; - } - } - - /* Never get here */ -} - -static int load_array(char ***array, const char *filename, const char *topic) -{ - int ret; - - if (OPAL_SUCCESS != (ret = open_file(filename, topic))) { - return ret; - } - - ret = find_topic(filename, topic); - if (OPAL_SUCCESS == ret) { - ret = read_topic(array); - } - - fclose(opal_show_help_yyin); - opal_show_help_yylex_destroy(); - - if (OPAL_SUCCESS != ret) { - opal_argv_free(*array); - } - - return ret; -} - char *opal_show_help_vstring(const char *filename, const char *topic, int want_error_header, va_list arglist) { - int rc; - char *single_string, *output, **array = NULL; - - /* Load the message */ - if (OPAL_SUCCESS != (rc = load_array(&array, filename, topic))) { + const char *content = opal_show_help_get_content(filename, topic); + if (NULL == content) { + opal_show_help_error(filename, topic); return NULL; } + int rc; + char *single_string, *output; + char *array[] = { (char*) content, NULL }; + /* Convert it to a single raw string */ rc = array2string(&single_string, want_error_header, array); @@ -418,7 +247,6 @@ char *opal_show_help_vstring(const char *filename, const char *topic, int want_e free(single_string); } - opal_argv_free(array); return (OPAL_SUCCESS == rc) ? output : NULL; } @@ -434,8 +262,8 @@ char *opal_show_help_string(const char *filename, const char *topic, int want_er return output; } -static int opal_show_vhelp_internal(const char *filename, const char *topic, int want_error_header, - va_list arglist) +int opal_show_vhelp(const char *filename, const char *topic, int want_error_header, + va_list arglist) { char *output; @@ -450,8 +278,7 @@ static int opal_show_vhelp_internal(const char *filename, const char *topic, int return (NULL == output) ? OPAL_ERROR : OPAL_SUCCESS; } -static int opal_show_help_internal(const char *filename, const char *topic, int want_error_header, - ...) +int opal_show_help(const char *filename, const char *topic, int want_error_header, ...) { va_list arglist; int rc; diff --git a/opal/util/show_help.h b/opal/util/show_help.h index d4db6c74a9a..c497dd235cf 100644 --- a/opal/util/show_help.h +++ b/opal/util/show_help.h @@ -13,6 +13,7 @@ * Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2018 Triad National Security, LLC. All rights * reserved. + * Copyright (c) 2025 Jeffrey M. Squyres. All Rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -127,17 +128,15 @@ OPAL_DECLSPEC int opal_show_help_init(void); * promotion to va_start() has undefined behavior (according to clang * warnings on MacOS High Sierra). */ -typedef int (*opal_show_help_fn_t)(const char *filename, const char *topic, int want_error_header, - ...); -OPAL_DECLSPEC extern opal_show_help_fn_t opal_show_help; +OPAL_DECLSPEC int opal_show_help(const char *filename, const char *topic, int want_error_header, + ...); /** * This function does the same thing as opal_show_help(), but accepts * a va_list form of varargs. */ -typedef int (*opal_show_vhelp_fn_t)(const char *filename, const char *topic, int want_error_header, - va_list ap); -OPAL_DECLSPEC extern opal_show_vhelp_fn_t opal_show_vhelp; +OPAL_DECLSPEC int opal_show_vhelp(const char *filename, const char *topic, int want_error_header, + va_list ap); /** * This function does the same thing as opal_show_help(), but returns @@ -167,6 +166,19 @@ OPAL_DECLSPEC char *opal_show_help_vstring(const char *filename, const char *top */ OPAL_DECLSPEC int opal_show_help_add_dir(const char *directory); +/** + * \internal + * + * This is an internal function that returns a string representing the + * content of the section "topic" from the help file "filename". This + * content is a hard-coded C string and should not be freed by the + * caller. + * + * NOTE: This hard-coded C string is generated during "make" in the + * opal/util directory -- it is not read from a text file at run time. + */ +const char *opal_show_help_get_content(const char *filename, const char* topic); + END_C_DECLS #endif diff --git a/opal/util/show_help_lex.h b/opal/util/show_help_lex.h deleted file mode 100644 index b13f023a2c1..00000000000 --- a/opal/util/show_help_lex.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. 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 (c) 2006 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_SHOW_HELP_LEX_H -#define OPAL_SHOW_HELP_LEX_H - -#include "opal_config.h" - -#ifdef malloc -# undef malloc -#endif -#ifdef realloc -# undef realloc -#endif -#ifdef free -# undef free -#endif - -#include -BEGIN_C_DECLS -int opal_show_help_yylex(void); -int opal_show_help_init_buffer(FILE *file); -int opal_show_help_yylex_destroy(void); - -extern FILE *opal_show_help_yyin; -extern bool opal_show_help_parse_done; -extern char *opal_show_help_yytext; -extern int opal_show_help_yynewlines; - -/* - * Make lex-generated files not issue compiler warnings - */ -#define YY_STACK_USED 0 -#define YY_ALWAYS_INTERACTIVE 0 -#define YY_NEVER_INTERACTIVE 0 -#define YY_MAIN 0 -#define YY_NO_UNPUT 1 -#define YY_SKIP_YYWRAP 1 - -enum { - OPAL_SHOW_HELP_PARSE_DONE, - OPAL_SHOW_HELP_PARSE_ERROR, - - OPAL_SHOW_HELP_PARSE_TOPIC, - OPAL_SHOW_HELP_PARSE_MESSAGE, - - OPAL_SHOW_HELP_PARSE_MAX -}; -END_C_DECLS -#endif diff --git a/opal/util/show_help_lex.l b/opal/util/show_help_lex.l deleted file mode 100644 index 2de61e830ec..00000000000 --- a/opal/util/show_help_lex.l +++ /dev/null @@ -1,113 +0,0 @@ -%option nounput -%option noinput - -%{ /* -*- C -*- */ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University - * of Tennessee Research Foundation. 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$ - */ - -#include "opal_config.h" - -#include -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/util/show_help_lex.h" - -BEGIN_C_DECLS - -/* - * public functions - */ -extern int opal_show_help_finish_parsing(void); - -/* - * local functions - */ -static int opal_show_help_yywrap(void); - -END_C_DECLS - -/* - * global variables - */ -int opal_show_help_yynewlines = 1; -bool opal_show_help_parse_done = false; - -%} - -WHITE [\f\t\v ] -CHAR [A-Za-z0-9_\-\.] - -%x CHOMP - -%% - -#.*\n ; /* comment line */ - -^\[.+\]/[^\]\n]*\n { BEGIN(CHOMP); return OPAL_SHOW_HELP_PARSE_TOPIC; } - -.*\n { BEGIN(INITIAL); } - -.*/\n { BEGIN(CHOMP); return OPAL_SHOW_HELP_PARSE_MESSAGE; } - -%% - -/* Old flex (2.5.4a? and older) does not define a destroy function */ -#if !defined(YY_FLEX_SUBMINOR_VERSION) -#define YY_FLEX_SUBMINOR_VERSION 0 -#endif - -#if (YY_FLEX_MAJOR_VERSION < 2) || (YY_FLEX_MAJOR_VERSION == 2 && (YY_FLEX_MINOR_VERSION < 5 || (YY_FLEX_MINOR_VERSION == 5 && YY_FLEX_SUBMINOR_VERSION < 5))) -int opal_show_help_yylex_destroy(void) -{ - if (NULL != YY_CURRENT_BUFFER) { - yy_delete_buffer(YY_CURRENT_BUFFER); -#if defined(YY_CURRENT_BUFFER_LVALUE) - YY_CURRENT_BUFFER_LVALUE = NULL; -#else - YY_CURRENT_BUFFER = NULL; -#endif /* YY_CURRENT_BUFFER_LVALUE */ - } - return YY_NULL; -} -#endif - -static int opal_show_help_yywrap(void) -{ - opal_show_help_parse_done = true; - return 1; -} - - -/* - * Ensure that we have a valid yybuffer to use. Specifically, if this - * scanner is invoked a second time, finish_parsing() (above) will - * have been executed, and the current buffer will have been freed. - * Flex doesn't recognize this fact because as far as it's concerned, - * its internal state was already initialized, so it thinks it should - * have a valid buffer. Hence, here we ensure to give it a valid - * buffer. - */ -int opal_show_help_init_buffer(FILE *file) -{ - YY_BUFFER_STATE buf = yy_create_buffer(file, YY_BUF_SIZE); - yy_switch_to_buffer(buf); - - return 0; -} diff --git a/oshmem/Makefile.am b/oshmem/Makefile.am index 8d58ad20eff..73b31ad9397 100644 --- a/oshmem/Makefile.am +++ b/oshmem/Makefile.am @@ -8,6 +8,7 @@ # Copyright (c) 2016 IBM Corporation. All rights reserved. # Copyright (c) 2021 Amazon.com, Inc. or its affiliates. # All Rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -64,7 +65,7 @@ liboshmem_la_LDFLAGS = \ headers = noinst_LTLIBRARIES = include_HEADERS = -dist_oshmemdata_DATA = +EXTRA_DIST = liboshmem_la_SOURCES += $(headers) # Conditionally install the header files diff --git a/oshmem/mca/memheap/base/Makefile.am b/oshmem/mca/memheap/base/Makefile.am index 0244f7ea103..4414fca7939 100644 --- a/oshmem/mca/memheap/base/Makefile.am +++ b/oshmem/mca/memheap/base/Makefile.am @@ -1,6 +1,7 @@ # Copyright (c) 2014 Mellanox Technologies, Inc. # All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -8,7 +9,7 @@ # $HEADER$ # -dist_oshmemdata_DATA += base/help-oshmem-memheap.txt +EXTRA_DIST = base/help-oshmem-memheap.txt AM_CPPFLAGS = -DOMPI_LIBMPI_NAME=\"$(OMPI_LIBMPI_NAME)\" diff --git a/oshmem/mca/scoll/mpi/Makefile.am b/oshmem/mca/scoll/mpi/Makefile.am index f8782fccffa..542046a50b6 100644 --- a/oshmem/mca/scoll/mpi/Makefile.am +++ b/oshmem/mca/scoll/mpi/Makefile.am @@ -1,6 +1,7 @@ # Copyright (c) 2013-2015 Mellanox Technologies, Inc. # All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -9,7 +10,7 @@ # # -dist_oshmemdata_DATA = \ +EXTRA_DIST = \ help-oshmem-scoll-mpi.txt scoll_mpi_sources = \ diff --git a/oshmem/mca/scoll/ucc/Makefile.am b/oshmem/mca/scoll/ucc/Makefile.am index 2e487a9b37a..04a46e11768 100644 --- a/oshmem/mca/scoll/ucc/Makefile.am +++ b/oshmem/mca/scoll/ucc/Makefile.am @@ -1,5 +1,6 @@ # Copyright (c) 2021 Mellanox Technologies, Inc. # All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -8,7 +9,7 @@ # # -dist_oshmemdata_DATA = \ +EXTRA_DIST = \ help-oshmem-scoll-ucc.txt AM_CPPFLAGS = $(scoll_ucc_CPPFLAGS) @@ -24,7 +25,7 @@ scoll_ucc_sources = \ scoll_ucc_broadcast.c \ scoll_ucc_reduce.c \ scoll_ucc_collect.c \ - scoll_ucc_alltoall.c + scoll_ucc_alltoall.c if MCA_BUILD_oshmem_scoll_ucc_DSO component_noinst = component_install = mca_scoll_ucc.la diff --git a/oshmem/mca/sshmem/base/Makefile.am b/oshmem/mca/sshmem/base/Makefile.am index 05b4af1afd0..d3b7720874f 100644 --- a/oshmem/mca/sshmem/base/Makefile.am +++ b/oshmem/mca/sshmem/base/Makefile.am @@ -1,5 +1,6 @@ # Copyright (c) 2014 Mellanox Technologies, Inc. # All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -7,7 +8,7 @@ # $HEADER$ # -dist_oshmemdata_DATA = base/help-oshmem-sshmem.txt +EXTRA_DIST = base/help-oshmem-sshmem.txt headers += \ base/base.h diff --git a/oshmem/mca/sshmem/mmap/Makefile.am b/oshmem/mca/sshmem/mmap/Makefile.am index 5529cdd7f08..2b3f7309bb5 100644 --- a/oshmem/mca/sshmem/mmap/Makefile.am +++ b/oshmem/mca/sshmem/mmap/Makefile.am @@ -1,6 +1,7 @@ # Copyright (c) 2014 Mellanox Technologies, Inc. # All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -8,7 +9,7 @@ # $HEADER$ # -dist_oshmemdata_DATA = help-oshmem-sshmem-mmap.txt +EXTRA_DIST = help-oshmem-sshmem-mmap.txt sources = \ sshmem_mmap.h \ diff --git a/oshmem/mca/sshmem/sysv/Makefile.am b/oshmem/mca/sshmem/sysv/Makefile.am index dd677a8d3c6..71502d48d86 100644 --- a/oshmem/mca/sshmem/sysv/Makefile.am +++ b/oshmem/mca/sshmem/sysv/Makefile.am @@ -2,6 +2,7 @@ # All rights reserved. # Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -9,7 +10,7 @@ # $HEADER$ # -dist_oshmemdata_DATA = help-oshmem-sshmem-sysv.txt +EXTRA_DIST = help-oshmem-sshmem-sysv.txt sources = \ sshmem_sysv.h \ diff --git a/oshmem/mca/sshmem/ucx/Makefile.am b/oshmem/mca/sshmem/ucx/Makefile.am index ce37cd0e906..a7e93e51ec1 100644 --- a/oshmem/mca/sshmem/ucx/Makefile.am +++ b/oshmem/mca/sshmem/ucx/Makefile.am @@ -1,6 +1,7 @@ # Copyright (c) 2014 Mellanox Technologies, Inc. # All rights reserved. # Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -8,8 +9,6 @@ # $HEADER$ # -#dist_oshmemdata_DATA = help-oshmem-sshmem-mmap.txt - AM_CPPFLAGS = $(sshmem_ucx_CPPFLAGS) sources = \ @@ -40,4 +39,3 @@ mca_sshmem_ucx_la_LIBADD = $(top_builddir)/oshmem/liboshmem.la \ noinst_LTLIBRARIES = $(component_noinst) libmca_sshmem_ucx_la_SOURCES =$(sources) libmca_sshmem_ucx_la_LDFLAGS = -module -avoid-version $(sshmem_ucx_LDFLAGS) - diff --git a/oshmem/runtime/Makefile.am b/oshmem/runtime/Makefile.am index 301b1e01ae5..f3be80a7d16 100644 --- a/oshmem/runtime/Makefile.am +++ b/oshmem/runtime/Makefile.am @@ -1,5 +1,6 @@ # Copyright (c) 2013 Mellanox Technologies, Inc. # All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -9,9 +10,7 @@ # This makefile.am does not stand on its own - it is included from oshmem/Makefile.am -if PROJECT_OSHMEM -dist_oshmemdata_DATA += runtime/help-shmem-runtime.txt -endif +EXTRA_DIST += runtime/help-shmem-runtime.txt headers += \ runtime/runtime.h \ @@ -26,4 +25,3 @@ liboshmem_la_SOURCES += \ runtime/oshmem_shmem_params.c \ runtime/oshmem_shmem_exchange.c \ runtime/oshmem_info_support.c - diff --git a/oshmem/shmem/Makefile.am b/oshmem/shmem/Makefile.am index bf219790643..fab81bddd52 100644 --- a/oshmem/shmem/Makefile.am +++ b/oshmem/shmem/Makefile.am @@ -1,5 +1,6 @@ # Copyright (c) 2013-2015 Mellanox Technologies, Inc. # All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -7,11 +8,7 @@ # $HEADER$ # -EXTRA_DIST = - headers += shmem/shmem_api_logger.h \ shmem/shmem_lock.h -if PROJECT_OSHMEM -dist_oshmemdata_DATA += shmem/help-shmem-api.txt -endif +EXTRA_DIST += shmem/help-shmem-api.txt diff --git a/oshmem/tools/oshmem_info/Makefile.am b/oshmem/tools/oshmem_info/Makefile.am index 06a9b881318..e569d7538c0 100644 --- a/oshmem/tools/oshmem_info/Makefile.am +++ b/oshmem/tools/oshmem_info/Makefile.am @@ -6,6 +6,7 @@ # Copyright (c) 2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2019 Intel, Inc. All rights reserved. +# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -49,10 +50,10 @@ bin_PROGRAMS = if PROJECT_OSHMEM # Only build/install the binary pages if we're building oshmem bin_PROGRAMS += oshmem_info -dist_ompidata_DATA = \ - help-oshmem-info.txt endif +EXTRA_DIST = \ + help-oshmem-info.txt oshmem_info_SOURCES = \ oshmem_info.h \