Skip to content

Commit

Permalink
Squashes OLCF customizations
Browse files Browse the repository at this point in the history
- Requests hdf5+hl when using xl toolchains

Needed to resolve concretization conflict.

- Updates source hash for mpfr v4.0.2 and adds missing autoconf macros.

Additional autoconf macros are needed for v4.0.2 which are provided by the
autoconf-archive package. This commit adds a missing spack package for
autoconf-archive and fixes an outdated source hash for mpfr v4.0.2.

It might be better to simply include the autoconf-archive dependency at the
autoconf package level if other packages also need the extension macros.

- Adds missing hdf5 lib search paths to netcdf-fortran when using the XL toolchain.

When using the XL toolchain, libtool does automatically pass the necessary HDF5
library search paths needed at link time. This commit explicitly injects the
HDF5 library search paths to the LD_FLAGS when using the XL toolchain for
libtool.

- Excludes SIMD optimization arguments when using PGI toolchain.

The FFTW package attempts to apply SIMD optimization flags when building FFTW.
The flags selected are not controlled by variants to the fftw package spec.
However, when using PGI on ppc64le, unsupported flags are added to the
configuration.

This commit removes targetted optimization options when using a PGI toolchain.
However, it is likely this is only necessary on certain architectures (ppc64le?)
or OSes (RHEL7?) and the logic should be improved before pushing this change to
upstream spack.

- Fixes global allocation error in newer GCC.

Newer GCC (9.0+) does not quietly handle allocation for uninitialized
global variables. GDBM up to the current version requires the `-fcommon`
flag for these toolchains to overcome "multiple-definition" errors.
Unfortunately, this carries a speed and code size penalty. Perhaps GDBM
will release a newer version that corrects this problem for newer GCC
toolchains.

- Adds missing dependnency.

Imagemagick depends on libSM and, if left implicit, will generally find
libSM from the OS which is unlikely to contain libuuid symbols matching
those used when spack builds libuuid. This causes build-time missing
symbol errors. By having spack build both libuuid and libSM, the problem
is avoided and the builds are decoupled from the host OS.

- Patches broken pre-built docs out of build

The RDMA-Core releases ship with pre-built documentation in case pandoc
and rst2man are not available on the system. It is not possible to
disable documentation at configuration time and the build will fail if
documentation cannot be built or installed. However, the pre-build
documentation is not complete (at least for infiniband-diags) and
rdma-core's CMake install process will attempt to copy pre-built
documentation that does not exist at install time, causing a fatal
error.

Adding a dependency on pandoc makes the DAG for this package extremely
large (pulling in many X11 dependencies). This is bound to cause
problems for non-GCC toolchains. So rather than have the spack package
build the docs from source, we will rely on the pre-built documentation
but exclude the attempted installation of the missing infiniband-diags
man pages.

- Adds patch for intel and long directory paths.

Intel toolchains do not tolerate string array intial values larger than the declared size of the array.

The path set via `buildlib/config.h.in` for `#define ACM_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma"` can be exceptionally long under spack. For example, in file `ibacm/prov/acmp/src/acmp.c`, the line (274) `static char route_data_file[128] = ACM_CONF_DIR "/ibacm_route.data";` sets a string 134+ characters long (ie `len("/sw/andes/spack-envs/base/opt/linux-rhel8-x86_64/clang-9.0.1/rdma-core-28.0-2ixcucck7eb4fzbd3t6imjrhz5qahxui/etc/rdma/ibacm_route.data")`).

This causes the intel compilers to choke when trying to shove that string into a 128-character array.

This commit adds a patch to the source code to allow for a path up to 192 characters in length.
It is unknown if this change breaks other things and this bug should be reported upstream.

- Adds OpenBLAS version 0.3.10

This latest version includes fixes for Zen2 targets and truncated symbol
names when using AOCC and Flang.

- Adds missing PIC flag for MPI builds with PGI.

PGI doesn't automatically propagate the PIC flag when building with MPI
support and autoconf does not detect the appropriate PIC flag when using
the mpif90 spack wrapper.

