Remove obsolete autotools patches (#35479)

* netcdf-fortran: remove obsolete Autotools patches
* openmpi: remove obsolete Autotools patches
* parallel-netcdf: remove obsolete Autotools patches
This commit is contained in:
Sergey Kosukhin 2023-02-14 19:54:37 +01:00 committed by GitHub
parent e75a07d155
commit 38512d18e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 0 additions and 593 deletions

View file

@ -1,124 +0,0 @@
--- a/configure
+++ b/configure
@@ -9584,6 +9584,10 @@ for cc_temp in $compiler""; do
esac
done
cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+case $cc_basename in
+ nagfor*) ;;
+ *) $cc_temp -V 2>&1 | $GREP '^NAG Fortran Compiler Release' >/dev/null 2>&1 && cc_basename='nagfor-wrapper' ;;
+esac
# Only perform the check for file, if the check method requires it
@@ -10657,6 +10661,10 @@ _LT_EOF
lf95*) # Lahey Fortran 8.1
whole_archive_flag_spec=
tmp_sharedflag='--shared' ;;
+ nagfor*)
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
@@ -13415,6 +13423,10 @@ $RM -r conftest*
esac
done
cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+case $cc_basename in
+ nagfor*) ;;
+ *) $cc_temp -V 2>&1 | $GREP '^NAG Fortran Compiler Release' >/dev/null 2>&1 && cc_basename='nagfor-wrapper' ;;
+esac
GCC=$G77
if test -n "$compiler"; then
@@ -14252,6 +14264,10 @@ _LT_EOF
lf95*) # Lahey Fortran 8.1
whole_archive_flag_spec_F77=
tmp_sharedflag='--shared' ;;
+ nagfor*)
+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_F77=yes
+ tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
@@ -16142,6 +16158,10 @@ $RM -r conftest*
esac
done
cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+case $cc_basename in
+ nagfor*) ;;
+ *) $cc_temp -V 2>&1 | $GREP '^NAG Fortran Compiler Release' >/dev/null 2>&1 && cc_basename='nagfor-wrapper' ;;
+esac
if test -n "$compiler"; then
@@ -17142,6 +17162,10 @@ _LT_EOF
lf95*) # Lahey Fortran 8.1
whole_archive_flag_spec_FC=
tmp_sharedflag='--shared' ;;
+ nagfor*)
+ whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_FC=yes
+ tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -180,6 +180,24 @@ func_basename ()
func_basename_result=`$ECHO "${1}" | $SED "$basename"`
} # func_basename may be replaced by extended shell implementation
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+ case $func_cc_basename_result in
+ nagfor*) ;;
+ *) $cc_temp -V 2>&1 | $GREP '^NAG Fortran Compiler Release' >/dev/null 2>&1 && func_cc_basename_result='nagfor-wrapper' ;;
+ esac
+}
+
# func_dirname_and_basename file append nondir_replacement
# perform func_basename and func_dirname in a single function
@@ -6422,6 +6440,13 @@ func_mode_link ()
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+
+ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;;
+ esac
+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
@@ -8007,6 +8032,14 @@ EOF
;;
esac
+ # Time to revert the changes made for nagfor.
+
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*)
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;;
+ esac
+
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=

View file

