summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/parallel-netcdf/cray_pgi_libtool_master.patch10
-rw-r--r--var/spack/repos/builtin/packages/parallel-netcdf/cray_pgi_libtool_release.patch26
-rw-r--r--var/spack/repos/builtin/packages/parallel-netcdf/package.py34
3 files changed, 69 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/cray_pgi_libtool_master.patch b/var/spack/repos/builtin/packages/parallel-netcdf/cray_pgi_libtool_master.patch
new file mode 100644
index 0000000000..dab9381be6
--- /dev/null
+++ b/var/spack/repos/builtin/packages/parallel-netcdf/cray_pgi_libtool_master.patch
@@ -0,0 +1,10 @@
+--- 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*)
diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/cray_pgi_libtool_release.patch b/var/spack/repos/builtin/packages/parallel-netcdf/cray_pgi_libtool_release.patch
new file mode 100644
index 0000000000..dcf34ee962
--- /dev/null
+++ b/var/spack/repos/builtin/packages/parallel-netcdf/cray_pgi_libtool_release.patch
@@ -0,0 +1,26 @@
+--- 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*)
diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/package.py b/var/spack/repos/builtin/packages/parallel-netcdf/package.py
index 14c97f6111..8f35ea98c6 100644
--- a/var/spack/repos/builtin/packages/parallel-netcdf/package.py
+++ b/var/spack/repos/builtin/packages/parallel-netcdf/package.py
@@ -17,6 +17,8 @@ class ParallelNetcdf(AutotoolsPackage):
url = "https://parallel-netcdf.github.io/Release/pnetcdf-1.11.0.tar.gz"
list_url = "https://parallel-netcdf.github.io/wiki/Download.html"
+ maintainers = ['skosukhin']
+
def url_for_version(self, version):
if version >= Version('1.11.0'):
url = "https://parallel-netcdf.github.io/Release/pnetcdf-{0}.tar.gz"
@@ -53,12 +55,42 @@ class ParallelNetcdf(AutotoolsPackage):
depends_on('perl', type='build')
- conflicts('+shared', when='@:1.9%nag+fortran')
+ # Suport for shared libraries was introduced in version 1.9.0
conflicts('+shared', when='@:1.8')
conflicts('+burstbuffer', when='@:1.10')
+ # Before 1.10.0, C utility programs (e.g. ncmpigen) were linked without
+ # explicit specification of the Fortran runtime libraries, which is
+ # required when libpnetcdf.so contains Fortran symbols. Libtool sets the
+ # required linking flags implicitly but only if the Fortran compiler
+ # produces verbose output with the '-v' flag (and, due to a bug in Libtool,
+ # when CXX is not set to 'no'; see macro _LT_LANG_FC_CONFIG in libtool.m4
+ # for more details). The latter is not the case for NAG. Starting 1.10.0,
+ # the required linking flags are explicitly set in the makefiles and
+ # detected using macro AC_FC_LIBRARY_LDFLAGS, which means that we can
+ # override the verbose output flag for Fortran compiler on the command line
+ # (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']