Skip to content

Commit

Permalink
Merge pull request #20471 from ronawho/gasnet-ld-requires-mpi-patch
Browse files Browse the repository at this point in the history
Bring in upstream gasnet patch for checking if LD requires MPI

[reviewed by @mppf]

Bring in https://bitbucket.org/berkeleylab/gasnet/pull-requests/554 and
some related work to enable getting `GASNET_LD_REQUIRES_MPI` out of
gasnet's pkg-config file. This is a follow up to #20385, which has
additional motivation for the change.
  • Loading branch information
ronawho authored Aug 24, 2022
2 parents 46a3897 + 454ae1a commit 59543df
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 18 deletions.
13 changes: 13 additions & 0 deletions third-party/gasnet/README
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ convenience and was obtained from
Any Chapel issues that seem to be related to GASNet should be directed
to the Chapel team at https://chapel-lang.org/bugs.html.

Chapel modifications to GASNet
==============================
The modifications that we have made to the official GASNet release are
as follows:

* Pulled in an upstream patch for getting gasnet prefix out of .pc file
- https://bitbucket.org/berkeleylab/gasnet/commits/8f5f8a1ab
* Pulled in an upstream patch to check if LD requires MPI using .pc file
- https://bitbucket.org/berkeleylab/gasnet/commits/a657aa1ef
- https://bitbucket.org/berkeleylab/gasnet/commits/12335d0fe
- https://bitbucket.org/berkeleylab/gasnet/commits/a57d84def
* Pulled in an upstream fix for `--disable-full-path-expansion`
- https://bitbucket.org/berkeleylab/gasnet/commits/8f3eb926b

Upgrading GASNet versions
=========================
Expand Down
2 changes: 1 addition & 1 deletion third-party/gasnet/gasnet-src/aries-conduit/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,9 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@USE_ARIES_CONDUIT_FALSE@uninstall-local:
@USE_ARIES_CONDUIT_FALSE@install-data-local:
@USE_ARIES_CONDUIT_FALSE@clean-local:
@USE_ARIES_CONDUIT_FALSE@uninstall-local:
clean: clean-recursive

clean-am: clean-generic clean-libLIBRARIES clean-local mostlyclean-am
Expand Down
4 changes: 2 additions & 2 deletions third-party/gasnet/gasnet-src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $_gasneti_envcmd > config.env

echo > /dev/null \
.
# From configure.in gex-2022.3.0-0-gd509b6a.
# From configure.in no-version-control-info.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
Expand Down Expand Up @@ -181197,7 +181197,7 @@ fi



if expr "x$MPI_CC" : 'x/' >/dev/null; then
if command -v $MPI_CC > /dev/null 2>&1; then
# figure out a reasonable fallback MPI_CFLAGS for this arch/OS and C99 support
# this is complicated by the fact that $MPI_CC may be a different compiler than $CC

Expand Down
2 changes: 1 addition & 1 deletion third-party/gasnet/gasnet-src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -3352,7 +3352,7 @@ if test "$enabled_mpi" = yes || test "$enabled_mpi_compat" = yes; then
mpi_reason="was disabled"
else
GASNET_GETFULLPATH(MPI_CC)
if expr "x$MPI_CC" : 'x/' >/dev/null; then
if command -v $MPI_CC > /dev/null 2>&1; then
# figure out a reasonable fallback MPI_CFLAGS for this arch/OS and C99 support
# this is complicated by the fact that $MPI_CC may be a different compiler than $CC
GASNET_PUSHVAR(CC,"$MPI_CC")
Expand Down
2 changes: 1 addition & 1 deletion third-party/gasnet/gasnet-src/ibv-conduit/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,8 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@USE_IBV_CONDUIT_FALSE@uninstall-local:
@USE_IBV_CONDUIT_FALSE@install-data-local:
@USE_IBV_CONDUIT_FALSE@uninstall-local:
@USE_IBV_CONDUIT_FALSE@clean-local:
clean: clean-recursive

Expand Down
2 changes: 1 addition & 1 deletion third-party/gasnet/gasnet-src/mpi-conduit/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,8 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@USE_MPI_CONDUIT_FALSE@uninstall-local:
@USE_MPI_CONDUIT_FALSE@install-data-local:
@USE_MPI_CONDUIT_FALSE@uninstall-local:
@USE_MPI_CONDUIT_FALSE@clean-local:
clean: clean-recursive

Expand Down
2 changes: 1 addition & 1 deletion third-party/gasnet/gasnet-src/ofi-conduit/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,8 @@ maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@USE_OFI_CONDUIT_FALSE@uninstall-local:
@USE_OFI_CONDUIT_FALSE@install-data-local:
@USE_OFI_CONDUIT_FALSE@clean-local:
@USE_OFI_CONDUIT_FALSE@install-data-local:
clean: clean-recursive