@ -1,96 +0,0 @@
--- a/configure
+++ b/configure
@@ -9034,6 +9034,12 @@ func_cc_basename ()
esac
done
func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+ # Set result to 'nagfor-wrapper' when NAG compiler is called via a wrapper (e.g. mpif90).
+ case $func_cc_basename_result in
+ nagfor*) ;;
+ *) $cc_temp -V 2>&1 | $GREP '^NAG Fortran Compiler Release' >/dev/null 2>&1 && func_cc_basename_result='nagfor-wrapper' ;;
+ esac
}
# Check whether --enable-libtool-lock was given.
@@ -11811,6 +11817,8 @@ _LT_EOF
whole_archive_flag_spec=
tmp_sharedflag='--shared' ;;
nagfor*) # NAGFOR 5.3
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object=yes
tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
@@ -15663,6 +15671,8 @@ _LT_EOF
whole_archive_flag_spec_F77=
tmp_sharedflag='--shared' ;;
nagfor*) # NAGFOR 5.3
+ whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object_F77=yes
tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
@@ -18788,6 +18798,8 @@ _LT_EOF
whole_archive_flag_spec_FC=
tmp_sharedflag='--shared' ;;
nagfor*) # NAGFOR 5.3
+ whole_archive_flag_spec_FC='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object_FC=yes
tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
@@ -26086,6 +26098,12 @@ func_cc_basename ()
esac
done
func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+ # Set result to 'nagfor-wrapper' when NAG compiler is called via a wrapper (e.g. mpif90).
+ case $func_cc_basename_result in
+ nagfor*) ;;
+ *) $cc_temp -V 2>&1 | $GREP '^NAG Fortran Compiler Release' >/dev/null 2>&1 && func_cc_basename_result='nagfor-wrapper' ;;
+ esac
}
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -7868,6 +7868,13 @@ func_mode_link ()
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+
+ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;;
+ esac
+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
@@ -8890,7 +8897,8 @@ func_mode_link ()
xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
# On Darwin other compilers
- case $CC in
+ func_cc_basename $CC
+ case $func_cc_basename_result in
nagfor*)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
@@ -9502,6 +9510,14 @@ EOF
;;
esac
+ # Time to revert the changes made for nagfor.
+
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*)
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;;
+ esac
+
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=

View file

@ -37,14 +37,6 @@ class NetcdfFortran(AutotoolsPackage):
depends_on("netcdf-c@4.7.4:", when="@4.5.3:") # nc_def_var_szip required
depends_on("doxygen", when="+doc", type="build")
# The default libtool.m4 is too old to handle NAG compiler properly:
# https://github.com/Unidata/netcdf-fortran/issues/94
# Moreover, Libtool can't handle '-pthread' flag coming from libcurl,
# doesn't inject convenience libraries into the shared ones, and is unable
# to detect NAG when it is called with an MPI wrapper.
patch("nag_libtool_2.4.2.patch", when="@:4.4.4%nag")
patch("nag_libtool_2.4.6.patch", when="@4.4.5:%nag")
# Enable 'make check' for NAG, which is too strict.
patch("nag_testing.patch", when="@4.4.5%nag")
@ -136,54 +128,6 @@ def configure_args(self):
return config_args
@run_after("configure")
def patch_libtool(self):
"""AOCC support for NETCDF-F"""
if "%aocc" in self.spec:
# Libtool does not fully support the compiler toolchain, therefore
# we have to patch the script. The C compiler normally gets
# configured correctly, the variables of interest in the
# 'BEGIN LIBTOOL CONFIG' section are set to non-empty values and,
# therefore, are not affected by the replacements below. A more
# robust solution would be to extend the filter_file function with
# an additional argument start_at and perform the replacements
# between the '# ### BEGIN LIBTOOL TAG CONFIG: FC' and
# '# ### END LIBTOOL TAG CONFIG: FC' markers for the Fortran
# compiler, and between the '# ### BEGIN LIBTOOL TAG CONFIG: F77'
# and '# ### END LIBTOOL TAG CONFIG: F77' markers for the Fortran 77
# compiler.
# How to pass a linker flag through the compiler:
filter_file(r'^wl=""$', 'wl="{0}"'.format(self.compiler.linker_arg), "libtool")
# Additional compiler flags for building library objects (we need
# this to enable shared libraries when building with ~pic). Note
# that the following will set fc_pic_flag for both FC and F77, which
# in the case of AOCC, should not be a problem. If it is, the
# aforementioned modification of the filter_file function could be
# a solution.
filter_file(
r'^pic_flag=""$', 'pic_flag=" {0}"'.format(self.compiler.fc_pic_flag), "libtool"
)
# The following is supposed to tell the compiler to use the GNU
# linker. However, the replacement does not happen (at least for
# NetCDF-Fortran 4.5.3) because the replaced substring (i.e. the
# first argument passed to the filter_file function) is not present
# in the file. The flag should probably be added to 'ldflags' in the
# flag_handler method above (another option is to add the flag to
# 'ldflags' in compilers.yaml automatically as it was done for other
# flags in https://github.com/spack/spack/pull/22219).
filter_file(
r"\${wl}-soname \$wl\$soname",
r"-fuse-ld=ld -Wl,-soname,\$soname",
"libtool",
string=True,
)
# TODO: resolve the NAG-related issues in a similar way: remove the
# respective patch files and tune the generated libtool script instead.
@when("@:4.4.5")
def check(self):
with working_dir(self.build_directory):