This commit forces FCFLAGS (respected by the mpif90 wrapper) to contain
the appropriate PIC flag when building with that option and MPI support
for all compilers.

- Updates NetCDF-Fortran version; adds GCC10 build error fix.

GCC10 fails to build netcdf-fortran and parallel-netcdf due to a
issue common to both packages that is known to the upstream developers
(at least for netcdf-fortran):

Unidata/netcdf-fortran#212

NetCDF-fortran has fixed the issue in a new release as of early June 2020
(Unidata/netcdf-fortran#250) but the problem has
not yet been patched in parallel-netcdf.

The latest version of netcdf-fortran (v4.5.3) requires netcdf-c >=
v4.7.4 so the base netcdf-c package is also updated to the latest
release.

- Updates Gromacs version; fixes package errors.

- Updates pkgconf dependency name.

The name of the package pkgconfig has been changed to pkgconf. This
package is updated to use the new name when declaring dependencies.

- Allow libs to be found in lib64 subdir.

When using external OpenSSL, the libs are not always in `$prefix/lib` in
the external build. Sometimes, the libraries exist in `$prefix/lib64`.
Packages which must declare the location of the SSL libraries outside of
using pkgconfig need the `openssl.libs` method to return valid paths.

- Pass OpenSSL libs via envvar without relying on pkgconfig.

When using external OS-provided OpenSSL, spack-built pkgconfig might not
be able to find the openssl libs if `/usr/lib64/pkgconfig` is not in
pkgconfig's search path. Passing the location of the OpenSSL libs
directly will work for both spack-built and external OpenSSL pacakges.

- Adds CUDA v11.0.2

The CUDA Toolkit v11.0.2, also referred to in documentation as CUDA Toolkit v11.0.194, was released on 8 July 2020 ([Release Notes](https://docs.nvidia.com/cuda/archive/11.0/)).
This commit adds this current latest version to the CUDA spack package.

- Adds fontconfig v2.13.92

This version fixes a bug that prevents fc cache updates when fonts are
missing their fc checksum files.

- Patches netlib-scalapack to solve confusion between PGI and Intel.

The netlib-scalapack CMakeLists have a faulty check to identify if the
Intel compiler suite is being used. It checks if the substring 'ifort'
matches the fortran compiler binary. Unfortunately, this also catches
the PGI fortran compiler 'pgifort'. This causes the build system to
inject Intel-specific compiler options into the build. Since
unrecognized arguments are generally fatal to PGI, this causes problems
when trying to build the package with PGI.

Instead, the developers probably want to check the
`CMAKE_Fortran_COMPILER_ID` for `Intel` which is unique for the Intel
toolchain. This commit adds a patch for this to spack builds. This patch
should probably be generalized better for future versions and applied as
a patch function. Or, better yet, contributed to the upstream Scalapack
codebase.

- Enable UCX dev headers by default.

No reason to not have the development headers available for applications
that need them.

- LSF systems must use own PMIx implementation.

IBM's PMIx libraries are not provided with LSF and instead are
incorporated in CSM or SMPI. OMPI cannot reliably find the necessary
external PMIx implementation when on certain systems using LSF.

Therefore, we force the use of internal PMIx when using LSF.

However, the LSF libdirs options are also not reliably found due to the
way IBM packages LSF headers and libraries in separate locations. The
second block of code in this commit is experimental and doesn't
necessarily work.

- Skip patching missing config files.

The libiberty subdirectory does not contain its own config files and
Spack should not attempt to patch them.

- Adds new Plumed version and library fix.

Adds latest release v2.6.2 of plumed to the spack package and ensures
that both c and fortan blas libraries are added to compiler linking
incantations.

- Fixes __ieee128 error building Gromacs on ppc64le
  • Loading branch information
mpbelhorn committed Nov 19, 2020
1 parent 77d9acb commit dc52448
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 15 deletions.
4 changes: 4 additions & 0 deletions var/spack/repos/builtin/packages/autoconf-archive/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ class AutoconfArchive(AutotoolsPackage, GNUMirrorPackage):
gnu_mirror_path = "autoconf-archive/autoconf-archive-2019.01.06.tar.xz"

version('2019.01.06', sha256='17195c833098da79de5778ee90948f4c5d90ed1a0cf8391b4ab348e2ec511e3f')

def setup_dependent_build_environment(self, env, dependent_spec):
"""Adds the ACLOCAL path for autotools."""
env.append_path('ACLOCAL_PATH', self.prefix.share.aclocal)
4 changes: 3 additions & 1 deletion var/spack/repos/builtin/packages/fontconfig/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Fontconfig(AutotoolsPackage):
homepage = "http://www.freedesktop.org/wiki/Software/fontconfig/"
url = "http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.3.tar.gz"

version('2.13.92', sha256='3406a05b83a42231e3df68d02bc0a0cf47b3f2e8f11c8ede62267daf5f130016')
version('2.13.1', sha256='9f0d852b39d75fc655f9f53850eb32555394f36104a044bb2b2fc9e66dbbfa7f')
version('2.12.3', sha256='ffc3cbf6dd9fcd516ee42f48306a715e66698b238933d6fa7cef02ea8b3b818e')
version('2.12.1', sha256='a9f42d03949f948a3a4f762287dbc16e53a927c91a07ee64207ebd90a9e5e292')
Expand All @@ -19,9 +20,10 @@ class Fontconfig(AutotoolsPackage):
depends_on('freetype')
depends_on('gperf', type='build', when='@2.12.2:')
depends_on('libxml2')
depends_on('pkgconfig', type='build')
depends_on('pkgconf', type='build')
depends_on('font-util')
depends_on('libuuid', when='@2.13.1:')
depends_on('bzip2')

def configure_args(self):
font_path = join_path(self.spec['font-util'].prefix, 'share', 'fonts')
Expand Down
6 changes: 5 additions & 1 deletion var/spack/repos/builtin/packages/gdbm/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def configure_args(self):
# https://patchwork.ozlabs.org/patch/771300/
# https://stackoverflow.com/questions/5582211
# https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
extra_args = []
if self.spec.satisfies('%[email protected]:'):
extra_args.append('CFLAGS=-fcommon')
return [
'--enable-libgdbm-compat',
'CPPFLAGS=-D_GNU_SOURCE']
'CPPFLAGS=-D_GNU_SOURCE'
] + extra_args
2 changes: 2 additions & 0 deletions var/spack/repos/builtin/packages/gromacs/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def cmake_args(self):
if '+cuda' in self.spec:
options.append('-DCUDA_TOOLKIT_ROOT_DIR:STRING=' +
self.spec['cuda'].prefix)
if self.spec.satisfies('%gcc target=ppc64le'):
options.append('-DCUDA_NVCC_FLAGS=-Xcompiler=-mno-float128')

if '+opencl' in self.spec:
options.append('-DGMX_USE_OPENCL=on')
Expand Down
1 change: 1 addition & 0 deletions var/spack/repos/builtin/packages/libiberty/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Libiberty(AutotoolsPackage, GNUMirrorPackage):

# Configure and build just libiberty.
configure_directory = 'libiberty'
patch_config_files = False

# Set default cflags (-g -O2), add -fPIC if requested, and move to
# the configure line.
Expand Down
4 changes: 1 addition & 3 deletions var/spack/repos/builtin/packages/mpfr/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ class Mpfr(AutotoolsPackage, GNUMirrorPackage):
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('m4', type='build')
depends_on('autoconf-archive', when='@4.0.2:', type='build')

force_autoreconf = True
depends_on('autoconf-archive', when='@4.0.2:', type=('build', 'run'))

# Check the Bugs section of old release pages for patches.
# https://www.mpfr.org/mpfr-X.Y.Z/#bugs
Expand Down
4 changes: 4 additions & 0 deletions var/spack/repos/builtin/packages/netcdf-fortran/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class NetcdfFortran(AutotoolsPackage):

depends_on('netcdf-c')
depends_on('doxygen', when='+doc', type='build')
depends_on('hdf5+hl', when="%xl")
depends_on('hdf5+hl', when="%xl_r")

# The default libtool.m4 is too old to handle NAG compiler properly:
# https://github.com/Unidata/netcdf-fortran/issues/94
Expand Down Expand Up @@ -87,6 +89,8 @@ def flag_handler(self, name, flags):
# building takes place outside of Spack environment, i.e.
# without Spack's compiler wrappers.
config_flags = [self.spec['netcdf-c'].libs.search_flags]
if self.spec.satisfies('%xl') or self.spec.satisfies('%xl_r'):
config_flags.append(self.spec['hdf5'].libs.search_flags)

return flags, None, config_flags

Expand Down
11 changes: 11 additions & 0 deletions var/spack/repos/builtin/packages/netlib-scalapack/pgi-intel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/CMakeLists.txt 2020-08-06 15:36:41.979180109 -0400
+++ b/CMakeLists.txt 2020-08-06 15:37:32.837236523 -0400
@@ -76,7 +76,7 @@


if (UNIX)
- if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
+ if ( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel" )
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
endif ()
endif ()
14 changes: 14 additions & 0 deletions var/spack/repos/builtin/packages/openmpi/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,13 @@ def configure_args(self):
if spec.satisfies('@3.1.3:') or spec.satisfies('@3.0.3'):
if '+static' in spec:
config_args.append('--enable-static')
elif spec.satisfies('schedulers=lsf +pmi'):
config_args.extend(
['--with-pmix=internal',
'--enable-mpirun-prefix-by-default',
])
if '+static' in spec:
config_args.append('--enable-static')
else:
if '+static' in spec:
config_args.append('--enable-static')
Expand All @@ -631,6 +638,13 @@ def configure_args(self):

config_args.extend(self.with_or_without('pmi'))

if spec.satisfies('schedulers=lsf'):
lsf_libdirs = find_libraries('liblsf', spec['lsf'].prefix,
shared=True,
recursive=True).directories
if lsf_libdirs:
config_args.append('--with-lsf-libdir={0}'.format(lsf_libdirs[0]))

if spec.satisfies('@3.0.0:', strict=True):
config_args.append('--with-zlib={0}'.format(spec['zlib'].prefix))

Expand Down
6 changes: 4 additions & 2 deletions var/spack/repos/builtin/packages/openssl/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ def determine_version(cls, exe):

@property
def libs(self):
return find_libraries(
['libssl', 'libcrypto'], root=self.prefix, recursive=True)
libs = find_libraries(['libssl', 'libcrypto'], root=self.prefix.lib)
if not libs:
libs = find_libraries(['libssl', 'libcrypto'], root=self.prefix.lib64)
return libs

def handle_fetch_error(self, error):
tty.warn("Fetching OpenSSL failed. This may indicate that OpenSSL has "
Expand Down
3 changes: 2 additions & 1 deletion var/spack/repos/builtin/packages/plumed/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Plumed(AutotoolsPackage):
git = 'https://github.com/plumed/plumed2.git'

version('master', branch='master')
version('2.6.2', sha256='bbc2ef0cb08d404513b8b737c72333b6656389e15effd6a0f9ace2a5758c9a4a')
version('2.6.1', sha256='c1b3c397b2d971140aa240dde50e48a04ce78e3dedb02b6dca80fa53f8026e4e')
version('2.6.0', sha256='3d57ae460607a49547ef38a52c4ac93493a3966857c352280a9c05f5dcdb1820')
version('2.5.5', preferred=True, sha256='70faa9ff1938e286dc388cb793b39840953e5646855b684f48df1bc864b737e8')
Expand Down Expand Up @@ -161,7 +162,7 @@ def configure_args(self):
# Set flags to help find gsl
if '+gsl' in self.spec:
gsl_libs = self.spec['gsl'].libs
blas_libs = self.spec['blas'].libs
blas_libs = self.spec['blas:c,fortran'].libs
configure_opts.append('LDFLAGS={0}'.format(
(gsl_libs + blas_libs).ld_flags
))
Expand Down
15 changes: 10 additions & 5 deletions var/spack/repos/builtin/packages/rdma-core/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ class RdmaCore(CMakePackage):
version('31.0', sha256='51ae9a3ab81cd6834436813fafc310c8b7007feae9d09a53fdd5c169e648d50b')
version('30.0', sha256='23e1bd2d7b38149a1621ee577a3428ac652e305adb8e0eee923cbe71356a9bf9')
version('28.1', sha256='d9961fd9b0867f17cb6a30a728562f00528b63dd72d1168d838220ab44e5c713')
version('28.0', sha256='e8ae3a78f9908cdc9139e8f6a155cd0bb43a30d0e54f28a3c7a2df4af51b3f4d')
version('27.1', sha256='39eeb3ab5f868ef3a5f7623d1ee69adca04efabe2a37de8080f354b8f4ef0ad7')
version('26.2', sha256='115087ab438bea3530a0d520640f1eeb5872b902ee2263acf83dcc7835d296c6')
version('25.4', sha256='f622491b0aac819f05c73174e0c7a9e630cc02fc0914d5ba1bb1d87fc4d313fd')
version('24.3', sha256='3a02d2d864258acc763849c635c815e3fa6a798a1464511cd3a2a370ddd6ee89')
version('23.4', sha256='6bfe009e9a382085def3b004d9396f7255a2e0c90c36647d1df0b86773d21a79')
version('22.6', sha256='b984e80af2bb9b22c5cd6bf802688b488338228ed9a5b09447e64292d65e2d0a')
version('22.3', sha256='482009a90b250c391639f9335e40fb4718c6c2c19bd8494d9ea02331600ff749')
version('20.6', sha256='ae2daaee0fc567e88c84966497993e40a83a502ebe90c0344481ef3b13787bf0')
version('20', sha256='bc846989f807cd2b03643927d2b99fbf6f849cb1e766ab49bc9e81ce769d5421')
version('17.1', sha256='b47444b7c05d3906deb8771eec3e634984dd83f5e620d5e37d3a83f74f0cc1ba')
version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97')
Expand All @@ -29,12 +33,13 @@ class RdmaCore(CMakePackage):
depends_on('py-docutils', type='build')
depends_on('libnl')
conflicts('platform=darwin', msg='rdma-core requires FreeBSD or Linux')
conflicts('%intel', msg='rdma-core cannot be built with intel (use gcc instead)')
conflicts('%intel', when="@:20.0",
msg='rdma-core cannot be built with intel (use gcc instead)')

# NOTE: specify CMAKE_INSTALL_RUNDIR explicitly to prevent rdma-core from
# using the spack staging build dir (which may be a very long file
# system path) as a component in compile-time static strings such as
# IBACM_SERVER_PATH.
# NOTE: specify CMAKE_INSTALL_RUNDIR explicitly to prevent rdma-core from
# using the spack staging build dir (which may be a very long file
# system path) as a component in compile-time static strings such as
# IBACM_SERVER_PATH.
def cmake_args(self):
cmake_args = ["-DCMAKE_INSTALL_SYSCONFDIR=" +
self.spec.prefix.etc,
Expand Down
4 changes: 2 additions & 2 deletions var/spack/repos/builtin/packages/ucx/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ def autoreconf(self, spec, prefix):

def configure_args(self):
spec = self.spec
config_args = []
config_args = ['--enable-devel-headers']

if '+thread_multiple' in spec:
config_args.append('--enable-mt')
else:
config_args.append('--disable-mt')

if '+paramter_checking' in spec:
if '+parameter_checking' in spec:
config_args.append('--enable-params-check')
else:
config_args.append('--disable-params-check')
Expand Down
3 changes: 3 additions & 0 deletions var/spack/repos/builtin/packages/wget/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def configure_args(self):
args = [
'--with-ssl={0}'.format(spec.variants['ssl'].value),
]
if spec.variants['ssl'].value == 'openssl':
args.append('OPENSSL_LIBS=%s' % spec['openssl'].libs.link_flags)
args.append('OPENSSL_CFLAGS=%s' % spec['openssl'].libs.ld_flags)

if '+zlib' in spec:
args.append('--with-zlib')
Expand Down

0 comments on commit dc52448

Please sign in to comment.