clean-am: clean-generic clean-libLIBRARIES clean-local mostlyclean-am
Expand Down
7 changes: 5 additions & 2 deletions third-party/gasnet/gasnet-src/other/Makefile-conduit.mak.in
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,11 @@ do-pkgconfig-conduit: force
@VARS="GASNET_CC GASNET_OPT_CFLAGS GASNET_MISC_CFLAGS \
GASNET_MISC_CPPFLAGS GASNET_DEFINES GASNET_INCLUDES \
GASNET_CXX GASNET_OPT_CXXFLAGS GASNET_MISC_CXXFLAGS GASNET_MISC_CXXCPPFLAGS \
GASNET_LD GASNET_LDFLAGS GASNET_LIBS" ; \
$(MAKE) --no-print-directory -f $(top_srcdir)/other/Makefile-echovar.mak VARS="$$VARS" echovars \
GASNET_LD GASNET_LDFLAGS GASNET_LIBS \
GASNET_LD_REQUIRES_CXX GASNET_LD_REQUIRES_MPI \
GASNET_SPAWNER_DEFAULT GASNET_SPAWNER_PMI GASNET_SPAWNER_MPI GASNET_SPAWNER_SSH \
GASNET_PREFIX" ; \
$(MAKE) --no-print-directory -f $(top_srcdir)/other/Makefile-echovar.mak VARS="$$VARS" echovars-preserve-unset \
>> $(pkgconfig_file)
@unset GASNET_DESC; \
if test -d $(top_srcdir)/.git ; then \
Expand Down
30 changes: 26 additions & 4 deletions third-party/gasnet/gasnet-src/other/Makefile-echovar.mak
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
include $(FRAGMENT)

.EXPORT_ALL_VARIABLES:

# echovar:
# output a VAR=VAL string for provided $(VAR)
# if the variable is unset, the result is an empty VAL

echovar:
@echo $(VAR)=$($(VAR))

#export $(VARS)
.EXPORT_ALL_VARIABLES:

# Iterative form accepts variable names in $(VARS)
echovars:
@for var in $(VARS) ; do \
eval echo $$var=\$$$$var ; \
done

.PHONY: echovar echovars
# echovar-preserve-unset:
# output a VAR=VAL string for provided $(VAR)
# if the variable is unset, the result is no output

echovar-preserve-unset:
@if ! test -z $${$(VAR)+set} ; then \
echo $(VAR)=$($(VAR)) ; \
fi

# Iterative form accepts variable names in $(VARS)
echovars-preserve-unset:
@for var in $(VARS) ; do \
if ! eval test -z \$${$${var}+set} ; then \
eval echo $$var=\$$$$var ; \
fi ; \
done


.PHONY: echovar echovars echovar-preserve-unset echovars-preserve-unset

5 changes: 3 additions & 2 deletions third-party/gasnet/gasnet-src/other/Makefile-libgasnet.mak.in
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ do-pkgconfig-tools: force
@echo '# See the GASNet README for instructions on using these variables' >> $(pkgconfig_file)
@VARS="GASNETTOOLS_CC GASNETTOOLS_CPPFLAGS GASNETTOOLS_CFLAGS \
GASNETTOOLS_CXX GASNETTOOLS_CXXFLAGS \
GASNETTOOLS_LD GASNETTOOLS_LDFLAGS GASNETTOOLS_LIBS" ; \
$(MAKE) --no-print-directory -f $(top_srcdir)/other/Makefile-echovar.mak VARS="$$VARS" echovars \
GASNETTOOLS_LD GASNETTOOLS_LDFLAGS GASNETTOOLS_LIBS \
GASNET_PREFIX" ; \
$(MAKE) --no-print-directory -f $(top_srcdir)/other/Makefile-echovar.mak VARS="$$VARS" echovars-preserve-unset \
>> $(pkgconfig_file)
@unset GASNET_DESC; \
if test -d $(top_srcdir)/.git ; then \
Expand Down
2 changes: 1 addition & 1 deletion third-party/gasnet/gasnet-src/smp-conduit/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,8 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@USE_SMP_CONDUIT_FALSE@uninstall-local:
@USE_SMP_CONDUIT_FALSE@install-data-local:
@USE_SMP_CONDUIT_FALSE@uninstall-local:
@USE_SMP_CONDUIT_FALSE@clean-local:
clean: clean-recursive

Expand Down
2 changes: 1 addition & 1 deletion third-party/gasnet/gasnet-src/ucx-conduit/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,9 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@USE_UCX_CONDUIT_FALSE@uninstall-local:
@USE_UCX_CONDUIT_FALSE@install-data-local:
@USE_UCX_CONDUIT_FALSE@clean-local:
@USE_UCX_CONDUIT_FALSE@uninstall-local:
clean: clean-recursive

clean-am: clean-generic clean-libLIBRARIES clean-local mostlyclean-am
Expand Down
2 changes: 1 addition & 1 deletion third-party/gasnet/gasnet-src/udp-conduit/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,9 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@USE_UDP_CONDUIT_FALSE@uninstall-local:
@USE_UDP_CONDUIT_FALSE@install-data-local:
@USE_UDP_CONDUIT_FALSE@clean-local:
@USE_UDP_CONDUIT_FALSE@uninstall-local:
clean: clean-recursive

clean-am: clean-generic clean-libLIBRARIES clean-local mostlyclean-am
Expand Down

0 comments on commit 59543df

Please sign in to comment.