View file

@ -1,49 +0,0 @@
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -7860,14 +7860,15 @@ func_mode_link ()
func_source "$lib"
# Convert "-framework foo" to "foo.ltframework"
- # and "-pthread" to "-Wl,-pthread" if NAG compiler
if test -n "$inherited_linker_flags"; then
- case "$CC" in
- nagfor*)
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g' | $SED 's/-pthread/-Wl,-pthread'`;;
- *)
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`;;
- esac
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+
+ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;;
+ esac
+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
@@ -8887,7 +8888,8 @@ func_mode_link ()
xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
# On Darwin other compilers
- case $CC in
+ func_cc_basename $CC
+ case $func_cc_basename_result in
nagfor*)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
@@ -9499,6 +9501,13 @@ EOF
;;
esac
+ # Time to revert the changes made for nagfor.
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*)
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;;
+ esac
+
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=

View file

@ -1,40 +0,0 @@
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -7862,6 +7862,13 @@ func_mode_link ()
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+
+ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;;
+ esac
+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
@@ -8881,7 +8888,8 @@ func_mode_link ()
xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
# On Darwin other compilers
- case $CC in
+ func_cc_basename $CC
+ case $func_cc_basename_result in
nagfor*)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
@@ -9493,6 +9501,13 @@ EOF
;;
esac
+ # Time to revert the changes made for nagfor.
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*)
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;;
+ esac
+
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=

View file

@ -1,49 +0,0 @@
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -7860,14 +7860,15 @@ func_mode_link ()
func_source "$lib"
# Convert "-framework foo" to "foo.ltframework"
- # and "-pthread" to "-Wl,-pthread" if NAG compiler
if test -n "$inherited_linker_flags"; then
- case "$CC" in
- nagfor*)
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g' | $SED 's/-pthread/-Wl,-pthread/g'`;;
- *)
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`;;
- esac
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+
+ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;;
+ esac
+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
@@ -8887,7 +8888,8 @@ func_mode_link ()
xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
# On Darwin other compilers
- case $CC in
+ func_cc_basename $CC
+ case $func_cc_basename_result in
nagfor*)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
@@ -9499,6 +9501,13 @@ EOF
;;
esac
+ # Time to revert the changes made for nagfor.
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*)
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;;
+ esac
+
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=

View file

@ -1,49 +0,0 @@
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -7860,14 +7860,15 @@ func_mode_link ()
func_source "$lib"
# Convert "-framework foo" to "foo.ltframework"
- # and "-pthread" to "-Wl,-pthread" if NAG compiler
if test -n "$inherited_linker_flags"; then
- case "$CC" in
- *nagfor*)
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g' | $SED 's/-pthread/-Wl,-pthread/g'`;;
- *)
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`;;
- esac
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+
+ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;;
+ esac
+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
@@ -8887,7 +8888,8 @@ func_mode_link ()
xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
# On Darwin other compilers
- case $CC in
+ func_cc_basename $CC
+ case $func_cc_basename_result in
nagfor*)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
@@ -9499,6 +9501,13 @@ EOF
;;
esac
+ # Time to revert the changes made for nagfor.
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*)
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;;
+ esac
+
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=

View file

@ -382,14 +382,6 @@ class Openmpi(AutotoolsPackage, CudaPackage):
patch("btl_vader.patch", when="@3.0.1:3.0.2")
patch("btl_vader.patch", when="@3.1.0:3.1.2")
# Make NAG compiler pass the -pthread option to the linker:
# https://github.com/open-mpi/ompi/pull/6378
# We support only versions based on Libtool 2.4.6.
patch("nag_pthread/2.1.4_2.1.999_3.0.1_4.patch", when="@2.1.4:2.1,3.0.1:4%nag")
patch("nag_pthread/2.1.2_2.1.3_3.0.0.patch", when="@2.1.2:2.1.3,3.0.0%nag")
patch("nag_pthread/2.0.0_2.1.1.patch", when="@2.0.0:2.1.1%nag")
patch("nag_pthread/1.10.4_1.10.999.patch", when="@1.10.4:1.10%nag")
# Fix MPI_Sizeof() in the "mpi" Fortran module for compilers that do not
# support "IGNORE TKR" functionality (e.g. NAG).
# The issue has been resolved upstream in two steps:

View file

@ -1,10 +0,0 @@
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -5282,7 +5282,6 @@ _LT_EOF
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)

View file

@ -1,26 +0,0 @@
--- a/configure
+++ b/configure
@@ -11858,7 +11858,6 @@ _LT_EOF
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
@@ -21326,7 +21325,6 @@ _LT_EOF
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
@@ -25066,7 +25064,6 @@ _LT_EOF
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_FC='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)

View file

@ -1,69 +0,0 @@
--- a/configure
+++ b/configure
@@ -11745,6 +11745,8 @@ _LT_EOF
whole_archive_flag_spec=
tmp_sharedflag='--shared' ;;
nagfor*) # NAGFOR 5.3
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object=yes
tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
@@ -21030,6 +21032,8 @@ _LT_EOF
whole_archive_flag_spec_F77=
tmp_sharedflag='--shared' ;;
nagfor*) # NAGFOR 5.3
+ whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object_F77=yes
tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
@@ -24765,6 +24769,8 @@ _LT_EOF
whole_archive_flag_spec_FC=
tmp_sharedflag='--shared' ;;
nagfor*) # NAGFOR 5.3
+ whole_archive_flag_spec_FC='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object_FC=yes
tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
--- a/scripts/ltmain.sh
+++ b/scripts/ltmain.sh
@@ -7862,6 +7862,13 @@ func_mode_link ()
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+
+ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;;
+ esac
+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
@@ -8881,7 +8888,8 @@ func_mode_link ()
xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
# On Darwin other compilers
- case $CC in
+ func_cc_basename $CC
+ case $func_cc_basename_result in
nagfor*)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
@@ -9493,6 +9501,13 @@ EOF
;;
esac
+ # Time to revert the changes made for nagfor.
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*)
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;;
+ esac
+
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=

View file

@ -79,23 +79,6 @@ def url_for_version(self, version):
# (see below).
conflicts("+shared", when="@:1.9%nag+fortran")
# https://github.com/Parallel-NetCDF/PnetCDF/pull/59
patch("nag_libtool.patch", when="@1.9:1.12.1%nag")
# We could apply the patch unconditionally. However, it fixes a problem
# that manifests itself only when we build shared libraries with Spack on
# a Cray system with PGI compiler. Based on the name of the $CC executable,
# Libtool "thinks" that it works with PGI compiler directly but on a Cray
# system it actually works with the Cray's wrapper. PGI compiler (at least
# since the version 15.7) "understands" two formats of the
# '--whole-archive' argument. Unluckily, Cray's wrapper "understands" only
# one of them but Libtool switches to another one. The following patch
# discards the switching.
patch("cray_pgi_libtool_release.patch", when="@1.8:999%pgi+shared platform=cray")
# Given that the bug manifests itself in rather specific conditions, it is
# not reported upstream.
patch("cray_pgi_libtool_master.patch", when="@master%pgi+shared platform=cray")
@property
def libs(self):
libraries = ["libpnetcdf"]