summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorSergey Kosukhin <sergey.kosukhin@mpimet.mpg.de>2020-03-10 17:29:57 +0100
committerGitHub <noreply@github.com>2020-03-10 11:29:57 -0500
commit7118e24664a62f193fb86c2178e02033a219e834 (patch)
treeb8566aa41d24ccae5e00e3656ad0b461841c04ca /var
parent21634e805ef61b4e503f25a681003a9ef19e68c0 (diff)
downloadspack-7118e24664a62f193fb86c2178e02033a219e834.tar.gz
spack-7118e24664a62f193fb86c2178e02033a219e834.tar.bz2
spack-7118e24664a62f193fb86c2178e02033a219e834.tar.xz
spack-7118e24664a62f193fb86c2178e02033a219e834.zip
Parallel-netcdf: update package. (#15359)
* Parallel-netcdf: update package. * Add a temporary patch for version 'develop'. * Rename version 'develop' to 'master'. * Drop the patch for 'master'.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/parallel-netcdf/nag_libtool.patch69
-rw-r--r--var/spack/repos/builtin/packages/parallel-netcdf/package.py84
2 files changed, 127 insertions, 26 deletions
diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/nag_libtool.patch b/var/spack/repos/builtin/packages/parallel-netcdf/nag_libtool.patch
new file mode 100644
index 0000000000..f391c1dc5e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/parallel-netcdf/nag_libtool.patch
@@ -0,0 +1,69 @@
+--- 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=
diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/package.py b/var/spack/repos/builtin/packages/parallel-netcdf/package.py
index 34a1af5984..384717d05e 100644
--- a/var/spack/repos/builtin/packages/parallel-netcdf/package.py
+++ b/var/spack/repos/builtin/packages/parallel-netcdf/package.py
@@ -25,7 +25,6 @@ class ParallelNetcdf(AutotoolsPackage):
return url.format(version.dotted)
- version('develop', branch='develop')
version('master', branch='master')
version('1.12.1', sha256='56f5afaa0ddc256791c405719b6436a83b92dcd5be37fe860dea103aee8250a2')
version('1.11.2', sha256='d2c18601b364c35b5acb0a0b46cd6e14cae456e0eb854e5c789cf65f3cd6a2a7')
@@ -42,41 +41,74 @@ class ParallelNetcdf(AutotoolsPackage):
variant('fortran', default=True, description='Build the Fortran Interface')
variant('pic', default=True,
description='Produce position-independent code (for shared libs)')
+ variant('shared', default=True, description='Enable shared library')
depends_on('mpi')
depends_on('m4', type='build')
+ depends_on('autoconf', when='@master', type='build')
+ depends_on('automake', when='@master', type='build')
+ depends_on('libtool', when='@master', type='build')
- # See:
- # https://trac.mcs.anl.gov/projects/parallel-netcdf/browser/trunk/INSTALL
- def configure_args(self):
- spec = self.spec
+ conflicts('+shared', when='@:1.9%nag+fortran')
+ conflicts('+shared', when='@:1.8')
+
+ patch('nag_libtool.patch', when='@1.9:1.12.1%nag')
- args = ['--with-mpi={0}'.format(spec['mpi'].prefix)]
- args.append('MPICC={0}'.format(spec['mpi'].mpicc))
- args.append('MPICXX={0}'.format(spec['mpi'].mpicxx))
- args.append('MPIF77={0}'.format(spec['mpi'].mpifc))
- args.append('MPIF90={0}'.format(spec['mpi'].mpifc))
- args.append('SEQ_CC={0}'.format(spack_cc))
+ @property
+ def libs(self):
+ libraries = ['libpnetcdf']
- if '+pic' in spec:
- args.extend([
- 'CFLAGS={0}'.format(self.compiler.pic_flag),
- 'CXXFLAGS={0}'.format(self.compiler.pic_flag),
- 'FFLAGS={0}'.format(self.compiler.pic_flag)
- ])
+ query_parameters = self.spec.last_query.extra_parameters
+
+ if 'shared' in query_parameters:
+ shared = True
+ elif 'static' in query_parameters:
+ shared = False
+ else:
+ shared = '+shared' in self.spec
- if '~cxx' in spec:
- args.append('--disable-cxx')
+ libs = find_libraries(
+ libraries, root=self.prefix, shared=shared, recursive=True
+ )
- if '~fortran' in spec:
- args.append('--disable-fortran')
+ if libs:
+ return libs
- if spec.satisfies('@1.8.0:'):
+ msg = 'Unable to recursively locate {0} {1} libraries in {2}'
+ raise spack.error.NoLibrariesError(
+ msg.format('shared' if shared else 'static',
+ self.spec.name,
+ self.spec.prefix))
+
+ @when('@master')
+ def autoreconf(self, spec, prefix):
+ with working_dir(self.configure_directory):
+ # We do not specify '-f' because we need to use libtool files from
+ # the repository.
+ autoreconf('-iv')
+
+ def configure_args(self):
+ args = ['--with-mpi=%s' % self.spec['mpi'].prefix,
+ 'SEQ_CC=%s' % spack_cc]
+
+ args += self.enable_or_disable('cxx')
+ args += self.enable_or_disable('fortran')
+
+ if '+pic' in self.spec:
+ args.extend(['{0}FLAGS={1}'.format(lang, self.compiler.pic_flag)
+ for lang in ['C', 'CXX', 'F', 'FC']])
+
+ if self.version >= Version('1.8'):
args.append('--enable-relax-coord-bound')
- return args
+ if self.version >= Version('1.9'):
+ args += self.enable_or_disable('shared')
+ args.extend(['--enable-static',
+ '--disable-silent-rules'])
+
+ if self.spec.satisfies('%nag+fortran+shared'):
+ args.extend(['ac_cv_prog_fc_v=-Wl,-v',
+ 'ac_cv_prog_f77_v=-Wl,-v'])
- def install(self, spec, prefix):
- # Installation fails in parallel
- make('install', parallel=False)
+ return args