From d4afd738915a91df27922f4d1049806da5b61189 Mon Sep 17 00:00:00 2001 From: Ben Corbett <32752943+corbett5@users.noreply.github.com> Date: Thu, 17 Dec 2020 13:22:37 -0800 Subject: [PATCH 01/48] LC Spack Support (#1204) * Spack work. * Working with existing LLNL host configs. * SuiteSparse on Lassen progress. * Trilinos working on Lassen. * HYPRE finally working. * Trilinos MKL TPL * Fixed CHAI version. * Initial commit MacOS spack support * Travis host configs. * Expanded VTK libraries. Co-authored-by: Herve Gross --- scripts/uberenv/packages/adiak/package.py | 41 + scripts/uberenv/packages/chai/package.py | 77 ++ scripts/uberenv/packages/essl/package.py | 104 +++ scripts/uberenv/packages/geosx/package.py | 474 ++++++++++ scripts/uberenv/packages/hypre/package.py | 207 +++++ scripts/uberenv/packages/petsc/package.py | 503 +++++++++++ scripts/uberenv/packages/py-numpy/package.py | 319 +++++++ scripts/uberenv/packages/py-scipy/package.py | 124 +++ .../packages/py-scipy/scipy-clang.patch | 13 + scripts/uberenv/packages/raja/package.py | 77 ++ scripts/uberenv/packages/silo/package.py | 121 +++ .../uberenv/packages/suite-sparse/package.py | 211 +++++ scripts/uberenv/packages/trilinos/package.py | 813 ++++++++++++++++++ scripts/uberenv/packages/umpire/package.py | 108 +++ .../uberenv/packages/uncrustify/package.py | 44 + .../blueos_3_ppc64le_ib_p9/compilers.yaml | 31 + .../blueos_3_ppc64le_ib_p9/packages.yaml | 71 ++ scripts/uberenv/spack_configs/config.yaml | 78 ++ .../spack_configs/darwin/compilers.yaml | 17 + .../spack_configs/darwin/packages.yaml | 134 +++ .../toss_3_x86_64_ib/compilers.yaml | 49 ++ .../toss_3_x86_64_ib/packages.yaml | 142 +++ 22 files changed, 3758 insertions(+) create mode 100644 scripts/uberenv/packages/adiak/package.py create mode 100644 scripts/uberenv/packages/chai/package.py create mode 100644 scripts/uberenv/packages/essl/package.py create mode 100644 scripts/uberenv/packages/geosx/package.py create mode 100644 scripts/uberenv/packages/hypre/package.py create mode 100644 scripts/uberenv/packages/petsc/package.py create mode 100644 scripts/uberenv/packages/py-numpy/package.py create mode 100644 scripts/uberenv/packages/py-scipy/package.py create mode 100644 scripts/uberenv/packages/py-scipy/scipy-clang.patch create mode 100644 scripts/uberenv/packages/raja/package.py create mode 100644 scripts/uberenv/packages/silo/package.py create mode 100644 scripts/uberenv/packages/suite-sparse/package.py create mode 100644 scripts/uberenv/packages/trilinos/package.py create mode 100644 scripts/uberenv/packages/umpire/package.py create mode 100644 scripts/uberenv/packages/uncrustify/package.py create mode 100644 scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml create mode 100644 scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml create mode 100644 scripts/uberenv/spack_configs/config.yaml create mode 100644 scripts/uberenv/spack_configs/darwin/compilers.yaml create mode 100644 scripts/uberenv/spack_configs/darwin/packages.yaml create mode 100644 scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml create mode 100644 scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml diff --git a/scripts/uberenv/packages/adiak/package.py b/scripts/uberenv/packages/adiak/package.py new file mode 100644 index 00000000..d7d11ef0 --- /dev/null +++ b/scripts/uberenv/packages/adiak/package.py @@ -0,0 +1,41 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Adiak(CMakePackage): + """Adiak collects metadata about HPC application runs and provides it + to tools.""" + + homepage = "https://github.com/LLNL/Adiak" + git = "https://github.com/LLNL/Adiak.git" + + version('master', branch='master', submodules='True') + version('0.2.1', tag='v0.2.1', submodules="True") + version('0.2.0', tag='v0.2.0', submodules="True") + version('0.1.1', tag='v0.1', submodules="True") + + variant('mpi', default=True, description='Build with MPI support') + variant('shared', default=True, description='Build dynamic libraries') + + depends_on('mpi', when='+mpi') + + def cmake_args(self): + args = [] + if self.spec.satisfies('+mpi'): + args.append('-DMPICXX=%s' % self.spec['mpi'].mpicxx) + args.append('-DMPICC=%s' % self.spec['mpi'].mpicc) + args.append('-DENABLE_MPI=ON') + else: + args.append('-DENABLE_MPI=OFF') + + if (self.spec.satisfies('+shared')): + args.append('-DBUILD_SHARED_LIBS=ON') + else: + args.append('-DBUILD_SHARED_LIBS=OFF') + + args.append('-DENABLE_TESTS=OFF') + return args diff --git a/scripts/uberenv/packages/chai/package.py b/scripts/uberenv/packages/chai/package.py new file mode 100644 index 00000000..e4cdd23f --- /dev/null +++ b/scripts/uberenv/packages/chai/package.py @@ -0,0 +1,77 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Chai(CMakePackage, CudaPackage): + """ + Copy-hiding array interface for data migration between memory spaces + """ + + homepage = "https://github.com/LLNL/CHAI" + git = "https://github.com/LLNL/CHAI.git" + + version('develop', branch='develop', submodules='True') + version('master', branch='main', submodules='True') + version('2.3.0', tag='v2.3.0', submodules='True') + version('2.2.2', tag='v2.2.2', submodules='True') + version('2.2.1', tag='v2.2.1', submodules='True') + version('2.2.0', tag='v2.2.0', submodules='True') + version('2.1.1', tag='v2.1.1', submodules='True') + version('2.1.0', tag='v2.1.0', submodules='True') + version('2.0.0', tag='v2.0.0', submodules='True') + version('1.2.0', tag='v1.2.0', submodules='True') + version('1.1.0', tag='v1.1.0', submodules='True') + version('1.0', tag='v1.0', submodules='True') + + variant('shared', default=True, description='Build Shared Libs') + variant('raja', default=False, description='Build plugin for RAJA') + variant('benchmarks', default=True, description='Build benchmarks.') + variant('examples', default=True, description='Build examples.') + + depends_on('cmake@3.8:', type='build') + depends_on('umpire') + depends_on('raja', when="+raja") + + depends_on('cmake@3.9:', type='build', when="+cuda") + depends_on('umpire+cuda', when="+cuda") + depends_on('raja+cuda', when="+raja+cuda") + + def cmake_args(self): + spec = self.spec + + options = [] + + if '+cuda' in spec: + options.extend([ + '-DENABLE_CUDA=ON', + '-DCUDA_TOOLKIT_ROOT_DIR=' + spec['cuda'].prefix]) + + if not spec.satisfies('cuda_arch=none'): + cuda_arch = spec.variants['cuda_arch'].value + options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) + flag = '-arch sm_{0}'.format(cuda_arch[0]) + options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag)) + else: + options.append('-DENABLE_CUDA=OFF') + + if '+raja' in spec: + options.extend(['-DENABLE_RAJA_PLUGIN=ON', + '-DRAJA_DIR=' + spec['raja'].prefix]) + + options.append('-Dumpire_DIR:PATH=' + + spec['umpire'].prefix.share.umpire.cmake) + + options.append('-DENABLE_TESTS={0}'.format( + 'ON' if self.run_tests else 'OFF')) + + options.append('-DENABLE_BENCHMARKS={0}'.format( + 'ON' if '+benchmarks' in spec else 'OFF')) + + options.append('-DENABLE_EXAMPLES={0}'.format( + 'ON' if '+examples' in spec else 'OFF')) + + return options diff --git a/scripts/uberenv/packages/essl/package.py b/scripts/uberenv/packages/essl/package.py new file mode 100644 index 00000000..d4b3df31 --- /dev/null +++ b/scripts/uberenv/packages/essl/package.py @@ -0,0 +1,104 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + +class Essl(Package): + """IBM's Engineering and Scientific Subroutine Library (ESSL).""" + + # homepage = "https://www.ibm.com/systems/power/software/essl/" + + variant('ilp64', default=False, description='64 bit integers') + variant( + 'threads', default='openmp', + description='Multithreading support', + values=('openmp', 'none'), + multi=False + ) + variant('cuda', default=False, description='CUDA acceleration') + variant('lapack', default=False, description='Support lapack interface.') + + depends_on('cuda', when='+cuda') + + provides('blas') + provides('lapack', when='+lapack') + + conflicts('+cuda', when='+ilp64', + msg='ESSL+cuda+ilp64 cannot combine CUDA acceleration' + ' 64 bit integers') + + conflicts('+cuda', when='threads=none', + msg='ESSL+cuda threads=none cannot combine CUDA acceleration' + ' without multithreading support') + + @property + def blas_libs(self): + spec = self.spec + + if '+ilp64' in spec: + essl_lib = ['libessl6464'] + else: + essl_lib = ['libessl'] + + if spec.satisfies('threads=openmp'): + # ESSL SMP support requires XL or Clang OpenMP library + if '%xl' in spec or '%xl_r' in spec or '%clang' in spec: + if '+ilp64' in spec: + essl_lib = ['libesslsmp6464'] + else: + if '+cuda' in spec: + essl_lib = ['libesslsmpcuda'] + else: + essl_lib = ['libesslsmp'] + + essl_libs = find_libraries( + essl_lib, + root=self.prefix.lib64, + shared=True + ) + + if '+cuda' in spec: + essl_libs += ['/usr/tce/packages/cuda/cuda-10.1.243/lib64/libcublas.so', + '/usr/tce/packages/cuda/cuda-10.1.243/lib64/libcudart.so'] + # essl_libs += spec['cuda'].libs + + if spec.satisfies('threads=openmp'): + if '%gcc' in self.spec: + gcc = Executable(self.compiler.cc) + omp_lib_path = gcc('--print-file-name', 'libgomp.so', output=str) + omp_libs = LibraryList(omp_lib_path.strip()) + + elif '%clang' in self.spec: + clang = Executable(self.compiler.cc) + omp_lib_path = clang('--print-file-name', 'libomp.so', output=str) + omp_libs = LibraryList(omp_lib_path.strip()) + + essl_libs += omp_libs + + return essl_libs + + @property + def lapack_libs(self): + essl_libs = self.blas_libs + essl_libs += find_libraries( + ['liblapackforessl'], + # ['liblapackforessl', 'liblapackforessl_'], + root=self.prefix.lib64, + shared=True + ) + + return essl_libs + + @property + def libs(self): + result = self.blas_libs + if '+lapack' in self.spec: + result += self.lapack_libs + + return result + + def install(self, spec, prefix): + raise InstallError('IBM ESSL is not installable;' + ' it is vendor supplied') diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py new file mode 100644 index 00000000..490d66da --- /dev/null +++ b/scripts/uberenv/packages/geosx/package.py @@ -0,0 +1,474 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +import warnings + +import socket +import os + +from os import environ as env +from os.path import join as pjoin + + +# ./scripts/uberenv/uberenv.py --spec="%clang +mkl ^chai ^caliper+papi" + +# ./scripts/uberenv/uberenv.py --spec="%clang +mkl ^raja build_type=Release ^umpire build_type=Release ^chai build_type=Release ^adiak build_type=Release ^caliper+papi build_type=Release ^pugixml build_type=Release ^parmetis build_type=Release ^superlu-dist build_type=Release ^trilinos build_type=Release" + +# ./scripts/uberenv/uberenv.py --spec="%clang +essl +cuda ~petsc cuda_arch=70 ^raja build_type=Release cuda_arch=70 ^umpire build_type=Release cuda_arch=70 ^chai build_type=Release cuda_arch=70 ^adiak build_type=Release ^caliper~papi build_type=Release ^pugixml build_type=Release ^parmetis build_type=Release ^superlu-dist build_type=Release ^trilinos build_type=Release" + + +# PETSC doesn't compile on Lassen +# ./scripts/uberenv/uberenv.py --spec="%gcc +essl ~petsc +cuda cuda_arch=70 ^cuda@10.1.243 ^raja cuda_arch=70 ^umpire cuda_arch=70 ^chai cuda_arch=70 ^caliper~papi" + +def cmake_cache_entry(name, value, comment=""): + """Generate a string for a cmake cache variable""" + + return 'set(%s "%s" CACHE PATH "%s")\n\n' % (name, value, comment) + +def cmake_cache_list(name, value, comment=""): + """Generate a list for a cmake cache variable""" + + indent = 5 + len(name) + join_str = '\n' + ' ' * indent + return 'set(%s %s CACHE STRING "%s")\n\n' % (name, join_str.join(value), comment) + + +def cmake_cache_string(name, string, comment=""): + """Generate a string for a cmake cache variable""" + + return 'set(%s "%s" CACHE STRING "%s")\n\n' % (name, string, comment) + + +def cmake_cache_option(name, boolean_value, comment=""): + """Generate a string for a cmake configuration option""" + + value = "ON" if boolean_value else "OFF" + return 'set(%s %s CACHE BOOL "%s")\n\n' % (name, value, comment) + + +class Geosx(CMakePackage, CudaPackage): + """GEOSX simulation framework.""" + + homepage = "https://github.com/GEOSX/GEOSX" + git = "https://github.com/GEOSX/GEOSX.git" + + version('develop', branch='develop', submodules='True') + + variant('shared', default=True, description='Build Shared Libs.') + variant('caliper', default=True, description='Build Caliper support.') + variant('mkl', default=False, description='Use the Intel MKL library.') + variant('essl', default=False, description='Use the IBM ESSL library.') + variant('suite-sparse', default=True, description='Build SuiteSparse support.') + variant('trilinos', default=True, description='Build Trilinos support.') + variant('hypre', default=True, description='Build HYPRE support.') + variant('petsc', default=True, description='Build PETSc support.') + variant('lai', default='trilinos', description='Linear algebra interface.', + values=('trilinos', 'hypre', 'petsc'), multi=False) + variant('pygeosx', default=False, description='Build the GEOSX python interface.') + + # variant('tests', default=True, description='Build tests') + # variant('benchmarks', default=False, description='Build benchmarks') + # variant('examples', default=False, description='Build examples') + # variant('docs', default=False, description='Build docs') + # variant('addr2line', default=True, + # description='Build support for addr2line.') + + depends_on('cmake@3.8:', type='build') + depends_on('cmake@3.9:', when='+cuda', type='build') + + # + # Virtual packages + # + depends_on('mpi') + depends_on('blas') + depends_on('lapack') + + # + # Performance portability + # + depends_on('raja@0.12.1 +openmp +shared ~examples ~exercises') + depends_on('raja +cuda', when='+cuda') + + depends_on('umpire@4.1.2 ~c +shared +openmp ~examples') + depends_on('umpire +cuda', when='+cuda') + + depends_on('chai@2.2.2 +shared +raja ~benchmarks ~examples') + depends_on('chai@2.2.2 +cuda', when='+cuda') + + # + # IO + # + depends_on('hdf5@1.10.5: +shared +pic +mpi', when='~vtk') + + depends_on('conduit@0.5: +shared ~test ~fortran +mpi +hdf5 ~hdf5_compat') + + depends_on('silo@4.10: ~fortran +shared ~silex +pic +mpi ~zlib') + + depends_on('adiak@0.2: +mpi +shared', when='+caliper') + depends_on('caliper@2.4: +shared +adiak +mpi ~callpath ~libpfm ~gotcha ~sampler', when='+caliper') + + depends_on('pugixml@1.8: +shared') + + # + # Math + # + depends_on('intel-mkl +shared ~ilp64', when='+mkl') + + # depends_on('essl ~ilp64 threads=openmp +lapack +cuda', when='+essl') + + depends_on('parmetis@4.0.3: +shared +int64') + + depends_on('superlu-dist +int64 +openmp +shared', when='~petsc') + depends_on('superlu-dist@6.3.0 +int64 +openmp +shared', when='+petsc') + + depends_on('suite-sparse@5.8.1: +pic +openmp +amd +camd +colamd +ccolamd +cholmod +umfpack', when='+suite-sparse') + depends_on('suite-sparse +blas-no-underscore', when='%gcc +suite-sparse +essl') + + trilinos_build_options = '~fortran +openmp +shared' + trilinos_tpls = '~boost ~glm ~gtest ~hdf5 ~hypre ~matio ~metis +mpi ~mumps ~netcdf ~suite-sparse' + trilinos_packages = '+amesos +aztec +epetra +epetraext +ifpack +kokkos +ml +stk +stratimikos +teuchos +tpetra ~amesos2 ~anasazi ~belos ~exodus ~ifpack2 ~muelu ~sacado ~zoltan ~zoltan2' + depends_on('trilinos@12.18.1: ' + trilinos_build_options + trilinos_tpls + trilinos_packages, when='+trilinos') + depends_on('trilinos +blas_lowercase_no_underscore', when='+trilinos +essl') + # depends_on('trilinos +force-new-lapack', when='+trilinos +essl') + + depends_on('hypre@2.20.0: +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') + + petsc_build_options = '+shared +mpi' + petsc_tpls = '+metis ~hdf5 ~hypre +superlu-dist +int64' + depends_on('petsc@3.13.0: ' + petsc_build_options + petsc_tpls, when='+petsc') + + # + # Python + # + depends_on('python +shared +pic ~sqlite3', when='+pygeosx') + depends_on('py-numpy@1.19: +blas +lapack +force-parallel-build', when='+pygeosx') + depends_on('py-scipy@1.5.2: +force-parallel-build', when='+pygeosx') + depends_on('py-mpi4py@3.0.3:', when='+pygeosx') + + # + # Dev tools + # + depends_on('uncrustify@0.71:') + + # + # Documentation + # + depends_on('doxygen@1.8.13:', when='+docs', type='build') + depends_on('py-sphinx@1.6.3:', when='+docs', type='build') + + # + # Conflicts + # + conflicts('+mkl +essl', msg='Cannot use both MKL and ESSL.') + conflicts('+essl ~cuda', msg='Cannot use ESSL without CUDA.') + + conflicts('~trilinos lai=trilinos', msg='To use Trilinos as the Linear Algebra Interface you must build it.') + conflicts('~hypre lai=hypre', msg='To use HYPRE as the Linear Algebra Interface you must build it.') + conflicts('~petsc lai=petsc', msg='To use PETSc as the Linear Algebra Interface you must build it.') + + phases = ['hostconfig', 'cmake', 'build', 'install'] + + @run_after('build') + @on_package_attributes(run_tests=True) + def check(self): + """Searches the CMake-generated Makefile for the target ``test`` + and runs it if found. + """ + with working_dir(self.build_directory): + ctest('-V', '--force-new-ctest-process', '-j 1') + + @run_after('build') + def build_docs(self): + if '+docs' in self.spec: + with working_dir(self.build_directory): + make('docs') + + def _get_sys_type(self, spec): + sys_type = str(spec.architecture) + # if on llnl systems, we can use the SYS_TYPE + if "SYS_TYPE" in env: + sys_type = env["SYS_TYPE"] + return sys_type + + def _get_host_config_path(self, spec): + var = '' + if '+cuda' in spec: + var = '-'.join([var, 'cuda']) + + hostname = socket.gethostname().rstrip('1234567890') + host_config_path = "%s-%s-%s%s.cmake" % (hostname, + self._get_sys_type(spec), + spec.compiler, var) + + dest_dir = self.stage.source_path + host_config_path = os.path.abspath(pjoin(dest_dir, host_config_path)) + return host_config_path + + def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): + """ + This method creates a 'host-config' file that specifies + all of the options used to configure and build GEOSX. + + Note: + The `py_site_pkgs_dir` arg exists to allow a package that + subclasses this package provide a specific site packages + dir when calling this function. `py_site_pkgs_dir` should + be an absolute path or `None`. + + This is necessary because the spack `site_packages_dir` + var will not exist in the base class. For more details + on this issue see: https://github.com/spack/spack/issues/6261 + """ + + ####################### + # Compiler Info + ####################### + c_compiler = env["SPACK_CC"] + cpp_compiler = env["SPACK_CXX"] + + ####################################################################### + # By directly fetching the names of the actual compilers we appear + # to doing something evil here, but this is necessary to create a + # 'host config' file that works outside of the spack install env. + ####################################################################### + + sys_type = self._get_sys_type(spec) + + ############################################## + # Find and record what CMake is used + ############################################## + + cmake_exe = spec['cmake'].command.path + cmake_exe = os.path.realpath(cmake_exe) + + host_config_path = self._get_host_config_path(spec) + with open(host_config_path, "w") as cfg: + cfg.write("#{0}\n".format("#" * 80)) + cfg.write("# Generated host-config - Edit at own risk!\n") + cfg.write("#{0}\n".format("#" * 80)) + + cfg.write("#{0}\n".format("-" * 80)) + cfg.write("# SYS_TYPE: {0}\n".format(sys_type)) + cfg.write("# Compiler Spec: {0}\n".format(spec.compiler)) + cfg.write("# CMake executable path: %s\n" % cmake_exe) + cfg.write("#{0}\n\n".format("-" * 80)) + + ####################### + # Compiler Settings + ####################### + + cfg.write("#{0}\n".format("-" * 80)) + cfg.write("# Compilers\n") + cfg.write("#{0}\n\n".format("-" * 80)) + cfg.write(cmake_cache_entry("CMAKE_C_COMPILER", c_compiler)) + cflags = ' '.join(spec.compiler_flags['cflags']) + if cflags: + cfg.write(cmake_cache_entry("CMAKE_C_FLAGS", cflags)) + + cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler)) + cxxflags = ' '.join(spec.compiler_flags['cxxflags']) + if cxxflags: + cfg.write(cmake_cache_entry("CMAKE_CXX_FLAGS", cxxflags)) + + release_flags = "-O3 -DNDEBUG" + cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELEASE", release_flags)) + reldebinf_flags = "-O3 -g -DNDEBUG" + cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELWITHDEBINFO", reldebinf_flags)) + debug_flags = "-O0 -g" + cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", debug_flags)) + + cfg.write("#{0}\n".format("-" * 80)) + cfg.write("# MPI\n") + cfg.write("#{0}\n\n".format("-" * 80)) + + cfg.write(cmake_cache_option('ENABLE_MPI', True)) + cfg.write(cmake_cache_entry('MPI_C_COMPILER', spec['mpi'].mpicc)) + cfg.write(cmake_cache_entry('MPI_CXX_COMPILER', spec['mpi'].mpicxx)) + + cfg.write("#{0}\n".format("-" * 80)) + cfg.write("# OpenMP\n") + cfg.write("#{0}\n\n".format("-" * 80)) + + cfg.write(cmake_cache_option('ENABLE_OPENMP', True)) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Cuda\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + if '+cuda' in spec: + cfg.write(cmake_cache_option('ENABLE_CUDA', True)) + cfg.write(cmake_cache_entry('CMAKE_CUDA_STANDARD', 14)) + + cudatoolkitdir = spec['cuda'].prefix + cfg.write(cmake_cache_entry('CUDA_TOOLKIT_ROOT_DIR', + cudatoolkitdir)) + cudacompiler = '${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc' + cfg.write(cmake_cache_entry('CMAKE_CUDA_COMPILER', cudacompiler)) + + cmake_cuda_flags = ('-restrict --expt-extended-lambda -Werror ' + 'cross-execution-space-call,reorder,' + 'deprecated-declarations') + + archSpecifiers = ('-mtune', '-mcpu', '-march', '-qtune', '-qarch') + for archSpecifier in archSpecifiers: + for compilerArg in spec.compiler_flags['cxxflags']: + if compilerArg.startswith(archSpecifier): + cmake_cuda_flags += ' -Xcompiler ' + compilerArg + + if not spec.satisfies('cuda_arch=none'): + cuda_arch = spec.variants['cuda_arch'].value + cmake_cuda_flags += ' -arch sm_{0}'.format(cuda_arch[0]) + + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS', cmake_cuda_flags)) + + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', + '-O3 -Xcompiler -O3 -DNDEBUG')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', + '-O3 -g -lineinfo -Xcompiler -O3')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', + '-O0 -Xcompiler -O0 -g -G')) + + else: + cfg.write(cmake_cache_option('ENABLE_CUDA', False)) + + performance_portability_tpls = (('raja', 'RAJA', True), + ('umpire', 'UMPIRE', True), + ('chai', 'CHAI', True)) + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Performance Portability TPLs\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + for tpl, cmake_name, enable in performance_portability_tpls: + if enable: + cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) + else: + cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) + + io_tpls = (('hdf5', 'HDF5', True), + ('conduit', 'CONDUIT', True), + ('silo', 'SILO', True), + ('adiak', 'ADIAK', '+caliper' in spec), + ('caliper', 'CALIPER', '+caliper' in spec), + ('pugixml', 'PUGIXML', True)) + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# IO TPLs\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + for tpl, cmake_name, enable in io_tpls: + if enable: + cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) + else: + cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# System Math Libraries\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + if '+mkl' in spec: + cfg.write(cmake_cache_option('ENABLE_MKL', True)) + cfg.write(cmake_cache_entry('MKL_INCLUDE_DIRS', spec['intel-mkl'].prefix.include)) + cfg.write(cmake_cache_list('MKL_LIBRARIES', spec['intel-mkl'].libs)) + elif '+essl' in spec: + cfg.write(cmake_cache_option('ENABLE_ESSL', True)) + cfg.write(cmake_cache_entry('ESSL_INCLUDE_DIRS', spec['essl'].prefix.include)) + cfg.write(cmake_cache_list('ESSL_LIBRARIES', spec['essl'].libs + spec['cuda'].libs)) + + cfg.write(cmake_cache_option('FORTRAN_MANGLE_NO_UNDERSCORE', True)) + else: + cfg.write(cmake_cache_list('BLAS_LIBRARIES', spec['blas'].libs)) + cfg.write(cmake_cache_list('LAPACK_LIBRARIES', spec['lapack'].libs)) + + math_tpls = (('metis', 'METIS', True), + ('parmetis', 'PARMETIS', True), + ('superlu-dist', 'SUPERLU_DIST', True), + ('suite-sparse', 'SUITESPARSE', '+suite-sparse' in spec), + ('trilinos', 'TRILINOS', '+trilinos' in spec), + ('hypre', 'HYPRE', '+hypre' in spec), + ('petsc', 'PETSC', '+petsc' in spec)) + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Math TPLs\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + for tpl, cmake_name, enable in math_tpls: + if enable: + cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) + else: + cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) + + if 'lai=trilinos' in spec: + cfg.write(cmake_cache_entry('GEOSX_LA_INTERFACE', 'Trilinos')) + if 'lai=hypre' in spec: + cfg.write(cmake_cache_entry('GEOSX_LA_INTERFACE', 'Hypre')) + if 'lai=petsc' in spec: + cfg.write(cmake_cache_entry('GEOSX_LA_INTERFACE', 'Petsc')) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Python\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + if '+pygeosx' in spec: + cfg.write(cmake_cache_option('ENABLE_PYTHON', True)) + cfg.write(cmake_cache_entry('Python3_EXECUTABLE', os.path.join(spec['python'].prefix.bin, 'python3'))) + else: + cfg.write(cmake_cache_option('ENABLE_PYTHON', False)) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Documentation\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + if '+docs' in spec: + sphinx_bin_dir = spec['py-sphinx'].prefix.bin + cfg.write(cmake_cache_entry('SPHINX_EXECUTABLE', + os.path.join(sphinx_bin_dir, 'sphinx-build'))) + + doxygen_bin_dir = spec['doxygen'].prefix.bin + cfg.write(cmake_cache_entry('DOXYGEN_EXECUTABLE', + os.path.join(doxygen_bin_dir, 'doxygen'))) + else: + cfg.write(cmake_cache_option('ENABLE_DOCS', False)) + cfg.write(cmake_cache_option('ENABLE_DOXYGEN', False)) + cfg.write(cmake_cache_option('ENABLE_SPHYNX', False)) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Development tools\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + cfg.write(cmake_cache_entry('UNCRUSTIFY_EXECUTABLE', + os.path.join(spec['uncrustify'].prefix.bin, 'uncrustify'))) + + # cfg.write('#{0}\n'.format('-' * 80)) + # cfg.write('# addr2line\n') + # cfg.write('#{0}\n\n'.format('-' * 80)) + # cfg.write(cmake_cache_option('ENABLE_ADDR2LINE', '+addr2line' in spec)) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Other\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + + cfg.write(cmake_cache_option('ENABLE_MATHPRESSO', False)) + cfg.write(cmake_cache_option('ENABLE_XML_UPDATES', False)) + + + def cmake_args(self): + pass + # spec = self.spec + # host_config_path = self._get_host_config_path(spec) + + # options = [] + # options.extend(['-C', host_config_path]) + + # # Shared libs + # options.append(self.define_from_variant('BUILD_SHARED_LIBS', 'shared')) + + # if '~tests~examples~benchmarks' in spec: + # options.append('-DENABLE_TESTS=OFF') + # else: + # options.append('-DENABLE_TESTS=ON') + + # if '~test' in spec: + # options.append('-DDISABLE_UNIT_TESTS=ON') + # elif "+tests" in spec and ('%intel' in spec or '%xl' in spec): + # warnings.warn('The LvArray unit tests take an excessive amount of' + # ' time to build with the Intel or IBM compilers.') + + # options.append(self.define_from_variant('ENABLE_EXAMPLES', 'examples')) + # options.append(self.define_from_variant('ENABLE_BENCHMARKS', + # 'benchmarks')) + # options.append(self.define_from_variant('ENABLE_DOCS', 'docs')) + + # return options diff --git a/scripts/uberenv/packages/hypre/package.py b/scripts/uberenv/packages/hypre/package.py new file mode 100644 index 00000000..61bfb59b --- /dev/null +++ b/scripts/uberenv/packages/hypre/package.py @@ -0,0 +1,207 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +import os +import sys + + +class Hypre(Package): + """Hypre is a library of high performance preconditioners that + features parallel multigrid methods for both structured and + unstructured grid problems.""" + + homepage = "http://computing.llnl.gov/project/linear_solvers/software.php" + url = "https://github.com/hypre-space/hypre/archive/v2.14.0.tar.gz" + git = "https://github.com/hypre-space/hypre.git" + + maintainers = ['ulrikeyang', 'osborn9', 'balay'] + + version('develop', branch='master') + version('2.20.0', sha256='5be77b28ddf945c92cde4b52a272d16fb5e9a7dc05e714fc5765948cba802c01') + version('2.19.0', sha256='466b19d8a86c69989a237f6f03f20d35c0c63a818776d2cd071b0a084cffeba5') + version('2.18.2', sha256='28007b5b584eaf9397f933032d8367788707a2d356d78e47b99e551ab10cc76a') + version('2.18.1', sha256='220f9c4ad024e815add8dad8950eaa2d8f4f231104788cf2a3c5d9da8f94ba6e') + version('2.18.0', sha256='62591ac69f9cc9728bd6d952b65bcadd2dfe52b521081612609804a413f49b07') + version('2.17.0', sha256='4674f938743aa29eb4d775211b13b089b9de84bfe5e9ea00c7d8782ed84a46d7') + version('2.16.0', sha256='33f8a27041e697343b820d0426e74694670f955e21bbf3fcb07ee95b22c59e90') + version('2.15.1', sha256='50d0c0c86b4baad227aa9bdfda4297acafc64c3c7256c27351f8bae1ae6f2402') + version('2.15.0', sha256='2d597472b473964210ca9368b2cb027510fff4fa2193a8c04445e2ed4ff63045') + version('2.14.0', sha256='705a0c67c68936bb011c50e7aa8d7d8b9693665a9709b584275ec3782e03ee8c') + version('2.13.0', sha256='3979602689c3b6e491c7cf4b219cfe96df5a6cd69a5302ccaa8a95ab19064bad') + version('2.12.1', sha256='824841a60b14167a0051b68fdb4e362e0207282348128c9d0ca0fd2c9848785c') + version('2.11.2', sha256='25b6c1226411593f71bb5cf3891431afaa8c3fd487bdfe4faeeb55c6fdfb269e') + version('2.11.1', sha256='6bb2ff565ff694596d0e94d0a75f0c3a2cd6715b8b7652bc71feb8698554db93') + version('2.10.1', sha256='a4a9df645ebdc11e86221b794b276d1e17974887ead161d5050aaf0b43bb183a') + version('2.10.0b', sha256='b55dbdc692afe5a00490d1ea1c38dd908dae244f7bdd7faaf711680059824c11') + version('xsdk-0.2.0', tag='xsdk-0.2.0', git='https://github.com/LLNL/hypre.git') + + # Versions 2.13.0 and later can be patched to build shared + # libraries on Darwin; the patch for this capability does not + # apply to version 2.12.1 and earlier due to changes in the build system + # between versions 2.12.1 and 2.13.0. + variant('shared', default=(sys.platform != 'darwin'), + description="Build shared library (disables static library)") + # Use internal SuperLU routines for FEI - version 2.12.1 and below + variant('internal-superlu', default=False, + description="Use internal SuperLU routines") + variant('superlu-dist', default=False, + description='Activates support for SuperLU_Dist library') + variant('int64', default=False, + description="Use 64bit integers") + variant('mixedint', default=False, + description="Use 64bit integers while reducing memory use") + variant('complex', default=False, description='Use complex values') + variant('mpi', default=True, description='Enable MPI support') + variant('openmp', default=False, description='Enable OpenMP support') + variant('debug', default=False, + description='Build debug instead of optimized version') + + # Patch to add ppc64le in config.guess + patch('ibm-ppc64le.patch', when='@:2.11.1') + + # Patch to build shared libraries on Darwin + patch('darwin-shared-libs-for-hypre-2.13.0.patch', when='+shared@2.13.0 platform=darwin') + patch('darwin-shared-libs-for-hypre-2.14.0.patch', when='+shared@2.14.0 platform=darwin') + patch('superlu-dist-link-2.15.0.patch', when='+superlu-dist @2.15:2.16.0') + patch('superlu-dist-link-2.14.0.patch', when='+superlu-dist @:2.14.0') + patch('hypre21800-compat.patch', when='@2.18.0') + + depends_on("mpi", when='+mpi') + depends_on("blas") + depends_on("lapack") + depends_on('superlu-dist', when='+superlu-dist+mpi') + + # Patch to build shared libraries on Darwin does not apply to + # versions before 2.13.0 + conflicts("+shared@:2.12.99 platform=darwin") + + # Conflicts + # Option added in v2.13.0 + conflicts('+superlu-dist', when='@:2.12.99') + + # Internal SuperLU Option removed in v2.13.0 + conflicts('+internal-superlu', when='@2.13.0:') + + # Option added in v2.16.0 + conflicts('+mixedint', when='@:2.15.99') + + def url_for_version(self, version): + if version >= Version('2.12.0'): + url = 'https://github.com/hypre-space/hypre/archive/v{0}.tar.gz' + else: + url = 'http://computing.llnl.gov/project/linear_solvers/download/hypre-{0}.tar.gz' + + return url.format(version) + + def install(self, spec, prefix): + # Note: --with-(lapack|blas)_libs= needs space separated list of names + lapack_libs = spec['lapack'].libs + blas_libs = spec['blas'].libs + + configure_args = [ + '--prefix=%s' % prefix, + '--with-lapack-libs=%s' % ' '.join(lapack_libs.names), + '--with-lapack-lib-dirs=%s' % ' '.join(lapack_libs.directories), + '--with-blas-libs=%s' % ' '.join(blas_libs.names), + '--with-blas-lib-dirs=%s' % ' '.join(blas_libs.directories) + ] + + if '+mpi' in self.spec: + configure_args.append('CC=%s' % spec['mpi'].mpicc) + configure_args.append('CXX=%s' % spec['mpi'].mpicxx) + configure_args.append('F77=%s' % spec['mpi'].mpif77) + configure_args.append('--with-MPI') + else: + configure_args.append('CC=%s' % spack_cc) + configure_args.append('CXX=%s' % spack_cxx) + configure_args.append('F77=%s' % spack_f77) + configure_args.append('--without-MPI') + + cflags = ' '.join(spec.compiler_flags['cflags']) + cxxflags = ' '.join(spec.compiler_flags['cxxflags']) + fflags = ' '.join(spec.compiler_flags['fflags']) + + if '+openmp' in self.spec: + configure_args.append('--with-openmp') + cflags += ' ' + self.compiler.openmp_flag + configure_args.append('LDFLAGS=%s' % self.compiler.openmp_flag) + else: + configure_args.append('--without-openmp') + + configure_args.append('CFLAGS=%s' % cflags) + configure_args.append('CXXFLAGS=%s' % cxxflags) + configure_args.append('FCFLAGS=%s' % fflags) + + if '+int64' in self.spec: + configure_args.append('--enable-bigint') + else: + configure_args.append('--disable-bigint') + + if '+mixedint' in self.spec: + configure_args.append('--enable-mixedint') + else: + configure_args.append('--disable-mixedint') + + if '+complex' in self.spec: + configure_args.append('--enable-complex') + else: + configure_args.append('--disable-complex') + + if '+shared' in self.spec: + configure_args.append("--enable-shared") + + if '~internal-superlu' in self.spec: + configure_args.append("--without-superlu") + # MLI and FEI do not build without superlu on Linux + configure_args.append("--without-mli") + configure_args.append("--without-fei") + + if '+superlu-dist' in self.spec: + configure_args.append('--with-dsuperlu-include=%s' % + spec['superlu-dist'].prefix.include) + configure_args.append('--with-dsuperlu-lib=%s' % + spec['superlu-dist'].libs) + configure_args.append('--with-dsuperlu') + + if '+debug' in self.spec: + configure_args.append("--enable-debug") + else: + configure_args.append("--disable-debug") + + # Hypre's source is staged under ./src so we'll have to manually + # cd into it. + with working_dir("src"): + configure(*configure_args) + + make() + if self.run_tests: + make("check") + make("test") + Executable(join_path('test', 'ij'))() + sstruct = Executable(join_path('test', 'struct')) + sstruct() + sstruct('-in', 'test/sstruct.in.default', '-solver', '40', + '-rhsone') + make("install") + + @property + def headers(self): + """Export the main hypre header, HYPRE.h; all other headers can be found + in the same directory. + Sample usage: spec['hypre'].headers.cpp_flags + """ + hdrs = find_headers('HYPRE', self.prefix.include, recursive=False) + return hdrs or None + + @property + def libs(self): + """Export the hypre library. + Sample usage: spec['hypre'].libs.ld_flags + """ + is_shared = '+shared' in self.spec + libs = find_libraries('libHYPRE', root=self.prefix, shared=is_shared, + recursive=True) + return libs or None diff --git a/scripts/uberenv/packages/petsc/package.py b/scripts/uberenv/packages/petsc/package.py new file mode 100644 index 00000000..1dddb437 --- /dev/null +++ b/scripts/uberenv/packages/petsc/package.py @@ -0,0 +1,503 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + + +class Petsc(Package): + """PETSc is a suite of data structures and routines for the scalable + (parallel) solution of scientific applications modeled by partial + differential equations. + """ + + homepage = "http://www.mcs.anl.gov/petsc/index.html" + url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.1.tar.gz" + git = "https://gitlab.com/petsc/petsc.git" + maintainers = ['balay', 'barrysmith', 'jedbrown'] + + version('develop', branch='master') + version('xsdk-0.2.0', tag='xsdk-0.2.0') + + version('3.14.0', sha256='a8f9caba03e0d57d8452c08505cf96be5f6949adaa266e819382162c03ddb9c5') + version('3.13.6', sha256='67ca2cf3040d08fdc51d27f660ea3157732b24c2f47aae1b19d63f62a39842c2') + version('3.13.5', sha256='10fc542dab961c8b17db35ad3a208cb184c237fc84e183817e38e6c7ab4b8732') + version('3.13.4', sha256='8d470cba1ceb9638694550134a2f23aac85ed7249cb74992581210597d978b94') + version('3.13.3', sha256='dc744895ee6b9c4491ff817bef0d3abd680c5e3c25e601be44240ce65ab4f337') + version('3.13.2', sha256='6083422a7c5b8e89e5e4ccf64acade9bf8ab70245e25bca3a3da03caf74602f1') + version('3.13.1', sha256='74a895e44e2ff1146838aaccb7613e7626d99e0eed64ca032c87c72d084efac3') + version('3.13.0', sha256='f0ea543a54145c5d1387e25b121c3fd1b1ca834032c5a33f6f1d929e95bdf0e5') + version('3.12.5', sha256='d676eb67e79314d6cca6422d7c477d2b192c830b89d5edc6b46934f7453bcfc0') + version('3.12.4', sha256='56a941130da93bbacb3cfa74dcacea1e3cd8e36a0341f9ced09977b1457084c3') + version('3.12.3', sha256='91f77d7b0f54056f085b9e27938922db3d9bb1734a2e2a6d26f43d3e6c0cf631') + version('3.12.2', sha256='d874b2e198c4cb73551c2eca1d2c5d27da710be4d00517adb8f9eb3d6d0375e8') + version('3.12.1', sha256='b72d895d0f4a79acb13ebc782b47b26d10d4e5706d399f533afcd5b3dba13737') + version('3.12.0', sha256='ba9ecf69783c7ebf05bd1c91dd1d4b38bf09b7a2d5f9a774aa6bb46deff7cb14') + version('3.11.4', sha256='319cb5a875a692a67fe5b1b90009ba8f182e21921ae645d38106544aff20c3c1') + version('3.11.3', sha256='199ad9650a9f58603b49e7fff7cd003ceb03aa231e5d37d0bf0496c6348eca81') + version('3.11.2', sha256='4d244dd7d1565d6534e776445fcf6977a6ee2a8bb2be4a36ac1e0fc1f9ad9cfa') + version('3.11.1', sha256='cb627f99f7ce1540ebbbf338189f89a5f1ecf3ab3b5b0e357f9e46c209f1fb23') + version('3.11.0', sha256='b3bed2a9263193c84138052a1b92d47299c3490dd24d1d0bf79fb884e71e678a') + version('3.10.5', sha256='3a81c8406410e0ffa8a3e9f8efcdf2e683cc40613c9bb5cb378a6498f595803e') + version('3.10.4', sha256='6c836df84caa9ae683ae401d3f94eb9471353156fec6db602bf2e857e4ec339f') + version('3.10.3', sha256='cd106babbae091604fee40c258737c84dec048949be779eaef5a745df3dc8de4') + version('3.10.2', sha256='9d3381bcf9c63abe6521b21a88efc70f8e893293503cff497971d0d9c1ec68cc') + version('3.10.1', sha256='b6e64ce062113ee0e2e2a6cfffb4d33c085ec91d5bc3afeb33781074aa5a22a5') + version('3.10.0', sha256='6ebacc010397ea47649495e8363cd7d7d86b876e6df07c6f6ccfa48b22fa555c') + version('3.9.4', sha256='ecc647c9b1ef565a2c113936454c65632eedc1626e0fc99b5a36accb91195a63') + version('3.9.3', sha256='6c7f2c7a28433385d74d647b4934aaeea3c1b3053b207973c9497639b6ebf7c8') + version('3.9.2', sha256='ab396ae5dbfff808df1b5648f5ce30f3021ec70faec3d5cd63df324d416ac6ac') + version('3.9.1', sha256='742e838a35d278693e956ed1ca4592c1d663451f6beea0694bf334aeb67681e8') + version('3.9.0', sha256='dcbcab1f321667be1c6e5f8e7b4ee8670bb09e372e51f1ea6471464519d54b2d') + version('3.8.4', sha256='9f78dc4dd4c58433fa18d3dd3a9029e39a83e4e4b64f845a029dd9fed44bc4c7') + version('3.8.3', sha256='01f9c3ed937eafac6c9e006510b61c7cd07197115ec40c429fc835f346ca3eac') + version('3.8.2', sha256='42690508d408e31fb98be738ac097bc869be14c5bfe08dda2184243283ceb16a') + version('3.8.1', sha256='9b48a9e72d304046923667d2ab1f201778cc56242928a374ff9e074843a334ff') + version('3.8.0', sha256='1e1b4d90ccbf98dc5759a956ac9a771310a6690f1cbb37b31502b29568262d7e') + version('3.7.7', sha256='40fd3bc76998e056c4097704c08f28eb89bf3b93164dc9e69abab393f43bf6f0') + version('3.7.6', sha256='3c8ee051349587d45baa7910c54ce8e0a571592e3b40f3054a7b7f986919d449') + version('3.7.5', sha256='493ab0b6c1b3fe68e71d990eff87c84f499f680e6d2c0c394e78646a82ed4be3') + version('3.7.4', sha256='54b804f924ea5be3b6718b4d4e98f8ccb9d1bd6bbbd1e9c0f18c4a90ddf5db18') + version('3.7.2', sha256='36681dd0df97e0d5cd182d902e89f527eb8f441f05271159dac5340acb4cf0ec') + version('3.6.4', sha256='eb09925a139b52b4dd5a071b3da4fe2165f1d6e8f71d410479603c9976c940f0') + version('3.6.3', sha256='776e2644e4003653c56a44a6f7c02c41427af26f7c5cd9bec3aa84ed90223245') + version('3.5.3', sha256='68e6a42f5ec75bad87f74d4df8f55ad63f0c4d996f162da6713cb3d6f566830d') + version('3.5.2', sha256='1a8f09af654afab787c732e7b2f5d0c1d856777398148351565389d38d30935e') + version('3.5.1', sha256='199af205f62dcc572728600670c7d4c8cb0d4efc4172c26f02b895d9dd1df245') + version('3.4.4', sha256='fa73b99caf70c416a967234f5476cdb1d2c014610ee0619e48f54d8d309631b7') + + variant('shared', default=True, + description='Enables the build of shared libraries') + variant('mpi', default=True, description='Activates MPI support') + variant('cuda', default=False, description='Activates CUDA support') + variant('double', default=True, + description='Switches between single and double precision') + variant('complex', default=False, description='Build with complex numbers') + variant('debug', default=False, description='Compile in debug mode') + + variant('metis', default=True, + description='Activates support for metis and parmetis') + variant('hdf5', default=True, + description='Activates support for HDF5 (only parallel)') + variant('hypre', default=True, + description='Activates support for Hypre (only parallel)') + # Mumps is disabled by default, because it depends on Scalapack + # which is not portable to all HPC systems + variant('mumps', default=False, + description='Activates support for MUMPS (only parallel)') + variant('superlu-dist', default=True, + description='Activates support for SuperluDist (only parallel)') + variant('trilinos', default=False, + description='Activates support for Trilinos (only parallel)') + variant('int64', default=False, + description='Compile with 64bit indices') + variant('clanguage', default='C', values=('C', 'C++'), + description='Specify C (recommended) or C++ to compile PETSc', + multi=False) + variant('fftw', default=False, + description='Activates support for FFTW (only parallel)') + variant('suite-sparse', default=False, + description='Activates support for SuiteSparse') + variant('knl', default=False, + description='Build for KNL') + variant('X', default=False, + description='Activate X support') + variant('batch', default=False, + description='Enable when mpiexec is not available to run binaries') + variant('valgrind', default=False, + description='Enable Valgrind Client Request mechanism') + variant('jpeg', default=False, + description='Activates support for JPEG') + variant('libpng', default=False, + description='Activates support for PNG') + variant('giflib', default=False, + description='Activates support for GIF') + variant('mpfr', default=False, + description='Activates support for MPFR') + variant('moab', default=False, + description='Acivates support for MOAB (only parallel)') + variant('random123', default=False, + description='Activates support for Random123') + variant('exodusii', default=False, + description='Activates support for ExodusII (only parallel)') + variant('cgns', default=False, + description='Activates support for CGNS (only parallel)') + variant('memkind', default=False, + description='Activates support for Memkind') + variant('p4est', default=False, + description='Activates support for P4Est (only parallel)') + variant('saws', default=False, + description='Activates support for Saws') + variant('libyaml', default=False, + description='Activates support for YAML') + + # 3.8.0 has a build issue with MKL - so list this conflict explicitly + conflicts('^intel-mkl', when='@3.8.0') + + # These require +mpi + mpi_msg = 'Requires +mpi' + conflicts('+cgns', when='~mpi', msg=mpi_msg) + conflicts('+exodusii', when='~mpi', msg=mpi_msg) + conflicts('+fftw', when='~mpi', msg=mpi_msg) + conflicts('+hdf5', when='~mpi', msg=mpi_msg) + conflicts('+hypre', when='~mpi', msg=mpi_msg) + conflicts('+moab', when='~mpi', msg=mpi_msg) + conflicts('+mumps', when='~mpi', msg=mpi_msg) + conflicts('+p4est', when='~mpi', msg=mpi_msg) + conflicts('+superlu-dist', when='~mpi', msg=mpi_msg) + conflicts('+trilinos', when='~mpi', msg=mpi_msg) + + # older versions of petsc did not support mumps when +int64 + conflicts('+mumps', when='@:3.12.99+int64') + + filter_compiler_wrappers( + 'petscvariables', relative_root='lib/petsc/conf' + ) + + # temporary workaround Clang 8.1.0 with XCode 8.3 on macOS, see + # https://bitbucket.org/petsc/petsc/commits/4f290403fdd060d09d5cb07345cbfd52670e3cbc + # the patch is an adaptation of the original commit to 3.7.5 + patch('macos-clang-8.1.0.diff', when='@3.7.5%apple-clang@8.1.0:') + patch('pkg-config-3.7.6-3.8.4.diff', when='@3.7.6:3.8.4') + + patch('xcode_stub_out_of_sync.patch', when='@:3.10.4') + + patch('xlf_fix-dup-petscfecreate.patch', when='@3.11.0') + + depends_on('diffutils', type='build') + + # Virtual dependencies + # Git repository needs sowing to build Fortran interface + depends_on('sowing', when='@develop') + depends_on('sowing@1.1.23-p1', when='@xsdk-0.2.0') + + # PETSc, hypre, superlu_dist when built with int64 use 32 bit integers + # with BLAS/LAPACK + depends_on('blas') + depends_on('lapack') + depends_on('mpi', when='+mpi') + depends_on('cuda', when='+cuda') + + # Build dependencies + depends_on('python@2.6:2.8', type='build', when='@:3.10.99') + depends_on('python@2.6:2.8,3.4:', type='build', when='@3.11:') + + # Other dependencies + depends_on('metis@5:~int64+real64', when='@:3.7.99+metis~int64+double') + depends_on('metis@5:~int64', when='@:3.7.99+metis~int64~double') + depends_on('metis@5:+int64+real64', when='@:3.7.99+metis+int64+double') + depends_on('metis@5:+int64', when='@:3.7.99+metis+int64~double') + # petsc-3.8+ uses default (float) metis with any (petsc) precision + depends_on('metis@5:~int64', when='@3.8:+metis~int64') + depends_on('metis@5:+int64', when='@3.8:+metis+int64') + + depends_on('hdf5@:1.10.99+mpi', when='@:3.12.99+hdf5+mpi') + depends_on('hdf5+mpi', when='@3.13:+hdf5+mpi') + depends_on('hdf5+mpi', when='+exodusii+mpi') + depends_on('hdf5+mpi', when='+cgns+mpi') + depends_on('zlib', when='+hdf5') + depends_on('zlib', when='+libpng') + depends_on('zlib', when='+p4est') + depends_on('parmetis', when='+metis+mpi') + depends_on('valgrind', when='+valgrind') + # Hypre does not support complex numbers. + # Also PETSc prefer to build it without internal superlu, likely due to + # conflict in headers see + # https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py + depends_on('hypre@:2.13.99+mpi~internal-superlu~int64', when='@:3.8.99+hypre+mpi~complex~int64') + depends_on('hypre@:2.13.99+mpi~internal-superlu+int64', when='@:3.8.99+hypre+mpi~complex+int64') + depends_on('hypre@2.14:2.18.2+mpi~internal-superlu~int64', when='@3.9:3.13.99+hypre+mpi~complex~int64') + depends_on('hypre@2.14:2.18.2+mpi~internal-superlu+int64', when='@3.9:3.13.99+hypre+mpi~complex+int64') + depends_on('hypre@2.14:+mpi~internal-superlu~int64', when='@3.14:+hypre+mpi~complex~int64') + depends_on('hypre@2.14:+mpi~internal-superlu+int64', when='@3.14:+hypre+mpi~complex+int64') + depends_on('hypre@xsdk-0.2.0+mpi~internal-superlu+int64', when='@xsdk-0.2.0+hypre+mpi~complex+int64') + depends_on('hypre@xsdk-0.2.0+mpi~internal-superlu~int64', when='@xsdk-0.2.0+hypre+mpi~complex~int64') + depends_on('hypre@develop+mpi~internal-superlu+int64', when='@develop+hypre+mpi~complex+int64') + depends_on('hypre@develop+mpi~internal-superlu~int64', when='@develop+hypre+mpi~complex~int64') + depends_on('superlu-dist@:4.3~int64', when='@3.4.4:3.6.4+superlu-dist+mpi~int64') + depends_on('superlu-dist@:4.3+int64', when='@3.4.4:3.6.4+superlu-dist+mpi+int64') + depends_on('superlu-dist@5.0.0:5.1.3~int64', when='@3.7:3.7.99+superlu-dist+mpi~int64') + depends_on('superlu-dist@5.0.0:5.1.3+int64', when='@3.7:3.7.99+superlu-dist+mpi+int64') + depends_on('superlu-dist@5.2:5.2.99~int64', when='@3.8:3.9.99+superlu-dist+mpi~int64') + depends_on('superlu-dist@5.2:5.2.99+int64', when='@3.8:3.9.99+superlu-dist+mpi+int64') + depends_on('superlu-dist@5.4:5.4.99~int64', when='@3.10:3.10.2+superlu-dist+mpi~int64') + depends_on('superlu-dist@5.4:5.4.99+int64', when='@3.10:3.10.2+superlu-dist+mpi+int64') + depends_on('superlu-dist@6.1:6.1.99~int64', when='@3.10.3:3.12.99+superlu-dist+mpi~int64') + depends_on('superlu-dist@6.1:6.1.99+int64', when='@3.10.3:3.12.99+superlu-dist+mpi+int64') + depends_on('superlu-dist@6.1:6.3.0~int64', when='@3.13.0:3.14+superlu-dist+mpi~int64') + depends_on('superlu-dist@6.1:6.3.0+int64', when='@3.13.0:3.14+superlu-dist+mpi+int64') + depends_on('superlu-dist@xsdk-0.2.0~int64', when='@xsdk-0.2.0+superlu-dist+mpi~int64') + depends_on('superlu-dist@xsdk-0.2.0+int64', when='@xsdk-0.2.0+superlu-dist+mpi+int64') + depends_on('superlu-dist@develop~int64', when='@develop+superlu-dist+mpi~int64') + depends_on('superlu-dist@develop+int64', when='@develop+superlu-dist+mpi+int64') + depends_on('mumps+mpi~int64', when='+mumps') + depends_on('scalapack', when='+mumps') + depends_on('trilinos@12.6.2:+mpi', when='@3.7.0:+trilinos+mpi') + depends_on('trilinos@xsdk-0.2.0+mpi', when='@xsdk-0.2.0+trilinos+mpi') + depends_on('trilinos@develop+mpi', when='@xdevelop+trilinos+mpi') + depends_on('fftw+mpi', when='+fftw+mpi') + depends_on('suite-sparse', when='+suite-sparse') + depends_on('libx11', when='+X') + depends_on('mpfr', when='+mpfr') + depends_on('gmp', when='+mpfr') + depends_on('jpeg', when='+jpeg') + depends_on('libpng', when='+libpng') + depends_on('giflib', when='+giflib') + depends_on('exodusii+mpi', when='+exodusii+mpi') + depends_on('netcdf-c+mpi', when='+exodusii+mpi') + depends_on('parallel-netcdf', when='+exodusii+mpi') + depends_on('random123', when='+random123') + depends_on('moab+mpi', when='+moab+mpi') + depends_on('cgns+mpi', when='+cgns+mpi') + depends_on('memkind', when='+memkind') + depends_on('p4est+mpi', when='+p4est+mpi') + depends_on('saws', when='+saws') + depends_on('libyaml', when='+libyaml') + + def url_for_version(self, version): + if version >= Version('3.13.0'): + # petsc-lite tarballs are smaller by skipping docs + return "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-{0}.tar.gz".format(version) + else: + return "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-{0}.tar.gz".format(version) + + def mpi_dependent_options(self): + if '~mpi' in self.spec: + compiler_opts = [ + '--with-cc=%s' % os.environ['CC'], + '--with-cxx=%s' % (os.environ['CXX'] + if self.compiler.cxx is not None else '0'), + '--with-fc=%s' % (os.environ['FC'] + if self.compiler.fc is not None else '0'), + '--with-mpi=0' + ] + else: + compiler_opts = [ + '--with-cc=%s' % self.spec['mpi'].mpicc, + '--with-cxx=%s' % self.spec['mpi'].mpicxx, + '--with-fc=%s' % self.spec['mpi'].mpifc, + ] + if self.spec.satisfies('%intel'): + # mpiifort needs some help to automatically link + # all necessary run-time libraries + compiler_opts.append('--FC_LINKER_FLAGS=-lintlc') + return compiler_opts + + def install(self, spec, prefix): + options = ['--with-ssl=0', + '--download-c2html=0', + '--download-sowing=0', + '--download-hwloc=0', + 'CFLAGS=%s' % ' '.join(spec.compiler_flags['cflags']), + 'FFLAGS=%s' % ' '.join(spec.compiler_flags['fflags']), + 'CXXFLAGS=%s' % ' '.join(spec.compiler_flags['cxxflags'])] + options.extend(self.mpi_dependent_options()) + options.extend([ + '--with-precision=%s' % ( + 'double' if '+double' in spec else 'single'), + '--with-scalar-type=%s' % ( + 'complex' if '+complex' in spec else 'real'), + '--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'), + '--with-debugging=%s' % ('1' if '+debug' in spec else '0'), + '--with-64-bit-indices=%s' % ('1' if '+int64' in spec else '0') + ]) + if '+debug' not in spec: + options.extend(['COPTFLAGS=', + 'FOPTFLAGS=', + 'CXXOPTFLAGS=']) + + # Make sure we use exactly the same Blas/Lapack libraries + # across the DAG. To that end list them explicitly + lapack_blas = spec['lapack'].libs + spec['blas'].libs + options.extend([ + '--with-blas-lapack-lib=%s' % lapack_blas.joined() + ]) + + if '+batch' in spec: + options.append('--with-batch=1') + if '+knl' in spec: + options.append('--with-avx-512-kernels') + options.append('--with-memalign=64') + if '+X' in spec: + options.append('--with-x=1') + else: + options.append('--with-x=0') + + if 'trilinos' in spec: + options.append('--with-cxx-dialect=C++11') + if spec.satisfies('^trilinos+boost'): + options.append('--with-boost=1') + + if self.spec.satisfies('clanguage=C++'): + options.append('--with-clanguage=C++') + else: + options.append('--with-clanguage=C') + + # PETSc depends on scalapack when '+mumps' (see depends()) + # help PETSc pick up Scalapack from MKL + if spec.satisfies('+mumps'): + scalapack = spec['scalapack'].libs + options.extend([ + '--with-scalapack-lib=%s' % scalapack.joined(), + '--with-scalapack=1' + ]) + else: + options.extend([ + '--with-scalapack=0' + ]) + + # Activates library support if needed (i.e. direct dependency) + if '^libjpeg-turbo' in spec: + jpeg_library = 'libjpeg-turbo' + else: + jpeg_library = 'libjpeg' + + for library in ('cuda', 'metis', 'hypre', 'parmetis', 'mumps', + 'trilinos', 'fftw', 'valgrind', 'gmp', 'libpng', + 'giflib', 'mpfr', 'netcdf-c', 'parallel-netcdf', + 'moab', 'random123', 'exodusii', 'cgns', 'memkind', + 'p4est', 'saws', 'libyaml', jpeg_library): + # Cannot check `library in spec` because of transitive deps + # Cannot check variants because parmetis keys on +metis + library_requested = library in spec.dependencies_dict() + options.append( + '--with-{library}={value}'.format( + library=('libjpeg' if library == 'libjpeg-turbo' + else 'netcdf' if library == 'netcdf-c' + else 'pnetcdf' if library == 'parallel-netcdf' + else 'yaml' if library == 'libyaml' + else library), + value=('1' if library_requested else '0')) + ) + if library_requested: + options.append( + '--with-{library}-dir={path}'.format( + library=('libjpeg' if library == 'libjpeg-turbo' + else 'netcdf' if library == 'netcdf-c' + else 'pnetcdf' if library == 'parallel-netcdf' + else 'yaml' if library == 'libyaml' + else library), path=spec[library].prefix) + ) + + # PETSc does not pick up SuperluDist from the dir as they look for + # superlu_dist_4.1.a + if '+superlu-dist' in spec: + import warnings + warnings.warn('spec["superlu-dist"].prefix.include = %s' % spec['superlu-dist'].prefix.include) + warnings.warn('spec["superlu-dist"].libs = %s' % spec['superlu-dist'].libs) + if spec.satisfies('@3.10.3:'): + options.append('--with-cxx-dialect=C++11') + options.extend([ + '--with-superlu_dist-include=%s' % + spec['superlu-dist'].prefix.include, + '--with-superlu_dist-lib=%s' % + spec['superlu-dist'].libs, + '--with-superlu_dist=1' + ]) + else: + options.append( + '--with-superlu_dist=0' + ) + # SuiteSparse: configuring using '--with-suitesparse-dir=...' has some + # issues, so specify directly the include path and the libraries. + if '+suite-sparse' in spec: + ss_spec = 'suite-sparse:umfpack,klu,cholmod,btf,ccolamd,colamd,' \ + 'camd,amd,suitesparseconfig' + options.extend([ + '--with-suitesparse-include=%s' % spec[ss_spec].prefix.include, + '--with-suitesparse-lib=%s' % spec[ss_spec].libs.joined(), + '--with-suitesparse=1' + ]) + else: + options.append('--with-suitesparse=0') + + # hdf5: configure detection is convoluted for pflotran + if '+hdf5' in spec: + options.extend([ + '--with-hdf5-include=%s' % spec['hdf5'].prefix.include, + '--with-hdf5-lib=%s' % spec['hdf5:hl,fortran'].libs.joined(), + '--with-hdf5=1' + ]) + else: + options.append('--with-hdf5=0') + + # zlib: configuring using '--with-zlib-dir=...' has some issues with + # SuiteSparse so specify directly the include path and the libraries. + if 'zlib' in spec: + options.extend([ + '--with-zlib-include=%s' % spec['zlib'].prefix.include, + '--with-zlib-lib=%s' % spec['zlib'].libs.joined(), + '--with-zlib=1' + ]) + else: + options.append('--with-zlib=0') + + python('configure', '--prefix=%s' % prefix, *options) + + # PETSc has its own way of doing parallel make. + make('MAKE_NP=%s' % make_jobs, parallel=False) + make("install") + + # solve Poisson equation in 2D to make sure nothing is broken: + if ('mpi' in spec) and self.run_tests: + with working_dir('src/ksp/ksp/examples/tutorials'): + env['PETSC_DIR'] = self.prefix + cc = Executable(spec['mpi'].mpicc) + cc('ex50.c', '-I%s' % prefix.include, '-L%s' % prefix.lib, + '-lpetsc', '-lm', '-o', 'ex50') + run = Executable(join_path(spec['mpi'].prefix.bin, 'mpirun')) + # For Spectrum MPI, if -np is omitted, the default behavior is + # to assign one process per process slot, where the default + # process slot allocation is one per core. On systems with + # many cores, the number of processes can exceed the size of + # the grid specified when the testcase is run and the test case + # fails. Specify a small number of processes to prevent + # failure. + # For more information about Spectrum MPI invocation, see URL + # https://www.ibm.com/support/knowledgecenter/en/SSZTET_10.1.0/smpi02/smpi02_mpirun_options.html + if ('spectrum-mpi' in spec): + run.add_default_arg('-np') + run.add_default_arg('4') + run('ex50', '-da_grid_x', '4', '-da_grid_y', '4') + if '+superlu-dist' in spec: + run('ex50', + '-da_grid_x', '4', + '-da_grid_y', '4', + '-pc_type', 'lu', + '-pc_factor_mat_solver_package', 'superlu_dist') + + if 'mumps' in spec: + run('ex50', + '-da_grid_x', '4', + '-da_grid_y', '4', + '-pc_type', 'lu', + '-pc_factor_mat_solver_package', 'mumps') + + if 'hypre' in spec: + run('ex50', + '-da_grid_x', '4', + '-da_grid_y', '4', + '-pc_type', 'hypre', + '-pc_hypre_type', 'boomeramg') + + def setup_build_environment(self, env): + # configure fails if these env vars are set outside of Spack + env.unset('PETSC_DIR') + env.unset('PETSC_ARCH') + + def setup_run_environment(self, env): + # Set PETSC_DIR in the module file + env.set('PETSC_DIR', self.prefix) + env.unset('PETSC_ARCH') + + def setup_dependent_build_environment(self, env, dependent_spec): + # Set up PETSC_DIR for everyone using PETSc package + env.set('PETSC_DIR', self.prefix) + env.unset('PETSC_ARCH') + + @property + def headers(self): + return find_headers('petsc', self.prefix.include, recursive=False) \ + or None # return None to indicate failure + + # For the 'libs' property - use the default handler. diff --git a/scripts/uberenv/packages/py-numpy/package.py b/scripts/uberenv/packages/py-numpy/package.py new file mode 100644 index 00000000..7b1a748c --- /dev/null +++ b/scripts/uberenv/packages/py-numpy/package.py @@ -0,0 +1,319 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +import platform +import subprocess + + +class PyNumpy(PythonPackage): + """NumPy is the fundamental package for scientific computing with Python. + It contains among other things: a powerful N-dimensional array object, + sophisticated (broadcasting) functions, tools for integrating C/C++ and + Fortran code, and useful linear algebra, Fourier transform, and random + number capabilities""" + + homepage = "https://numpy.org/" + url = "https://pypi.io/packages/source/n/numpy/numpy-1.19.2.zip" + git = "https://github.com/numpy/numpy.git" + + maintainers = ['adamjstewart'] + install_time_test_callbacks = ['install_test', 'import_module_test'] + + import_modules = [ + 'numpy', 'numpy.compat', 'numpy.core', 'numpy.distutils', 'numpy.doc', + 'numpy.f2py', 'numpy.fft', 'numpy.lib', 'numpy.linalg', 'numpy.ma', + 'numpy.matrixlib', 'numpy.polynomial', 'numpy.random', 'numpy.testing', + 'numpy.distutils.command', 'numpy.distutils.fcompiler' + ] + + version('master', branch='master') + version('1.19.2', sha256='0d310730e1e793527065ad7dde736197b705d0e4c9999775f212b03c44a8484c') + version('1.19.1', sha256='b8456987b637232602ceb4d663cb34106f7eb780e247d51a260b84760fd8f491') + version('1.19.0', sha256='76766cc80d6128750075378d3bb7812cf146415bd29b588616f72c943c00d598') + version('1.18.5', sha256='34e96e9dae65c4839bd80012023aadd6ee2ccb73ce7fdf3074c62f301e63120b') + version('1.18.4', sha256='bbcc85aaf4cd84ba057decaead058f43191cc0e30d6bc5d44fe336dc3d3f4509') + version('1.18.3', sha256='e46e2384209c91996d5ec16744234d1c906ab79a701ce1a26155c9ec890b8dc8') + version('1.18.2', sha256='e7894793e6e8540dbeac77c87b489e331947813511108ae097f1715c018b8f3d') + version('1.18.1', sha256='b6ff59cee96b454516e47e7721098e6ceebef435e3e21ac2d6c3b8b02628eb77') + version('1.18.0', sha256='a9d72d9abaf65628f0f31bbb573b7d9304e43b1e6bbae43149c17737a42764c4') + version('1.17.5', sha256='16507ba6617f62ae3c6ab1725ae6f550331025d4d9a369b83f6d5a470446c342') + version('1.17.4', sha256='f58913e9227400f1395c7b800503ebfdb0772f1c33ff8cb4d6451c06cabdf316') + version('1.17.3', sha256='a0678793096205a4d784bd99f32803ba8100f639cf3b932dc63b21621390ea7e') + version('1.17.2', sha256='73615d3edc84dd7c4aeb212fa3748fb83217e00d201875a47327f55363cef2df') + version('1.17.1', sha256='f11331530f0eff69a758d62c2461cd98cdc2eae0147279d8fc86e0464eb7e8ca') + version('1.17.0', sha256='951fefe2fb73f84c620bec4e001e80a80ddaa1b84dce244ded7f1e0cbe0ed34a') + version('1.16.6', sha256='e5cf3fdf13401885e8eea8170624ec96225e2174eb0c611c6f26dd33b489e3ff') + version('1.16.5', sha256='8bb452d94e964b312205b0de1238dd7209da452343653ab214b5d681780e7a0c') + version('1.16.4', sha256='7242be12a58fec245ee9734e625964b97cf7e3f2f7d016603f9e56660ce479c7') + version('1.16.3', sha256='78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621') + version('1.16.2', sha256='6c692e3879dde0b67a9dc78f9bfb6f61c666b4562fd8619632d7043fb5b691b0') + version('1.16.1', sha256='31d3fe5b673e99d33d70cfee2ea8fe8dccd60f265c3ed990873a88647e3dd288') + version('1.16.0', sha256='cb189bd98b2e7ac02df389b6212846ab20661f4bafe16b5a70a6f1728c1cc7cb') + version('1.15.4', sha256='3d734559db35aa3697dadcea492a423118c5c55d176da2f3be9c98d4803fc2a7') + version('1.15.3', sha256='1c0c80e74759fa4942298044274f2c11b08c86230b25b8b819e55e644f5ff2b6') + version('1.15.2', sha256='27a0d018f608a3fe34ac5e2b876f4c23c47e38295c47dd0775cc294cd2614bc1') + version('1.15.2', sha256='27a0d018f608a3fe34ac5e2b876f4c23c47e38295c47dd0775cc294cd2614bc1') + version('1.15.1', sha256='7b9e37f194f8bcdca8e9e6af92e2cbad79e360542effc2dd6b98d63955d8d8a3') + version('1.15.0', sha256='f28e73cf18d37a413f7d5de35d024e6b98f14566a10d82100f9dc491a7d449f9') + version('1.14.6', sha256='1250edf6f6c43e1d7823f0967416bc18258bb271dc536298eb0ea00a9e45b80a') + version('1.14.5', sha256='a4a433b3a264dbc9aa9c7c241e87c0358a503ea6394f8737df1683c7c9a102ac') + version('1.14.4', sha256='2185a0f31ecaa0792264fa968c8e0ba6d96acf144b26e2e1d1cd5b77fc11a691') + version('1.14.3', sha256='9016692c7d390f9d378fc88b7a799dc9caa7eb938163dda5276d3f3d6f75debf') + version('1.14.2', sha256='facc6f925c3099ac01a1f03758100772560a0b020fb9d70f210404be08006bcb') + version('1.14.1', sha256='fa0944650d5d3fb95869eaacd8eedbd2d83610c85e271bd9d3495ffa9bc4dc9c') + version('1.14.0', sha256='3de643935b212307b420248018323a44ec51987a336d1d747c1322afc3c099fb') + version('1.13.3', sha256='36ee86d5adbabc4fa2643a073f93d5504bdfed37a149a3a49f4dde259f35a750') + version('1.13.1', sha256='c9b0283776085cb2804efff73e9955ca279ba4edafd58d3ead70b61d209c4fbb') + version('1.13.0', sha256='dcff367b725586830ff0e20b805c7654c876c2d4585c0834a6049502b9d6cf7e') + version('1.12.1', sha256='a65266a4ad6ec8936a1bc85ce51f8600634a31a258b722c9274a80ff189d9542') + version('1.12.0', sha256='ff320ecfe41c6581c8981dce892fe6d7e69806459a899e294e4bf8229737b154') + version('1.11.3', sha256='2e0fc5248246a64628656fe14fcab0a959741a2820e003bd15538226501b82f7') + version('1.11.2', sha256='c1ed4d1d2a795409c7df1eb4bfee65c0e3326cfc7c57875fa39e5c7414116d9a') + version('1.11.1', sha256='4e9c289b9d764d10353a224a5286dda3e0425b13b112719bdc3e9864ae648d79') + version('1.11.0', sha256='9109f260850627e4b83a3c4bcef4f2f99357eb4a5eaae75dec51c32f3c197aa3') + version('1.10.4', sha256='8ce443dc79656a9fc97a7837f1444d324aef2c9b53f31f83441f57ad1f1f3659') + version('1.9.3', sha256='baa074bb1c7f9c822122fb81459b7caa5fc49267ca94cca69465c8dcfd63ac79') + version('1.9.2', sha256='e37805754f4ebb575c434d134f6bebb8b857d9843c393f6943c7be71ef57311c') + version('1.9.1', sha256='2a545c0d096d86035b12160fcba5e4c0a08dcabbf902b4f867eb64deb31a2b7a') + + variant('blas', default=True, description='Build with BLAS support') + variant('lapack', default=True, description='Build with LAPACK support') + variant('force-parallel-build', default=False, description='Force a parallel build, may break with Python 3.') + + depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.5:', type=('build', 'run'), when='@1.16:') + depends_on('python@3.5:', type=('build', 'run'), when='@1.17:') + depends_on('python@3.6:', type=('build', 'run'), when='@1.19:') + depends_on('py-setuptools', type=('build', 'run')) + # Check pyproject.toml for updates to the required cython version + depends_on('py-cython@0.29.13:', when='@1.18.0:', type='build') + depends_on('py-cython@0.29.14:', when='@1.18.1:', type='build') + depends_on('py-cython@0.29.21:', when='@1.19.1:', type='build') + depends_on('blas', when='+blas') + depends_on('lapack', when='+lapack') + + depends_on('py-nose@1.0.0:', when='@:1.14', type='test') + depends_on('py-pytest', when='@1.15:', type='test') + depends_on('py-hypothesis', when='@1.19:', type='test') + + # Allows you to specify order of BLAS/LAPACK preference + # https://github.com/numpy/numpy/pull/13132 + patch('blas-lapack-order.patch', when='@1.15:1.16') + + # GCC 4.8 is the minimum version that works + conflicts('%gcc@:4.7', msg='GCC 4.8+ required') + + def flag_handler(self, name, flags): + # -std=c99 at least required, old versions of GCC default to -std=c90 + if self.spec.satisfies('%gcc@:5.1') and name == 'cflags': + flags.append(self.compiler.c99_flag) + # Check gcc version in use by intel compiler + # This will essentially check the system gcc compiler unless a gcc + # module is already loaded. + if self.spec.satisfies('%intel') and name == 'cflags': + p1 = subprocess.Popen( + [self.compiler.cc, '-v'], + stderr=subprocess.PIPE + ) + p2 = subprocess.Popen( + ['grep', 'compatibility'], + stdin=p1.stderr, + stdout=subprocess.PIPE + ) + p1.stderr.close() + out, err = p2.communicate() + gcc_version = Version(out.split()[5].decode('utf-8')) + if gcc_version < Version('4.8'): + raise InstallError('The GCC version that the Intel compiler ' + 'uses must be >= 4.8. The GCC in use is ' + '{0}'.format(gcc_version)) + if gcc_version <= Version('5.1'): + flags.append(self.compiler.c99_flag) + return (flags, None, None) + + @run_before('build') + def set_blas_lapack(self): + # https://numpy.org/devdocs/user/building.html + # https://github.com/numpy/numpy/blob/master/site.cfg.example + + # Skip if no BLAS/LAPACK requested + spec = self.spec + if '+blas' not in spec and '+lapack' not in spec: + return + + def write_library_dirs(f, dirs): + f.write('library_dirs = {0}\n'.format(dirs)) + if not ((platform.system() == 'Darwin') and + (Version(platform.mac_ver()[0]).up_to(2) == Version( + '10.12'))): + f.write('rpath = {0}\n'.format(dirs)) + + blas_libs = LibraryList([]) + blas_headers = HeaderList([]) + if '+blas' in spec: + blas_libs = spec['blas'].libs + blas_headers = spec['blas'].headers + + lapack_libs = LibraryList([]) + lapack_headers = HeaderList([]) + if '+lapack' in spec: + lapack_libs = spec['lapack'].libs + lapack_headers = spec['lapack'].headers + + lapackblas_libs = lapack_libs + blas_libs + lapackblas_headers = lapack_headers + blas_headers + + blas_lib_names = ','.join(blas_libs.names) + blas_lib_dirs = ':'.join(blas_libs.directories) + blas_header_dirs = ':'.join(blas_headers.directories) + + lapack_lib_names = ','.join(lapack_libs.names) + lapack_lib_dirs = ':'.join(lapack_libs.directories) + lapack_header_dirs = ':'.join(lapack_headers.directories) + + lapackblas_lib_names = ','.join(lapackblas_libs.names) + lapackblas_lib_dirs = ':'.join(lapackblas_libs.directories) + lapackblas_header_dirs = ':'.join(lapackblas_headers.directories) + + # Tell numpy where to find BLAS/LAPACK libraries + with open('site.cfg', 'w') as f: + if '^intel-mkl' in spec or '^intel-parallel-studio+mkl' in spec: + f.write('[mkl]\n') + # FIXME: as of @1.11.2, numpy does not work with separately + # specified threading and interface layers. A workaround is a + # terribly bad idea to use mkl_rt. In this case Spack will no + # longer be able to guarantee that one and the same variant of + # Blas/Lapack (32/64bit, threaded/serial) is used within the + # DAG. This may lead to a lot of hard-to-debug segmentation + # faults on user's side. Users may also break working + # installation by (unconsciously) setting environment variable + # to switch between different interface and threading layers + # dynamically. From this perspective it is no different from + # throwing away RPATH's and using LD_LIBRARY_PATH throughout + # Spack. + f.write('libraries = {0}\n'.format(lapackblas_lib_names + ',mkl_avx2,mkl_def')) + write_library_dirs(f, lapackblas_lib_dirs) + f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs)) + + if '^blis' in spec: + f.write('[blis]\n') + f.write('libraries = {0}\n'.format(blas_lib_names)) + write_library_dirs(f, blas_lib_dirs) + f.write('include_dirs = {0}\n'.format(blas_header_dirs)) + + if '^openblas' in spec: + f.write('[openblas]\n') + f.write('libraries = {0}\n'.format(lapackblas_lib_names)) + write_library_dirs(f, lapackblas_lib_dirs) + f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs)) + + if '^libflame' in spec: + f.write('[flame]\n') + f.write('libraries = {0}\n'.format(lapack_lib_names)) + write_library_dirs(f, lapack_lib_dirs) + f.write('include_dirs = {0}\n'.format(lapack_header_dirs)) + + if '^atlas' in spec: + f.write('[atlas]\n') + f.write('libraries = {0}\n'.format(lapackblas_lib_names)) + write_library_dirs(f, lapackblas_lib_dirs) + f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs)) + + if '^veclibfort' in spec: + f.write('[accelerate]\n') + f.write('libraries = {0}\n'.format(lapackblas_lib_names)) + write_library_dirs(f, lapackblas_lib_dirs) + + if '^netlib-lapack' in spec: + # netlib requires blas and lapack listed + # separately so that scipy can find them + if spec.satisfies('+blas'): + f.write('[blas]\n') + f.write('libraries = {0}\n'.format(blas_lib_names)) + write_library_dirs(f, blas_lib_dirs) + f.write('include_dirs = {0}\n'.format(blas_header_dirs)) + if spec.satisfies('+lapack'): + f.write('[lapack]\n') + f.write('libraries = {0}\n'.format(lapack_lib_names)) + write_library_dirs(f, lapack_lib_dirs) + f.write('include_dirs = {0}\n'.format(lapack_header_dirs)) + + def setup_build_environment(self, env): + # Tell numpy which BLAS/LAPACK libraries we want to use. + # https://github.com/numpy/numpy/pull/13132 + # https://numpy.org/devdocs/user/building.html#accelerated-blas-lapack-libraries + spec = self.spec + + # https://numpy.org/devdocs/user/building.html#blas + if 'blas' not in spec: + blas = '' + elif spec['blas'].name == 'intel-mkl' or \ + spec['blas'].name == 'intel-parallel-studio': + blas = 'mkl' + elif spec['blas'].name == 'blis': + blas = 'blis' + elif spec['blas'].name == 'openblas': + blas = 'openblas' + elif spec['blas'].name == 'atlas': + blas = 'atlas' + elif spec['blas'].name == 'veclibfort': + blas = 'accelerate' + else: + blas = 'blas' + + env.set('NPY_BLAS_ORDER', blas) + + # https://numpy.org/devdocs/user/building.html#lapack + if 'lapack' not in spec: + lapack = '' + elif spec['lapack'].name == 'intel-mkl' or \ + spec['lapack'].name == 'intel-parallel-studio': + lapack = 'mkl' + elif spec['lapack'].name == 'openblas': + lapack = 'openblas' + elif spec['lapack'].name == 'libflame': + lapack = 'flame' + elif spec['lapack'].name == 'atlas': + lapack = 'atlas' + elif spec['lapack'].name == 'veclibfort': + lapack = 'accelerate' + else: + lapack = 'lapack' + + env.set('NPY_LAPACK_ORDER', lapack) + + def build_args(self, spec, prefix): + args = [] + + # From NumPy 1.10.0 on it's possible to do a parallel build. + # https://numpy.org/devdocs/user/building.html#parallel-builds + if self.version >= Version('1.10.0'): + # But Parallel build in Python 3.5+ is broken. See: + # https://github.com/spack/spack/issues/7927 + # https://github.com/scipy/scipy/issues/7112 + if spec['python'].version < Version('3.5') or '+force-parallel-build' in spec: + args = ['-j', str(make_jobs)] + + return args + + def test(self): + # `setup.py test` is not supported. Use one of the following + # instead: + # + # - `python runtests.py` (to build and test) + # - `python runtests.py --no-build` (to test installed numpy) + # - `>>> numpy.test()` (run tests for installed numpy + # from within an interpreter) + pass + + def install_test(self): + # Change directories due to the following error: + # + # ImportError: Error importing numpy: you should not try to import + # numpy from its source directory; please exit the numpy + # source tree, and relaunch your python interpreter from there. + with working_dir('spack-test', create=True): + python('-c', 'import numpy; numpy.test("full", verbose=2)') diff --git a/scripts/uberenv/packages/py-scipy/package.py b/scripts/uberenv/packages/py-scipy/package.py new file mode 100644 index 00000000..63b86d3b --- /dev/null +++ b/scripts/uberenv/packages/py-scipy/package.py @@ -0,0 +1,124 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyScipy(PythonPackage): + """SciPy (pronounced "Sigh Pie") is a Scientific Library for Python. + It provides many user-friendly and efficient numerical routines such + as routines for numerical integration and optimization.""" + + homepage = "https://www.scipy.org/" + url = "https://pypi.io/packages/source/s/scipy/scipy-1.5.3.tar.gz" + + maintainers = ['adamjstewart'] + install_time_test_callbacks = ['install_test', 'import_module_test'] + + import_modules = [ + 'scipy', 'scipy._build_utils', 'scipy._lib', 'scipy.cluster', + 'scipy.constants', 'scipy.fftpack', 'scipy.integrate', + 'scipy.interpolate', 'scipy.io', 'scipy.linalg', 'scipy.misc', + 'scipy.ndimage', 'scipy.odr', 'scipy.optimize', 'scipy.signal', + 'scipy.sparse', 'scipy.spatial', 'scipy.special', 'scipy.stats', + 'scipy.io.arff', 'scipy.io.harwell_boeing', 'scipy.io.matlab', + 'scipy.optimize._lsq', 'scipy.sparse.csgraph', 'scipy.sparse.linalg', + 'scipy.sparse.linalg.dsolve', 'scipy.sparse.linalg.eigen', + 'scipy.sparse.linalg.isolve', 'scipy.sparse.linalg.eigen.arpack', + 'scipy.sparse.linalg.eigen.lobpcg', 'scipy.special._precompute' + ] + + version('1.5.3', sha256='ddae76784574cc4c172f3d5edd7308be16078dd3b977e8746860c76c195fa707') + version('1.5.2', sha256='066c513d90eb3fd7567a9e150828d39111ebd88d3e924cdfc9f8ce19ab6f90c9') + version('1.5.1', sha256='039572f0ca9578a466683558c5bf1e65d442860ec6e13307d528749cfe6d07b8') + version('1.5.0', sha256='4ff72877d19b295ee7f7727615ea8238f2d59159df0bdd98f91754be4a2767f0') + version('1.4.1', sha256='dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59') + version('1.4.0', sha256='31f7cfa93b01507c935c12b535e24812594002a02a56803d7cd063e9920d25e8') + version('1.3.3', sha256='64bf4e8ae0db2d42b58477817f648d81e77f0b381d0ea4427385bba3f959380a') + version('1.3.2', sha256='a03939b431994289f39373c57bbe452974a7da724ae7f9620a1beee575434da4') + version('1.3.1', sha256='2643cfb46d97b7797d1dbdb6f3c23fe3402904e3c90e6facfe6a9b98d808c1b5') + version('1.3.0', sha256='c3bb4bd2aca82fb498247deeac12265921fe231502a6bc6edea3ee7fe6c40a7a') + version('1.2.3', sha256='ecbe6413ca90b8e19f8475bfa303ac001e81b04ec600d17fa7f816271f7cca57') + version('1.2.2', sha256='a4331e0b8dab1ff75d2c67b5158a8bb9a83c799d7140094dda936d876c7cfbb1') + version('1.2.1', sha256='e085d1babcb419bbe58e2e805ac61924dac4ca45a07c9fa081144739e500aa3c') + version('1.1.0', sha256='878352408424dffaa695ffedf2f9f92844e116686923ed9aa8626fc30d32cfd1') + version('1.0.0', sha256='87ea1f11a0e9ec08c264dc64551d501fa307289460705f6fccd84cbfc7926d10') + version('0.19.1', sha256='a19a2ca7a7336495ec180adeaa0dfdcf41e96dbbee90d51c3ed828ba570884e6') + version('0.18.1', sha256='8ab6e9c808bf2fb3e8576cd8cf07226d9cdc18b012c06d9708429a821ac6634e') + version('0.17.0', sha256='f600b755fb69437d0f70361f9e560ab4d304b1b66987ed5a28bdd9dd7793e089') + version('0.15.1', sha256='a212cbc3b79e9a563aa45fc5c517b3499198bd7eb7e7be1e047568a5f48c259a') + version('0.15.0', sha256='0c74e31e08acc8bf9b6ceb9bced73df2ae0cc76003e0366350bc7b26292bf8b1') + + variant('force-parallel-build', default=False, description='Force a parallel build, may break with Python 3.') + + depends_on('python@2.6:2.8,3.2:', type=('build', 'link', 'run')) + depends_on('python@2.7:2.8,3.4:', when='@0.18:', type=('build', 'link', 'run')) + depends_on('python@3.5:', when='@1.3:', type=('build', 'link', 'run')) + depends_on('python@3.6:', when='@1.5:', type=('build', 'link', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-pybind11@2.2.4:', when='@1.4.0:', type=('build', 'link')) + depends_on('py-pybind11@2.4.0:', when='@1.4.1:', type=('build', 'link')) + depends_on('py-pybind11@2.4.3:', when='@1.5.0:', type=('build', 'link')) + depends_on('py-numpy@1.5.1:+blas+lapack', type=('build', 'link', 'run')) + depends_on('py-numpy@1.6.2:+blas+lapack', when='@0.16:', type=('build', 'link', 'run')) + depends_on('py-numpy@1.7.1:+blas+lapack', when='@0.18:', type=('build', 'link', 'run')) + depends_on('py-numpy@1.8.2:+blas+lapack', when='@0.19:', type=('build', 'link', 'run')) + depends_on('py-numpy@1.13.3:+blas+lapack', when='@1.3:', type=('build', 'link', 'run')) + depends_on('py-numpy@1.14.5:+blas+lapack', when='@1.5:', type=('build', 'link', 'run')) + depends_on('py-pytest', type='test') + + # NOTE: scipy picks up Blas/Lapack from numpy, see + # http://www.scipy.org/scipylib/building/linux.html#step-4-build-numpy-1-5-0 + depends_on('blas') + depends_on('lapack') + + # https://github.com/scipy/scipy/issues/12860 + patch('https://git.sagemath.org/sage.git/plain/build/pkgs/scipy/patches/extern_decls.patch?id=711fe05025795e44b84233e065d240859ccae5bd', + sha256='5433f60831cb554101520a8f8871ac5a32c95f7a971ccd68b69049535b106780', when='@1.2:1.5') + + patch('scipy-clang.patch', when='%clang') + + def setup_build_environment(self, env): + # https://github.com/scipy/scipy/issues/11611 + if self.spec.satisfies('@:1.4 %gcc@10:'): + env.set('FFLAGS', '-fallow-argument-mismatch') + + # Build in parallel + # Known problems with Python 3.5+ + # https://github.com/spack/spack/issues/7927 + # https://github.com/scipy/scipy/issues/7112 + if not self.spec.satisfies('^python@3.5:') or '+force-parallel-build' in self.spec: + env.set('NPY_NUM_BUILD_JOBS', str(make_jobs)) + + def build_args(self, spec, prefix): + args = [] + + # Build in parallel + # Known problems with Python 3.5+ + # https://github.com/spack/spack/issues/7927 + # https://github.com/scipy/scipy/issues/7112 + if not spec.satisfies('^python@3.5:') or '+force-parallel-build' in spec: + args.extend(['-j', str(make_jobs)]) + + return args + + def test(self): + # `setup.py test` is not supported. Use one of the following + # instead: + # + # - `python runtests.py` (to build and test) + # - `python runtests.py --no-build` (to test installed scipy) + # - `>>> scipy.test()` (run tests for installed scipy + # from within an interpreter) + pass + + def install_test(self): + # Change directories due to the following error: + # + # ImportError: Error importing scipy: you should not try to import + # scipy from its source directory; please exit the scipy + # source tree, and relaunch your python interpreter from there. + with working_dir('spack-test', create=True): + python('-c', 'import scipy; scipy.test("full", verbose=2)') diff --git a/scripts/uberenv/packages/py-scipy/scipy-clang.patch b/scripts/uberenv/packages/py-scipy/scipy-clang.patch new file mode 100644 index 00000000..dcca99bd --- /dev/null +++ b/scripts/uberenv/packages/py-scipy/scipy-clang.patch @@ -0,0 +1,13 @@ +diff --git a/scipy/special/_faddeeva.cxx b/scipy/special/_faddeeva.cxx +index 9134516..159122c 100644 +--- a/scipy/special/_faddeeva.cxx ++++ b/scipy/special/_faddeeva.cxx +@@ -130,7 +130,7 @@ double faddeeva_voigt_profile(double x, double sigma, double gamma) + + if(sigma == 0){ + if (gamma == 0){ +- if (isnan(x)) ++ if (std::isnan(x)) + return x; + if (x == 0) + return NPY_INFINITY; diff --git a/scripts/uberenv/packages/raja/package.py b/scripts/uberenv/packages/raja/package.py new file mode 100644 index 00000000..56af1a48 --- /dev/null +++ b/scripts/uberenv/packages/raja/package.py @@ -0,0 +1,77 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Raja(CMakePackage, CudaPackage): + """RAJA Parallel Framework.""" + + homepage = "http://software.llnl.gov/RAJA/" + git = "https://github.com/LLNL/RAJA.git" + + version('develop', branch='develop', submodules='True') + version('main', branch='main', submodules='True') + version('0.13.0', tag='v0.13.0', submodules="True") + version('0.12.1', tag='v0.12.1', submodules="True") + version('0.12.0', tag='v0.12.0', submodules="True") + version('0.11.0', tag='v0.11.0', submodules="True") + version('0.10.1', tag='v0.10.1', submodules="True") + version('0.10.0', tag='v0.10.0', submodules="True") + version('0.9.0', tag='v0.9.0', submodules="True") + version('0.8.0', tag='v0.8.0', submodules="True") + version('0.7.0', tag='v0.7.0', submodules="True") + version('0.6.0', tag='v0.6.0', submodules="True") + version('0.5.3', tag='v0.5.3', submodules="True") + version('0.5.2', tag='v0.5.2', submodules="True") + version('0.5.1', tag='v0.5.1', submodules="True") + version('0.5.0', tag='v0.5.0', submodules="True") + version('0.4.1', tag='v0.4.1', submodules="True") + version('0.4.0', tag='v0.4.0', submodules="True") + + variant('openmp', default=True, description='Build OpenMP backend') + variant('shared', default=True, description='Build Shared Libs') + variant('examples', default=True, description='Build examples.') + variant('exercises', default=True, description='Build exercises.') + + depends_on('cmake@3.8:', type='build') + depends_on('cmake@3.9:', when='+cuda', type='build') + + def cmake_args(self): + spec = self.spec + + options = [] + options.append('-DENABLE_OPENMP={0}'.format( + 'ON' if '+openmp' in spec else 'OFF')) + + if '+cuda' in spec: + options.extend([ + '-DENABLE_CUDA=ON', + '-DCUDA_TOOLKIT_ROOT_DIR=%s' % (spec['cuda'].prefix)]) + + if not spec.satisfies('cuda_arch=none'): + cuda_arch = spec.variants['cuda_arch'].value + options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) + else: + options.append('-DENABLE_CUDA=OFF') + + options.append('-DBUILD_SHARED_LIBS={0}'.format( + 'ON' if '+shared' in spec else 'OFF')) + + options.append('-DENABLE_EXAMPLES={0}'.format( + 'ON' if '+examples' in spec else 'OFF')) + + options.append('-DENABLE_EXERCISES={0}'.format( + 'ON' if '+exercises' in spec else 'OFF')) + + # Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which + # is used by the spack compiler wrapper. This can go away when BLT + # removes -Werror from GTest flags + if self.spec.satisfies('%clang target=ppc64le:') or not self.run_tests: + options.append('-DENABLE_TESTS=OFF') + else: + options.append('-DENABLE_TESTS=ON') + + return options diff --git a/scripts/uberenv/packages/silo/package.py b/scripts/uberenv/packages/silo/package.py new file mode 100644 index 00000000..d7ccc3d9 --- /dev/null +++ b/scripts/uberenv/packages/silo/package.py @@ -0,0 +1,121 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Silo(AutotoolsPackage): + """Silo is a library for reading and writing a wide variety of scientific + data to binary, disk files.""" + + homepage = "http://wci.llnl.gov/simulation/computer-codes/silo" + url = "https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2.tar.gz" + + version('4.10.2', sha256='3af87e5f0608a69849c00eb7c73b11f8422fa36903dd14610584506e7f68e638', preferred=True) + version('4.10.2-bsd', sha256='4b901dfc1eb4656e83419a6fde15a2f6c6a31df84edfad7f1dc296e01b20140e', + url="https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2-bsd.tar.gz") + version('4.9', sha256='90f3d069963d859c142809cfcb034bc83eb951f61ac02ccb967fc8e8d0409854') + version('4.8', sha256='c430c1d33fcb9bc136a99ad473d535d6763bd1357b704a915ba7b1081d58fb21') + + variant('fortran', default=True, description='Enable Fortran support') + variant('shared', default=True, description='Build shared libraries') + variant('silex', default=False, + description='Builds Silex, a GUI for viewing Silo files') + variant('pic', default=True, + description='Produce position-independent code (for shared libs)') + variant('mpi', default=True, + description='Compile with MPI Compatibility') + variant('zlib', default=True, description='Compile with zlib') + + depends_on('hdf5@:1.10.999', when='@:4.10.2') + depends_on('hdf5~mpi', when='~mpi') + depends_on('mpi', when='+mpi') + depends_on('hdf5+mpi', when='+mpi') + depends_on('qt~framework@4.8:4.9', when='+silex') + depends_on('libx11', when='+silex') + depends_on('readline') + depends_on('zlib', when='+zlib') + + patch('remove-mpiposix.patch', when='@4.8:4.10.2') + + def flag_handler(self, name, flags): + spec = self.spec + if name == 'ldflags': + if spec['hdf5'].satisfies('~shared'): + flags.append('-ldl') + flags.append(spec['readline'].libs.search_flags) + + if '+pic' in spec: + if name == 'cflags': + flags.append(self.compiler.cc_pic_flag) + elif name == 'cxxflags': + flags.append(self.compiler.cxx_pic_flag) + elif name == 'fcflags': + flags.append(self.compiler.fc_pic_flag) + return (flags, None, None) + + @when('%clang@9:') + def patch(self): + self.clang_9_patch() + + @when('%apple-clang@11.0.3:') + def patch(self): + self.clang_9_patch() + + def clang_9_patch(self): + # Clang 9 and later include macro definitions in that conflict + # with typedefs DOMAIN and RANGE used in Silo plugins. + # It looks like the upstream fpzip repo has been fixed, but that change + # hasn't yet made it into silo. + # https://github.com/LLNL/fpzip/blob/master/src/pcmap.h + + def repl(match): + # Change macro-like uppercase to title-case. + return match.group(1).title() + + files_to_filter = [ + "src/fpzip/codec.h", + "src/fpzip/pcdecoder.inl", + "src/fpzip/pcencoder.inl", + "src/fpzip/pcmap.h", + "src/fpzip/pcmap.inl", + "src/fpzip/read.cpp", + "src/fpzip/write.cpp", + "src/hzip/hzmap.h", + "src/hzip/hzresidual.h", + ] + + filter_file(r'\b(DOMAIN|RANGE|UNION)\b', repl, *files_to_filter) + + def configure_args(self): + spec = self.spec + config_args = [ + '--with-hdf5=%s,%s' % (spec['hdf5'].prefix.include, + spec['hdf5'].prefix.lib), + '--enable-install-lite-headers', + '--enable-fortran' if '+fortran' in spec else '--disable-fortran', + '--enable-silex' if '+silex' in spec else '--disable-silex', + '--enable-shared' if '+shared' in spec else '--disable-shared', + ] + + if '+zlib' in spec: + config_args.extend(['--with-zlib=%s,%s' % (spec['zlib'].prefix.include, spec['zlib'].prefix.lib)]) + + if '+silex' in spec: + x = spec['libx11'] + config_args.extend([ + '--with-Qt-dir=' + spec['qt'].prefix, + '--with-Qt-lib=QtGui -lQtCore', + '--x-includes=' + x.prefix.include, + '--x-libraries=' + x.prefix.lib, + ]) + + if '+mpi' in spec: + config_args.append('CC=%s' % spec['mpi'].mpicc) + config_args.append('CXX=%s' % spec['mpi'].mpicxx) + if '+fortran' in spec: + config_args.append('FC=%s' % spec['mpi'].mpifc) + + return config_args diff --git a/scripts/uberenv/packages/suite-sparse/package.py b/scripts/uberenv/packages/suite-sparse/package.py new file mode 100644 index 00000000..48d0bf92 --- /dev/null +++ b/scripts/uberenv/packages/suite-sparse/package.py @@ -0,0 +1,211 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class SuiteSparse(Package): + """ + SuiteSparse is a suite of sparse matrix algorithms + """ + homepage = 'http://faculty.cse.tamu.edu/davis/suitesparse.html' + url = 'https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v4.5.3.tar.gz' + git = 'https://github.com/DrTimothyAldenDavis/SuiteSparse.git' + + version('5.8.1', sha256='06726e471fbaa55f792578f9b4ab282ea9d008cf39ddcc3b42b73400acddef40') + version('5.8.0', sha256='94a9b7134eb4dd82b97f1a22a6b464feb81e73af2dcdf683c6f252285191df1d') + version('5.7.2', sha256='fe3bc7c3bd1efdfa5cffffb5cebf021ff024c83b5daf0ab445429d3d741bd3ad') + version('5.7.1', sha256='5ba5add1663d51a1b6fb128b50fe869b497f3096765ff7f8212f0ede044b9557') + version('5.6.0', sha256='76d34d9f6dafc592b69af14f58c1dc59e24853dcd7c2e8f4c98ffa223f6a1adb') + version('5.5.0', sha256='63c73451734e2bab19d1915796c6776565ea6aea5da4063a9797ecec60da2e3d') + version('5.4.0', sha256='d9d62d539410d66550d0b795503a556830831f50087723cb191a030525eda770') + version('5.3.0', sha256='d8ef4bee4394d2f07299d4688b83bbd98e9d3a2ebbe1c1632144b6f7095ce165') + version('5.2.0', sha256='68c431aef3d9a0b02e97803eb61671c5ecb9d36fd292a807db87067dadb36e53') + version('5.1.2', sha256='97dc5fdc7f78ff5018e6a1fcc841e17a9af4e5a35cebd62df6922349bf12959e') + version('5.1.0', sha256='0b0e03c63e67b04529bb6248808d2a8c82259d40b30fc5a7599f4b6f7bdd4dc6') + version('5.0.0', sha256='2f8694d9978033659f10ceb8bdb19147d3c519a0251b8de84be6ba8824d30517') + version('4.5.6', sha256='1c7b7a265a1d6c606095eb8aa3cb8e27821f1b7f5bc04f28df6d62906e02f4e4') + version('4.5.5', sha256='80d1d9960a6ec70031fecfe9adfe5b1ccd8001a7420efb50d6fa7326ef14af91') + version('4.5.3', sha256='b6965f9198446a502cde48fb0e02236e75fa5700b94c7306fc36599d57b563f4') + + variant('tbb', default=False, description='Build with Intel TBB') + variant('pic', default=True, description='Build position independent code (required to link with shared libraries)') + variant('cuda', default=False, description='Build with CUDA') + variant('openmp', default=False, description='Build with OpenMP') + + variant('klu', default=False, description='Build KLU.') + variant('btf', default=False, description='Build BTF.') + variant('umfpack', default=False, description='Build UMFPACK.') + variant('cholmod', default=False, description='Build CHOLMOD.') + variant('colamd', default=False, description='Build COLAMD.') + variant('amd', default=False, description='Build AMD.') + variant('camd', default=False, description='Build CAMD.') + variant('ccolamd', default=False, description='Build CCOLAMD.') + variant('csparse', default=False, description='Build CSparse.') + variant('cxsparse', default=False, description='Build CXSparse.') + variant('rbio', default=False, description='Build RBio.') + variant('spqr', default=False, description='Build SPQR.') + + variant('blas-no-underscore', default=False, description='Force no underscore for BLAS and LAPACK libs.') + + depends_on('blas') + depends_on('lapack') + depends_on('m4', type='build', when='@5.0.0:') + depends_on('cmake', when='@5.2.0:', type='build') + + depends_on('metis@5.1.0', when='@4.5.1:') + # in @4.5.1. TBB support in SPQR seems to be broken as TBB-related linkng + # flags does not seem to be used, which leads to linking errors on Linux. + depends_on('tbb', when='@4.5.3:+tbb') + + depends_on('cuda', when='+cuda') + + patch('tbb_453.patch', when='@4.5.3:4.5.5+tbb') + + # This patch removes unsupported flags for pgi compiler + patch('pgi.patch', when='%pgi') + + # This patch adds '-lm' when linking libgraphblas and when using clang. + # Fixes 'libgraphblas.so.2.0.1: undefined reference to `__fpclassify'' + patch('graphblas_libm_dep.patch', when='@5.2.0:5.2.99%clang') + + conflicts('%gcc@:4.8', when='@5.2.0:', msg='gcc version must be at least 4.9 for suite-sparse@5.2.0:') + conflicts('+cholmod~amd', msg='CHOLMOD depends on AMD.') + conflicts('+cholmod~camd', msg='CHOLMOD depends on CAMD.') + conflicts('+cholmod~colamd', msg='CHOLMOD depends on COLAMD.') + conflicts('+cholmod~ccolamd', msg='CHOLMOD depends on CCOLAMD.') + + conflicts('+umfpack~cholmod', msg='UMFPACK depends on cholmod') + + def install(self, spec, prefix): + # The build system of SuiteSparse is quite old-fashioned. + # It's basically a plain Makefile which include an header + # (SuiteSparse_config/SuiteSparse_config.mk)with a lot of convoluted + # logic in it. Any kind of customization will need to go through + # filtering of that file + + cc_pic_flag = self.compiler.cc_pic_flag if '+pic' in spec else '' + f77_pic_flag = self.compiler.f77_pic_flag if '+pic' in spec else '' + + make_args = [ + # By default, the Makefile uses the Intel compilers if + # they are found. The AUTOCC flag disables this behavior, + # forcing it to use Spack's compiler wrappers. + 'AUTOCC=no', + # CUDA=no does NOT disable cuda, it only disables internal search + # for CUDA_PATH. If in addition the latter is empty, then CUDA is + # completely disabled. See + # [SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk] for more. + 'CUDA=no', + 'CUDA_PATH=%s' % (spec['cuda'].prefix if '+cuda' in spec else ''), + 'CFOPENMP=%s' % (self.compiler.openmp_flag + if '+openmp' in spec else ''), + 'CFLAGS=-O3 %s' % cc_pic_flag, + # Both FFLAGS and F77FLAGS are used in SuiteSparse makefiles; + # FFLAGS is used in CHOLMOD, F77FLAGS is used in AMD and UMFPACK. + 'FFLAGS=%s' % f77_pic_flag, + 'F77FLAGS=%s' % f77_pic_flag, + # use Spack's metis in CHOLMOD/Partition module, + # otherwise internal Metis will be compiled + 'MY_METIS_LIB=%s' % spec['metis'].libs.ld_flags, + 'MY_METIS_INC=%s' % spec['metis'].prefix.include, + # Make sure Spack's Blas/Lapack is used. Otherwise System's + # Blas/Lapack might be picked up. Need to add -lstdc++, following + # with the TCOV path of SparseSuite 4.5.1's Suitesparse_config.mk, + # even though this fix is ugly + 'BLAS=%s' % (spec['blas'].libs.ld_flags + ( + ' -lstdc++' if '@4.5.1' in spec else '')), + 'LAPACK=%s' % spec['lapack'].libs.ld_flags, + ] + + # Recent versions require c11 but some demos do not get the c11 from + # GraphBLAS/CMakeLists.txt, for example the file + # GraphBLAS/Demo/Program/wildtype_demo.c. For many compilers this is + # not an issue because c11 or newer is their default. However, for some + # compilers (e.g. xlc) the c11 flag is necessary. + if spec.satisfies('@5.4:5.7.1') and ('%xl' in spec or '%xl_r' in spec): + make_args += ['CFLAGS+=%s' % self.compiler.c11_flag] + + # 64bit blas in UMFPACK: + if (spec.satisfies('^openblas+ilp64') or + spec.satisfies('^intel-mkl+ilp64') or + spec.satisfies('^intel-parallel-studio+mkl+ilp64')): + make_args.append('UMFPACK_CONFIG=-DLONGBLAS="long long"') + + # SuiteSparse defaults to using '-fno-common -fexceptions' in + # CFLAGS, but not all compilers use the same flags for these + # optimizations + if any([x in spec + for x in ('%apple-clang', '%clang', '%gcc', '%intel')]): + make_args += ['CFLAGS+=-fno-common -fexceptions'] + elif '%pgi' in spec: + make_args += ['CFLAGS+=--exceptions'] + + if '+blas-no-underscore' in spec or spack_f77.endswith('xlf') or spack_f77.endswith('xlf_r'): + make_args += ['CFLAGS+=-DBLAS_NO_UNDERSCORE'] + + # Intel TBB in SuiteSparseQR + if 'tbb' in spec: + make_args += [ + 'SPQR_CONFIG=-DHAVE_TBB', + 'TBB=%s' % spec['tbb'].libs.ld_flags, + ] + + if '@5.3:' in spec: + # Without CMAKE_LIBRARY_PATH defined, the CMake file in the + # Mongoose directory finds libsuitesparseconfig.so in system + # directories like /usr/lib. + make_args += [ + 'CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=%s' % prefix + + ' -DCMAKE_LIBRARY_PATH=%s' % prefix.lib] + + make_args.append('INSTALL=%s' % prefix) + + libraries = (('SuiteSparse_config', True), + ('SPQR', '+spqr' in spec), + ('RBio', '+rbio' in spec), + ('CSparse', '+csparse' in spec), + ('CXSparse', '+cxsparse' in spec), + ('CCOLAMD', '+ccolamd' in spec), + ('CAMD', '+camd' in spec), + ('AMD', '+amd' in spec), + ('COLAMD', '+colamd' in spec), + ('CHOLMOD', '+cholmod' in spec), + ('UMFPACK', '+umfpack' in spec), + ('BTF', '+btf' in spec), + ('KLU', '+klu' in spec)) + + # In those SuiteSparse versions calling "make install" in one go is + # not possible, mainly because of GraphBLAS. Thus compile first and + # install in a second run. + for directory, shouldBuild in libraries: + if shouldBuild: + with working_dir(directory): + if '@5.4.0:' in self.spec: + make('library', *make_args) + + for directory, shouldBuild in libraries: + if shouldBuild: + with working_dir(directory): + make('install', *make_args) + + @property + def libs(self): + """Export the libraries of SuiteSparse. + Sample usage: spec['suite-sparse'].libs.ld_flags + spec['suite-sparse:klu,btf'].libs.ld_flags + """ + # Component libraries, ordered by dependency. Any missing components? + all_comps = ['klu', 'btf', 'umfpack', 'cholmod', 'colamd', 'amd', + 'camd', 'ccolamd', 'cxsparse', 'ldl', 'rbio', 'spqr', + 'suitesparseconfig'] + query_parameters = self.spec.last_query.extra_parameters + comps = all_comps if not query_parameters else query_parameters + libs = find_libraries(['lib' + c for c in comps], root=self.prefix.lib, + shared=True, recursive=False) + if not libs: + return None + libs += find_system_libraries('librt') + return libs diff --git a/scripts/uberenv/packages/trilinos/package.py b/scripts/uberenv/packages/trilinos/package.py new file mode 100644 index 00000000..b126010d --- /dev/null +++ b/scripts/uberenv/packages/trilinos/package.py @@ -0,0 +1,813 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os +import sys +from spack import * +from spack.operating_systems.mac_os import macos_version + +# Trilinos is complicated to build, as an inspiration a couple of links to +# other repositories which build it: +# https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/t/trilinos.py#L111 +# https://github.com/koecher/candi/blob/master/deal.II-toolchain/packages/trilinos.package +# https://gitlab.com/configurations/cluster-config/blob/master/trilinos.sh +# https://github.com/Homebrew/homebrew-science/blob/master/trilinos.rb and some +# relevant documentation/examples: +# https://github.com/trilinos/Trilinos/issues/175 + + +class Trilinos(CMakePackage): + """The Trilinos Project is an effort to develop algorithms and enabling + technologies within an object-oriented software framework for the solution + of large-scale, complex multi-physics engineering and scientific problems. + A unique design feature of Trilinos is its focus on packages. + """ + homepage = "https://trilinos.org/" + url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-12-12-1.tar.gz" + git = "https://github.com/trilinos/Trilinos.git" + + maintainers = ['keitat'] + + # ###################### Versions ########################## + + version('xsdk-0.2.0', tag='xsdk-0.2.0') + version('develop', branch='develop') + version('master', branch='master') + version('13.0.0', commit='9fec35276d846a667bc668ff4cbdfd8be0dfea08') # tag trilinos-release-13-0-0 + version('12.18.1', commit='55a75997332636a28afc9db1aee4ae46fe8d93e7') # tag trilinos-release-12-8-1 + version('12.14.1', sha256='52a4406cca2241f5eea8e166c2950471dd9478ad6741cbb2a7fc8225814616f0') + version('12.12.1', sha256='5474c5329c6309224a7e1726cf6f0d855025b2042959e4e2be2748bd6bb49e18') + version('12.10.1', sha256='ab81d917196ffbc21c4927d42df079dd94c83c1a08bda43fef2dd34d0c1a5512') + version('12.8.1', sha256='d20fe60e31e3ba1ef36edecd88226240a518f50a4d6edcc195b88ee9dda5b4a1') + version('12.6.4', sha256='1c7104ba60ee8cc4ec0458a1c4f6a26130616bae7580a7b15f2771a955818b73') + version('12.6.3', sha256='4d28298bb4074eef522db6cd1626f1a934e3d80f292caf669b8846c0a458fe81') + version('12.6.2', sha256='8be7e3e1166cc05aea7f856cc8033182e8114aeb8f87184cb38873bfb2061779') + version('12.6.1', sha256='4b38ede471bed0036dcb81a116fba8194f7bf1a9330da4e29c3eb507d2db18db') + version('12.4.2', sha256='fd2c12e87a7cedc058bcb8357107ffa2474997aa7b17b8e37225a1f7c32e6f0e') + version('12.2.1', sha256='088f303e0dc00fb4072b895c6ecb4e2a3ad9a2687b9c62153de05832cf242098') + version('12.0.1', sha256='eee7c19ca108538fa1c77a6651b084e06f59d7c3307dae77144136639ab55980') + version('11.14.3', sha256='e37fa5f69103576c89300e14d43ba77ad75998a54731008b25890d39892e6e60') + version('11.14.2', sha256='f22b2b0df7b88e28b992e19044ba72b845292b93cbbb3a948488199647381119') + version('11.14.1', sha256='f10fc0a496bf49427eb6871c80816d6e26822a39177d850cc62cf1484e4eec07') + + # ###################### Variants ########################## + + # Other + # not everyone has py-numpy activated, keep it disabled by default to avoid + # configure errors + variant('python', default=False, + description='Build python wrappers') + + # Build options + variant('complex', default=False, + description='Enable complex numbers in Trilinos') + variant('explicit_template_instantiation', default=True, + description='Enable explicit template instantiation (ETI)') + variant('float', default=False, + description='Enable single precision (float) numbers in Trilinos') + variant('gotype', default='long', + values=('int', 'long', 'long_long'), + multi=False, + description='global ordinal type for Tpetra') + variant('fortran', default=True, + description='Compile with Fortran support') + variant('openmp', default=False, + description='Enable OpenMP') + variant('shared', default=True, + description='Enables the build of shared libraries') + variant('debug', default=False, + description='Enable runtime safety and debug checks') + variant('xsdkflags', default=False, + description='Compile using the default xSDK configuration') + variant('blas_lowercase_no_underscore', default=False, + description='Override the default F77_BLAS_MANGLE scheme.') + variant('force-new-lapack', default=False, + description='Override the auto detection of the LAPACK API.') + + # TPLs (alphabet order) + variant('boost', default=True, + description='Compile with Boost') + variant('cgns', default=False, + description='Enable CGNS') + variant('adios2', default=False, + description='Enable ADIOS2') + variant('glm', default=True, + description='Compile with GLM') + variant('gtest', default=True, + description='Compile with Gtest') + variant('hdf5', default=True, + description='Compile with HDF5') + variant('hypre', default=True, + description='Compile with Hypre preconditioner') + variant('matio', default=True, + description='Compile with Matio') + variant('metis', default=True, + description='Compile with METIS and ParMETIS') + variant('mpi', default=True, + description='Compile with MPI parallelism') + variant('mumps', default=True, + description='Compile with support for MUMPS solvers') + variant('netcdf', default=True, + description='Compile with netcdf') + variant('pnetcdf', default=False, + description='Compile with parallel-netcdf') + variant('suite-sparse', default=True, + description='Compile with SuiteSparse solvers') + variant('superlu-dist', default=False, + description='Compile with SuperluDist solvers') + variant('superlu', default=False, + description='Compile with SuperLU solvers') + variant('x11', default=False, + description='Compile with X11') + variant('zlib', default=False, + description='Compile with zlib') + + # Package options (alphabet order) + variant('alloptpkgs', default=False, + description='Compile with all optional packages') + variant('amesos', default=True, + description='Compile with Amesos') + variant('amesos2', default=True, + description='Compile with Amesos2') + variant('anasazi', default=True, + description='Compile with Anasazi') + variant('aztec', default=True, + description='Compile with Aztec') + variant('belos', default=True, + description='Compile with Belos') + # chaco is disabled by default. As of 12.14.1 libchaco.so + # has the global symbol divide (and maybe others) that can + # lead to symbol clash. + variant('chaco', default=False, + description='Compile with Chaco from SEACAS') + variant('epetra', default=True, + description='Compile with Epetra') + variant('epetraext', default=True, + description='Compile with EpetraExt') + variant('exodus', default=True, + description='Compile with Exodus from SEACAS') + variant('ifpack', default=True, + description='Compile with Ifpack') + variant('ifpack2', default=True, + description='Compile with Ifpack2') + variant('intrepid', default=False, + description='Enable Intrepid') + variant('intrepid2', default=False, + description='Enable Intrepid2') + variant('isorropia', default=False, + description='Compile with Isorropia') + variant('kokkos', default=True, + description='Compile with Kokkos') + variant('ml', default=True, + description='Compile with ML') + variant('minitensor', default=False, + description='Compile with MiniTensor') + variant('muelu', default=True, + description='Compile with Muelu') + variant('nox', default=False, + description='Compile with NOX') + variant('piro', default=False, + description='Compile with Piro') + variant('phalanx', default=False, + description='Compile with Phalanx') + variant('rol', default=False, + description='Compile with ROL') + variant('rythmos', default=False, + description='Compile with Rythmos') + variant('sacado', default=True, + description='Compile with Sacado') + variant('stk', default=False, + description='Compile with STK') + variant('shards', default=False, + description='Compile with Shards') + variant('shylu', default=False, + description='Compile with ShyLU') + variant('stratimikos', default=False, + description='Compile with Stratimikos') + variant('teko', default=False, + description='Compile with Teko') + variant('tempus', default=False, + description='Compile with Tempus') + variant('teuchos', default=True, + description='Compile with Teuchos') + variant('tpetra', default=True, + description='Compile with Tpetra') + variant('zoltan', default=True, + description='Compile with Zoltan') + variant('zoltan2', default=True, + description='Compile with Zoltan2') + + # External package options + variant('dtk', default=False, + description='Enable DataTransferKit') + variant('mesquite', default=False, + description='Enable Mesquite') + + resource(name='dtk', + git='https://github.com/ornl-cees/DataTransferKit.git', + commit='4fe4d9d56cfd4f8a61f392b81d8efd0e389ee764', # branch dtk-3.0 + placement='DataTransferKit', + when='+dtk @12.14.0:12.14.99') + resource(name='dtk', + git='https://github.com/ornl-cees/DataTransferKit.git', + commit='edfa050cd46e2274ab0a0b7558caca0079c2e4ca', # tag 3.1-rc1 + placement='DataTransferKit', + submodules=True, + when='+dtk @12.18:12.18.99') + resource(name='dtk', + git='https://github.com/ornl-cees/DataTransferKit.git', + branch='master', + placement='DataTransferKit', + submodules=True, + when='+dtk @develop') + resource(name='mesquite', + url='https://github.com/trilinos/mesquite/archive/trilinos-release-12-12-1.tar.gz', + sha256='e0d09b0939dbd461822477449dca611417316e8e8d8268fd795debb068edcbb5', + placement='packages/mesquite', + when='+mesquite @12.12.1:12.16.99') + resource(name='mesquite', + git='https://github.com/trilinos/mesquite.git', + commit='20a679679b5cdf15bf573d66c5dc2b016e8b9ca1', # branch trilinos-release-12-12-1 + placement='packages/mesquite', + when='+mesquite @12.18.1:12.18.99') + resource(name='mesquite', + git='https://github.com/trilinos/mesquite.git', + tag='develop', + placement='packages/mesquite', + when='+mesquite @develop') + + conflicts('+amesos2', when='~teuchos') + conflicts('+amesos2', when='~tpetra') + conflicts('+amesos', when='~epetra') + conflicts('+amesos', when='~teuchos') + conflicts('+anasazi', when='~teuchos') + conflicts('+aztec', when='~epetra') + conflicts('+belos', when='~teuchos') + conflicts('+epetraext', when='~epetra') + conflicts('+epetraext', when='~teuchos') + conflicts('+exodus', when='~netcdf') + conflicts('+ifpack2', when='~belos') + conflicts('+ifpack2', when='~teuchos') + conflicts('+ifpack2', when='~tpetra') + conflicts('+ifpack', when='~epetra') + conflicts('+ifpack', when='~teuchos') + conflicts('+intrepid2', when='~kokkos') + conflicts('+intrepid2', when='~shards') + conflicts('+intrepid2', when='~teuchos') + conflicts('+intrepid', when='~sacado') + conflicts('+intrepid', when='~shards') + conflicts('+intrepid', when='~teuchos') + conflicts('+isorropia', when='~epetra') + conflicts('+isorropia', when='~epetraext') + conflicts('+isorropia', when='~teuchos') + conflicts('+isorropia', when='~zoltan') + conflicts('+muelu', when='~teuchos') + conflicts('+muelu', when='~xpetra') + conflicts('+nox', when='~teuchos') + conflicts('+phalanx', when='~kokkos') + conflicts('+phalanx', when='~sacado') + conflicts('+phalanx', when='~teuchos') + conflicts('+piro', when='~teuchos') + conflicts('+rol', when='~teuchos') + conflicts('+rythmos', when='~teuchos') + conflicts('+teko', when='~amesos') + conflicts('+teko', when='~anasazi') + conflicts('+teko', when='~aztec') + conflicts('+teko', when='~ifpack') + conflicts('+teko', when='~ml') + conflicts('+teko', when='~teuchos') + conflicts('+teko', when='~tpetra') + conflicts('+tempus', when='~nox') + conflicts('+tempus', when='~teuchos') + conflicts('+tpetra', when='~kokkos') + conflicts('+tpetra', when='~teuchos') + conflicts('+zoltan2', when='~teuchos') + conflicts('+zoltan2', when='~tpetra') + conflicts('+zoltan2', when='~xpetra') + conflicts('+zoltan2', when='~zoltan') + + conflicts('+dtk', when='~boost') + conflicts('+dtk', when='~intrepid2') + conflicts('+dtk', when='~kokkos') + conflicts('+dtk', when='~teuchos') + conflicts('+dtk', when='~tpetra') + # Only allow DTK with Trilinos 12.14 and develop + conflicts('+dtk', when='@0:12.12.99,master') + # Only allow Mesquite with Trilinos 12.12 and up, and develop + conflicts('+mesquite', when='@0:12.10.99,master') + # Can only use one type of SuperLU + conflicts('+superlu-dist', when='+superlu') + # For Trilinos v11 we need to force SuperLUDist=OFF, since only the + # deprecated SuperLUDist v3.3 together with an Amesos patch is working. + conflicts('+superlu-dist', when='@11.4.1:11.14.3') + # see https://github.com/trilinos/Trilinos/issues/3566 + conflicts('+superlu-dist', when='+float+amesos2+explicit_template_instantiation^superlu-dist@5.3.0:') + # Amesos, conflicting types of double and complex SLU_D + # see + # https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html + # and + # https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html + conflicts('+superlu-dist', when='+complex+amesos2') + # PnetCDF was only added after v12.10.1 + conflicts('+pnetcdf', when='@0:12.10.1') + # https://github.com/trilinos/Trilinos/issues/2994 + conflicts( + '+shared', when='+stk platform=darwin', + msg='Cannot build Trilinos with STK as a shared library on Darwin.' + ) + # ADIOS2 was only added after v12.14.1 + conflicts('+adios2', when='@:12.14.1') + conflicts('+adios2', when='@xsdk-0.2.0') + conflicts('+pnetcdf', when='~netcdf') + + # ###################### Dependencies ########################## + + # Everything should be compiled position independent (-fpic) + depends_on('blas') + depends_on('lapack') + depends_on('boost', when='+boost') + depends_on('glm', when='+glm') + depends_on('hdf5+hl', when='+hdf5') + depends_on('matio', when='+matio') + depends_on('metis@5:', when='+metis') + depends_on('suite-sparse', when='+suite-sparse') + depends_on('zlib', when="+zlib") + + # MPI related dependencies + depends_on('mpi', when='+mpi') + depends_on('hdf5+mpi', when="+hdf5+mpi") + depends_on('netcdf-c+mpi', when="+netcdf~pnetcdf+mpi") + depends_on('netcdf-c+mpi+parallel-netcdf', when="+netcdf+pnetcdf@master,12.12.1:") + depends_on('parallel-netcdf', when="+netcdf+pnetcdf@master,12.12.1:") + depends_on('parmetis', when='+metis+mpi') + depends_on('cgns', when='+cgns') + depends_on('adios2', when='+adios2') + # Trilinos' Tribits config system is limited which makes it very tricky to + # link Amesos with static MUMPS, see + # https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html + # One could work it out by getting linking flags from mpif90 --showme:link + # (or alike) and adding results to -DTrilinos_EXTRA_LINK_FLAGS together + # with Blas and Lapack and ScaLAPACK and Blacs and -lgfortran and it may + # work at the end. But let's avoid all this by simply using shared libs + depends_on('mumps@5.0:+mpi+shared', when='+mumps') + depends_on('scalapack', when='+mumps') + depends_on('superlu-dist', when='+superlu-dist') + depends_on('superlu-dist@:4.3', when='@11.14.1:12.6.1+superlu-dist') + depends_on('superlu-dist@4.4:5.3', when='@12.6.2:12.12.1+superlu-dist') + depends_on('superlu-dist@5.4:6.2.0', when='@12.12.2:13.0+superlu-dist') + depends_on('superlu-dist@develop', when='@develop+superlu-dist') + depends_on('superlu-dist@xsdk-0.2.0', when='@xsdk-0.2.0+superlu-dist') + depends_on('superlu+pic@4.3', when='+superlu') + # Trilinos can not be built against 64bit int hypre + depends_on('hypre~internal-superlu~int64', when='+hypre') + depends_on('hypre@xsdk-0.2.0~internal-superlu', when='@xsdk-0.2.0+hypre') + depends_on('hypre@develop~internal-superlu', when='@develop+hypre') + depends_on('python', when='+python') + depends_on('py-numpy', when='+python', type=('build', 'run')) + depends_on('swig', when='+python') + + # Dependencies/conflicts when MPI is disabled + depends_on('hdf5~mpi', when='+hdf5~mpi') + conflicts('+parmetis', when='~mpi') + conflicts('+pnetcdf', when='~mpi') + + patch('umfpack_from_suitesparse.patch', when='@11.14.1:12.8.1') + patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %xl') + patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %xl_r') + patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %clang') + patch('xlf_tpetra.patch', when='@12.12.1%xl') + patch('xlf_tpetra.patch', when='@12.12.1%xl_r') + patch('xlf_tpetra.patch', when='@12.12.1%clang') + patch('fix_clang_errors_12_18_1.patch', when='@12.18.1%clang') + patch('cray_secas_12_12_1.patch', when='@12.12.1%cce') + patch('cray_secas.patch', when='@12.14.1:12.18.1%cce') + + def url_for_version(self, version): + url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-{0}.tar.gz" + return url.format(version.dashed) + + def cmake_args(self): + spec = self.spec + define = CMakePackage.define + + def define_trilinos_enable(cmake_var, spec_var=None): + if spec_var is None: + spec_var = cmake_var.lower() + return self.define_from_variant( + 'Trilinos_ENABLE_' + cmake_var, spec_var) + + def define_tpl_enable(cmake_var, spec_var=None): + if spec_var is None: + spec_var = cmake_var.lower() + return self.define_from_variant('TPL_ENABLE_' + cmake_var, + spec_var) + + cxx_flags = [] + options = [] + + # #################### Base Settings ####################### + + options.extend([ + define('Trilinos_VERBOSE_CONFIGURE', False), + define('Trilinos_ENABLE_TESTS', False), + define('Trilinos_ENABLE_EXAMPLES', False), + define('Trilinos_ENABLE_CXX11', True), + self.define_from_variant('BUILD_SHARED_LIBS', 'shared'), + define_trilinos_enable('DEBUG', 'debug'), + # The following can cause problems on systems that don't have + # static libraries available for things like dl and pthreads + # for example when trying to build static libs + # define('TPL_FIND_SHARED_LIBS', ( + # 'ON' if '+shared' in spec else 'OFF')) + # define('Trilinos_LINK_SEARCH_START_STATIC', ( + # 'OFF' if '+shared' in spec else 'ON')) + ]) + + # MPI settings + options.append(define_tpl_enable('MPI')) + if '+mpi' in spec: + # Force Trilinos to use the MPI wrappers instead of raw compilers + # this is needed on Apple systems that require full resolution of + # all symbols when linking shared libraries + options.extend([ + define('CMAKE_C_COMPILER', spec['mpi'].mpicc), + define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), + define('CMAKE_Fortran_COMPILER', spec['mpi'].mpifc), + define('MPI_BASE_DIR', spec['mpi'].prefix), + ]) + + if '+blas_lowercase_no_underscore' in spec: + options.extend([define('F77_BLAS_MANGLE', '(lcase,UCASE) lcase')]) + + if '+force-new-lapack' in spec: + options.extend([define('HAVE_dggsvd3', 'ON')]) + + # ################## Trilinos Packages ##################### + + options.extend([ + define_trilinos_enable('ALL_OPTIONAL_PACKAGES', 'alloptpkgs'), + define_trilinos_enable('Amesos'), + define_trilinos_enable('Amesos2'), + define_trilinos_enable('Anasazi'), + define_trilinos_enable('AztecOO', 'aztec'), + define_trilinos_enable('Belos'), + define_trilinos_enable('Epetra'), + define_trilinos_enable('EpetraExt'), + define_trilinos_enable('Ifpack'), + define_trilinos_enable('Ifpack2'), + define_trilinos_enable('Intrepid'), + define_trilinos_enable('Intrepid2'), + define_trilinos_enable('Isorropia'), + define_trilinos_enable('Kokkos'), + define_trilinos_enable('MiniTensor'), + define_trilinos_enable('Mesquite'), + define_trilinos_enable('ML'), + define_trilinos_enable('MueLu'), + define_trilinos_enable('NOX'), + define_trilinos_enable('Piro'), + define_trilinos_enable('Phalanx'), + define_trilinos_enable('PyTrilinos', 'python'), + define_trilinos_enable('ROL'), + define_trilinos_enable('Rythmos'), + define_trilinos_enable('Sacado'), + define_trilinos_enable('Shards'), + define_trilinos_enable('ShyLU'), + define_trilinos_enable('STK'), + define_trilinos_enable('Stratimikos'), + define_trilinos_enable('Teko'), + define_trilinos_enable('Tempus'), + define_trilinos_enable('Teuchos'), + define_trilinos_enable('Tpetra'), + define_trilinos_enable('Zoltan'), + define_trilinos_enable('Zoltan2'), + ]) + + options.append(self.define_from_variant('USE_XSDK_DEFAULTS', + 'xsdkflags')) + + if '+dtk' in spec: + options.extend([ + define('Trilinos_EXTRA_REPOSITORIES', 'DataTransferKit'), + define('Trilinos_ENABLE_DataTransferKit', True), + ]) + + if '+exodus' in spec: + options.extend([ + define('Trilinos_ENABLE_SEACAS', True), + define('Trilinos_ENABLE_SEACASExodus', True), + define('Trilinos_ENABLE_SEACASIoss', True), + define('Trilinos_ENABLE_SEACASEpu', True), + define('Trilinos_ENABLE_SEACASExodiff', True), + define('Trilinos_ENABLE_SEACASNemspread', True), + define('Trilinos_ENABLE_SEACASNemslice', True), + ]) + else: + options.extend([ + define('Trilinos_ENABLE_SEACASExodus', False), + define('Trilinos_ENABLE_SEACASIoss', False), + ]) + + if '+chaco' in spec: + options.extend([ + define('Trilinos_ENABLE_SEACAS', True), + define('Trilinos_ENABLE_SEACASChaco', True), + ]) + else: + # don't disable SEACAS, could be needed elsewhere + options.extend([ + define('Trilinos_ENABLE_SEACASChaco', False), + define('Trilinos_ENABLE_SEACASNemslice', False) + ]) + + if '+stratimikos' in spec: + # Explicitly enable Thyra (ThyraCore is required). If you don't do + # this, then you get "NOT setting ${pkg}_ENABLE_Thyra=ON since + # Thyra is NOT enabled at this point!" leading to eventual build + # errors if using MueLu because `Xpetra_ENABLE_Thyra` is set to + # off. + options.append(define('Trilinos_ENABLE_Thyra', True)) + + # Add thyra adapters based on package enables + options.extend( + define_trilinos_enable('Thyra' + pkg + 'Adapters', pkg.lower()) + for pkg in ['Epetra', 'EpetraExt', 'Tpetra']) + + # ######################### TPLs ############################# + + blas = spec['blas'].libs + lapack = spec['lapack'].libs + options.extend([ + define('TPL_ENABLE_BLAS', True), + define('BLAS_LIBRARY_NAMES', blas.names), + define('BLAS_LIBRARY_DIRS', blas.directories), + define('TPL_ENABLE_LAPACK', True), + define('LAPACK_LIBRARY_NAMES', lapack.names), + define('LAPACK_LIBRARY_DIRS', lapack.directories), + define_tpl_enable('GLM'), + define_tpl_enable('Matio'), + define_tpl_enable('X11'), + define_trilinos_enable('Gtest', 'gtest'), + ]) + + if '^intel-mkl' in spec: + options.extend([define('TPL_ENABLE_MKL', True), + define('TPL_MKL_INCLUDE_DIRS', spec['intel-mkl'].prefix.include), + define('TPL_MKL_LIBRARIES', ';'.join(spec['intel-mkl'].libs))]) + + options.append(define_tpl_enable('Netcdf')) + if '+netcdf' in spec: + options.append(define('NetCDF_ROOT', spec['netcdf-c'].prefix)) + + options.append(define_tpl_enable('HYPRE')) + if '+hypre' in spec: + options.extend([ + define('HYPRE_INCLUDE_DIRS', spec['hypre'].prefix.include), + define('HYPRE_LIBRARY_DIRS', spec['hypre'].prefix.lib), + ]) + + options.append(define_tpl_enable('Boost')) + if '+boost' in spec: + options.extend([ + define('Boost_INCLUDE_DIRS', spec['boost'].prefix.include), + define('Boost_LIBRARY_DIRS', spec['boost'].prefix.lib), + ]) + + options.append(define_tpl_enable('HDF5')) + if '+hdf5' in spec: + options.extend([ + define('HDF5_INCLUDE_DIRS', spec['hdf5'].prefix.include), + define('HDF5_LIBRARY_DIRS', spec['hdf5'].prefix.lib), + ]) + + if '+suite-sparse' in spec: + options.extend([ + # FIXME: Trilinos seems to be looking for static libs only, + # patch CMake TPL file? + define('TPL_ENABLE_Cholmod', False), + # define('TPL_ENABLE_Cholmod', True), + # define('Cholmod_LIBRARY_DIRS', ( + # spec['suite-sparse'].prefix.lib) + # define('Cholmod_INCLUDE_DIRS', ( + # spec['suite-sparse'].prefix.include) + define('TPL_ENABLE_UMFPACK', True), + define('UMFPACK_LIBRARY_DIRS', + spec['suite-sparse'].prefix.lib), + define('UMFPACK_INCLUDE_DIRS', + spec['suite-sparse'].prefix.include), + define('UMFPACK_LIBRARY_NAMES', [ + 'umfpack', 'amd', 'colamd', 'cholmod', 'suitesparseconfig' + ]), + ]) + else: + options.extend([ + define('TPL_ENABLE_Cholmod', False), + define('TPL_ENABLE_UMFPACK', False), + ]) + + options.append(define_tpl_enable('METIS')) + options.append(define_tpl_enable('ParMETIS', 'metis')) + if '+metis' in spec: + options.extend([ + define('METIS_LIBRARY_DIRS', spec['metis'].prefix.lib), + define('METIS_LIBRARY_NAMES', 'metis'), + define('TPL_METIS_INCLUDE_DIRS', spec['metis'].prefix.include), + define('TPL_ENABLE_ParMETIS', True), + define('ParMETIS_LIBRARY_DIRS', [ + spec['parmetis'].prefix.lib, spec['metis'].prefix.lib + ]), + define('ParMETIS_LIBRARY_NAMES', ['parmetis', 'metis']), + define('TPL_ParMETIS_INCLUDE_DIRS', [ + spec['parmetis'].prefix.include, + spec['metis'].prefix.include + ]), + ]) + + options.append(define_tpl_enable('MUMPS')) + options.append(define_tpl_enable('SCALAPACK', 'mumps')) + if '+mumps' in spec: + scalapack = spec['scalapack'].libs + options.extend([ + define('MUMPS_LIBRARY_DIRS', spec['mumps'].prefix.lib), + # order is important! + define('MUMPS_LIBRARY_NAMES', [ + 'dmumps', 'mumps_common', 'pord' + ]), + define('SCALAPACK_LIBRARY_NAMES', scalapack.names), + define('SCALAPACK_LIBRARY_DIRS', scalapack.directories), + ]) + # see + # https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS + cxx_flags.extend([ + '-DMUMPS_5_0' + ]) + + options.append(define_tpl_enable('SuperLUDist', 'superlu-dist')) + if '+superlu-dist' in spec: + options.extend([ + define('KokkosTSQR_ENABLE_Complex', False), + define('TPL_ENABLE_SuperLUDist', True), + define('SuperLUDist_LIBRARY_DIRS', + spec['superlu-dist'].prefix.lib), + define('SuperLUDist_INCLUDE_DIRS', + spec['superlu-dist'].prefix.include), + ]) + if spec.satisfies('^superlu-dist@4.0:'): + options.extend([ + define('HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG', True), + ]) + + options.append(define_tpl_enable('SuperLU')) + if '+superlu' in spec: + options.extend([ + define('SuperLU_LIBRARY_DIRS', spec['superlu'].prefix.lib), + define('SuperLU_INCLUDE_DIRS', spec['superlu'].prefix.include), + ]) + + options.append(define_tpl_enable('Pnetcdf')) + if '+pnetcdf' in spec: + options.extend([ + define('TPL_Netcdf_Enables_Netcdf4', True), + define('TPL_Netcdf_PARALLEL', True), + define('PNetCDF_ROOT', spec['parallel-netcdf'].prefix), + ]) + + options.append(define_tpl_enable('Zlib')) + if '+zlib' in spec: + options.extend([ + define('TPL_ENABLE_Zlib', True), + define('Zlib_ROOT', spec['zlib'].prefix), + ]) + + options.append(define_tpl_enable('CGNS')) + if '+cgns' in spec: + options.extend([ + define('TPL_ENABLE_CGNS', True), + define('CGNS_INCLUDE_DIRS', spec['cgns'].prefix.include), + define('CGNS_LIBRARY_DIRS', spec['cgns'].prefix.lib), + ]) + + options.append(self.define_from_variant('TPL_ENABLE_ADIOS2', 'adios2')) + + # ################# Miscellaneous Stuff ###################### + + # OpenMP + options.append(define_trilinos_enable('OpenMP')) + if '+openmp' in spec: + options.append(define('Kokkos_ENABLE_OpenMP', True)) + if '+tpetra' in spec: + options.append(define('Tpetra_INST_OPENMP', True)) + + # Fortran lib (assumes clang is built with gfortran!) + if '+fortran' in spec and ( + spec.satisfies('%gcc') or spec.satisfies('%clang') or + spec.satisfies('%apple-clang') + ): + options.append(define('Trilinos_ENABLE_Fortran', True)) + if '+mpi' in spec: + libgfortran = os.path.dirname(os.popen( + '%s --print-file-name libgfortran.a' % + spec['mpi'].mpifc).read()) + options.append(define( + 'Trilinos_EXTRA_LINK_FLAGS', + '-L%s/ -lgfortran' % (libgfortran), + )) + + float_s = '+float' in spec + complex_s = '+complex' in spec + if '+teuchos' in spec: + options.extend([ + define('Teuchos_ENABLE_COMPLEX', complex_s), + define('Teuchos_ENABLE_FLOAT', float_s), + ]) + + # Explicit Template Instantiation (ETI) in Tpetra + # NOTE: Trilinos will soon move to fixed std::uint64_t for GO and + # std::int32_t or std::int64_t for local. + options.append(self.define_from_variant( + 'Trilinos_ENABLE_EXPLICIT_INSTANTIATION', + 'explicit_template_instantiation')) + + if '+explicit_template_instantiation' in spec and '+tpetra' in spec: + options.extend([ + define('Tpetra_INST_DOUBLE', True), + define('Tpetra_INST_COMPLEX_DOUBLE', complex_s), + define('Tpetra_INST_COMPLEX_FLOAT', float_s and complex_s), + define('Tpetra_INST_FLOAT', float_s), + define('Tpetra_INST_SERIAL', True), + ]) + + gotype = spec.variants['gotype'].value + # default in older Trilinos versions to enable multiple GOs + if ((gotype == 'none') and spec.satisfies('@:12.14.1')): + options.extend([ + '-DTpetra_INST_INT_INT:BOOL=ON', + '-DTpetra_INST_INT_LONG:BOOL=ON', + '-DTpetra_INST_INT_LONG_LONG:BOOL=ON' + ]) + # set default GO in newer versions to long + elif (gotype == 'none'): + options.extend([ + '-DTpetra_INST_INT_INT:BOOL=OFF', + '-DTpetra_INST_INT_LONG:BOOL=ON', + '-DTpetra_INST_INT_LONG_LONG:BOOL=OFF' + ]) + # if another GO is specified, use this + else: + options.extend([ + define('Tpetra_INST_INT_INT', gotype == 'int'), + define('Tpetra_INST_INT_LONG', gotype == 'long'), + define('Tpetra_INST_INT_LONG_LONG', gotype == 'long_long'), + ]) + + # disable due to compiler / config errors: + if spec.satisfies('%xl') or spec.satisfies('%xl_r'): + options.extend([ + define('Trilinos_ENABLE_Pamgen', False), + define('Trilinos_ENABLE_Stokhos', False), + ]) + + if sys.platform == 'darwin': + options.append(define('Trilinos_ENABLE_FEI', False)) + + if sys.platform == 'darwin' and macos_version() >= Version('10.12'): + # use @rpath on Sierra due to limit of dynamic loader + options.append(define('CMAKE_MACOSX_RPATH', True)) + else: + options.append(define('CMAKE_INSTALL_NAME_DIR', self.prefix.lib)) + + if spec.satisfies('%intel') and spec.satisfies('@12.6.2'): + # Panzer uses some std:chrono that is not recognized by Intel + # Don't know which (maybe all) Trilinos versions this applies to + # Don't know which (maybe all) Intel versions this applies to + options.append(define('Trilinos_ENABLE_Panzer', False)) + + # collect CXX flags: + options.append(define('CMAKE_CXX_FLAGS', (' '.join(cxx_flags)))) + + # disable due to compiler / config errors: + options.append(define('Trilinos_ENABLE_Pike', False)) + + return options + + @run_after('install') + def filter_python(self): + # When trilinos is built with Python, libpytrilinos is included + # through cmake configure files. Namely, Trilinos_LIBRARIES in + # TrilinosConfig.cmake contains pytrilinos. This leads to a + # run-time error: Symbol not found: _PyBool_Type and prevents + # Trilinos to be used in any C++ code, which links executable + # against the libraries listed in Trilinos_LIBRARIES. See + # https://github.com/Homebrew/homebrew-science/issues/2148#issuecomment-103614509 + # A workaround is to remove PyTrilinos from the COMPONENTS_LIST : + if '+python' in self.spec: + filter_file(r'(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)', + (r'\1\3'), + '%s/cmake/Trilinos/TrilinosConfig.cmake' % + self.prefix.lib) + + def setup_run_environment(self, env): + if '+exodus' in self.spec: + env.prepend_path('PYTHONPATH', + self.prefix.lib) diff --git a/scripts/uberenv/packages/umpire/package.py b/scripts/uberenv/packages/umpire/package.py new file mode 100644 index 00000000..420a23a4 --- /dev/null +++ b/scripts/uberenv/packages/umpire/package.py @@ -0,0 +1,108 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack import * + + +class Umpire(CMakePackage, CudaPackage): + """An application-focused API for memory management on NUMA & GPU + architectures""" + + homepage = 'https://github.com/LLNL/Umpire' + git = 'https://github.com/LLNL/Umpire.git' + + version('develop', branch='develop', submodules='True') + version('main', branch='main', submodules='True') + version('4.1.2', tag='v4.1.2', submodules='True') + version('4.1.1', tag='v4.1.1', submodules='True') + version('4.1.0', tag='v4.1.0', submodules='True') + version('4.0.1', tag='v4.0.1', submodules='True') + version('4.0.0', tag='v4.0.0', submodules='True') + version('3.0.0', tag='v3.0.0', submodules='True') + version('2.1.0', tag='v2.1.0', submodules='True') + version('2.0.0', tag='v2.0.0', submodules='True') + version('1.1.0', tag='v1.1.0', submodules='True') + version('1.0.1', tag='v1.0.1', submodules='True') + version('1.0.0', tag='v1.0.0', submodules='True') + version('0.3.5', tag='v0.3.5', submodules='True') + version('0.3.4', tag='v0.3.4', submodules='True') + version('0.3.3', tag='v0.3.3', submodules='True') + version('0.3.2', tag='v0.3.2', submodules='True') + version('0.3.1', tag='v0.3.1', submodules='True') + version('0.3.0', tag='v0.3.0', submodules='True') + version('0.2.4', tag='v0.2.4', submodules='True') + version('0.2.3', tag='v0.2.3', submodules='True') + version('0.2.2', tag='v0.2.2', submodules='True') + version('0.2.1', tag='v0.2.1', submodules='True') + version('0.2.0', tag='v0.2.0', submodules='True') + version('0.1.4', tag='v0.1.4', submodules='True') + version('0.1.3', tag='v0.1.3', submodules='True') + + patch('camp_target_umpire_3.0.0.patch', when='@3.0.0') + + variant('fortran', default=False, description='Build C/Fortran API') + variant('c', default=True, description='Build C API') + variant('numa', default=False, description='Enable NUMA support') + variant('shared', default=True, description='Enable Shared libs') + variant('openmp', default=False, description='Build with OpenMP support') + variant('deviceconst', default=False, + description='Enables support for constant device memory') + variant('examples', default=True, description='Build Umpire Examples') + variant('tests', default='none', values=('none', 'basic', 'benchmarks'), + multi=False, description='Tests to run') + + depends_on('cmake@3.8:', type='build') + depends_on('cmake@3.9:', when='+cuda', type='build') + + conflicts('+numa', when='@:0.3.2') + conflicts('~c', when='+fortran', msg='Fortran API requires C API') + + def cmake_args(self): + spec = self.spec + + options = [] + + if '+cuda' in spec: + options.extend([ + '-DENABLE_CUDA=On', + '-DCUDA_TOOLKIT_ROOT_DIR=%s' % (spec['cuda'].prefix)]) + + if not spec.satisfies('cuda_arch=none'): + cuda_arch = spec.variants['cuda_arch'].value + options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) + flag = '-arch sm_{0}'.format(cuda_arch[0]) + options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag)) + + if '+deviceconst' in spec: + options.append('-DENABLE_DEVICE_CONST=On') + else: + options.append('-DENABLE_CUDA=Off') + + options.append('-DENABLE_C={0}'.format( + 'On' if '+c' in spec else 'Off')) + + options.append('-DENABLE_FORTRAN={0}'.format( + 'On' if '+fortran' in spec else 'Off')) + + options.append('-DENABLE_NUMA={0}'.format( + 'On' if '+numa' in spec else 'Off')) + + options.append('-DENABLE_OPENMP={0}'.format( + 'On' if '+openmp' in spec else 'Off')) + + options.append('-DBUILD_SHARED_LIBS={0}'.format( + 'On' if '+shared' in spec else 'Off')) + + options.append('-DENABLE_BENCHMARKS={0}'.format( + 'On' if 'tests=benchmarks' in spec else 'Off')) + + options.append('-DENABLE_EXAMPLES={0}'.format( + 'On' if '+examples' in spec else 'Off')) + + options.append('-DENABLE_TESTS={0}'.format( + 'Off' if 'tests=none' in spec else 'On')) + + return options diff --git a/scripts/uberenv/packages/uncrustify/package.py b/scripts/uberenv/packages/uncrustify/package.py new file mode 100644 index 00000000..dc584241 --- /dev/null +++ b/scripts/uberenv/packages/uncrustify/package.py @@ -0,0 +1,44 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Uncrustify(Package): + """Source Code Beautifier for C, C++, C#, ObjectiveC, Java, and others.""" + + homepage = "https://github.com/uncrustify/uncrustify" + git = "https://github.com/uncrustify/uncrustify.git" + + version('master', branch='master') + version('0.71.0', tag='uncrustify-0.71.0') + version('0.70.1', tag='uncrustify-0.70.1') + version('0.70.0', tag='uncrustify-0.70') + version('0.69.0', tag='uncrustify-0.69.0') + version('0.68.1', tag='uncrustify-0.68.1') + version('0.68', tag='uncrustify-0.68') + version('0.67', tag='uncrustify-0.67') + version('0.66.1', tag='uncrustify-0.66.1') + version('0.66', tag='uncrustify-0.66') + version('0.65', tag='uncrustify-0.65') + version('0.64', tag='uncrustify-0.64') + version('0.63', tag='uncrustify-0.63') + version('0.62', tag='uncrustify-0.62') + version('0.61', tag='uncrustify-0.61') + + depends_on('cmake', type='build', when='@0.64:') + + @when('@0.64:') + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + cmake('..', *std_cmake_args) + make() + make('install') + + @when('@:0.62') + def install(self, spec, prefix): + configure('--prefix={0}'.format(self.prefix)) + make() + make('install') diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml new file mode 100644 index 00000000..309203cf --- /dev/null +++ b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml @@ -0,0 +1,31 @@ +compilers: +- compiler: + spec: clang@10.0.1 + paths: + cc: /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/bin/clang + cxx: /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + cflags: -mcpu=native -mtune=native -Wl,--no-toc-optimize + cxxflags: -mcpu=native -mtune=native -Wl,--no-toc-optimize + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] +- compiler: + spec: gcc@8.3.1 + paths: + cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + cflags: -mcpu=native -mtune=native + cxxflags: -mcpu=native -mtune=native + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml new file mode 100644 index 00000000..b5eacf9e --- /dev/null +++ b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml @@ -0,0 +1,71 @@ +packages: + all: + target: [default] + compiler: [gcc, clang] + providers: + mpi: [spectrum-mpi] + blas: [essl] + lapack: [essl] + + cuda: + buildable: False + externals: + - spec: cuda@10.1.243 + modules: + - cuda/10.1.243 + + spectrum-mpi: + buildable: False + externals: + - spec: spectrum-mpi@10.3.1.03rtm0 %gcc@8.3.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/ + - spec: spectrum-mpi@10.3.1.03rtm0 %clang@10.0.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-10.0.1-gcc-8.3.1/ + + netlib-lapack: + buildable: false + externals: + - spec: netlib-lapack@3.6.1 + prefix: /usr/lib64 + + essl: + buildable: False + externals: + - spec: essl@6.2.1 ~ilp64 threads=openmp +cuda +lapack + prefix: /usr/tcetmp/packages/essl/essl-6.2.1/ + + cmake: + buildable: False + externals: + - spec: cmake@3.14.5 + prefix: /usr/tce/packages/cmake/cmake-3.14.5 + + readline: + buildable: False + externals: + - spec: readline@6.2 + prefix: /usr/lib64/ + + zlib: + buildable: False + externals: + - spec: zlib@1.2.7 + prefix: /usr/ + + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr/bin/ + + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin/ + + python: + buildable: False + externals: + - spec: python@3.8.2 + prefix: /usr/tce/packages/python/python-3.8.2/ diff --git a/scripts/uberenv/spack_configs/config.yaml b/scripts/uberenv/spack_configs/config.yaml new file mode 100644 index 00000000..9a6f85c8 --- /dev/null +++ b/scripts/uberenv/spack_configs/config.yaml @@ -0,0 +1,78 @@ +# ------------------------------------------------------------------------- +# This is the default spack configuration file. +# +# Settings here are versioned with Spack and are intended to provide +# sensible defaults out of the box. Spack maintainers should edit this +# file to keep it current. +# +# Users can override these settings by editing the following files. +# +# Per-spack-instance settings (overrides defaults): +# $SPACK_ROOT/etc/spack/config.yaml +# Per-user settings (overrides default and site settings): +# ~/.spack/config.yaml +# +# See https://spack.readthedocs.io/en/latest/config_yaml.html +# ------------------------------------------------------------------------- +config: + # This is the path to the root of the Spack install tree. + # You can use $spack here to refer to the root of the spack instance. + install_tree: $spack/.. + + # Locations where templates should be found + template_dirs: + - $spack/templates + + # install directory layout + install_path_scheme: "${ARCHITECTURE}-${COMPILERNAME}@${COMPILERVER}/${PACKAGE}@${VERSION}" + + # Locations where different types of modules should be installed. + module_roots: + tcl: $spack/share/spack/modules + lmod: $spack/share/spack/lmod + + + # Temporary locations Spack can try to use for builds. + # + # Spack will use the first one it finds that exists and is writable. + # You can use $tempdir to refer to the system default temp directory + # (as returned by tempfile.gettempdir()). + # + # A value of $spack/var/spack/stage indicates that Spack should run + # builds directly inside its install directory without staging them in + # temporary space. + # + # The build stage can be purged with `spack purge --stage`. + build_stage: + - $spack/../builds + + + # Cache directory already downloaded source tarballs and archived + # repositories. This can be purged with `spack purge --downloads`. + source_cache: $spack/var/spack/cache + + + # Cache directory for miscellaneous files, like the package index. + # This can be purged with `spack purge --misc-cache` + misc_cache: .spack/misccache + + + # If this is false, tools like curl that use SSL will not verify + # certifiates. (e.g., curl will use use the -k option) + verify_ssl: true + + + # If set to true, Spack will always check checksums after downloading + # archives. If false, Spack skips the checksum step. + checksum: true + + + # If set to true, `spack install` and friends will NOT clean + # potentially harmful variables from the build environment. Use wisely. + dirty: false + + + # The default number of jobs to use when running `make` in parallel. + # Spack will use up to this many jobs but limits it to the physical core count. + # The default value is 16. + build_jobs: 1000 diff --git a/scripts/uberenv/spack_configs/darwin/compilers.yaml b/scripts/uberenv/spack_configs/darwin/compilers.yaml new file mode 100644 index 00000000..00889a4a --- /dev/null +++ b/scripts/uberenv/spack_configs/darwin/compilers.yaml @@ -0,0 +1,17 @@ +compilers: +- compiler: + spec: clang@12.0.0-apple + paths: + cc: /usr/bin/clang + cxx: /usr/bin/clang++ + f77: /usr/local/bin/gfortran + fc: /usr/local/bin/gfortran + flags: + cflags: + cxxflags: + fflags: + operating_system: catalina + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] diff --git a/scripts/uberenv/spack_configs/darwin/packages.yaml b/scripts/uberenv/spack_configs/darwin/packages.yaml new file mode 100644 index 00000000..5b05bd37 --- /dev/null +++ b/scripts/uberenv/spack_configs/darwin/packages.yaml @@ -0,0 +1,134 @@ +packages: + all: + target: [default] + compiler: [clang] + providers: + mpi: [openmpi] + blas: [netlib-lapack] + lapack: [netlib-lapack] + + openmpi: + buildable: False + externals: + - spec: openmpi@4.0.5 + prefix: /usr/local/Cellar/open-mpi/4.0.5/ + + netlib-lapack: + buildable: False + externals: + - spec: netlib-lapack + prefix: /usr/lib/ + + cmake: + buildable: False + externals: + - spec: cmake@3.18.4 + prefix: /usr/local/Cellar/cmake/3.18.4/ + + readline: + buildable: False + externals: + - spec: readline + prefix: /usr/lib/ + + zlib: + buildable: False + externals: + - spec: zlib@1.2.11 + prefix: /usr/lib/ + + m4: + buildable: False + externals: + - spec: m4@1.4.6 + prefix: /usr/bin/ + + diffutils: + buildable: False + externals: + - spec: diffutils@2.8.1 + prefix: /usr/bin/ + + python: + buildable: False + externals: + - spec: python@3.8.6 + prefix: /usr/local/Cellar/python@3.8/3.8.6/ + + # py-sphinx: + # buildable: False + # externals: + # - spec: py-sphinx@1.6.3 + # prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ + # + # bison: + # buildable: False + # externals: + # - spec: bison@3.0.4 + # prefix: /usr/bin/ + # + # flex: + # buildable: False + # externals: + # - spec: flex@2.5.37 + # prefix: /usr/bin/ + # + # bzip2: + # buildable: False + # externals: + # - spec: bzip2@1.0.6 + # prefix: /usr/bin/ + # + # expat: + # buildable: False + # externals: + # - spec: expat@1.6.0 + # prefix: /usr/lib64/ + # + # gdbm: + # buildable: False + # externals: + # - spec: gdbm@4.0.0 + # prefix: /usr/lib64/ + # + # gettext: + # buildable: False + # externals: + # - spec: gettext@0.19.8.1 + # prefix: /usr/bin/ + # + # openssl: + # buildable: False + # externals: + # - spec: openssl@1.0.2 + # prefix: /usr/bin/ + # + # libffi: + # buildable: False + # externals: + # - spec: libffi@6.0.1 + # prefix: /usr/lib64/ + # + # libuuid: + # buildable: False + # externals: + # - spec: libuuid@1.3.0 + # prefix: /usr/lib64/ + # + # ncurses: + # buildable: False + # externals: + # - spec: ncurses@5.9 + # prefix: /usr/lib64/ + # + # xz: + # buildable: False + # externals: + # - spec: xz@5.2.2 + # prefix: /usr/bin/ + # + # pkg-config: + # buildable: False + # externals: + # - spec: pkg-config@0.27.1 + # prefix: /usr/bin/ diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml new file mode 100644 index 00000000..5661ef53 --- /dev/null +++ b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml @@ -0,0 +1,49 @@ +compilers: +- compiler: + spec: clang@10.0.1 + paths: + cc: /usr/tce/packages/clang/clang-10.0.1/bin/clang + cxx: /usr/tce/packages/clang/clang-10.0.1/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + cflags: -march=native -mtune=native + cxxflags: -march=native -mtune=native + fflags: -march=native -mtune=native + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] +- compiler: + spec: gcc@8.3.1 + paths: + cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + cflags: -march=native -mtune=native + cxxflags: -march=native -mtune=native + fflags: -march=native -mtune=native + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] +- compiler: + spec: intel@19.1.2 + paths: + cc: /usr/tce/packages/intel/intel-19.1.2/bin/icc + cxx: /usr/tce/packages/intel/intel-19.1.2/bin/icpc + f77: /usr/tce/packages/intel/intel-19.1.2/bin/ifort + fc: /usr/tce/packages/intel/intel-19.1.2/bin/ifort + flags: + cflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc -march=native -mtune=native + cxxflags: -gxx-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ -march=native -mtune=native + fflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc -march=native -mtune=native + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml new file mode 100644 index 00000000..9cb6322f --- /dev/null +++ b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml @@ -0,0 +1,142 @@ +packages: + all: + target: [default] + compiler: [gcc, clang, intel] + providers: + mpi: [mvapich2] + blas: [intel-mkl] + lapack: [intel-mkl] + + mvapich2: + buildable: False + externals: + - spec: mvapich2@2.3 %gcc@8.3.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/ + - spec: mvapich2@2.3 %clang@10.0.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.1 + + intel-mkl: + buildable: False + externals: + - spec: intel-mkl@2020.0.166 threads=openmp + prefix: /usr/tce/packages/mkl/mkl-2020.0/ + + papi: + buildable: False + externals: + - spec: papi@5.5.1 + prefix: /usr/tce/packages/papi/papi-5.5.1/ + + cmake: + buildable: False + externals: + - spec: cmake@3.14.5 + prefix: /usr/tce/packages/cmake/cmake-3.14.5/ + + readline: + buildable: False + externals: + - spec: readline@6.2 + prefix: /usr/lib64/ + + zlib: + buildable: False + externals: + - spec: zlib@1.2.7 + prefix: /usr/ + + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr/bin + + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin + + python: + buildable: False + externals: + - spec: python@3.8.2 + prefix: /usr/tce/packages/python/python-3.8.2/ + + py-sphinx: + buildable: False + externals: + - spec: py-sphinx@1.6.3 + prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ + + bison: + buildable: False + externals: + - spec: bison@3.0.4 + prefix: /usr/bin/ + + flex: + buildable: False + externals: + - spec: flex@2.5.37 + prefix: /usr/bin/ + + bzip2: + buildable: False + externals: + - spec: bzip2@1.0.6 + prefix: /usr/bin/ + + expat: + buildable: False + externals: + - spec: expat@1.6.0 + prefix: /usr/lib64/ + + gdbm: + buildable: False + externals: + - spec: gdbm@4.0.0 + prefix: /usr/lib64/ + + gettext: + buildable: False + externals: + - spec: gettext@0.19.8.1 + prefix: /usr/bin/ + + openssl: + buildable: False + externals: + - spec: openssl@1.0.2 + prefix: /usr/bin/ + + libffi: + buildable: False + externals: + - spec: libffi@6.0.1 + prefix: /usr/lib64/ + + libuuid: + buildable: False + externals: + - spec: libuuid@1.3.0 + prefix: /usr/lib64/ + + ncurses: + buildable: False + externals: + - spec: ncurses@5.9 + prefix: /usr/lib64/ + + xz: + buildable: False + externals: + - spec: xz@5.2.2 + prefix: /usr/bin/ + + pkg-config: + buildable: False + externals: + - spec: pkg-config@0.27.1 + prefix: /usr/bin/ From f5d63f6f8ddefd376b5ffbbaba32a1d1d802d16b Mon Sep 17 00:00:00 2001 From: Ben Corbett <32752943+corbett5@users.noreply.github.com> Date: Thu, 11 Feb 2021 16:58:33 -0800 Subject: [PATCH 02/48] Python interface (#1068) * Add current GEOSX compilers to spack. * Added python interface. * Removed static variables. * Python improvements. * Removed std::string. Co-authored-by: Randolph R. Settgast --- scripts/uberenv/packages/adiak/package.py | 41 - scripts/uberenv/packages/chai/package.py | 77 -- scripts/uberenv/packages/essl/package.py | 104 --- scripts/uberenv/packages/geosx/package.py | 9 +- scripts/uberenv/packages/hypre/package.py | 207 ----- scripts/uberenv/packages/petsc/package.py | 503 ----------- scripts/uberenv/packages/py-numpy/package.py | 319 ------- scripts/uberenv/packages/py-scipy/package.py | 124 --- .../packages/py-scipy/scipy-clang.patch | 13 - scripts/uberenv/packages/raja/package.py | 77 -- scripts/uberenv/packages/silo/package.py | 121 --- .../uberenv/packages/suite-sparse/package.py | 211 ----- scripts/uberenv/packages/trilinos/package.py | 813 ------------------ scripts/uberenv/packages/umpire/package.py | 108 --- .../uberenv/packages/uncrustify/package.py | 44 - .../blueos_3_ppc64le_ib_p9/packages.yaml | 20 +- .../compilers.yaml | 31 + .../packages.yaml | 132 +++ .../toss_3_x86_64_ib/compilers.yaml | 32 + .../toss_3_x86_64_ib/packages.yaml | 72 -- .../toss_3_x86_64_ib_python/compilers.yaml | 1 + .../toss_3_x86_64_ib_python/packages.yaml | 146 ++++ 22 files changed, 354 insertions(+), 2851 deletions(-) delete mode 100644 scripts/uberenv/packages/adiak/package.py delete mode 100644 scripts/uberenv/packages/chai/package.py delete mode 100644 scripts/uberenv/packages/essl/package.py delete mode 100644 scripts/uberenv/packages/hypre/package.py delete mode 100644 scripts/uberenv/packages/petsc/package.py delete mode 100644 scripts/uberenv/packages/py-numpy/package.py delete mode 100644 scripts/uberenv/packages/py-scipy/package.py delete mode 100644 scripts/uberenv/packages/py-scipy/scipy-clang.patch delete mode 100644 scripts/uberenv/packages/raja/package.py delete mode 100644 scripts/uberenv/packages/silo/package.py delete mode 100644 scripts/uberenv/packages/suite-sparse/package.py delete mode 100644 scripts/uberenv/packages/trilinos/package.py delete mode 100644 scripts/uberenv/packages/umpire/package.py delete mode 100644 scripts/uberenv/packages/uncrustify/package.py create mode 100644 scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/compilers.yaml create mode 100644 scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/packages.yaml create mode 120000 scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/compilers.yaml create mode 100644 scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/packages.yaml diff --git a/scripts/uberenv/packages/adiak/package.py b/scripts/uberenv/packages/adiak/package.py deleted file mode 100644 index d7d11ef0..00000000 --- a/scripts/uberenv/packages/adiak/package.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class Adiak(CMakePackage): - """Adiak collects metadata about HPC application runs and provides it - to tools.""" - - homepage = "https://github.com/LLNL/Adiak" - git = "https://github.com/LLNL/Adiak.git" - - version('master', branch='master', submodules='True') - version('0.2.1', tag='v0.2.1', submodules="True") - version('0.2.0', tag='v0.2.0', submodules="True") - version('0.1.1', tag='v0.1', submodules="True") - - variant('mpi', default=True, description='Build with MPI support') - variant('shared', default=True, description='Build dynamic libraries') - - depends_on('mpi', when='+mpi') - - def cmake_args(self): - args = [] - if self.spec.satisfies('+mpi'): - args.append('-DMPICXX=%s' % self.spec['mpi'].mpicxx) - args.append('-DMPICC=%s' % self.spec['mpi'].mpicc) - args.append('-DENABLE_MPI=ON') - else: - args.append('-DENABLE_MPI=OFF') - - if (self.spec.satisfies('+shared')): - args.append('-DBUILD_SHARED_LIBS=ON') - else: - args.append('-DBUILD_SHARED_LIBS=OFF') - - args.append('-DENABLE_TESTS=OFF') - return args diff --git a/scripts/uberenv/packages/chai/package.py b/scripts/uberenv/packages/chai/package.py deleted file mode 100644 index e4cdd23f..00000000 --- a/scripts/uberenv/packages/chai/package.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class Chai(CMakePackage, CudaPackage): - """ - Copy-hiding array interface for data migration between memory spaces - """ - - homepage = "https://github.com/LLNL/CHAI" - git = "https://github.com/LLNL/CHAI.git" - - version('develop', branch='develop', submodules='True') - version('master', branch='main', submodules='True') - version('2.3.0', tag='v2.3.0', submodules='True') - version('2.2.2', tag='v2.2.2', submodules='True') - version('2.2.1', tag='v2.2.1', submodules='True') - version('2.2.0', tag='v2.2.0', submodules='True') - version('2.1.1', tag='v2.1.1', submodules='True') - version('2.1.0', tag='v2.1.0', submodules='True') - version('2.0.0', tag='v2.0.0', submodules='True') - version('1.2.0', tag='v1.2.0', submodules='True') - version('1.1.0', tag='v1.1.0', submodules='True') - version('1.0', tag='v1.0', submodules='True') - - variant('shared', default=True, description='Build Shared Libs') - variant('raja', default=False, description='Build plugin for RAJA') - variant('benchmarks', default=True, description='Build benchmarks.') - variant('examples', default=True, description='Build examples.') - - depends_on('cmake@3.8:', type='build') - depends_on('umpire') - depends_on('raja', when="+raja") - - depends_on('cmake@3.9:', type='build', when="+cuda") - depends_on('umpire+cuda', when="+cuda") - depends_on('raja+cuda', when="+raja+cuda") - - def cmake_args(self): - spec = self.spec - - options = [] - - if '+cuda' in spec: - options.extend([ - '-DENABLE_CUDA=ON', - '-DCUDA_TOOLKIT_ROOT_DIR=' + spec['cuda'].prefix]) - - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) - flag = '-arch sm_{0}'.format(cuda_arch[0]) - options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag)) - else: - options.append('-DENABLE_CUDA=OFF') - - if '+raja' in spec: - options.extend(['-DENABLE_RAJA_PLUGIN=ON', - '-DRAJA_DIR=' + spec['raja'].prefix]) - - options.append('-Dumpire_DIR:PATH=' - + spec['umpire'].prefix.share.umpire.cmake) - - options.append('-DENABLE_TESTS={0}'.format( - 'ON' if self.run_tests else 'OFF')) - - options.append('-DENABLE_BENCHMARKS={0}'.format( - 'ON' if '+benchmarks' in spec else 'OFF')) - - options.append('-DENABLE_EXAMPLES={0}'.format( - 'ON' if '+examples' in spec else 'OFF')) - - return options diff --git a/scripts/uberenv/packages/essl/package.py b/scripts/uberenv/packages/essl/package.py deleted file mode 100644 index d4b3df31..00000000 --- a/scripts/uberenv/packages/essl/package.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - -class Essl(Package): - """IBM's Engineering and Scientific Subroutine Library (ESSL).""" - - # homepage = "https://www.ibm.com/systems/power/software/essl/" - - variant('ilp64', default=False, description='64 bit integers') - variant( - 'threads', default='openmp', - description='Multithreading support', - values=('openmp', 'none'), - multi=False - ) - variant('cuda', default=False, description='CUDA acceleration') - variant('lapack', default=False, description='Support lapack interface.') - - depends_on('cuda', when='+cuda') - - provides('blas') - provides('lapack', when='+lapack') - - conflicts('+cuda', when='+ilp64', - msg='ESSL+cuda+ilp64 cannot combine CUDA acceleration' - ' 64 bit integers') - - conflicts('+cuda', when='threads=none', - msg='ESSL+cuda threads=none cannot combine CUDA acceleration' - ' without multithreading support') - - @property - def blas_libs(self): - spec = self.spec - - if '+ilp64' in spec: - essl_lib = ['libessl6464'] - else: - essl_lib = ['libessl'] - - if spec.satisfies('threads=openmp'): - # ESSL SMP support requires XL or Clang OpenMP library - if '%xl' in spec or '%xl_r' in spec or '%clang' in spec: - if '+ilp64' in spec: - essl_lib = ['libesslsmp6464'] - else: - if '+cuda' in spec: - essl_lib = ['libesslsmpcuda'] - else: - essl_lib = ['libesslsmp'] - - essl_libs = find_libraries( - essl_lib, - root=self.prefix.lib64, - shared=True - ) - - if '+cuda' in spec: - essl_libs += ['/usr/tce/packages/cuda/cuda-10.1.243/lib64/libcublas.so', - '/usr/tce/packages/cuda/cuda-10.1.243/lib64/libcudart.so'] - # essl_libs += spec['cuda'].libs - - if spec.satisfies('threads=openmp'): - if '%gcc' in self.spec: - gcc = Executable(self.compiler.cc) - omp_lib_path = gcc('--print-file-name', 'libgomp.so', output=str) - omp_libs = LibraryList(omp_lib_path.strip()) - - elif '%clang' in self.spec: - clang = Executable(self.compiler.cc) - omp_lib_path = clang('--print-file-name', 'libomp.so', output=str) - omp_libs = LibraryList(omp_lib_path.strip()) - - essl_libs += omp_libs - - return essl_libs - - @property - def lapack_libs(self): - essl_libs = self.blas_libs - essl_libs += find_libraries( - ['liblapackforessl'], - # ['liblapackforessl', 'liblapackforessl_'], - root=self.prefix.lib64, - shared=True - ) - - return essl_libs - - @property - def libs(self): - result = self.blas_libs - if '+lapack' in self.spec: - result += self.lapack_libs - - return result - - def install(self, spec, prefix): - raise InstallError('IBM ESSL is not installable;' - ' it is vendor supplied') diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index 490d66da..d7b076ff 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -134,7 +134,7 @@ class Geosx(CMakePackage, CudaPackage): depends_on('trilinos +blas_lowercase_no_underscore', when='+trilinos +essl') # depends_on('trilinos +force-new-lapack', when='+trilinos +essl') - depends_on('hypre@2.20.0: +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') + depends_on('hypre@2.21.0: +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') petsc_build_options = '+shared +mpi' petsc_tpls = '+metis ~hdf5 ~hypre +superlu-dist +int64' @@ -143,10 +143,11 @@ class Geosx(CMakePackage, CudaPackage): # # Python # - depends_on('python +shared +pic ~sqlite3', when='+pygeosx') + depends_on('python +shared +pic', when='+pygeosx') depends_on('py-numpy@1.19: +blas +lapack +force-parallel-build', when='+pygeosx') depends_on('py-scipy@1.5.2: +force-parallel-build', when='+pygeosx') depends_on('py-mpi4py@3.0.3:', when='+pygeosx') + depends_on('py-pip', when='+pygeosx') # # Dev tools @@ -404,10 +405,10 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write('# Python\n') cfg.write('#{0}\n\n'.format('-' * 80)) if '+pygeosx' in spec: - cfg.write(cmake_cache_option('ENABLE_PYTHON', True)) + cfg.write(cmake_cache_option('ENABLE_PYGEOSX', True)) cfg.write(cmake_cache_entry('Python3_EXECUTABLE', os.path.join(spec['python'].prefix.bin, 'python3'))) else: - cfg.write(cmake_cache_option('ENABLE_PYTHON', False)) + cfg.write(cmake_cache_option('ENABLE_PYGEOSX', False)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Documentation\n') diff --git a/scripts/uberenv/packages/hypre/package.py b/scripts/uberenv/packages/hypre/package.py deleted file mode 100644 index 61bfb59b..00000000 --- a/scripts/uberenv/packages/hypre/package.py +++ /dev/null @@ -1,207 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * -import os -import sys - - -class Hypre(Package): - """Hypre is a library of high performance preconditioners that - features parallel multigrid methods for both structured and - unstructured grid problems.""" - - homepage = "http://computing.llnl.gov/project/linear_solvers/software.php" - url = "https://github.com/hypre-space/hypre/archive/v2.14.0.tar.gz" - git = "https://github.com/hypre-space/hypre.git" - - maintainers = ['ulrikeyang', 'osborn9', 'balay'] - - version('develop', branch='master') - version('2.20.0', sha256='5be77b28ddf945c92cde4b52a272d16fb5e9a7dc05e714fc5765948cba802c01') - version('2.19.0', sha256='466b19d8a86c69989a237f6f03f20d35c0c63a818776d2cd071b0a084cffeba5') - version('2.18.2', sha256='28007b5b584eaf9397f933032d8367788707a2d356d78e47b99e551ab10cc76a') - version('2.18.1', sha256='220f9c4ad024e815add8dad8950eaa2d8f4f231104788cf2a3c5d9da8f94ba6e') - version('2.18.0', sha256='62591ac69f9cc9728bd6d952b65bcadd2dfe52b521081612609804a413f49b07') - version('2.17.0', sha256='4674f938743aa29eb4d775211b13b089b9de84bfe5e9ea00c7d8782ed84a46d7') - version('2.16.0', sha256='33f8a27041e697343b820d0426e74694670f955e21bbf3fcb07ee95b22c59e90') - version('2.15.1', sha256='50d0c0c86b4baad227aa9bdfda4297acafc64c3c7256c27351f8bae1ae6f2402') - version('2.15.0', sha256='2d597472b473964210ca9368b2cb027510fff4fa2193a8c04445e2ed4ff63045') - version('2.14.0', sha256='705a0c67c68936bb011c50e7aa8d7d8b9693665a9709b584275ec3782e03ee8c') - version('2.13.0', sha256='3979602689c3b6e491c7cf4b219cfe96df5a6cd69a5302ccaa8a95ab19064bad') - version('2.12.1', sha256='824841a60b14167a0051b68fdb4e362e0207282348128c9d0ca0fd2c9848785c') - version('2.11.2', sha256='25b6c1226411593f71bb5cf3891431afaa8c3fd487bdfe4faeeb55c6fdfb269e') - version('2.11.1', sha256='6bb2ff565ff694596d0e94d0a75f0c3a2cd6715b8b7652bc71feb8698554db93') - version('2.10.1', sha256='a4a9df645ebdc11e86221b794b276d1e17974887ead161d5050aaf0b43bb183a') - version('2.10.0b', sha256='b55dbdc692afe5a00490d1ea1c38dd908dae244f7bdd7faaf711680059824c11') - version('xsdk-0.2.0', tag='xsdk-0.2.0', git='https://github.com/LLNL/hypre.git') - - # Versions 2.13.0 and later can be patched to build shared - # libraries on Darwin; the patch for this capability does not - # apply to version 2.12.1 and earlier due to changes in the build system - # between versions 2.12.1 and 2.13.0. - variant('shared', default=(sys.platform != 'darwin'), - description="Build shared library (disables static library)") - # Use internal SuperLU routines for FEI - version 2.12.1 and below - variant('internal-superlu', default=False, - description="Use internal SuperLU routines") - variant('superlu-dist', default=False, - description='Activates support for SuperLU_Dist library') - variant('int64', default=False, - description="Use 64bit integers") - variant('mixedint', default=False, - description="Use 64bit integers while reducing memory use") - variant('complex', default=False, description='Use complex values') - variant('mpi', default=True, description='Enable MPI support') - variant('openmp', default=False, description='Enable OpenMP support') - variant('debug', default=False, - description='Build debug instead of optimized version') - - # Patch to add ppc64le in config.guess - patch('ibm-ppc64le.patch', when='@:2.11.1') - - # Patch to build shared libraries on Darwin - patch('darwin-shared-libs-for-hypre-2.13.0.patch', when='+shared@2.13.0 platform=darwin') - patch('darwin-shared-libs-for-hypre-2.14.0.patch', when='+shared@2.14.0 platform=darwin') - patch('superlu-dist-link-2.15.0.patch', when='+superlu-dist @2.15:2.16.0') - patch('superlu-dist-link-2.14.0.patch', when='+superlu-dist @:2.14.0') - patch('hypre21800-compat.patch', when='@2.18.0') - - depends_on("mpi", when='+mpi') - depends_on("blas") - depends_on("lapack") - depends_on('superlu-dist', when='+superlu-dist+mpi') - - # Patch to build shared libraries on Darwin does not apply to - # versions before 2.13.0 - conflicts("+shared@:2.12.99 platform=darwin") - - # Conflicts - # Option added in v2.13.0 - conflicts('+superlu-dist', when='@:2.12.99') - - # Internal SuperLU Option removed in v2.13.0 - conflicts('+internal-superlu', when='@2.13.0:') - - # Option added in v2.16.0 - conflicts('+mixedint', when='@:2.15.99') - - def url_for_version(self, version): - if version >= Version('2.12.0'): - url = 'https://github.com/hypre-space/hypre/archive/v{0}.tar.gz' - else: - url = 'http://computing.llnl.gov/project/linear_solvers/download/hypre-{0}.tar.gz' - - return url.format(version) - - def install(self, spec, prefix): - # Note: --with-(lapack|blas)_libs= needs space separated list of names - lapack_libs = spec['lapack'].libs - blas_libs = spec['blas'].libs - - configure_args = [ - '--prefix=%s' % prefix, - '--with-lapack-libs=%s' % ' '.join(lapack_libs.names), - '--with-lapack-lib-dirs=%s' % ' '.join(lapack_libs.directories), - '--with-blas-libs=%s' % ' '.join(blas_libs.names), - '--with-blas-lib-dirs=%s' % ' '.join(blas_libs.directories) - ] - - if '+mpi' in self.spec: - configure_args.append('CC=%s' % spec['mpi'].mpicc) - configure_args.append('CXX=%s' % spec['mpi'].mpicxx) - configure_args.append('F77=%s' % spec['mpi'].mpif77) - configure_args.append('--with-MPI') - else: - configure_args.append('CC=%s' % spack_cc) - configure_args.append('CXX=%s' % spack_cxx) - configure_args.append('F77=%s' % spack_f77) - configure_args.append('--without-MPI') - - cflags = ' '.join(spec.compiler_flags['cflags']) - cxxflags = ' '.join(spec.compiler_flags['cxxflags']) - fflags = ' '.join(spec.compiler_flags['fflags']) - - if '+openmp' in self.spec: - configure_args.append('--with-openmp') - cflags += ' ' + self.compiler.openmp_flag - configure_args.append('LDFLAGS=%s' % self.compiler.openmp_flag) - else: - configure_args.append('--without-openmp') - - configure_args.append('CFLAGS=%s' % cflags) - configure_args.append('CXXFLAGS=%s' % cxxflags) - configure_args.append('FCFLAGS=%s' % fflags) - - if '+int64' in self.spec: - configure_args.append('--enable-bigint') - else: - configure_args.append('--disable-bigint') - - if '+mixedint' in self.spec: - configure_args.append('--enable-mixedint') - else: - configure_args.append('--disable-mixedint') - - if '+complex' in self.spec: - configure_args.append('--enable-complex') - else: - configure_args.append('--disable-complex') - - if '+shared' in self.spec: - configure_args.append("--enable-shared") - - if '~internal-superlu' in self.spec: - configure_args.append("--without-superlu") - # MLI and FEI do not build without superlu on Linux - configure_args.append("--without-mli") - configure_args.append("--without-fei") - - if '+superlu-dist' in self.spec: - configure_args.append('--with-dsuperlu-include=%s' % - spec['superlu-dist'].prefix.include) - configure_args.append('--with-dsuperlu-lib=%s' % - spec['superlu-dist'].libs) - configure_args.append('--with-dsuperlu') - - if '+debug' in self.spec: - configure_args.append("--enable-debug") - else: - configure_args.append("--disable-debug") - - # Hypre's source is staged under ./src so we'll have to manually - # cd into it. - with working_dir("src"): - configure(*configure_args) - - make() - if self.run_tests: - make("check") - make("test") - Executable(join_path('test', 'ij'))() - sstruct = Executable(join_path('test', 'struct')) - sstruct() - sstruct('-in', 'test/sstruct.in.default', '-solver', '40', - '-rhsone') - make("install") - - @property - def headers(self): - """Export the main hypre header, HYPRE.h; all other headers can be found - in the same directory. - Sample usage: spec['hypre'].headers.cpp_flags - """ - hdrs = find_headers('HYPRE', self.prefix.include, recursive=False) - return hdrs or None - - @property - def libs(self): - """Export the hypre library. - Sample usage: spec['hypre'].libs.ld_flags - """ - is_shared = '+shared' in self.spec - libs = find_libraries('libHYPRE', root=self.prefix, shared=is_shared, - recursive=True) - return libs or None diff --git a/scripts/uberenv/packages/petsc/package.py b/scripts/uberenv/packages/petsc/package.py deleted file mode 100644 index 1dddb437..00000000 --- a/scripts/uberenv/packages/petsc/package.py +++ /dev/null @@ -1,503 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os - - -class Petsc(Package): - """PETSc is a suite of data structures and routines for the scalable - (parallel) solution of scientific applications modeled by partial - differential equations. - """ - - homepage = "http://www.mcs.anl.gov/petsc/index.html" - url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.1.tar.gz" - git = "https://gitlab.com/petsc/petsc.git" - maintainers = ['balay', 'barrysmith', 'jedbrown'] - - version('develop', branch='master') - version('xsdk-0.2.0', tag='xsdk-0.2.0') - - version('3.14.0', sha256='a8f9caba03e0d57d8452c08505cf96be5f6949adaa266e819382162c03ddb9c5') - version('3.13.6', sha256='67ca2cf3040d08fdc51d27f660ea3157732b24c2f47aae1b19d63f62a39842c2') - version('3.13.5', sha256='10fc542dab961c8b17db35ad3a208cb184c237fc84e183817e38e6c7ab4b8732') - version('3.13.4', sha256='8d470cba1ceb9638694550134a2f23aac85ed7249cb74992581210597d978b94') - version('3.13.3', sha256='dc744895ee6b9c4491ff817bef0d3abd680c5e3c25e601be44240ce65ab4f337') - version('3.13.2', sha256='6083422a7c5b8e89e5e4ccf64acade9bf8ab70245e25bca3a3da03caf74602f1') - version('3.13.1', sha256='74a895e44e2ff1146838aaccb7613e7626d99e0eed64ca032c87c72d084efac3') - version('3.13.0', sha256='f0ea543a54145c5d1387e25b121c3fd1b1ca834032c5a33f6f1d929e95bdf0e5') - version('3.12.5', sha256='d676eb67e79314d6cca6422d7c477d2b192c830b89d5edc6b46934f7453bcfc0') - version('3.12.4', sha256='56a941130da93bbacb3cfa74dcacea1e3cd8e36a0341f9ced09977b1457084c3') - version('3.12.3', sha256='91f77d7b0f54056f085b9e27938922db3d9bb1734a2e2a6d26f43d3e6c0cf631') - version('3.12.2', sha256='d874b2e198c4cb73551c2eca1d2c5d27da710be4d00517adb8f9eb3d6d0375e8') - version('3.12.1', sha256='b72d895d0f4a79acb13ebc782b47b26d10d4e5706d399f533afcd5b3dba13737') - version('3.12.0', sha256='ba9ecf69783c7ebf05bd1c91dd1d4b38bf09b7a2d5f9a774aa6bb46deff7cb14') - version('3.11.4', sha256='319cb5a875a692a67fe5b1b90009ba8f182e21921ae645d38106544aff20c3c1') - version('3.11.3', sha256='199ad9650a9f58603b49e7fff7cd003ceb03aa231e5d37d0bf0496c6348eca81') - version('3.11.2', sha256='4d244dd7d1565d6534e776445fcf6977a6ee2a8bb2be4a36ac1e0fc1f9ad9cfa') - version('3.11.1', sha256='cb627f99f7ce1540ebbbf338189f89a5f1ecf3ab3b5b0e357f9e46c209f1fb23') - version('3.11.0', sha256='b3bed2a9263193c84138052a1b92d47299c3490dd24d1d0bf79fb884e71e678a') - version('3.10.5', sha256='3a81c8406410e0ffa8a3e9f8efcdf2e683cc40613c9bb5cb378a6498f595803e') - version('3.10.4', sha256='6c836df84caa9ae683ae401d3f94eb9471353156fec6db602bf2e857e4ec339f') - version('3.10.3', sha256='cd106babbae091604fee40c258737c84dec048949be779eaef5a745df3dc8de4') - version('3.10.2', sha256='9d3381bcf9c63abe6521b21a88efc70f8e893293503cff497971d0d9c1ec68cc') - version('3.10.1', sha256='b6e64ce062113ee0e2e2a6cfffb4d33c085ec91d5bc3afeb33781074aa5a22a5') - version('3.10.0', sha256='6ebacc010397ea47649495e8363cd7d7d86b876e6df07c6f6ccfa48b22fa555c') - version('3.9.4', sha256='ecc647c9b1ef565a2c113936454c65632eedc1626e0fc99b5a36accb91195a63') - version('3.9.3', sha256='6c7f2c7a28433385d74d647b4934aaeea3c1b3053b207973c9497639b6ebf7c8') - version('3.9.2', sha256='ab396ae5dbfff808df1b5648f5ce30f3021ec70faec3d5cd63df324d416ac6ac') - version('3.9.1', sha256='742e838a35d278693e956ed1ca4592c1d663451f6beea0694bf334aeb67681e8') - version('3.9.0', sha256='dcbcab1f321667be1c6e5f8e7b4ee8670bb09e372e51f1ea6471464519d54b2d') - version('3.8.4', sha256='9f78dc4dd4c58433fa18d3dd3a9029e39a83e4e4b64f845a029dd9fed44bc4c7') - version('3.8.3', sha256='01f9c3ed937eafac6c9e006510b61c7cd07197115ec40c429fc835f346ca3eac') - version('3.8.2', sha256='42690508d408e31fb98be738ac097bc869be14c5bfe08dda2184243283ceb16a') - version('3.8.1', sha256='9b48a9e72d304046923667d2ab1f201778cc56242928a374ff9e074843a334ff') - version('3.8.0', sha256='1e1b4d90ccbf98dc5759a956ac9a771310a6690f1cbb37b31502b29568262d7e') - version('3.7.7', sha256='40fd3bc76998e056c4097704c08f28eb89bf3b93164dc9e69abab393f43bf6f0') - version('3.7.6', sha256='3c8ee051349587d45baa7910c54ce8e0a571592e3b40f3054a7b7f986919d449') - version('3.7.5', sha256='493ab0b6c1b3fe68e71d990eff87c84f499f680e6d2c0c394e78646a82ed4be3') - version('3.7.4', sha256='54b804f924ea5be3b6718b4d4e98f8ccb9d1bd6bbbd1e9c0f18c4a90ddf5db18') - version('3.7.2', sha256='36681dd0df97e0d5cd182d902e89f527eb8f441f05271159dac5340acb4cf0ec') - version('3.6.4', sha256='eb09925a139b52b4dd5a071b3da4fe2165f1d6e8f71d410479603c9976c940f0') - version('3.6.3', sha256='776e2644e4003653c56a44a6f7c02c41427af26f7c5cd9bec3aa84ed90223245') - version('3.5.3', sha256='68e6a42f5ec75bad87f74d4df8f55ad63f0c4d996f162da6713cb3d6f566830d') - version('3.5.2', sha256='1a8f09af654afab787c732e7b2f5d0c1d856777398148351565389d38d30935e') - version('3.5.1', sha256='199af205f62dcc572728600670c7d4c8cb0d4efc4172c26f02b895d9dd1df245') - version('3.4.4', sha256='fa73b99caf70c416a967234f5476cdb1d2c014610ee0619e48f54d8d309631b7') - - variant('shared', default=True, - description='Enables the build of shared libraries') - variant('mpi', default=True, description='Activates MPI support') - variant('cuda', default=False, description='Activates CUDA support') - variant('double', default=True, - description='Switches between single and double precision') - variant('complex', default=False, description='Build with complex numbers') - variant('debug', default=False, description='Compile in debug mode') - - variant('metis', default=True, - description='Activates support for metis and parmetis') - variant('hdf5', default=True, - description='Activates support for HDF5 (only parallel)') - variant('hypre', default=True, - description='Activates support for Hypre (only parallel)') - # Mumps is disabled by default, because it depends on Scalapack - # which is not portable to all HPC systems - variant('mumps', default=False, - description='Activates support for MUMPS (only parallel)') - variant('superlu-dist', default=True, - description='Activates support for SuperluDist (only parallel)') - variant('trilinos', default=False, - description='Activates support for Trilinos (only parallel)') - variant('int64', default=False, - description='Compile with 64bit indices') - variant('clanguage', default='C', values=('C', 'C++'), - description='Specify C (recommended) or C++ to compile PETSc', - multi=False) - variant('fftw', default=False, - description='Activates support for FFTW (only parallel)') - variant('suite-sparse', default=False, - description='Activates support for SuiteSparse') - variant('knl', default=False, - description='Build for KNL') - variant('X', default=False, - description='Activate X support') - variant('batch', default=False, - description='Enable when mpiexec is not available to run binaries') - variant('valgrind', default=False, - description='Enable Valgrind Client Request mechanism') - variant('jpeg', default=False, - description='Activates support for JPEG') - variant('libpng', default=False, - description='Activates support for PNG') - variant('giflib', default=False, - description='Activates support for GIF') - variant('mpfr', default=False, - description='Activates support for MPFR') - variant('moab', default=False, - description='Acivates support for MOAB (only parallel)') - variant('random123', default=False, - description='Activates support for Random123') - variant('exodusii', default=False, - description='Activates support for ExodusII (only parallel)') - variant('cgns', default=False, - description='Activates support for CGNS (only parallel)') - variant('memkind', default=False, - description='Activates support for Memkind') - variant('p4est', default=False, - description='Activates support for P4Est (only parallel)') - variant('saws', default=False, - description='Activates support for Saws') - variant('libyaml', default=False, - description='Activates support for YAML') - - # 3.8.0 has a build issue with MKL - so list this conflict explicitly - conflicts('^intel-mkl', when='@3.8.0') - - # These require +mpi - mpi_msg = 'Requires +mpi' - conflicts('+cgns', when='~mpi', msg=mpi_msg) - conflicts('+exodusii', when='~mpi', msg=mpi_msg) - conflicts('+fftw', when='~mpi', msg=mpi_msg) - conflicts('+hdf5', when='~mpi', msg=mpi_msg) - conflicts('+hypre', when='~mpi', msg=mpi_msg) - conflicts('+moab', when='~mpi', msg=mpi_msg) - conflicts('+mumps', when='~mpi', msg=mpi_msg) - conflicts('+p4est', when='~mpi', msg=mpi_msg) - conflicts('+superlu-dist', when='~mpi', msg=mpi_msg) - conflicts('+trilinos', when='~mpi', msg=mpi_msg) - - # older versions of petsc did not support mumps when +int64 - conflicts('+mumps', when='@:3.12.99+int64') - - filter_compiler_wrappers( - 'petscvariables', relative_root='lib/petsc/conf' - ) - - # temporary workaround Clang 8.1.0 with XCode 8.3 on macOS, see - # https://bitbucket.org/petsc/petsc/commits/4f290403fdd060d09d5cb07345cbfd52670e3cbc - # the patch is an adaptation of the original commit to 3.7.5 - patch('macos-clang-8.1.0.diff', when='@3.7.5%apple-clang@8.1.0:') - patch('pkg-config-3.7.6-3.8.4.diff', when='@3.7.6:3.8.4') - - patch('xcode_stub_out_of_sync.patch', when='@:3.10.4') - - patch('xlf_fix-dup-petscfecreate.patch', when='@3.11.0') - - depends_on('diffutils', type='build') - - # Virtual dependencies - # Git repository needs sowing to build Fortran interface - depends_on('sowing', when='@develop') - depends_on('sowing@1.1.23-p1', when='@xsdk-0.2.0') - - # PETSc, hypre, superlu_dist when built with int64 use 32 bit integers - # with BLAS/LAPACK - depends_on('blas') - depends_on('lapack') - depends_on('mpi', when='+mpi') - depends_on('cuda', when='+cuda') - - # Build dependencies - depends_on('python@2.6:2.8', type='build', when='@:3.10.99') - depends_on('python@2.6:2.8,3.4:', type='build', when='@3.11:') - - # Other dependencies - depends_on('metis@5:~int64+real64', when='@:3.7.99+metis~int64+double') - depends_on('metis@5:~int64', when='@:3.7.99+metis~int64~double') - depends_on('metis@5:+int64+real64', when='@:3.7.99+metis+int64+double') - depends_on('metis@5:+int64', when='@:3.7.99+metis+int64~double') - # petsc-3.8+ uses default (float) metis with any (petsc) precision - depends_on('metis@5:~int64', when='@3.8:+metis~int64') - depends_on('metis@5:+int64', when='@3.8:+metis+int64') - - depends_on('hdf5@:1.10.99+mpi', when='@:3.12.99+hdf5+mpi') - depends_on('hdf5+mpi', when='@3.13:+hdf5+mpi') - depends_on('hdf5+mpi', when='+exodusii+mpi') - depends_on('hdf5+mpi', when='+cgns+mpi') - depends_on('zlib', when='+hdf5') - depends_on('zlib', when='+libpng') - depends_on('zlib', when='+p4est') - depends_on('parmetis', when='+metis+mpi') - depends_on('valgrind', when='+valgrind') - # Hypre does not support complex numbers. - # Also PETSc prefer to build it without internal superlu, likely due to - # conflict in headers see - # https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py - depends_on('hypre@:2.13.99+mpi~internal-superlu~int64', when='@:3.8.99+hypre+mpi~complex~int64') - depends_on('hypre@:2.13.99+mpi~internal-superlu+int64', when='@:3.8.99+hypre+mpi~complex+int64') - depends_on('hypre@2.14:2.18.2+mpi~internal-superlu~int64', when='@3.9:3.13.99+hypre+mpi~complex~int64') - depends_on('hypre@2.14:2.18.2+mpi~internal-superlu+int64', when='@3.9:3.13.99+hypre+mpi~complex+int64') - depends_on('hypre@2.14:+mpi~internal-superlu~int64', when='@3.14:+hypre+mpi~complex~int64') - depends_on('hypre@2.14:+mpi~internal-superlu+int64', when='@3.14:+hypre+mpi~complex+int64') - depends_on('hypre@xsdk-0.2.0+mpi~internal-superlu+int64', when='@xsdk-0.2.0+hypre+mpi~complex+int64') - depends_on('hypre@xsdk-0.2.0+mpi~internal-superlu~int64', when='@xsdk-0.2.0+hypre+mpi~complex~int64') - depends_on('hypre@develop+mpi~internal-superlu+int64', when='@develop+hypre+mpi~complex+int64') - depends_on('hypre@develop+mpi~internal-superlu~int64', when='@develop+hypre+mpi~complex~int64') - depends_on('superlu-dist@:4.3~int64', when='@3.4.4:3.6.4+superlu-dist+mpi~int64') - depends_on('superlu-dist@:4.3+int64', when='@3.4.4:3.6.4+superlu-dist+mpi+int64') - depends_on('superlu-dist@5.0.0:5.1.3~int64', when='@3.7:3.7.99+superlu-dist+mpi~int64') - depends_on('superlu-dist@5.0.0:5.1.3+int64', when='@3.7:3.7.99+superlu-dist+mpi+int64') - depends_on('superlu-dist@5.2:5.2.99~int64', when='@3.8:3.9.99+superlu-dist+mpi~int64') - depends_on('superlu-dist@5.2:5.2.99+int64', when='@3.8:3.9.99+superlu-dist+mpi+int64') - depends_on('superlu-dist@5.4:5.4.99~int64', when='@3.10:3.10.2+superlu-dist+mpi~int64') - depends_on('superlu-dist@5.4:5.4.99+int64', when='@3.10:3.10.2+superlu-dist+mpi+int64') - depends_on('superlu-dist@6.1:6.1.99~int64', when='@3.10.3:3.12.99+superlu-dist+mpi~int64') - depends_on('superlu-dist@6.1:6.1.99+int64', when='@3.10.3:3.12.99+superlu-dist+mpi+int64') - depends_on('superlu-dist@6.1:6.3.0~int64', when='@3.13.0:3.14+superlu-dist+mpi~int64') - depends_on('superlu-dist@6.1:6.3.0+int64', when='@3.13.0:3.14+superlu-dist+mpi+int64') - depends_on('superlu-dist@xsdk-0.2.0~int64', when='@xsdk-0.2.0+superlu-dist+mpi~int64') - depends_on('superlu-dist@xsdk-0.2.0+int64', when='@xsdk-0.2.0+superlu-dist+mpi+int64') - depends_on('superlu-dist@develop~int64', when='@develop+superlu-dist+mpi~int64') - depends_on('superlu-dist@develop+int64', when='@develop+superlu-dist+mpi+int64') - depends_on('mumps+mpi~int64', when='+mumps') - depends_on('scalapack', when='+mumps') - depends_on('trilinos@12.6.2:+mpi', when='@3.7.0:+trilinos+mpi') - depends_on('trilinos@xsdk-0.2.0+mpi', when='@xsdk-0.2.0+trilinos+mpi') - depends_on('trilinos@develop+mpi', when='@xdevelop+trilinos+mpi') - depends_on('fftw+mpi', when='+fftw+mpi') - depends_on('suite-sparse', when='+suite-sparse') - depends_on('libx11', when='+X') - depends_on('mpfr', when='+mpfr') - depends_on('gmp', when='+mpfr') - depends_on('jpeg', when='+jpeg') - depends_on('libpng', when='+libpng') - depends_on('giflib', when='+giflib') - depends_on('exodusii+mpi', when='+exodusii+mpi') - depends_on('netcdf-c+mpi', when='+exodusii+mpi') - depends_on('parallel-netcdf', when='+exodusii+mpi') - depends_on('random123', when='+random123') - depends_on('moab+mpi', when='+moab+mpi') - depends_on('cgns+mpi', when='+cgns+mpi') - depends_on('memkind', when='+memkind') - depends_on('p4est+mpi', when='+p4est+mpi') - depends_on('saws', when='+saws') - depends_on('libyaml', when='+libyaml') - - def url_for_version(self, version): - if version >= Version('3.13.0'): - # petsc-lite tarballs are smaller by skipping docs - return "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-{0}.tar.gz".format(version) - else: - return "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-{0}.tar.gz".format(version) - - def mpi_dependent_options(self): - if '~mpi' in self.spec: - compiler_opts = [ - '--with-cc=%s' % os.environ['CC'], - '--with-cxx=%s' % (os.environ['CXX'] - if self.compiler.cxx is not None else '0'), - '--with-fc=%s' % (os.environ['FC'] - if self.compiler.fc is not None else '0'), - '--with-mpi=0' - ] - else: - compiler_opts = [ - '--with-cc=%s' % self.spec['mpi'].mpicc, - '--with-cxx=%s' % self.spec['mpi'].mpicxx, - '--with-fc=%s' % self.spec['mpi'].mpifc, - ] - if self.spec.satisfies('%intel'): - # mpiifort needs some help to automatically link - # all necessary run-time libraries - compiler_opts.append('--FC_LINKER_FLAGS=-lintlc') - return compiler_opts - - def install(self, spec, prefix): - options = ['--with-ssl=0', - '--download-c2html=0', - '--download-sowing=0', - '--download-hwloc=0', - 'CFLAGS=%s' % ' '.join(spec.compiler_flags['cflags']), - 'FFLAGS=%s' % ' '.join(spec.compiler_flags['fflags']), - 'CXXFLAGS=%s' % ' '.join(spec.compiler_flags['cxxflags'])] - options.extend(self.mpi_dependent_options()) - options.extend([ - '--with-precision=%s' % ( - 'double' if '+double' in spec else 'single'), - '--with-scalar-type=%s' % ( - 'complex' if '+complex' in spec else 'real'), - '--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'), - '--with-debugging=%s' % ('1' if '+debug' in spec else '0'), - '--with-64-bit-indices=%s' % ('1' if '+int64' in spec else '0') - ]) - if '+debug' not in spec: - options.extend(['COPTFLAGS=', - 'FOPTFLAGS=', - 'CXXOPTFLAGS=']) - - # Make sure we use exactly the same Blas/Lapack libraries - # across the DAG. To that end list them explicitly - lapack_blas = spec['lapack'].libs + spec['blas'].libs - options.extend([ - '--with-blas-lapack-lib=%s' % lapack_blas.joined() - ]) - - if '+batch' in spec: - options.append('--with-batch=1') - if '+knl' in spec: - options.append('--with-avx-512-kernels') - options.append('--with-memalign=64') - if '+X' in spec: - options.append('--with-x=1') - else: - options.append('--with-x=0') - - if 'trilinos' in spec: - options.append('--with-cxx-dialect=C++11') - if spec.satisfies('^trilinos+boost'): - options.append('--with-boost=1') - - if self.spec.satisfies('clanguage=C++'): - options.append('--with-clanguage=C++') - else: - options.append('--with-clanguage=C') - - # PETSc depends on scalapack when '+mumps' (see depends()) - # help PETSc pick up Scalapack from MKL - if spec.satisfies('+mumps'): - scalapack = spec['scalapack'].libs - options.extend([ - '--with-scalapack-lib=%s' % scalapack.joined(), - '--with-scalapack=1' - ]) - else: - options.extend([ - '--with-scalapack=0' - ]) - - # Activates library support if needed (i.e. direct dependency) - if '^libjpeg-turbo' in spec: - jpeg_library = 'libjpeg-turbo' - else: - jpeg_library = 'libjpeg' - - for library in ('cuda', 'metis', 'hypre', 'parmetis', 'mumps', - 'trilinos', 'fftw', 'valgrind', 'gmp', 'libpng', - 'giflib', 'mpfr', 'netcdf-c', 'parallel-netcdf', - 'moab', 'random123', 'exodusii', 'cgns', 'memkind', - 'p4est', 'saws', 'libyaml', jpeg_library): - # Cannot check `library in spec` because of transitive deps - # Cannot check variants because parmetis keys on +metis - library_requested = library in spec.dependencies_dict() - options.append( - '--with-{library}={value}'.format( - library=('libjpeg' if library == 'libjpeg-turbo' - else 'netcdf' if library == 'netcdf-c' - else 'pnetcdf' if library == 'parallel-netcdf' - else 'yaml' if library == 'libyaml' - else library), - value=('1' if library_requested else '0')) - ) - if library_requested: - options.append( - '--with-{library}-dir={path}'.format( - library=('libjpeg' if library == 'libjpeg-turbo' - else 'netcdf' if library == 'netcdf-c' - else 'pnetcdf' if library == 'parallel-netcdf' - else 'yaml' if library == 'libyaml' - else library), path=spec[library].prefix) - ) - - # PETSc does not pick up SuperluDist from the dir as they look for - # superlu_dist_4.1.a - if '+superlu-dist' in spec: - import warnings - warnings.warn('spec["superlu-dist"].prefix.include = %s' % spec['superlu-dist'].prefix.include) - warnings.warn('spec["superlu-dist"].libs = %s' % spec['superlu-dist'].libs) - if spec.satisfies('@3.10.3:'): - options.append('--with-cxx-dialect=C++11') - options.extend([ - '--with-superlu_dist-include=%s' % - spec['superlu-dist'].prefix.include, - '--with-superlu_dist-lib=%s' % - spec['superlu-dist'].libs, - '--with-superlu_dist=1' - ]) - else: - options.append( - '--with-superlu_dist=0' - ) - # SuiteSparse: configuring using '--with-suitesparse-dir=...' has some - # issues, so specify directly the include path and the libraries. - if '+suite-sparse' in spec: - ss_spec = 'suite-sparse:umfpack,klu,cholmod,btf,ccolamd,colamd,' \ - 'camd,amd,suitesparseconfig' - options.extend([ - '--with-suitesparse-include=%s' % spec[ss_spec].prefix.include, - '--with-suitesparse-lib=%s' % spec[ss_spec].libs.joined(), - '--with-suitesparse=1' - ]) - else: - options.append('--with-suitesparse=0') - - # hdf5: configure detection is convoluted for pflotran - if '+hdf5' in spec: - options.extend([ - '--with-hdf5-include=%s' % spec['hdf5'].prefix.include, - '--with-hdf5-lib=%s' % spec['hdf5:hl,fortran'].libs.joined(), - '--with-hdf5=1' - ]) - else: - options.append('--with-hdf5=0') - - # zlib: configuring using '--with-zlib-dir=...' has some issues with - # SuiteSparse so specify directly the include path and the libraries. - if 'zlib' in spec: - options.extend([ - '--with-zlib-include=%s' % spec['zlib'].prefix.include, - '--with-zlib-lib=%s' % spec['zlib'].libs.joined(), - '--with-zlib=1' - ]) - else: - options.append('--with-zlib=0') - - python('configure', '--prefix=%s' % prefix, *options) - - # PETSc has its own way of doing parallel make. - make('MAKE_NP=%s' % make_jobs, parallel=False) - make("install") - - # solve Poisson equation in 2D to make sure nothing is broken: - if ('mpi' in spec) and self.run_tests: - with working_dir('src/ksp/ksp/examples/tutorials'): - env['PETSC_DIR'] = self.prefix - cc = Executable(spec['mpi'].mpicc) - cc('ex50.c', '-I%s' % prefix.include, '-L%s' % prefix.lib, - '-lpetsc', '-lm', '-o', 'ex50') - run = Executable(join_path(spec['mpi'].prefix.bin, 'mpirun')) - # For Spectrum MPI, if -np is omitted, the default behavior is - # to assign one process per process slot, where the default - # process slot allocation is one per core. On systems with - # many cores, the number of processes can exceed the size of - # the grid specified when the testcase is run and the test case - # fails. Specify a small number of processes to prevent - # failure. - # For more information about Spectrum MPI invocation, see URL - # https://www.ibm.com/support/knowledgecenter/en/SSZTET_10.1.0/smpi02/smpi02_mpirun_options.html - if ('spectrum-mpi' in spec): - run.add_default_arg('-np') - run.add_default_arg('4') - run('ex50', '-da_grid_x', '4', '-da_grid_y', '4') - if '+superlu-dist' in spec: - run('ex50', - '-da_grid_x', '4', - '-da_grid_y', '4', - '-pc_type', 'lu', - '-pc_factor_mat_solver_package', 'superlu_dist') - - if 'mumps' in spec: - run('ex50', - '-da_grid_x', '4', - '-da_grid_y', '4', - '-pc_type', 'lu', - '-pc_factor_mat_solver_package', 'mumps') - - if 'hypre' in spec: - run('ex50', - '-da_grid_x', '4', - '-da_grid_y', '4', - '-pc_type', 'hypre', - '-pc_hypre_type', 'boomeramg') - - def setup_build_environment(self, env): - # configure fails if these env vars are set outside of Spack - env.unset('PETSC_DIR') - env.unset('PETSC_ARCH') - - def setup_run_environment(self, env): - # Set PETSC_DIR in the module file - env.set('PETSC_DIR', self.prefix) - env.unset('PETSC_ARCH') - - def setup_dependent_build_environment(self, env, dependent_spec): - # Set up PETSC_DIR for everyone using PETSc package - env.set('PETSC_DIR', self.prefix) - env.unset('PETSC_ARCH') - - @property - def headers(self): - return find_headers('petsc', self.prefix.include, recursive=False) \ - or None # return None to indicate failure - - # For the 'libs' property - use the default handler. diff --git a/scripts/uberenv/packages/py-numpy/package.py b/scripts/uberenv/packages/py-numpy/package.py deleted file mode 100644 index 7b1a748c..00000000 --- a/scripts/uberenv/packages/py-numpy/package.py +++ /dev/null @@ -1,319 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * -import platform -import subprocess - - -class PyNumpy(PythonPackage): - """NumPy is the fundamental package for scientific computing with Python. - It contains among other things: a powerful N-dimensional array object, - sophisticated (broadcasting) functions, tools for integrating C/C++ and - Fortran code, and useful linear algebra, Fourier transform, and random - number capabilities""" - - homepage = "https://numpy.org/" - url = "https://pypi.io/packages/source/n/numpy/numpy-1.19.2.zip" - git = "https://github.com/numpy/numpy.git" - - maintainers = ['adamjstewart'] - install_time_test_callbacks = ['install_test', 'import_module_test'] - - import_modules = [ - 'numpy', 'numpy.compat', 'numpy.core', 'numpy.distutils', 'numpy.doc', - 'numpy.f2py', 'numpy.fft', 'numpy.lib', 'numpy.linalg', 'numpy.ma', - 'numpy.matrixlib', 'numpy.polynomial', 'numpy.random', 'numpy.testing', - 'numpy.distutils.command', 'numpy.distutils.fcompiler' - ] - - version('master', branch='master') - version('1.19.2', sha256='0d310730e1e793527065ad7dde736197b705d0e4c9999775f212b03c44a8484c') - version('1.19.1', sha256='b8456987b637232602ceb4d663cb34106f7eb780e247d51a260b84760fd8f491') - version('1.19.0', sha256='76766cc80d6128750075378d3bb7812cf146415bd29b588616f72c943c00d598') - version('1.18.5', sha256='34e96e9dae65c4839bd80012023aadd6ee2ccb73ce7fdf3074c62f301e63120b') - version('1.18.4', sha256='bbcc85aaf4cd84ba057decaead058f43191cc0e30d6bc5d44fe336dc3d3f4509') - version('1.18.3', sha256='e46e2384209c91996d5ec16744234d1c906ab79a701ce1a26155c9ec890b8dc8') - version('1.18.2', sha256='e7894793e6e8540dbeac77c87b489e331947813511108ae097f1715c018b8f3d') - version('1.18.1', sha256='b6ff59cee96b454516e47e7721098e6ceebef435e3e21ac2d6c3b8b02628eb77') - version('1.18.0', sha256='a9d72d9abaf65628f0f31bbb573b7d9304e43b1e6bbae43149c17737a42764c4') - version('1.17.5', sha256='16507ba6617f62ae3c6ab1725ae6f550331025d4d9a369b83f6d5a470446c342') - version('1.17.4', sha256='f58913e9227400f1395c7b800503ebfdb0772f1c33ff8cb4d6451c06cabdf316') - version('1.17.3', sha256='a0678793096205a4d784bd99f32803ba8100f639cf3b932dc63b21621390ea7e') - version('1.17.2', sha256='73615d3edc84dd7c4aeb212fa3748fb83217e00d201875a47327f55363cef2df') - version('1.17.1', sha256='f11331530f0eff69a758d62c2461cd98cdc2eae0147279d8fc86e0464eb7e8ca') - version('1.17.0', sha256='951fefe2fb73f84c620bec4e001e80a80ddaa1b84dce244ded7f1e0cbe0ed34a') - version('1.16.6', sha256='e5cf3fdf13401885e8eea8170624ec96225e2174eb0c611c6f26dd33b489e3ff') - version('1.16.5', sha256='8bb452d94e964b312205b0de1238dd7209da452343653ab214b5d681780e7a0c') - version('1.16.4', sha256='7242be12a58fec245ee9734e625964b97cf7e3f2f7d016603f9e56660ce479c7') - version('1.16.3', sha256='78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621') - version('1.16.2', sha256='6c692e3879dde0b67a9dc78f9bfb6f61c666b4562fd8619632d7043fb5b691b0') - version('1.16.1', sha256='31d3fe5b673e99d33d70cfee2ea8fe8dccd60f265c3ed990873a88647e3dd288') - version('1.16.0', sha256='cb189bd98b2e7ac02df389b6212846ab20661f4bafe16b5a70a6f1728c1cc7cb') - version('1.15.4', sha256='3d734559db35aa3697dadcea492a423118c5c55d176da2f3be9c98d4803fc2a7') - version('1.15.3', sha256='1c0c80e74759fa4942298044274f2c11b08c86230b25b8b819e55e644f5ff2b6') - version('1.15.2', sha256='27a0d018f608a3fe34ac5e2b876f4c23c47e38295c47dd0775cc294cd2614bc1') - version('1.15.2', sha256='27a0d018f608a3fe34ac5e2b876f4c23c47e38295c47dd0775cc294cd2614bc1') - version('1.15.1', sha256='7b9e37f194f8bcdca8e9e6af92e2cbad79e360542effc2dd6b98d63955d8d8a3') - version('1.15.0', sha256='f28e73cf18d37a413f7d5de35d024e6b98f14566a10d82100f9dc491a7d449f9') - version('1.14.6', sha256='1250edf6f6c43e1d7823f0967416bc18258bb271dc536298eb0ea00a9e45b80a') - version('1.14.5', sha256='a4a433b3a264dbc9aa9c7c241e87c0358a503ea6394f8737df1683c7c9a102ac') - version('1.14.4', sha256='2185a0f31ecaa0792264fa968c8e0ba6d96acf144b26e2e1d1cd5b77fc11a691') - version('1.14.3', sha256='9016692c7d390f9d378fc88b7a799dc9caa7eb938163dda5276d3f3d6f75debf') - version('1.14.2', sha256='facc6f925c3099ac01a1f03758100772560a0b020fb9d70f210404be08006bcb') - version('1.14.1', sha256='fa0944650d5d3fb95869eaacd8eedbd2d83610c85e271bd9d3495ffa9bc4dc9c') - version('1.14.0', sha256='3de643935b212307b420248018323a44ec51987a336d1d747c1322afc3c099fb') - version('1.13.3', sha256='36ee86d5adbabc4fa2643a073f93d5504bdfed37a149a3a49f4dde259f35a750') - version('1.13.1', sha256='c9b0283776085cb2804efff73e9955ca279ba4edafd58d3ead70b61d209c4fbb') - version('1.13.0', sha256='dcff367b725586830ff0e20b805c7654c876c2d4585c0834a6049502b9d6cf7e') - version('1.12.1', sha256='a65266a4ad6ec8936a1bc85ce51f8600634a31a258b722c9274a80ff189d9542') - version('1.12.0', sha256='ff320ecfe41c6581c8981dce892fe6d7e69806459a899e294e4bf8229737b154') - version('1.11.3', sha256='2e0fc5248246a64628656fe14fcab0a959741a2820e003bd15538226501b82f7') - version('1.11.2', sha256='c1ed4d1d2a795409c7df1eb4bfee65c0e3326cfc7c57875fa39e5c7414116d9a') - version('1.11.1', sha256='4e9c289b9d764d10353a224a5286dda3e0425b13b112719bdc3e9864ae648d79') - version('1.11.0', sha256='9109f260850627e4b83a3c4bcef4f2f99357eb4a5eaae75dec51c32f3c197aa3') - version('1.10.4', sha256='8ce443dc79656a9fc97a7837f1444d324aef2c9b53f31f83441f57ad1f1f3659') - version('1.9.3', sha256='baa074bb1c7f9c822122fb81459b7caa5fc49267ca94cca69465c8dcfd63ac79') - version('1.9.2', sha256='e37805754f4ebb575c434d134f6bebb8b857d9843c393f6943c7be71ef57311c') - version('1.9.1', sha256='2a545c0d096d86035b12160fcba5e4c0a08dcabbf902b4f867eb64deb31a2b7a') - - variant('blas', default=True, description='Build with BLAS support') - variant('lapack', default=True, description='Build with LAPACK support') - variant('force-parallel-build', default=False, description='Force a parallel build, may break with Python 3.') - - depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) - depends_on('python@2.7:2.8,3.5:', type=('build', 'run'), when='@1.16:') - depends_on('python@3.5:', type=('build', 'run'), when='@1.17:') - depends_on('python@3.6:', type=('build', 'run'), when='@1.19:') - depends_on('py-setuptools', type=('build', 'run')) - # Check pyproject.toml for updates to the required cython version - depends_on('py-cython@0.29.13:', when='@1.18.0:', type='build') - depends_on('py-cython@0.29.14:', when='@1.18.1:', type='build') - depends_on('py-cython@0.29.21:', when='@1.19.1:', type='build') - depends_on('blas', when='+blas') - depends_on('lapack', when='+lapack') - - depends_on('py-nose@1.0.0:', when='@:1.14', type='test') - depends_on('py-pytest', when='@1.15:', type='test') - depends_on('py-hypothesis', when='@1.19:', type='test') - - # Allows you to specify order of BLAS/LAPACK preference - # https://github.com/numpy/numpy/pull/13132 - patch('blas-lapack-order.patch', when='@1.15:1.16') - - # GCC 4.8 is the minimum version that works - conflicts('%gcc@:4.7', msg='GCC 4.8+ required') - - def flag_handler(self, name, flags): - # -std=c99 at least required, old versions of GCC default to -std=c90 - if self.spec.satisfies('%gcc@:5.1') and name == 'cflags': - flags.append(self.compiler.c99_flag) - # Check gcc version in use by intel compiler - # This will essentially check the system gcc compiler unless a gcc - # module is already loaded. - if self.spec.satisfies('%intel') and name == 'cflags': - p1 = subprocess.Popen( - [self.compiler.cc, '-v'], - stderr=subprocess.PIPE - ) - p2 = subprocess.Popen( - ['grep', 'compatibility'], - stdin=p1.stderr, - stdout=subprocess.PIPE - ) - p1.stderr.close() - out, err = p2.communicate() - gcc_version = Version(out.split()[5].decode('utf-8')) - if gcc_version < Version('4.8'): - raise InstallError('The GCC version that the Intel compiler ' - 'uses must be >= 4.8. The GCC in use is ' - '{0}'.format(gcc_version)) - if gcc_version <= Version('5.1'): - flags.append(self.compiler.c99_flag) - return (flags, None, None) - - @run_before('build') - def set_blas_lapack(self): - # https://numpy.org/devdocs/user/building.html - # https://github.com/numpy/numpy/blob/master/site.cfg.example - - # Skip if no BLAS/LAPACK requested - spec = self.spec - if '+blas' not in spec and '+lapack' not in spec: - return - - def write_library_dirs(f, dirs): - f.write('library_dirs = {0}\n'.format(dirs)) - if not ((platform.system() == 'Darwin') and - (Version(platform.mac_ver()[0]).up_to(2) == Version( - '10.12'))): - f.write('rpath = {0}\n'.format(dirs)) - - blas_libs = LibraryList([]) - blas_headers = HeaderList([]) - if '+blas' in spec: - blas_libs = spec['blas'].libs - blas_headers = spec['blas'].headers - - lapack_libs = LibraryList([]) - lapack_headers = HeaderList([]) - if '+lapack' in spec: - lapack_libs = spec['lapack'].libs - lapack_headers = spec['lapack'].headers - - lapackblas_libs = lapack_libs + blas_libs - lapackblas_headers = lapack_headers + blas_headers - - blas_lib_names = ','.join(blas_libs.names) - blas_lib_dirs = ':'.join(blas_libs.directories) - blas_header_dirs = ':'.join(blas_headers.directories) - - lapack_lib_names = ','.join(lapack_libs.names) - lapack_lib_dirs = ':'.join(lapack_libs.directories) - lapack_header_dirs = ':'.join(lapack_headers.directories) - - lapackblas_lib_names = ','.join(lapackblas_libs.names) - lapackblas_lib_dirs = ':'.join(lapackblas_libs.directories) - lapackblas_header_dirs = ':'.join(lapackblas_headers.directories) - - # Tell numpy where to find BLAS/LAPACK libraries - with open('site.cfg', 'w') as f: - if '^intel-mkl' in spec or '^intel-parallel-studio+mkl' in spec: - f.write('[mkl]\n') - # FIXME: as of @1.11.2, numpy does not work with separately - # specified threading and interface layers. A workaround is a - # terribly bad idea to use mkl_rt. In this case Spack will no - # longer be able to guarantee that one and the same variant of - # Blas/Lapack (32/64bit, threaded/serial) is used within the - # DAG. This may lead to a lot of hard-to-debug segmentation - # faults on user's side. Users may also break working - # installation by (unconsciously) setting environment variable - # to switch between different interface and threading layers - # dynamically. From this perspective it is no different from - # throwing away RPATH's and using LD_LIBRARY_PATH throughout - # Spack. - f.write('libraries = {0}\n'.format(lapackblas_lib_names + ',mkl_avx2,mkl_def')) - write_library_dirs(f, lapackblas_lib_dirs) - f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs)) - - if '^blis' in spec: - f.write('[blis]\n') - f.write('libraries = {0}\n'.format(blas_lib_names)) - write_library_dirs(f, blas_lib_dirs) - f.write('include_dirs = {0}\n'.format(blas_header_dirs)) - - if '^openblas' in spec: - f.write('[openblas]\n') - f.write('libraries = {0}\n'.format(lapackblas_lib_names)) - write_library_dirs(f, lapackblas_lib_dirs) - f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs)) - - if '^libflame' in spec: - f.write('[flame]\n') - f.write('libraries = {0}\n'.format(lapack_lib_names)) - write_library_dirs(f, lapack_lib_dirs) - f.write('include_dirs = {0}\n'.format(lapack_header_dirs)) - - if '^atlas' in spec: - f.write('[atlas]\n') - f.write('libraries = {0}\n'.format(lapackblas_lib_names)) - write_library_dirs(f, lapackblas_lib_dirs) - f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs)) - - if '^veclibfort' in spec: - f.write('[accelerate]\n') - f.write('libraries = {0}\n'.format(lapackblas_lib_names)) - write_library_dirs(f, lapackblas_lib_dirs) - - if '^netlib-lapack' in spec: - # netlib requires blas and lapack listed - # separately so that scipy can find them - if spec.satisfies('+blas'): - f.write('[blas]\n') - f.write('libraries = {0}\n'.format(blas_lib_names)) - write_library_dirs(f, blas_lib_dirs) - f.write('include_dirs = {0}\n'.format(blas_header_dirs)) - if spec.satisfies('+lapack'): - f.write('[lapack]\n') - f.write('libraries = {0}\n'.format(lapack_lib_names)) - write_library_dirs(f, lapack_lib_dirs) - f.write('include_dirs = {0}\n'.format(lapack_header_dirs)) - - def setup_build_environment(self, env): - # Tell numpy which BLAS/LAPACK libraries we want to use. - # https://github.com/numpy/numpy/pull/13132 - # https://numpy.org/devdocs/user/building.html#accelerated-blas-lapack-libraries - spec = self.spec - - # https://numpy.org/devdocs/user/building.html#blas - if 'blas' not in spec: - blas = '' - elif spec['blas'].name == 'intel-mkl' or \ - spec['blas'].name == 'intel-parallel-studio': - blas = 'mkl' - elif spec['blas'].name == 'blis': - blas = 'blis' - elif spec['blas'].name == 'openblas': - blas = 'openblas' - elif spec['blas'].name == 'atlas': - blas = 'atlas' - elif spec['blas'].name == 'veclibfort': - blas = 'accelerate' - else: - blas = 'blas' - - env.set('NPY_BLAS_ORDER', blas) - - # https://numpy.org/devdocs/user/building.html#lapack - if 'lapack' not in spec: - lapack = '' - elif spec['lapack'].name == 'intel-mkl' or \ - spec['lapack'].name == 'intel-parallel-studio': - lapack = 'mkl' - elif spec['lapack'].name == 'openblas': - lapack = 'openblas' - elif spec['lapack'].name == 'libflame': - lapack = 'flame' - elif spec['lapack'].name == 'atlas': - lapack = 'atlas' - elif spec['lapack'].name == 'veclibfort': - lapack = 'accelerate' - else: - lapack = 'lapack' - - env.set('NPY_LAPACK_ORDER', lapack) - - def build_args(self, spec, prefix): - args = [] - - # From NumPy 1.10.0 on it's possible to do a parallel build. - # https://numpy.org/devdocs/user/building.html#parallel-builds - if self.version >= Version('1.10.0'): - # But Parallel build in Python 3.5+ is broken. See: - # https://github.com/spack/spack/issues/7927 - # https://github.com/scipy/scipy/issues/7112 - if spec['python'].version < Version('3.5') or '+force-parallel-build' in spec: - args = ['-j', str(make_jobs)] - - return args - - def test(self): - # `setup.py test` is not supported. Use one of the following - # instead: - # - # - `python runtests.py` (to build and test) - # - `python runtests.py --no-build` (to test installed numpy) - # - `>>> numpy.test()` (run tests for installed numpy - # from within an interpreter) - pass - - def install_test(self): - # Change directories due to the following error: - # - # ImportError: Error importing numpy: you should not try to import - # numpy from its source directory; please exit the numpy - # source tree, and relaunch your python interpreter from there. - with working_dir('spack-test', create=True): - python('-c', 'import numpy; numpy.test("full", verbose=2)') diff --git a/scripts/uberenv/packages/py-scipy/package.py b/scripts/uberenv/packages/py-scipy/package.py deleted file mode 100644 index 63b86d3b..00000000 --- a/scripts/uberenv/packages/py-scipy/package.py +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class PyScipy(PythonPackage): - """SciPy (pronounced "Sigh Pie") is a Scientific Library for Python. - It provides many user-friendly and efficient numerical routines such - as routines for numerical integration and optimization.""" - - homepage = "https://www.scipy.org/" - url = "https://pypi.io/packages/source/s/scipy/scipy-1.5.3.tar.gz" - - maintainers = ['adamjstewart'] - install_time_test_callbacks = ['install_test', 'import_module_test'] - - import_modules = [ - 'scipy', 'scipy._build_utils', 'scipy._lib', 'scipy.cluster', - 'scipy.constants', 'scipy.fftpack', 'scipy.integrate', - 'scipy.interpolate', 'scipy.io', 'scipy.linalg', 'scipy.misc', - 'scipy.ndimage', 'scipy.odr', 'scipy.optimize', 'scipy.signal', - 'scipy.sparse', 'scipy.spatial', 'scipy.special', 'scipy.stats', - 'scipy.io.arff', 'scipy.io.harwell_boeing', 'scipy.io.matlab', - 'scipy.optimize._lsq', 'scipy.sparse.csgraph', 'scipy.sparse.linalg', - 'scipy.sparse.linalg.dsolve', 'scipy.sparse.linalg.eigen', - 'scipy.sparse.linalg.isolve', 'scipy.sparse.linalg.eigen.arpack', - 'scipy.sparse.linalg.eigen.lobpcg', 'scipy.special._precompute' - ] - - version('1.5.3', sha256='ddae76784574cc4c172f3d5edd7308be16078dd3b977e8746860c76c195fa707') - version('1.5.2', sha256='066c513d90eb3fd7567a9e150828d39111ebd88d3e924cdfc9f8ce19ab6f90c9') - version('1.5.1', sha256='039572f0ca9578a466683558c5bf1e65d442860ec6e13307d528749cfe6d07b8') - version('1.5.0', sha256='4ff72877d19b295ee7f7727615ea8238f2d59159df0bdd98f91754be4a2767f0') - version('1.4.1', sha256='dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59') - version('1.4.0', sha256='31f7cfa93b01507c935c12b535e24812594002a02a56803d7cd063e9920d25e8') - version('1.3.3', sha256='64bf4e8ae0db2d42b58477817f648d81e77f0b381d0ea4427385bba3f959380a') - version('1.3.2', sha256='a03939b431994289f39373c57bbe452974a7da724ae7f9620a1beee575434da4') - version('1.3.1', sha256='2643cfb46d97b7797d1dbdb6f3c23fe3402904e3c90e6facfe6a9b98d808c1b5') - version('1.3.0', sha256='c3bb4bd2aca82fb498247deeac12265921fe231502a6bc6edea3ee7fe6c40a7a') - version('1.2.3', sha256='ecbe6413ca90b8e19f8475bfa303ac001e81b04ec600d17fa7f816271f7cca57') - version('1.2.2', sha256='a4331e0b8dab1ff75d2c67b5158a8bb9a83c799d7140094dda936d876c7cfbb1') - version('1.2.1', sha256='e085d1babcb419bbe58e2e805ac61924dac4ca45a07c9fa081144739e500aa3c') - version('1.1.0', sha256='878352408424dffaa695ffedf2f9f92844e116686923ed9aa8626fc30d32cfd1') - version('1.0.0', sha256='87ea1f11a0e9ec08c264dc64551d501fa307289460705f6fccd84cbfc7926d10') - version('0.19.1', sha256='a19a2ca7a7336495ec180adeaa0dfdcf41e96dbbee90d51c3ed828ba570884e6') - version('0.18.1', sha256='8ab6e9c808bf2fb3e8576cd8cf07226d9cdc18b012c06d9708429a821ac6634e') - version('0.17.0', sha256='f600b755fb69437d0f70361f9e560ab4d304b1b66987ed5a28bdd9dd7793e089') - version('0.15.1', sha256='a212cbc3b79e9a563aa45fc5c517b3499198bd7eb7e7be1e047568a5f48c259a') - version('0.15.0', sha256='0c74e31e08acc8bf9b6ceb9bced73df2ae0cc76003e0366350bc7b26292bf8b1') - - variant('force-parallel-build', default=False, description='Force a parallel build, may break with Python 3.') - - depends_on('python@2.6:2.8,3.2:', type=('build', 'link', 'run')) - depends_on('python@2.7:2.8,3.4:', when='@0.18:', type=('build', 'link', 'run')) - depends_on('python@3.5:', when='@1.3:', type=('build', 'link', 'run')) - depends_on('python@3.6:', when='@1.5:', type=('build', 'link', 'run')) - depends_on('py-setuptools', type='build') - depends_on('py-pybind11@2.2.4:', when='@1.4.0:', type=('build', 'link')) - depends_on('py-pybind11@2.4.0:', when='@1.4.1:', type=('build', 'link')) - depends_on('py-pybind11@2.4.3:', when='@1.5.0:', type=('build', 'link')) - depends_on('py-numpy@1.5.1:+blas+lapack', type=('build', 'link', 'run')) - depends_on('py-numpy@1.6.2:+blas+lapack', when='@0.16:', type=('build', 'link', 'run')) - depends_on('py-numpy@1.7.1:+blas+lapack', when='@0.18:', type=('build', 'link', 'run')) - depends_on('py-numpy@1.8.2:+blas+lapack', when='@0.19:', type=('build', 'link', 'run')) - depends_on('py-numpy@1.13.3:+blas+lapack', when='@1.3:', type=('build', 'link', 'run')) - depends_on('py-numpy@1.14.5:+blas+lapack', when='@1.5:', type=('build', 'link', 'run')) - depends_on('py-pytest', type='test') - - # NOTE: scipy picks up Blas/Lapack from numpy, see - # http://www.scipy.org/scipylib/building/linux.html#step-4-build-numpy-1-5-0 - depends_on('blas') - depends_on('lapack') - - # https://github.com/scipy/scipy/issues/12860 - patch('https://git.sagemath.org/sage.git/plain/build/pkgs/scipy/patches/extern_decls.patch?id=711fe05025795e44b84233e065d240859ccae5bd', - sha256='5433f60831cb554101520a8f8871ac5a32c95f7a971ccd68b69049535b106780', when='@1.2:1.5') - - patch('scipy-clang.patch', when='%clang') - - def setup_build_environment(self, env): - # https://github.com/scipy/scipy/issues/11611 - if self.spec.satisfies('@:1.4 %gcc@10:'): - env.set('FFLAGS', '-fallow-argument-mismatch') - - # Build in parallel - # Known problems with Python 3.5+ - # https://github.com/spack/spack/issues/7927 - # https://github.com/scipy/scipy/issues/7112 - if not self.spec.satisfies('^python@3.5:') or '+force-parallel-build' in self.spec: - env.set('NPY_NUM_BUILD_JOBS', str(make_jobs)) - - def build_args(self, spec, prefix): - args = [] - - # Build in parallel - # Known problems with Python 3.5+ - # https://github.com/spack/spack/issues/7927 - # https://github.com/scipy/scipy/issues/7112 - if not spec.satisfies('^python@3.5:') or '+force-parallel-build' in spec: - args.extend(['-j', str(make_jobs)]) - - return args - - def test(self): - # `setup.py test` is not supported. Use one of the following - # instead: - # - # - `python runtests.py` (to build and test) - # - `python runtests.py --no-build` (to test installed scipy) - # - `>>> scipy.test()` (run tests for installed scipy - # from within an interpreter) - pass - - def install_test(self): - # Change directories due to the following error: - # - # ImportError: Error importing scipy: you should not try to import - # scipy from its source directory; please exit the scipy - # source tree, and relaunch your python interpreter from there. - with working_dir('spack-test', create=True): - python('-c', 'import scipy; scipy.test("full", verbose=2)') diff --git a/scripts/uberenv/packages/py-scipy/scipy-clang.patch b/scripts/uberenv/packages/py-scipy/scipy-clang.patch deleted file mode 100644 index dcca99bd..00000000 --- a/scripts/uberenv/packages/py-scipy/scipy-clang.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/scipy/special/_faddeeva.cxx b/scipy/special/_faddeeva.cxx -index 9134516..159122c 100644 ---- a/scipy/special/_faddeeva.cxx -+++ b/scipy/special/_faddeeva.cxx -@@ -130,7 +130,7 @@ double faddeeva_voigt_profile(double x, double sigma, double gamma) - - if(sigma == 0){ - if (gamma == 0){ -- if (isnan(x)) -+ if (std::isnan(x)) - return x; - if (x == 0) - return NPY_INFINITY; diff --git a/scripts/uberenv/packages/raja/package.py b/scripts/uberenv/packages/raja/package.py deleted file mode 100644 index 56af1a48..00000000 --- a/scripts/uberenv/packages/raja/package.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class Raja(CMakePackage, CudaPackage): - """RAJA Parallel Framework.""" - - homepage = "http://software.llnl.gov/RAJA/" - git = "https://github.com/LLNL/RAJA.git" - - version('develop', branch='develop', submodules='True') - version('main', branch='main', submodules='True') - version('0.13.0', tag='v0.13.0', submodules="True") - version('0.12.1', tag='v0.12.1', submodules="True") - version('0.12.0', tag='v0.12.0', submodules="True") - version('0.11.0', tag='v0.11.0', submodules="True") - version('0.10.1', tag='v0.10.1', submodules="True") - version('0.10.0', tag='v0.10.0', submodules="True") - version('0.9.0', tag='v0.9.0', submodules="True") - version('0.8.0', tag='v0.8.0', submodules="True") - version('0.7.0', tag='v0.7.0', submodules="True") - version('0.6.0', tag='v0.6.0', submodules="True") - version('0.5.3', tag='v0.5.3', submodules="True") - version('0.5.2', tag='v0.5.2', submodules="True") - version('0.5.1', tag='v0.5.1', submodules="True") - version('0.5.0', tag='v0.5.0', submodules="True") - version('0.4.1', tag='v0.4.1', submodules="True") - version('0.4.0', tag='v0.4.0', submodules="True") - - variant('openmp', default=True, description='Build OpenMP backend') - variant('shared', default=True, description='Build Shared Libs') - variant('examples', default=True, description='Build examples.') - variant('exercises', default=True, description='Build exercises.') - - depends_on('cmake@3.8:', type='build') - depends_on('cmake@3.9:', when='+cuda', type='build') - - def cmake_args(self): - spec = self.spec - - options = [] - options.append('-DENABLE_OPENMP={0}'.format( - 'ON' if '+openmp' in spec else 'OFF')) - - if '+cuda' in spec: - options.extend([ - '-DENABLE_CUDA=ON', - '-DCUDA_TOOLKIT_ROOT_DIR=%s' % (spec['cuda'].prefix)]) - - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) - else: - options.append('-DENABLE_CUDA=OFF') - - options.append('-DBUILD_SHARED_LIBS={0}'.format( - 'ON' if '+shared' in spec else 'OFF')) - - options.append('-DENABLE_EXAMPLES={0}'.format( - 'ON' if '+examples' in spec else 'OFF')) - - options.append('-DENABLE_EXERCISES={0}'.format( - 'ON' if '+exercises' in spec else 'OFF')) - - # Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which - # is used by the spack compiler wrapper. This can go away when BLT - # removes -Werror from GTest flags - if self.spec.satisfies('%clang target=ppc64le:') or not self.run_tests: - options.append('-DENABLE_TESTS=OFF') - else: - options.append('-DENABLE_TESTS=ON') - - return options diff --git a/scripts/uberenv/packages/silo/package.py b/scripts/uberenv/packages/silo/package.py deleted file mode 100644 index d7ccc3d9..00000000 --- a/scripts/uberenv/packages/silo/package.py +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class Silo(AutotoolsPackage): - """Silo is a library for reading and writing a wide variety of scientific - data to binary, disk files.""" - - homepage = "http://wci.llnl.gov/simulation/computer-codes/silo" - url = "https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2.tar.gz" - - version('4.10.2', sha256='3af87e5f0608a69849c00eb7c73b11f8422fa36903dd14610584506e7f68e638', preferred=True) - version('4.10.2-bsd', sha256='4b901dfc1eb4656e83419a6fde15a2f6c6a31df84edfad7f1dc296e01b20140e', - url="https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2-bsd.tar.gz") - version('4.9', sha256='90f3d069963d859c142809cfcb034bc83eb951f61ac02ccb967fc8e8d0409854') - version('4.8', sha256='c430c1d33fcb9bc136a99ad473d535d6763bd1357b704a915ba7b1081d58fb21') - - variant('fortran', default=True, description='Enable Fortran support') - variant('shared', default=True, description='Build shared libraries') - variant('silex', default=False, - description='Builds Silex, a GUI for viewing Silo files') - variant('pic', default=True, - description='Produce position-independent code (for shared libs)') - variant('mpi', default=True, - description='Compile with MPI Compatibility') - variant('zlib', default=True, description='Compile with zlib') - - depends_on('hdf5@:1.10.999', when='@:4.10.2') - depends_on('hdf5~mpi', when='~mpi') - depends_on('mpi', when='+mpi') - depends_on('hdf5+mpi', when='+mpi') - depends_on('qt~framework@4.8:4.9', when='+silex') - depends_on('libx11', when='+silex') - depends_on('readline') - depends_on('zlib', when='+zlib') - - patch('remove-mpiposix.patch', when='@4.8:4.10.2') - - def flag_handler(self, name, flags): - spec = self.spec - if name == 'ldflags': - if spec['hdf5'].satisfies('~shared'): - flags.append('-ldl') - flags.append(spec['readline'].libs.search_flags) - - if '+pic' in spec: - if name == 'cflags': - flags.append(self.compiler.cc_pic_flag) - elif name == 'cxxflags': - flags.append(self.compiler.cxx_pic_flag) - elif name == 'fcflags': - flags.append(self.compiler.fc_pic_flag) - return (flags, None, None) - - @when('%clang@9:') - def patch(self): - self.clang_9_patch() - - @when('%apple-clang@11.0.3:') - def patch(self): - self.clang_9_patch() - - def clang_9_patch(self): - # Clang 9 and later include macro definitions in that conflict - # with typedefs DOMAIN and RANGE used in Silo plugins. - # It looks like the upstream fpzip repo has been fixed, but that change - # hasn't yet made it into silo. - # https://github.com/LLNL/fpzip/blob/master/src/pcmap.h - - def repl(match): - # Change macro-like uppercase to title-case. - return match.group(1).title() - - files_to_filter = [ - "src/fpzip/codec.h", - "src/fpzip/pcdecoder.inl", - "src/fpzip/pcencoder.inl", - "src/fpzip/pcmap.h", - "src/fpzip/pcmap.inl", - "src/fpzip/read.cpp", - "src/fpzip/write.cpp", - "src/hzip/hzmap.h", - "src/hzip/hzresidual.h", - ] - - filter_file(r'\b(DOMAIN|RANGE|UNION)\b', repl, *files_to_filter) - - def configure_args(self): - spec = self.spec - config_args = [ - '--with-hdf5=%s,%s' % (spec['hdf5'].prefix.include, - spec['hdf5'].prefix.lib), - '--enable-install-lite-headers', - '--enable-fortran' if '+fortran' in spec else '--disable-fortran', - '--enable-silex' if '+silex' in spec else '--disable-silex', - '--enable-shared' if '+shared' in spec else '--disable-shared', - ] - - if '+zlib' in spec: - config_args.extend(['--with-zlib=%s,%s' % (spec['zlib'].prefix.include, spec['zlib'].prefix.lib)]) - - if '+silex' in spec: - x = spec['libx11'] - config_args.extend([ - '--with-Qt-dir=' + spec['qt'].prefix, - '--with-Qt-lib=QtGui -lQtCore', - '--x-includes=' + x.prefix.include, - '--x-libraries=' + x.prefix.lib, - ]) - - if '+mpi' in spec: - config_args.append('CC=%s' % spec['mpi'].mpicc) - config_args.append('CXX=%s' % spec['mpi'].mpicxx) - if '+fortran' in spec: - config_args.append('FC=%s' % spec['mpi'].mpifc) - - return config_args diff --git a/scripts/uberenv/packages/suite-sparse/package.py b/scripts/uberenv/packages/suite-sparse/package.py deleted file mode 100644 index 48d0bf92..00000000 --- a/scripts/uberenv/packages/suite-sparse/package.py +++ /dev/null @@ -1,211 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class SuiteSparse(Package): - """ - SuiteSparse is a suite of sparse matrix algorithms - """ - homepage = 'http://faculty.cse.tamu.edu/davis/suitesparse.html' - url = 'https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v4.5.3.tar.gz' - git = 'https://github.com/DrTimothyAldenDavis/SuiteSparse.git' - - version('5.8.1', sha256='06726e471fbaa55f792578f9b4ab282ea9d008cf39ddcc3b42b73400acddef40') - version('5.8.0', sha256='94a9b7134eb4dd82b97f1a22a6b464feb81e73af2dcdf683c6f252285191df1d') - version('5.7.2', sha256='fe3bc7c3bd1efdfa5cffffb5cebf021ff024c83b5daf0ab445429d3d741bd3ad') - version('5.7.1', sha256='5ba5add1663d51a1b6fb128b50fe869b497f3096765ff7f8212f0ede044b9557') - version('5.6.0', sha256='76d34d9f6dafc592b69af14f58c1dc59e24853dcd7c2e8f4c98ffa223f6a1adb') - version('5.5.0', sha256='63c73451734e2bab19d1915796c6776565ea6aea5da4063a9797ecec60da2e3d') - version('5.4.0', sha256='d9d62d539410d66550d0b795503a556830831f50087723cb191a030525eda770') - version('5.3.0', sha256='d8ef4bee4394d2f07299d4688b83bbd98e9d3a2ebbe1c1632144b6f7095ce165') - version('5.2.0', sha256='68c431aef3d9a0b02e97803eb61671c5ecb9d36fd292a807db87067dadb36e53') - version('5.1.2', sha256='97dc5fdc7f78ff5018e6a1fcc841e17a9af4e5a35cebd62df6922349bf12959e') - version('5.1.0', sha256='0b0e03c63e67b04529bb6248808d2a8c82259d40b30fc5a7599f4b6f7bdd4dc6') - version('5.0.0', sha256='2f8694d9978033659f10ceb8bdb19147d3c519a0251b8de84be6ba8824d30517') - version('4.5.6', sha256='1c7b7a265a1d6c606095eb8aa3cb8e27821f1b7f5bc04f28df6d62906e02f4e4') - version('4.5.5', sha256='80d1d9960a6ec70031fecfe9adfe5b1ccd8001a7420efb50d6fa7326ef14af91') - version('4.5.3', sha256='b6965f9198446a502cde48fb0e02236e75fa5700b94c7306fc36599d57b563f4') - - variant('tbb', default=False, description='Build with Intel TBB') - variant('pic', default=True, description='Build position independent code (required to link with shared libraries)') - variant('cuda', default=False, description='Build with CUDA') - variant('openmp', default=False, description='Build with OpenMP') - - variant('klu', default=False, description='Build KLU.') - variant('btf', default=False, description='Build BTF.') - variant('umfpack', default=False, description='Build UMFPACK.') - variant('cholmod', default=False, description='Build CHOLMOD.') - variant('colamd', default=False, description='Build COLAMD.') - variant('amd', default=False, description='Build AMD.') - variant('camd', default=False, description='Build CAMD.') - variant('ccolamd', default=False, description='Build CCOLAMD.') - variant('csparse', default=False, description='Build CSparse.') - variant('cxsparse', default=False, description='Build CXSparse.') - variant('rbio', default=False, description='Build RBio.') - variant('spqr', default=False, description='Build SPQR.') - - variant('blas-no-underscore', default=False, description='Force no underscore for BLAS and LAPACK libs.') - - depends_on('blas') - depends_on('lapack') - depends_on('m4', type='build', when='@5.0.0:') - depends_on('cmake', when='@5.2.0:', type='build') - - depends_on('metis@5.1.0', when='@4.5.1:') - # in @4.5.1. TBB support in SPQR seems to be broken as TBB-related linkng - # flags does not seem to be used, which leads to linking errors on Linux. - depends_on('tbb', when='@4.5.3:+tbb') - - depends_on('cuda', when='+cuda') - - patch('tbb_453.patch', when='@4.5.3:4.5.5+tbb') - - # This patch removes unsupported flags for pgi compiler - patch('pgi.patch', when='%pgi') - - # This patch adds '-lm' when linking libgraphblas and when using clang. - # Fixes 'libgraphblas.so.2.0.1: undefined reference to `__fpclassify'' - patch('graphblas_libm_dep.patch', when='@5.2.0:5.2.99%clang') - - conflicts('%gcc@:4.8', when='@5.2.0:', msg='gcc version must be at least 4.9 for suite-sparse@5.2.0:') - conflicts('+cholmod~amd', msg='CHOLMOD depends on AMD.') - conflicts('+cholmod~camd', msg='CHOLMOD depends on CAMD.') - conflicts('+cholmod~colamd', msg='CHOLMOD depends on COLAMD.') - conflicts('+cholmod~ccolamd', msg='CHOLMOD depends on CCOLAMD.') - - conflicts('+umfpack~cholmod', msg='UMFPACK depends on cholmod') - - def install(self, spec, prefix): - # The build system of SuiteSparse is quite old-fashioned. - # It's basically a plain Makefile which include an header - # (SuiteSparse_config/SuiteSparse_config.mk)with a lot of convoluted - # logic in it. Any kind of customization will need to go through - # filtering of that file - - cc_pic_flag = self.compiler.cc_pic_flag if '+pic' in spec else '' - f77_pic_flag = self.compiler.f77_pic_flag if '+pic' in spec else '' - - make_args = [ - # By default, the Makefile uses the Intel compilers if - # they are found. The AUTOCC flag disables this behavior, - # forcing it to use Spack's compiler wrappers. - 'AUTOCC=no', - # CUDA=no does NOT disable cuda, it only disables internal search - # for CUDA_PATH. If in addition the latter is empty, then CUDA is - # completely disabled. See - # [SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk] for more. - 'CUDA=no', - 'CUDA_PATH=%s' % (spec['cuda'].prefix if '+cuda' in spec else ''), - 'CFOPENMP=%s' % (self.compiler.openmp_flag - if '+openmp' in spec else ''), - 'CFLAGS=-O3 %s' % cc_pic_flag, - # Both FFLAGS and F77FLAGS are used in SuiteSparse makefiles; - # FFLAGS is used in CHOLMOD, F77FLAGS is used in AMD and UMFPACK. - 'FFLAGS=%s' % f77_pic_flag, - 'F77FLAGS=%s' % f77_pic_flag, - # use Spack's metis in CHOLMOD/Partition module, - # otherwise internal Metis will be compiled - 'MY_METIS_LIB=%s' % spec['metis'].libs.ld_flags, - 'MY_METIS_INC=%s' % spec['metis'].prefix.include, - # Make sure Spack's Blas/Lapack is used. Otherwise System's - # Blas/Lapack might be picked up. Need to add -lstdc++, following - # with the TCOV path of SparseSuite 4.5.1's Suitesparse_config.mk, - # even though this fix is ugly - 'BLAS=%s' % (spec['blas'].libs.ld_flags + ( - ' -lstdc++' if '@4.5.1' in spec else '')), - 'LAPACK=%s' % spec['lapack'].libs.ld_flags, - ] - - # Recent versions require c11 but some demos do not get the c11 from - # GraphBLAS/CMakeLists.txt, for example the file - # GraphBLAS/Demo/Program/wildtype_demo.c. For many compilers this is - # not an issue because c11 or newer is their default. However, for some - # compilers (e.g. xlc) the c11 flag is necessary. - if spec.satisfies('@5.4:5.7.1') and ('%xl' in spec or '%xl_r' in spec): - make_args += ['CFLAGS+=%s' % self.compiler.c11_flag] - - # 64bit blas in UMFPACK: - if (spec.satisfies('^openblas+ilp64') or - spec.satisfies('^intel-mkl+ilp64') or - spec.satisfies('^intel-parallel-studio+mkl+ilp64')): - make_args.append('UMFPACK_CONFIG=-DLONGBLAS="long long"') - - # SuiteSparse defaults to using '-fno-common -fexceptions' in - # CFLAGS, but not all compilers use the same flags for these - # optimizations - if any([x in spec - for x in ('%apple-clang', '%clang', '%gcc', '%intel')]): - make_args += ['CFLAGS+=-fno-common -fexceptions'] - elif '%pgi' in spec: - make_args += ['CFLAGS+=--exceptions'] - - if '+blas-no-underscore' in spec or spack_f77.endswith('xlf') or spack_f77.endswith('xlf_r'): - make_args += ['CFLAGS+=-DBLAS_NO_UNDERSCORE'] - - # Intel TBB in SuiteSparseQR - if 'tbb' in spec: - make_args += [ - 'SPQR_CONFIG=-DHAVE_TBB', - 'TBB=%s' % spec['tbb'].libs.ld_flags, - ] - - if '@5.3:' in spec: - # Without CMAKE_LIBRARY_PATH defined, the CMake file in the - # Mongoose directory finds libsuitesparseconfig.so in system - # directories like /usr/lib. - make_args += [ - 'CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=%s' % prefix + - ' -DCMAKE_LIBRARY_PATH=%s' % prefix.lib] - - make_args.append('INSTALL=%s' % prefix) - - libraries = (('SuiteSparse_config', True), - ('SPQR', '+spqr' in spec), - ('RBio', '+rbio' in spec), - ('CSparse', '+csparse' in spec), - ('CXSparse', '+cxsparse' in spec), - ('CCOLAMD', '+ccolamd' in spec), - ('CAMD', '+camd' in spec), - ('AMD', '+amd' in spec), - ('COLAMD', '+colamd' in spec), - ('CHOLMOD', '+cholmod' in spec), - ('UMFPACK', '+umfpack' in spec), - ('BTF', '+btf' in spec), - ('KLU', '+klu' in spec)) - - # In those SuiteSparse versions calling "make install" in one go is - # not possible, mainly because of GraphBLAS. Thus compile first and - # install in a second run. - for directory, shouldBuild in libraries: - if shouldBuild: - with working_dir(directory): - if '@5.4.0:' in self.spec: - make('library', *make_args) - - for directory, shouldBuild in libraries: - if shouldBuild: - with working_dir(directory): - make('install', *make_args) - - @property - def libs(self): - """Export the libraries of SuiteSparse. - Sample usage: spec['suite-sparse'].libs.ld_flags - spec['suite-sparse:klu,btf'].libs.ld_flags - """ - # Component libraries, ordered by dependency. Any missing components? - all_comps = ['klu', 'btf', 'umfpack', 'cholmod', 'colamd', 'amd', - 'camd', 'ccolamd', 'cxsparse', 'ldl', 'rbio', 'spqr', - 'suitesparseconfig'] - query_parameters = self.spec.last_query.extra_parameters - comps = all_comps if not query_parameters else query_parameters - libs = find_libraries(['lib' + c for c in comps], root=self.prefix.lib, - shared=True, recursive=False) - if not libs: - return None - libs += find_system_libraries('librt') - return libs diff --git a/scripts/uberenv/packages/trilinos/package.py b/scripts/uberenv/packages/trilinos/package.py deleted file mode 100644 index b126010d..00000000 --- a/scripts/uberenv/packages/trilinos/package.py +++ /dev/null @@ -1,813 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import os -import sys -from spack import * -from spack.operating_systems.mac_os import macos_version - -# Trilinos is complicated to build, as an inspiration a couple of links to -# other repositories which build it: -# https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/t/trilinos.py#L111 -# https://github.com/koecher/candi/blob/master/deal.II-toolchain/packages/trilinos.package -# https://gitlab.com/configurations/cluster-config/blob/master/trilinos.sh -# https://github.com/Homebrew/homebrew-science/blob/master/trilinos.rb and some -# relevant documentation/examples: -# https://github.com/trilinos/Trilinos/issues/175 - - -class Trilinos(CMakePackage): - """The Trilinos Project is an effort to develop algorithms and enabling - technologies within an object-oriented software framework for the solution - of large-scale, complex multi-physics engineering and scientific problems. - A unique design feature of Trilinos is its focus on packages. - """ - homepage = "https://trilinos.org/" - url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-12-12-1.tar.gz" - git = "https://github.com/trilinos/Trilinos.git" - - maintainers = ['keitat'] - - # ###################### Versions ########################## - - version('xsdk-0.2.0', tag='xsdk-0.2.0') - version('develop', branch='develop') - version('master', branch='master') - version('13.0.0', commit='9fec35276d846a667bc668ff4cbdfd8be0dfea08') # tag trilinos-release-13-0-0 - version('12.18.1', commit='55a75997332636a28afc9db1aee4ae46fe8d93e7') # tag trilinos-release-12-8-1 - version('12.14.1', sha256='52a4406cca2241f5eea8e166c2950471dd9478ad6741cbb2a7fc8225814616f0') - version('12.12.1', sha256='5474c5329c6309224a7e1726cf6f0d855025b2042959e4e2be2748bd6bb49e18') - version('12.10.1', sha256='ab81d917196ffbc21c4927d42df079dd94c83c1a08bda43fef2dd34d0c1a5512') - version('12.8.1', sha256='d20fe60e31e3ba1ef36edecd88226240a518f50a4d6edcc195b88ee9dda5b4a1') - version('12.6.4', sha256='1c7104ba60ee8cc4ec0458a1c4f6a26130616bae7580a7b15f2771a955818b73') - version('12.6.3', sha256='4d28298bb4074eef522db6cd1626f1a934e3d80f292caf669b8846c0a458fe81') - version('12.6.2', sha256='8be7e3e1166cc05aea7f856cc8033182e8114aeb8f87184cb38873bfb2061779') - version('12.6.1', sha256='4b38ede471bed0036dcb81a116fba8194f7bf1a9330da4e29c3eb507d2db18db') - version('12.4.2', sha256='fd2c12e87a7cedc058bcb8357107ffa2474997aa7b17b8e37225a1f7c32e6f0e') - version('12.2.1', sha256='088f303e0dc00fb4072b895c6ecb4e2a3ad9a2687b9c62153de05832cf242098') - version('12.0.1', sha256='eee7c19ca108538fa1c77a6651b084e06f59d7c3307dae77144136639ab55980') - version('11.14.3', sha256='e37fa5f69103576c89300e14d43ba77ad75998a54731008b25890d39892e6e60') - version('11.14.2', sha256='f22b2b0df7b88e28b992e19044ba72b845292b93cbbb3a948488199647381119') - version('11.14.1', sha256='f10fc0a496bf49427eb6871c80816d6e26822a39177d850cc62cf1484e4eec07') - - # ###################### Variants ########################## - - # Other - # not everyone has py-numpy activated, keep it disabled by default to avoid - # configure errors - variant('python', default=False, - description='Build python wrappers') - - # Build options - variant('complex', default=False, - description='Enable complex numbers in Trilinos') - variant('explicit_template_instantiation', default=True, - description='Enable explicit template instantiation (ETI)') - variant('float', default=False, - description='Enable single precision (float) numbers in Trilinos') - variant('gotype', default='long', - values=('int', 'long', 'long_long'), - multi=False, - description='global ordinal type for Tpetra') - variant('fortran', default=True, - description='Compile with Fortran support') - variant('openmp', default=False, - description='Enable OpenMP') - variant('shared', default=True, - description='Enables the build of shared libraries') - variant('debug', default=False, - description='Enable runtime safety and debug checks') - variant('xsdkflags', default=False, - description='Compile using the default xSDK configuration') - variant('blas_lowercase_no_underscore', default=False, - description='Override the default F77_BLAS_MANGLE scheme.') - variant('force-new-lapack', default=False, - description='Override the auto detection of the LAPACK API.') - - # TPLs (alphabet order) - variant('boost', default=True, - description='Compile with Boost') - variant('cgns', default=False, - description='Enable CGNS') - variant('adios2', default=False, - description='Enable ADIOS2') - variant('glm', default=True, - description='Compile with GLM') - variant('gtest', default=True, - description='Compile with Gtest') - variant('hdf5', default=True, - description='Compile with HDF5') - variant('hypre', default=True, - description='Compile with Hypre preconditioner') - variant('matio', default=True, - description='Compile with Matio') - variant('metis', default=True, - description='Compile with METIS and ParMETIS') - variant('mpi', default=True, - description='Compile with MPI parallelism') - variant('mumps', default=True, - description='Compile with support for MUMPS solvers') - variant('netcdf', default=True, - description='Compile with netcdf') - variant('pnetcdf', default=False, - description='Compile with parallel-netcdf') - variant('suite-sparse', default=True, - description='Compile with SuiteSparse solvers') - variant('superlu-dist', default=False, - description='Compile with SuperluDist solvers') - variant('superlu', default=False, - description='Compile with SuperLU solvers') - variant('x11', default=False, - description='Compile with X11') - variant('zlib', default=False, - description='Compile with zlib') - - # Package options (alphabet order) - variant('alloptpkgs', default=False, - description='Compile with all optional packages') - variant('amesos', default=True, - description='Compile with Amesos') - variant('amesos2', default=True, - description='Compile with Amesos2') - variant('anasazi', default=True, - description='Compile with Anasazi') - variant('aztec', default=True, - description='Compile with Aztec') - variant('belos', default=True, - description='Compile with Belos') - # chaco is disabled by default. As of 12.14.1 libchaco.so - # has the global symbol divide (and maybe others) that can - # lead to symbol clash. - variant('chaco', default=False, - description='Compile with Chaco from SEACAS') - variant('epetra', default=True, - description='Compile with Epetra') - variant('epetraext', default=True, - description='Compile with EpetraExt') - variant('exodus', default=True, - description='Compile with Exodus from SEACAS') - variant('ifpack', default=True, - description='Compile with Ifpack') - variant('ifpack2', default=True, - description='Compile with Ifpack2') - variant('intrepid', default=False, - description='Enable Intrepid') - variant('intrepid2', default=False, - description='Enable Intrepid2') - variant('isorropia', default=False, - description='Compile with Isorropia') - variant('kokkos', default=True, - description='Compile with Kokkos') - variant('ml', default=True, - description='Compile with ML') - variant('minitensor', default=False, - description='Compile with MiniTensor') - variant('muelu', default=True, - description='Compile with Muelu') - variant('nox', default=False, - description='Compile with NOX') - variant('piro', default=False, - description='Compile with Piro') - variant('phalanx', default=False, - description='Compile with Phalanx') - variant('rol', default=False, - description='Compile with ROL') - variant('rythmos', default=False, - description='Compile with Rythmos') - variant('sacado', default=True, - description='Compile with Sacado') - variant('stk', default=False, - description='Compile with STK') - variant('shards', default=False, - description='Compile with Shards') - variant('shylu', default=False, - description='Compile with ShyLU') - variant('stratimikos', default=False, - description='Compile with Stratimikos') - variant('teko', default=False, - description='Compile with Teko') - variant('tempus', default=False, - description='Compile with Tempus') - variant('teuchos', default=True, - description='Compile with Teuchos') - variant('tpetra', default=True, - description='Compile with Tpetra') - variant('zoltan', default=True, - description='Compile with Zoltan') - variant('zoltan2', default=True, - description='Compile with Zoltan2') - - # External package options - variant('dtk', default=False, - description='Enable DataTransferKit') - variant('mesquite', default=False, - description='Enable Mesquite') - - resource(name='dtk', - git='https://github.com/ornl-cees/DataTransferKit.git', - commit='4fe4d9d56cfd4f8a61f392b81d8efd0e389ee764', # branch dtk-3.0 - placement='DataTransferKit', - when='+dtk @12.14.0:12.14.99') - resource(name='dtk', - git='https://github.com/ornl-cees/DataTransferKit.git', - commit='edfa050cd46e2274ab0a0b7558caca0079c2e4ca', # tag 3.1-rc1 - placement='DataTransferKit', - submodules=True, - when='+dtk @12.18:12.18.99') - resource(name='dtk', - git='https://github.com/ornl-cees/DataTransferKit.git', - branch='master', - placement='DataTransferKit', - submodules=True, - when='+dtk @develop') - resource(name='mesquite', - url='https://github.com/trilinos/mesquite/archive/trilinos-release-12-12-1.tar.gz', - sha256='e0d09b0939dbd461822477449dca611417316e8e8d8268fd795debb068edcbb5', - placement='packages/mesquite', - when='+mesquite @12.12.1:12.16.99') - resource(name='mesquite', - git='https://github.com/trilinos/mesquite.git', - commit='20a679679b5cdf15bf573d66c5dc2b016e8b9ca1', # branch trilinos-release-12-12-1 - placement='packages/mesquite', - when='+mesquite @12.18.1:12.18.99') - resource(name='mesquite', - git='https://github.com/trilinos/mesquite.git', - tag='develop', - placement='packages/mesquite', - when='+mesquite @develop') - - conflicts('+amesos2', when='~teuchos') - conflicts('+amesos2', when='~tpetra') - conflicts('+amesos', when='~epetra') - conflicts('+amesos', when='~teuchos') - conflicts('+anasazi', when='~teuchos') - conflicts('+aztec', when='~epetra') - conflicts('+belos', when='~teuchos') - conflicts('+epetraext', when='~epetra') - conflicts('+epetraext', when='~teuchos') - conflicts('+exodus', when='~netcdf') - conflicts('+ifpack2', when='~belos') - conflicts('+ifpack2', when='~teuchos') - conflicts('+ifpack2', when='~tpetra') - conflicts('+ifpack', when='~epetra') - conflicts('+ifpack', when='~teuchos') - conflicts('+intrepid2', when='~kokkos') - conflicts('+intrepid2', when='~shards') - conflicts('+intrepid2', when='~teuchos') - conflicts('+intrepid', when='~sacado') - conflicts('+intrepid', when='~shards') - conflicts('+intrepid', when='~teuchos') - conflicts('+isorropia', when='~epetra') - conflicts('+isorropia', when='~epetraext') - conflicts('+isorropia', when='~teuchos') - conflicts('+isorropia', when='~zoltan') - conflicts('+muelu', when='~teuchos') - conflicts('+muelu', when='~xpetra') - conflicts('+nox', when='~teuchos') - conflicts('+phalanx', when='~kokkos') - conflicts('+phalanx', when='~sacado') - conflicts('+phalanx', when='~teuchos') - conflicts('+piro', when='~teuchos') - conflicts('+rol', when='~teuchos') - conflicts('+rythmos', when='~teuchos') - conflicts('+teko', when='~amesos') - conflicts('+teko', when='~anasazi') - conflicts('+teko', when='~aztec') - conflicts('+teko', when='~ifpack') - conflicts('+teko', when='~ml') - conflicts('+teko', when='~teuchos') - conflicts('+teko', when='~tpetra') - conflicts('+tempus', when='~nox') - conflicts('+tempus', when='~teuchos') - conflicts('+tpetra', when='~kokkos') - conflicts('+tpetra', when='~teuchos') - conflicts('+zoltan2', when='~teuchos') - conflicts('+zoltan2', when='~tpetra') - conflicts('+zoltan2', when='~xpetra') - conflicts('+zoltan2', when='~zoltan') - - conflicts('+dtk', when='~boost') - conflicts('+dtk', when='~intrepid2') - conflicts('+dtk', when='~kokkos') - conflicts('+dtk', when='~teuchos') - conflicts('+dtk', when='~tpetra') - # Only allow DTK with Trilinos 12.14 and develop - conflicts('+dtk', when='@0:12.12.99,master') - # Only allow Mesquite with Trilinos 12.12 and up, and develop - conflicts('+mesquite', when='@0:12.10.99,master') - # Can only use one type of SuperLU - conflicts('+superlu-dist', when='+superlu') - # For Trilinos v11 we need to force SuperLUDist=OFF, since only the - # deprecated SuperLUDist v3.3 together with an Amesos patch is working. - conflicts('+superlu-dist', when='@11.4.1:11.14.3') - # see https://github.com/trilinos/Trilinos/issues/3566 - conflicts('+superlu-dist', when='+float+amesos2+explicit_template_instantiation^superlu-dist@5.3.0:') - # Amesos, conflicting types of double and complex SLU_D - # see - # https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html - # and - # https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html - conflicts('+superlu-dist', when='+complex+amesos2') - # PnetCDF was only added after v12.10.1 - conflicts('+pnetcdf', when='@0:12.10.1') - # https://github.com/trilinos/Trilinos/issues/2994 - conflicts( - '+shared', when='+stk platform=darwin', - msg='Cannot build Trilinos with STK as a shared library on Darwin.' - ) - # ADIOS2 was only added after v12.14.1 - conflicts('+adios2', when='@:12.14.1') - conflicts('+adios2', when='@xsdk-0.2.0') - conflicts('+pnetcdf', when='~netcdf') - - # ###################### Dependencies ########################## - - # Everything should be compiled position independent (-fpic) - depends_on('blas') - depends_on('lapack') - depends_on('boost', when='+boost') - depends_on('glm', when='+glm') - depends_on('hdf5+hl', when='+hdf5') - depends_on('matio', when='+matio') - depends_on('metis@5:', when='+metis') - depends_on('suite-sparse', when='+suite-sparse') - depends_on('zlib', when="+zlib") - - # MPI related dependencies - depends_on('mpi', when='+mpi') - depends_on('hdf5+mpi', when="+hdf5+mpi") - depends_on('netcdf-c+mpi', when="+netcdf~pnetcdf+mpi") - depends_on('netcdf-c+mpi+parallel-netcdf', when="+netcdf+pnetcdf@master,12.12.1:") - depends_on('parallel-netcdf', when="+netcdf+pnetcdf@master,12.12.1:") - depends_on('parmetis', when='+metis+mpi') - depends_on('cgns', when='+cgns') - depends_on('adios2', when='+adios2') - # Trilinos' Tribits config system is limited which makes it very tricky to - # link Amesos with static MUMPS, see - # https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html - # One could work it out by getting linking flags from mpif90 --showme:link - # (or alike) and adding results to -DTrilinos_EXTRA_LINK_FLAGS together - # with Blas and Lapack and ScaLAPACK and Blacs and -lgfortran and it may - # work at the end. But let's avoid all this by simply using shared libs - depends_on('mumps@5.0:+mpi+shared', when='+mumps') - depends_on('scalapack', when='+mumps') - depends_on('superlu-dist', when='+superlu-dist') - depends_on('superlu-dist@:4.3', when='@11.14.1:12.6.1+superlu-dist') - depends_on('superlu-dist@4.4:5.3', when='@12.6.2:12.12.1+superlu-dist') - depends_on('superlu-dist@5.4:6.2.0', when='@12.12.2:13.0+superlu-dist') - depends_on('superlu-dist@develop', when='@develop+superlu-dist') - depends_on('superlu-dist@xsdk-0.2.0', when='@xsdk-0.2.0+superlu-dist') - depends_on('superlu+pic@4.3', when='+superlu') - # Trilinos can not be built against 64bit int hypre - depends_on('hypre~internal-superlu~int64', when='+hypre') - depends_on('hypre@xsdk-0.2.0~internal-superlu', when='@xsdk-0.2.0+hypre') - depends_on('hypre@develop~internal-superlu', when='@develop+hypre') - depends_on('python', when='+python') - depends_on('py-numpy', when='+python', type=('build', 'run')) - depends_on('swig', when='+python') - - # Dependencies/conflicts when MPI is disabled - depends_on('hdf5~mpi', when='+hdf5~mpi') - conflicts('+parmetis', when='~mpi') - conflicts('+pnetcdf', when='~mpi') - - patch('umfpack_from_suitesparse.patch', when='@11.14.1:12.8.1') - patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %xl') - patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %xl_r') - patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %clang') - patch('xlf_tpetra.patch', when='@12.12.1%xl') - patch('xlf_tpetra.patch', when='@12.12.1%xl_r') - patch('xlf_tpetra.patch', when='@12.12.1%clang') - patch('fix_clang_errors_12_18_1.patch', when='@12.18.1%clang') - patch('cray_secas_12_12_1.patch', when='@12.12.1%cce') - patch('cray_secas.patch', when='@12.14.1:12.18.1%cce') - - def url_for_version(self, version): - url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-{0}.tar.gz" - return url.format(version.dashed) - - def cmake_args(self): - spec = self.spec - define = CMakePackage.define - - def define_trilinos_enable(cmake_var, spec_var=None): - if spec_var is None: - spec_var = cmake_var.lower() - return self.define_from_variant( - 'Trilinos_ENABLE_' + cmake_var, spec_var) - - def define_tpl_enable(cmake_var, spec_var=None): - if spec_var is None: - spec_var = cmake_var.lower() - return self.define_from_variant('TPL_ENABLE_' + cmake_var, - spec_var) - - cxx_flags = [] - options = [] - - # #################### Base Settings ####################### - - options.extend([ - define('Trilinos_VERBOSE_CONFIGURE', False), - define('Trilinos_ENABLE_TESTS', False), - define('Trilinos_ENABLE_EXAMPLES', False), - define('Trilinos_ENABLE_CXX11', True), - self.define_from_variant('BUILD_SHARED_LIBS', 'shared'), - define_trilinos_enable('DEBUG', 'debug'), - # The following can cause problems on systems that don't have - # static libraries available for things like dl and pthreads - # for example when trying to build static libs - # define('TPL_FIND_SHARED_LIBS', ( - # 'ON' if '+shared' in spec else 'OFF')) - # define('Trilinos_LINK_SEARCH_START_STATIC', ( - # 'OFF' if '+shared' in spec else 'ON')) - ]) - - # MPI settings - options.append(define_tpl_enable('MPI')) - if '+mpi' in spec: - # Force Trilinos to use the MPI wrappers instead of raw compilers - # this is needed on Apple systems that require full resolution of - # all symbols when linking shared libraries - options.extend([ - define('CMAKE_C_COMPILER', spec['mpi'].mpicc), - define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), - define('CMAKE_Fortran_COMPILER', spec['mpi'].mpifc), - define('MPI_BASE_DIR', spec['mpi'].prefix), - ]) - - if '+blas_lowercase_no_underscore' in spec: - options.extend([define('F77_BLAS_MANGLE', '(lcase,UCASE) lcase')]) - - if '+force-new-lapack' in spec: - options.extend([define('HAVE_dggsvd3', 'ON')]) - - # ################## Trilinos Packages ##################### - - options.extend([ - define_trilinos_enable('ALL_OPTIONAL_PACKAGES', 'alloptpkgs'), - define_trilinos_enable('Amesos'), - define_trilinos_enable('Amesos2'), - define_trilinos_enable('Anasazi'), - define_trilinos_enable('AztecOO', 'aztec'), - define_trilinos_enable('Belos'), - define_trilinos_enable('Epetra'), - define_trilinos_enable('EpetraExt'), - define_trilinos_enable('Ifpack'), - define_trilinos_enable('Ifpack2'), - define_trilinos_enable('Intrepid'), - define_trilinos_enable('Intrepid2'), - define_trilinos_enable('Isorropia'), - define_trilinos_enable('Kokkos'), - define_trilinos_enable('MiniTensor'), - define_trilinos_enable('Mesquite'), - define_trilinos_enable('ML'), - define_trilinos_enable('MueLu'), - define_trilinos_enable('NOX'), - define_trilinos_enable('Piro'), - define_trilinos_enable('Phalanx'), - define_trilinos_enable('PyTrilinos', 'python'), - define_trilinos_enable('ROL'), - define_trilinos_enable('Rythmos'), - define_trilinos_enable('Sacado'), - define_trilinos_enable('Shards'), - define_trilinos_enable('ShyLU'), - define_trilinos_enable('STK'), - define_trilinos_enable('Stratimikos'), - define_trilinos_enable('Teko'), - define_trilinos_enable('Tempus'), - define_trilinos_enable('Teuchos'), - define_trilinos_enable('Tpetra'), - define_trilinos_enable('Zoltan'), - define_trilinos_enable('Zoltan2'), - ]) - - options.append(self.define_from_variant('USE_XSDK_DEFAULTS', - 'xsdkflags')) - - if '+dtk' in spec: - options.extend([ - define('Trilinos_EXTRA_REPOSITORIES', 'DataTransferKit'), - define('Trilinos_ENABLE_DataTransferKit', True), - ]) - - if '+exodus' in spec: - options.extend([ - define('Trilinos_ENABLE_SEACAS', True), - define('Trilinos_ENABLE_SEACASExodus', True), - define('Trilinos_ENABLE_SEACASIoss', True), - define('Trilinos_ENABLE_SEACASEpu', True), - define('Trilinos_ENABLE_SEACASExodiff', True), - define('Trilinos_ENABLE_SEACASNemspread', True), - define('Trilinos_ENABLE_SEACASNemslice', True), - ]) - else: - options.extend([ - define('Trilinos_ENABLE_SEACASExodus', False), - define('Trilinos_ENABLE_SEACASIoss', False), - ]) - - if '+chaco' in spec: - options.extend([ - define('Trilinos_ENABLE_SEACAS', True), - define('Trilinos_ENABLE_SEACASChaco', True), - ]) - else: - # don't disable SEACAS, could be needed elsewhere - options.extend([ - define('Trilinos_ENABLE_SEACASChaco', False), - define('Trilinos_ENABLE_SEACASNemslice', False) - ]) - - if '+stratimikos' in spec: - # Explicitly enable Thyra (ThyraCore is required). If you don't do - # this, then you get "NOT setting ${pkg}_ENABLE_Thyra=ON since - # Thyra is NOT enabled at this point!" leading to eventual build - # errors if using MueLu because `Xpetra_ENABLE_Thyra` is set to - # off. - options.append(define('Trilinos_ENABLE_Thyra', True)) - - # Add thyra adapters based on package enables - options.extend( - define_trilinos_enable('Thyra' + pkg + 'Adapters', pkg.lower()) - for pkg in ['Epetra', 'EpetraExt', 'Tpetra']) - - # ######################### TPLs ############################# - - blas = spec['blas'].libs - lapack = spec['lapack'].libs - options.extend([ - define('TPL_ENABLE_BLAS', True), - define('BLAS_LIBRARY_NAMES', blas.names), - define('BLAS_LIBRARY_DIRS', blas.directories), - define('TPL_ENABLE_LAPACK', True), - define('LAPACK_LIBRARY_NAMES', lapack.names), - define('LAPACK_LIBRARY_DIRS', lapack.directories), - define_tpl_enable('GLM'), - define_tpl_enable('Matio'), - define_tpl_enable('X11'), - define_trilinos_enable('Gtest', 'gtest'), - ]) - - if '^intel-mkl' in spec: - options.extend([define('TPL_ENABLE_MKL', True), - define('TPL_MKL_INCLUDE_DIRS', spec['intel-mkl'].prefix.include), - define('TPL_MKL_LIBRARIES', ';'.join(spec['intel-mkl'].libs))]) - - options.append(define_tpl_enable('Netcdf')) - if '+netcdf' in spec: - options.append(define('NetCDF_ROOT', spec['netcdf-c'].prefix)) - - options.append(define_tpl_enable('HYPRE')) - if '+hypre' in spec: - options.extend([ - define('HYPRE_INCLUDE_DIRS', spec['hypre'].prefix.include), - define('HYPRE_LIBRARY_DIRS', spec['hypre'].prefix.lib), - ]) - - options.append(define_tpl_enable('Boost')) - if '+boost' in spec: - options.extend([ - define('Boost_INCLUDE_DIRS', spec['boost'].prefix.include), - define('Boost_LIBRARY_DIRS', spec['boost'].prefix.lib), - ]) - - options.append(define_tpl_enable('HDF5')) - if '+hdf5' in spec: - options.extend([ - define('HDF5_INCLUDE_DIRS', spec['hdf5'].prefix.include), - define('HDF5_LIBRARY_DIRS', spec['hdf5'].prefix.lib), - ]) - - if '+suite-sparse' in spec: - options.extend([ - # FIXME: Trilinos seems to be looking for static libs only, - # patch CMake TPL file? - define('TPL_ENABLE_Cholmod', False), - # define('TPL_ENABLE_Cholmod', True), - # define('Cholmod_LIBRARY_DIRS', ( - # spec['suite-sparse'].prefix.lib) - # define('Cholmod_INCLUDE_DIRS', ( - # spec['suite-sparse'].prefix.include) - define('TPL_ENABLE_UMFPACK', True), - define('UMFPACK_LIBRARY_DIRS', - spec['suite-sparse'].prefix.lib), - define('UMFPACK_INCLUDE_DIRS', - spec['suite-sparse'].prefix.include), - define('UMFPACK_LIBRARY_NAMES', [ - 'umfpack', 'amd', 'colamd', 'cholmod', 'suitesparseconfig' - ]), - ]) - else: - options.extend([ - define('TPL_ENABLE_Cholmod', False), - define('TPL_ENABLE_UMFPACK', False), - ]) - - options.append(define_tpl_enable('METIS')) - options.append(define_tpl_enable('ParMETIS', 'metis')) - if '+metis' in spec: - options.extend([ - define('METIS_LIBRARY_DIRS', spec['metis'].prefix.lib), - define('METIS_LIBRARY_NAMES', 'metis'), - define('TPL_METIS_INCLUDE_DIRS', spec['metis'].prefix.include), - define('TPL_ENABLE_ParMETIS', True), - define('ParMETIS_LIBRARY_DIRS', [ - spec['parmetis'].prefix.lib, spec['metis'].prefix.lib - ]), - define('ParMETIS_LIBRARY_NAMES', ['parmetis', 'metis']), - define('TPL_ParMETIS_INCLUDE_DIRS', [ - spec['parmetis'].prefix.include, - spec['metis'].prefix.include - ]), - ]) - - options.append(define_tpl_enable('MUMPS')) - options.append(define_tpl_enable('SCALAPACK', 'mumps')) - if '+mumps' in spec: - scalapack = spec['scalapack'].libs - options.extend([ - define('MUMPS_LIBRARY_DIRS', spec['mumps'].prefix.lib), - # order is important! - define('MUMPS_LIBRARY_NAMES', [ - 'dmumps', 'mumps_common', 'pord' - ]), - define('SCALAPACK_LIBRARY_NAMES', scalapack.names), - define('SCALAPACK_LIBRARY_DIRS', scalapack.directories), - ]) - # see - # https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS - cxx_flags.extend([ - '-DMUMPS_5_0' - ]) - - options.append(define_tpl_enable('SuperLUDist', 'superlu-dist')) - if '+superlu-dist' in spec: - options.extend([ - define('KokkosTSQR_ENABLE_Complex', False), - define('TPL_ENABLE_SuperLUDist', True), - define('SuperLUDist_LIBRARY_DIRS', - spec['superlu-dist'].prefix.lib), - define('SuperLUDist_INCLUDE_DIRS', - spec['superlu-dist'].prefix.include), - ]) - if spec.satisfies('^superlu-dist@4.0:'): - options.extend([ - define('HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG', True), - ]) - - options.append(define_tpl_enable('SuperLU')) - if '+superlu' in spec: - options.extend([ - define('SuperLU_LIBRARY_DIRS', spec['superlu'].prefix.lib), - define('SuperLU_INCLUDE_DIRS', spec['superlu'].prefix.include), - ]) - - options.append(define_tpl_enable('Pnetcdf')) - if '+pnetcdf' in spec: - options.extend([ - define('TPL_Netcdf_Enables_Netcdf4', True), - define('TPL_Netcdf_PARALLEL', True), - define('PNetCDF_ROOT', spec['parallel-netcdf'].prefix), - ]) - - options.append(define_tpl_enable('Zlib')) - if '+zlib' in spec: - options.extend([ - define('TPL_ENABLE_Zlib', True), - define('Zlib_ROOT', spec['zlib'].prefix), - ]) - - options.append(define_tpl_enable('CGNS')) - if '+cgns' in spec: - options.extend([ - define('TPL_ENABLE_CGNS', True), - define('CGNS_INCLUDE_DIRS', spec['cgns'].prefix.include), - define('CGNS_LIBRARY_DIRS', spec['cgns'].prefix.lib), - ]) - - options.append(self.define_from_variant('TPL_ENABLE_ADIOS2', 'adios2')) - - # ################# Miscellaneous Stuff ###################### - - # OpenMP - options.append(define_trilinos_enable('OpenMP')) - if '+openmp' in spec: - options.append(define('Kokkos_ENABLE_OpenMP', True)) - if '+tpetra' in spec: - options.append(define('Tpetra_INST_OPENMP', True)) - - # Fortran lib (assumes clang is built with gfortran!) - if '+fortran' in spec and ( - spec.satisfies('%gcc') or spec.satisfies('%clang') or - spec.satisfies('%apple-clang') - ): - options.append(define('Trilinos_ENABLE_Fortran', True)) - if '+mpi' in spec: - libgfortran = os.path.dirname(os.popen( - '%s --print-file-name libgfortran.a' % - spec['mpi'].mpifc).read()) - options.append(define( - 'Trilinos_EXTRA_LINK_FLAGS', - '-L%s/ -lgfortran' % (libgfortran), - )) - - float_s = '+float' in spec - complex_s = '+complex' in spec - if '+teuchos' in spec: - options.extend([ - define('Teuchos_ENABLE_COMPLEX', complex_s), - define('Teuchos_ENABLE_FLOAT', float_s), - ]) - - # Explicit Template Instantiation (ETI) in Tpetra - # NOTE: Trilinos will soon move to fixed std::uint64_t for GO and - # std::int32_t or std::int64_t for local. - options.append(self.define_from_variant( - 'Trilinos_ENABLE_EXPLICIT_INSTANTIATION', - 'explicit_template_instantiation')) - - if '+explicit_template_instantiation' in spec and '+tpetra' in spec: - options.extend([ - define('Tpetra_INST_DOUBLE', True), - define('Tpetra_INST_COMPLEX_DOUBLE', complex_s), - define('Tpetra_INST_COMPLEX_FLOAT', float_s and complex_s), - define('Tpetra_INST_FLOAT', float_s), - define('Tpetra_INST_SERIAL', True), - ]) - - gotype = spec.variants['gotype'].value - # default in older Trilinos versions to enable multiple GOs - if ((gotype == 'none') and spec.satisfies('@:12.14.1')): - options.extend([ - '-DTpetra_INST_INT_INT:BOOL=ON', - '-DTpetra_INST_INT_LONG:BOOL=ON', - '-DTpetra_INST_INT_LONG_LONG:BOOL=ON' - ]) - # set default GO in newer versions to long - elif (gotype == 'none'): - options.extend([ - '-DTpetra_INST_INT_INT:BOOL=OFF', - '-DTpetra_INST_INT_LONG:BOOL=ON', - '-DTpetra_INST_INT_LONG_LONG:BOOL=OFF' - ]) - # if another GO is specified, use this - else: - options.extend([ - define('Tpetra_INST_INT_INT', gotype == 'int'), - define('Tpetra_INST_INT_LONG', gotype == 'long'), - define('Tpetra_INST_INT_LONG_LONG', gotype == 'long_long'), - ]) - - # disable due to compiler / config errors: - if spec.satisfies('%xl') or spec.satisfies('%xl_r'): - options.extend([ - define('Trilinos_ENABLE_Pamgen', False), - define('Trilinos_ENABLE_Stokhos', False), - ]) - - if sys.platform == 'darwin': - options.append(define('Trilinos_ENABLE_FEI', False)) - - if sys.platform == 'darwin' and macos_version() >= Version('10.12'): - # use @rpath on Sierra due to limit of dynamic loader - options.append(define('CMAKE_MACOSX_RPATH', True)) - else: - options.append(define('CMAKE_INSTALL_NAME_DIR', self.prefix.lib)) - - if spec.satisfies('%intel') and spec.satisfies('@12.6.2'): - # Panzer uses some std:chrono that is not recognized by Intel - # Don't know which (maybe all) Trilinos versions this applies to - # Don't know which (maybe all) Intel versions this applies to - options.append(define('Trilinos_ENABLE_Panzer', False)) - - # collect CXX flags: - options.append(define('CMAKE_CXX_FLAGS', (' '.join(cxx_flags)))) - - # disable due to compiler / config errors: - options.append(define('Trilinos_ENABLE_Pike', False)) - - return options - - @run_after('install') - def filter_python(self): - # When trilinos is built with Python, libpytrilinos is included - # through cmake configure files. Namely, Trilinos_LIBRARIES in - # TrilinosConfig.cmake contains pytrilinos. This leads to a - # run-time error: Symbol not found: _PyBool_Type and prevents - # Trilinos to be used in any C++ code, which links executable - # against the libraries listed in Trilinos_LIBRARIES. See - # https://github.com/Homebrew/homebrew-science/issues/2148#issuecomment-103614509 - # A workaround is to remove PyTrilinos from the COMPONENTS_LIST : - if '+python' in self.spec: - filter_file(r'(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)', - (r'\1\3'), - '%s/cmake/Trilinos/TrilinosConfig.cmake' % - self.prefix.lib) - - def setup_run_environment(self, env): - if '+exodus' in self.spec: - env.prepend_path('PYTHONPATH', - self.prefix.lib) diff --git a/scripts/uberenv/packages/umpire/package.py b/scripts/uberenv/packages/umpire/package.py deleted file mode 100644 index 420a23a4..00000000 --- a/scripts/uberenv/packages/umpire/package.py +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack import * - - -class Umpire(CMakePackage, CudaPackage): - """An application-focused API for memory management on NUMA & GPU - architectures""" - - homepage = 'https://github.com/LLNL/Umpire' - git = 'https://github.com/LLNL/Umpire.git' - - version('develop', branch='develop', submodules='True') - version('main', branch='main', submodules='True') - version('4.1.2', tag='v4.1.2', submodules='True') - version('4.1.1', tag='v4.1.1', submodules='True') - version('4.1.0', tag='v4.1.0', submodules='True') - version('4.0.1', tag='v4.0.1', submodules='True') - version('4.0.0', tag='v4.0.0', submodules='True') - version('3.0.0', tag='v3.0.0', submodules='True') - version('2.1.0', tag='v2.1.0', submodules='True') - version('2.0.0', tag='v2.0.0', submodules='True') - version('1.1.0', tag='v1.1.0', submodules='True') - version('1.0.1', tag='v1.0.1', submodules='True') - version('1.0.0', tag='v1.0.0', submodules='True') - version('0.3.5', tag='v0.3.5', submodules='True') - version('0.3.4', tag='v0.3.4', submodules='True') - version('0.3.3', tag='v0.3.3', submodules='True') - version('0.3.2', tag='v0.3.2', submodules='True') - version('0.3.1', tag='v0.3.1', submodules='True') - version('0.3.0', tag='v0.3.0', submodules='True') - version('0.2.4', tag='v0.2.4', submodules='True') - version('0.2.3', tag='v0.2.3', submodules='True') - version('0.2.2', tag='v0.2.2', submodules='True') - version('0.2.1', tag='v0.2.1', submodules='True') - version('0.2.0', tag='v0.2.0', submodules='True') - version('0.1.4', tag='v0.1.4', submodules='True') - version('0.1.3', tag='v0.1.3', submodules='True') - - patch('camp_target_umpire_3.0.0.patch', when='@3.0.0') - - variant('fortran', default=False, description='Build C/Fortran API') - variant('c', default=True, description='Build C API') - variant('numa', default=False, description='Enable NUMA support') - variant('shared', default=True, description='Enable Shared libs') - variant('openmp', default=False, description='Build with OpenMP support') - variant('deviceconst', default=False, - description='Enables support for constant device memory') - variant('examples', default=True, description='Build Umpire Examples') - variant('tests', default='none', values=('none', 'basic', 'benchmarks'), - multi=False, description='Tests to run') - - depends_on('cmake@3.8:', type='build') - depends_on('cmake@3.9:', when='+cuda', type='build') - - conflicts('+numa', when='@:0.3.2') - conflicts('~c', when='+fortran', msg='Fortran API requires C API') - - def cmake_args(self): - spec = self.spec - - options = [] - - if '+cuda' in spec: - options.extend([ - '-DENABLE_CUDA=On', - '-DCUDA_TOOLKIT_ROOT_DIR=%s' % (spec['cuda'].prefix)]) - - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) - flag = '-arch sm_{0}'.format(cuda_arch[0]) - options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag)) - - if '+deviceconst' in spec: - options.append('-DENABLE_DEVICE_CONST=On') - else: - options.append('-DENABLE_CUDA=Off') - - options.append('-DENABLE_C={0}'.format( - 'On' if '+c' in spec else 'Off')) - - options.append('-DENABLE_FORTRAN={0}'.format( - 'On' if '+fortran' in spec else 'Off')) - - options.append('-DENABLE_NUMA={0}'.format( - 'On' if '+numa' in spec else 'Off')) - - options.append('-DENABLE_OPENMP={0}'.format( - 'On' if '+openmp' in spec else 'Off')) - - options.append('-DBUILD_SHARED_LIBS={0}'.format( - 'On' if '+shared' in spec else 'Off')) - - options.append('-DENABLE_BENCHMARKS={0}'.format( - 'On' if 'tests=benchmarks' in spec else 'Off')) - - options.append('-DENABLE_EXAMPLES={0}'.format( - 'On' if '+examples' in spec else 'Off')) - - options.append('-DENABLE_TESTS={0}'.format( - 'Off' if 'tests=none' in spec else 'On')) - - return options diff --git a/scripts/uberenv/packages/uncrustify/package.py b/scripts/uberenv/packages/uncrustify/package.py deleted file mode 100644 index dc584241..00000000 --- a/scripts/uberenv/packages/uncrustify/package.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class Uncrustify(Package): - """Source Code Beautifier for C, C++, C#, ObjectiveC, Java, and others.""" - - homepage = "https://github.com/uncrustify/uncrustify" - git = "https://github.com/uncrustify/uncrustify.git" - - version('master', branch='master') - version('0.71.0', tag='uncrustify-0.71.0') - version('0.70.1', tag='uncrustify-0.70.1') - version('0.70.0', tag='uncrustify-0.70') - version('0.69.0', tag='uncrustify-0.69.0') - version('0.68.1', tag='uncrustify-0.68.1') - version('0.68', tag='uncrustify-0.68') - version('0.67', tag='uncrustify-0.67') - version('0.66.1', tag='uncrustify-0.66.1') - version('0.66', tag='uncrustify-0.66') - version('0.65', tag='uncrustify-0.65') - version('0.64', tag='uncrustify-0.64') - version('0.63', tag='uncrustify-0.63') - version('0.62', tag='uncrustify-0.62') - version('0.61', tag='uncrustify-0.61') - - depends_on('cmake', type='build', when='@0.64:') - - @when('@0.64:') - def install(self, spec, prefix): - with working_dir('spack-build', create=True): - cmake('..', *std_cmake_args) - make() - make('install') - - @when('@:0.62') - def install(self, spec, prefix): - configure('--prefix={0}'.format(self.prefix)) - make() - make('install') diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml index b5eacf9e..ca12d2c5 100644 --- a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml +++ b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml @@ -7,13 +7,6 @@ packages: blas: [essl] lapack: [essl] - cuda: - buildable: False - externals: - - spec: cuda@10.1.243 - modules: - - cuda/10.1.243 - spectrum-mpi: buildable: False externals: @@ -22,18 +15,19 @@ packages: - spec: spectrum-mpi@10.3.1.03rtm0 %clang@10.0.1 prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-10.0.1-gcc-8.3.1/ - netlib-lapack: - buildable: false - externals: - - spec: netlib-lapack@3.6.1 - prefix: /usr/lib64 - essl: buildable: False externals: - spec: essl@6.2.1 ~ilp64 threads=openmp +cuda +lapack prefix: /usr/tcetmp/packages/essl/essl-6.2.1/ + cuda: + buildable: False + externals: + - spec: cuda@10.1.243 + modules: + - cuda/10.1.243 + cmake: buildable: False externals: diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/compilers.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/compilers.yaml new file mode 100644 index 00000000..6de2dd3c --- /dev/null +++ b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/compilers.yaml @@ -0,0 +1,31 @@ +compilers: +- compiler: + spec: clang@10.0.1 + paths: + cc: /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/bin/clang + cxx: /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + cflags: -mcpu=native -mtune=native + cxxflags: -mcpu=native -mtune=native + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] +- compiler: + spec: gcc@8.3.1 + paths: + cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + cflags: -mcpu=native -mtune=native + cxxflags: -mcpu=native -mtune=native + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/packages.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/packages.yaml new file mode 100644 index 00000000..dd9466ff --- /dev/null +++ b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/packages.yaml @@ -0,0 +1,132 @@ +packages: + all: + target: [default] + compiler: [gcc, clang] + providers: + mpi: [spectrum-mpi] + blas: [essl] + lapack: [essl] + + spectrum-mpi: + buildable: False + externals: + - spec: spectrum-mpi@10.3.1.03rtm0 %gcc@8.3.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/ + - spec: spectrum-mpi@10.3.1.03rtm0 %clang@10.0.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-10.0.1-gcc-8.3.1/ + + essl: + buildable: False + externals: + - spec: essl@6.2.1 ~ilp64 threads=openmp +cuda +lapack + prefix: /usr/tcetmp/packages/essl/essl-6.2.1/ + + cuda: + buildable: False + externals: + - spec: cuda@10.1.243 + modules: + - cuda/10.1.243 + + cmake: + buildable: False + externals: + - spec: cmake@3.14.5 + prefix: /usr/tce/packages/cmake/cmake-3.14.5 + + readline: + buildable: False + externals: + - spec: readline@6.2 + prefix: /usr/lib64/ + + zlib: + buildable: False + externals: + - spec: zlib@1.2.7 + prefix: /usr/ + + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr/bin/ + + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin/ + + bison: + buildable: False + externals: + - spec: bison@3.0.4 + prefix: /usr/bin/ + + flex: + buildable: False + externals: + - spec: flex@2.5.37 + prefix: /usr/bin/ + + bzip2: + buildable: False + externals: + - spec: bzip2@1.0.6 + prefix: /usr/bin/ + + expat: + buildable: False + externals: + - spec: expat@1.6.0 + prefix: /usr/lib64/ + + gdbm: + buildable: False + externals: + - spec: gdbm@4.0.0 + prefix: /usr/lib64/ + + gettext: + buildable: False + externals: + - spec: gettext@0.19.8.1 + prefix: /usr/bin/ + + openssl: + buildable: False + externals: + - spec: openssl@1.0.2k-fips + prefix: /usr/ + + libffi: + buildable: False + externals: + - spec: libffi@6.0.1 + prefix: /usr/lib64/ + + libuuid: + buildable: False + externals: + - spec: libuuid@1.3.0 + prefix: /usr/lib64/ + + ncurses: + buildable: False + externals: + - spec: ncurses@5.9 + prefix: /usr/lib64/ + + xz: + buildable: False + externals: + - spec: xz@5.2.2 + prefix: /usr/bin/ + + pkg-config: + buildable: False + externals: + - spec: pkg-config@0.27.1 + prefix: /usr/bin/ + diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml index 5661ef53..e8a7b553 100644 --- a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml +++ b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml @@ -1,4 +1,20 @@ compilers: +- compiler: + spec: clang@10.0.0 + paths: + cc: /usr/tce/packages/clang/clang-10.0.0/bin/clang + cxx: /usr/tce/packages/clang/clang-10.0.0/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-4.9.3/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-4.9.3/bin/gfortran + flags: + cflags: -march=native -mtune=native + cxxflags: -march=native -mtune=native + fflags: -march=native -mtune=native + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] - compiler: spec: clang@10.0.1 paths: @@ -15,6 +31,22 @@ compilers: modules: [] environment: {} extra_rpaths: [] +- compiler: + spec: gcc@8.1.0 + paths: + cc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-8.1.0/bin/g++ + f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran + flags: + cflags: -march=native -mtune=native + cxxflags: -march=native -mtune=native + fflags: -march=native -mtune=native + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] - compiler: spec: gcc@8.3.1 paths: diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml index 9cb6322f..234367ee 100644 --- a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml +++ b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml @@ -68,75 +68,3 @@ packages: externals: - spec: py-sphinx@1.6.3 prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ - - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr/bin/ - - flex: - buildable: False - externals: - - spec: flex@2.5.37 - prefix: /usr/bin/ - - bzip2: - buildable: False - externals: - - spec: bzip2@1.0.6 - prefix: /usr/bin/ - - expat: - buildable: False - externals: - - spec: expat@1.6.0 - prefix: /usr/lib64/ - - gdbm: - buildable: False - externals: - - spec: gdbm@4.0.0 - prefix: /usr/lib64/ - - gettext: - buildable: False - externals: - - spec: gettext@0.19.8.1 - prefix: /usr/bin/ - - openssl: - buildable: False - externals: - - spec: openssl@1.0.2 - prefix: /usr/bin/ - - libffi: - buildable: False - externals: - - spec: libffi@6.0.1 - prefix: /usr/lib64/ - - libuuid: - buildable: False - externals: - - spec: libuuid@1.3.0 - prefix: /usr/lib64/ - - ncurses: - buildable: False - externals: - - spec: ncurses@5.9 - prefix: /usr/lib64/ - - xz: - buildable: False - externals: - - spec: xz@5.2.2 - prefix: /usr/bin/ - - pkg-config: - buildable: False - externals: - - spec: pkg-config@0.27.1 - prefix: /usr/bin/ diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/compilers.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/compilers.yaml new file mode 120000 index 00000000..af5c3714 --- /dev/null +++ b/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/compilers.yaml @@ -0,0 +1 @@ +../toss_3_x86_64_ib/compilers.yaml \ No newline at end of file diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/packages.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/packages.yaml new file mode 100644 index 00000000..f3d0c55e --- /dev/null +++ b/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/packages.yaml @@ -0,0 +1,146 @@ +packages: + all: + target: [default] + compiler: [gcc, clang, intel] + providers: + mpi: [mvapich2] + blas: [intel-mkl] + lapack: [intel-mkl] + + mvapich2: + buildable: False + externals: + - spec: mvapich2@2.3 %clang@10.0.0 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0 + - spec: mvapich2@2.3 %clang@10.0.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.1 + - spec: mvapich2@2.3 %gcc@8.1.0 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.1.0/ + - spec: mvapich2@2.3 %gcc@8.3.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/ + + intel-mkl: + buildable: False + externals: + - spec: intel-mkl@2019.0 threads=openmp %clang@10.0.0 + prefix: /usr/tce/packages/mkl/mkl-2019.0/ + - spec: intel-mkl@2020.0.166 threads=openmp %clang@10.0.1 + prefix: /usr/tce/packages/mkl/mkl-2020.0/ + - spec: intel-mkl@2019.0 threads=openmp %gcc@8.1.0 + prefix: /usr/tce/packages/mkl/mkl-2019.0/ + - spec: intel-mkl@2020.0.166 threads=openmp %gcc@8.3.1 + prefix: /usr/tce/packages/mkl/mkl-2020.0/ + + papi: + buildable: False + externals: + - spec: papi@5.5.1 + prefix: /usr/tce/packages/papi/papi-5.5.1/ + + cmake: + buildable: False + externals: + - spec: cmake@3.14.5 + prefix: /usr/tce/packages/cmake/cmake-3.14.5/ + + readline: + buildable: False + externals: + - spec: readline@6.2 + prefix: /usr/lib64/ + + zlib: + buildable: False + externals: + - spec: zlib@1.2.7 + prefix: /usr/ + + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr/bin + + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin + + py-sphinx: + buildable: False + externals: + - spec: py-sphinx@1.6.3 + prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ + + bison: + buildable: False + externals: + - spec: bison@3.0.4 + prefix: /usr/bin/ + + flex: + buildable: False + externals: + - spec: flex@2.5.37 + prefix: /usr/bin/ + + bzip2: + buildable: False + externals: + - spec: bzip2@1.0.6 + prefix: /usr/bin/ + + expat: + buildable: False + externals: + - spec: expat@1.6.0 + prefix: /usr/lib64/ + + gdbm: + buildable: False + externals: + - spec: gdbm@4.0.0 + prefix: /usr/lib64/ + + gettext: + buildable: False + externals: + - spec: gettext@0.19.8.1 + prefix: /usr/bin/ + + openssl: + buildable: False + externals: + - spec: openssl@1.0.2 + prefix: /usr/ + + libffi: + buildable: False + externals: + - spec: libffi@6.0.1 + prefix: /usr/lib64/ + + libuuid: + buildable: False + externals: + - spec: libuuid@1.3.0 + prefix: /usr/lib64/ + + ncurses: + buildable: False + externals: + - spec: ncurses@5.9 + prefix: /usr/lib64/ + + xz: + buildable: False + externals: + - spec: xz@5.2.2 + prefix: /usr/bin/ + + pkg-config: + buildable: False + externals: + - spec: pkg-config@0.27.1 + prefix: /usr/bin/ From 90d44e6f2f413a8da8b84d6298a76be0e2759d10 Mon Sep 17 00:00:00 2001 From: Ben Corbett <32752943+corbett5@users.noreply.github.com> Date: Fri, 19 Feb 2021 13:34:43 -0800 Subject: [PATCH 03/48] Corbett/references and exceptions (#1318) * Changes to Group and Wrapper to favor references. * Added exceptions to harden the Python interface. * Added a Spack and Uberenv guide. * Changed getConstitutiveRelation and getConstitutiveManager. * Changed getMeshBodies, getMeshBody and getMeshLevel. * Changed getDomainPartition * Changed getRegion and getSubRegion. * Prevent MPI_Init from being called twice, (occurs with pygeosx). * Changed getConstitutiveModel(s). * Removing unnecessary uses of getGroupPointer. * Changed Group::getParent and Wrapper constructor. * Removed function input paths from restart. --- scripts/uberenv/packages/geosx/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index d7b076ff..1b19d43c 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -57,6 +57,8 @@ class Geosx(CMakePackage, CudaPackage): version('develop', branch='develop', submodules='True') + # SPHINX_BEGIN_VARIANTS + variant('shared', default=True, description='Build Shared Libs.') variant('caliper', default=True, description='Build Caliper support.') variant('mkl', default=False, description='Use the Intel MKL library.') @@ -69,6 +71,8 @@ class Geosx(CMakePackage, CudaPackage): values=('trilinos', 'hypre', 'petsc'), multi=False) variant('pygeosx', default=False, description='Build the GEOSX python interface.') + # SPHINX_END_VARIANTS + # variant('tests', default=True, description='Build tests') # variant('benchmarks', default=False, description='Build benchmarks') # variant('examples', default=False, description='Build examples') @@ -76,6 +80,8 @@ class Geosx(CMakePackage, CudaPackage): # variant('addr2line', default=True, # description='Build support for addr2line.') + # SPHINX_BEGIN_DEPENDS + depends_on('cmake@3.8:', type='build') depends_on('cmake@3.9:', when='+cuda', type='build') @@ -160,6 +166,8 @@ class Geosx(CMakePackage, CudaPackage): depends_on('doxygen@1.8.13:', when='+docs', type='build') depends_on('py-sphinx@1.6.3:', when='+docs', type='build') + # SPHINX_END_DEPENDS + # # Conflicts # From 93fc4392dfc95f891c4a72f70e454be43a4e0fa3 Mon Sep 17 00:00:00 2001 From: Ben Corbett <32752943+corbett5@users.noreply.github.com> Date: Mon, 22 Mar 2021 22:06:18 -0700 Subject: [PATCH 04/48] Changes for Summit. (#1367) --- scripts/uberenv/packages/geosx/package.py | 24 +++- .../spack_configs/summit/compilers.yaml | 16 +++ .../spack_configs/summit/packages.yaml | 67 ++++++++++ .../summit_python/compilers.yaml | 1 + .../spack_configs/summit_python/packages.yaml | 120 ++++++++++++++++++ 5 files changed, 221 insertions(+), 7 deletions(-) create mode 100644 scripts/uberenv/spack_configs/summit/compilers.yaml create mode 100644 scripts/uberenv/spack_configs/summit/packages.yaml create mode 120000 scripts/uberenv/spack_configs/summit_python/compilers.yaml create mode 100644 scripts/uberenv/spack_configs/summit_python/packages.yaml diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index 1b19d43c..df4df7cb 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -109,7 +109,7 @@ class Geosx(CMakePackage, CudaPackage): # depends_on('hdf5@1.10.5: +shared +pic +mpi', when='~vtk') - depends_on('conduit@0.5: +shared ~test ~fortran +mpi +hdf5 ~hdf5_compat') + depends_on('conduit@0.5.0 +shared ~test ~fortran +mpi +hdf5 ~hdf5_compat') depends_on('silo@4.10: ~fortran +shared ~silex +pic +mpi ~zlib') @@ -136,7 +136,7 @@ class Geosx(CMakePackage, CudaPackage): trilinos_build_options = '~fortran +openmp +shared' trilinos_tpls = '~boost ~glm ~gtest ~hdf5 ~hypre ~matio ~metis +mpi ~mumps ~netcdf ~suite-sparse' trilinos_packages = '+amesos +aztec +epetra +epetraext +ifpack +kokkos +ml +stk +stratimikos +teuchos +tpetra ~amesos2 ~anasazi ~belos ~exodus ~ifpack2 ~muelu ~sacado ~zoltan ~zoltan2' - depends_on('trilinos@12.18.1: ' + trilinos_build_options + trilinos_tpls + trilinos_packages, when='+trilinos') + depends_on('trilinos@12.18.1 ' + trilinos_build_options + trilinos_tpls + trilinos_packages, when='+trilinos') depends_on('trilinos +blas_lowercase_no_underscore', when='+trilinos +essl') # depends_on('trilinos +force-new-lapack', when='+trilinos +essl') @@ -297,6 +297,15 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_entry('MPI_C_COMPILER', spec['mpi'].mpicc)) cfg.write(cmake_cache_entry('MPI_CXX_COMPILER', spec['mpi'].mpicxx)) + if sys_type == 'linux-rhel7-ppc64le': + cfg.write(cmake_cache_option('ENABLE_WRAP_ALL_TESTS_WITH_MPIEXEC', True)) + if socket.gethostname().rstrip('1234567890') == "lassen": + cfg.write(cmake_cache_entry('MPIEXEC', 'lrun')) + cfg.write(cmake_cache_entry('MPIEXEC_NUMPROC_FLAG', '-n')) + else: + cfg.write(cmake_cache_entry('MPIEXEC', 'jsrun')) + cfg.write(cmake_cache_list('MPIEXEC_NUMPROC_FLAG', ['-g1', '--bind', 'rs', '-n'])) + cfg.write("#{0}\n".format("-" * 80)) cfg.write("# OpenMP\n") cfg.write("#{0}\n\n".format("-" * 80)) @@ -355,11 +364,12 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) io_tpls = (('hdf5', 'HDF5', True), - ('conduit', 'CONDUIT', True), - ('silo', 'SILO', True), - ('adiak', 'ADIAK', '+caliper' in spec), - ('caliper', 'CALIPER', '+caliper' in spec), - ('pugixml', 'PUGIXML', True)) + ('conduit', 'CONDUIT', True), + ('silo', 'SILO', True), + ('adiak', 'ADIAK', '+caliper' in spec), + ('caliper', 'CALIPER', '+caliper' in spec), + ('pugixml', 'PUGIXML', True), + ('vtk', 'VTK', False)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# IO TPLs\n') cfg.write('#{0}\n\n'.format('-' * 80)) diff --git a/scripts/uberenv/spack_configs/summit/compilers.yaml b/scripts/uberenv/spack_configs/summit/compilers.yaml new file mode 100644 index 00000000..1e72bfd5 --- /dev/null +++ b/scripts/uberenv/spack_configs/summit/compilers.yaml @@ -0,0 +1,16 @@ +compilers: +- compiler: + spec: gcc@10.2.0 + paths: + cc: /sw/summit/gcc/10.2.0/bin/gcc + cxx: /sw/summit/gcc/10.2.0/bin/g++ + f77: /sw/summit/gcc/10.2.0/bin/gfortran + fc: /sw/summit/gcc/10.2.0/bin/gfortran + flags: + cflags: -mcpu=native -mtune=native + cxxflags: -mcpu=native -mtune=native + operating_system: rhel7 + target: ppc64le + modules: [gcc/10.2.0] + environment: {} + extra_rpaths: [] diff --git a/scripts/uberenv/spack_configs/summit/packages.yaml b/scripts/uberenv/spack_configs/summit/packages.yaml new file mode 100644 index 00000000..75c49318 --- /dev/null +++ b/scripts/uberenv/spack_configs/summit/packages.yaml @@ -0,0 +1,67 @@ +packages: + all: + target: [default] + compiler: [gcc] + providers: + mpi: [spectrum-mpi] + blas: [openblas] + lapack: [openblas] + + openblas: + buildable: False + externals: + - spec: openblas@0.3.9 threads=openmp + modules: + - openblas/0.3.9-omp + + spectrum-mpi: + buildable: False + externals: + - spec: spectrum-mpi@10.3.1.2-20200121 + modules: + - spectrum-mpi/10.3.1.2-20200121 + + cuda: + buildable: False + externals: + - spec: cuda@11.2.0 + modules: + - cuda/11.2.0 + + cmake: + buildable: False + externals: + - spec: cmake@3.14.5 + modules: + - cmake/3.14.2 + + readline: + buildable: False + externals: + - spec: readline@6.2 + prefix: /usr/lib64/ + + zlib: + buildable: False + externals: + - spec: zlib@1.2.7 + prefix: /usr/ + + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr/bin/ + + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin/ + + python: + buildable: False + externals: + - spec: python@3.7.0 + modules: + - python/3.7.0 diff --git a/scripts/uberenv/spack_configs/summit_python/compilers.yaml b/scripts/uberenv/spack_configs/summit_python/compilers.yaml new file mode 120000 index 00000000..c0fbf0f7 --- /dev/null +++ b/scripts/uberenv/spack_configs/summit_python/compilers.yaml @@ -0,0 +1 @@ +../summit/compilers.yaml \ No newline at end of file diff --git a/scripts/uberenv/spack_configs/summit_python/packages.yaml b/scripts/uberenv/spack_configs/summit_python/packages.yaml new file mode 100644 index 00000000..094c8474 --- /dev/null +++ b/scripts/uberenv/spack_configs/summit_python/packages.yaml @@ -0,0 +1,120 @@ +packages: + all: + target: [default] + compiler: [gcc] + providers: + mpi: [spectrum-mpi] + blas: [openblas] + lapack: [openblas] + + openblas: + buildable: False + externals: + - spec: openblas@0.3.9 threads=openmp + modules: + - openblas/0.3.9-omp + + spectrum-mpi: + buildable: False + externals: + - spec: spectrum-mpi@10.3.1.2-20200121 + modules: + - spectrum-mpi/10.3.1.2-20200121 + + cuda: + buildable: False + externals: + - spec: cuda@11.2.0 + modules: + - cuda/11.2.0 + + cmake: + buildable: False + externals: + - spec: cmake@3.14.5 + modules: + - cmake/3.14.2 + + readline: + buildable: False + externals: + - spec: readline@6.2 + prefix: /usr/lib64/ + + zlib: + buildable: False + externals: + - spec: zlib@1.2.7 + prefix: /usr/ + + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr/bin/ + + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin/ + + bzip2: + buildable: False + externals: + - spec: bzip2@1.0.6 + prefix: /usr/bin/ + + expat: + buildable: False + externals: + - spec: expat@1.6.0 + prefix: /usr/lib64/ + + gdbm: + buildable: False + externals: + - spec: gdbm@4.0.0 + prefix: /gpfs/alpine/geo127/proj-shared/libs-for-geosx + + gettext: + buildable: False + externals: + - spec: gettext@0.19.8.1 + prefix: /usr/bin/ + + openssl: + buildable: False + externals: + - spec: openssl@1.0.2k-fips + prefix: /usr/ + + libffi: + buildable: False + externals: + - spec: libffi@6.0.1 + prefix: /usr/lib64/ + + libuuid: + buildable: False + externals: + - spec: libuuid@1.3.0 + prefix: /usr/lib64/ + + ncurses: + buildable: False + externals: + - spec: ncurses@5.9 + prefix: /usr/lib64/ + + xz: + buildable: False + externals: + - spec: xz@5.2.2 + prefix: /usr/bin/ + + pkg-config: + buildable: False + externals: + - spec: pkg-config@0.27.1 + prefix: /usr/bin/ From cba00e87d54dd2d5b71cae5eacbfc64e3aac3ba0 Mon Sep 17 00:00:00 2001 From: Ben Corbett <32752943+corbett5@users.noreply.github.com> Date: Thu, 3 Jun 2021 13:35:23 -0700 Subject: [PATCH 05/48] Spack changes. (#1445) --- scripts/uberenv/packages/geosx/package.py | 16 +++++++++++++--- .../blueos_3_ppc64le_ib_p9/compilers.yaml | 15 +++++++++++++++ .../blueos_3_ppc64le_ib_p9/packages.yaml | 2 ++ scripts/uberenv/spack_configs/config.yaml | 4 ++-- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index df4df7cb..8b0c6e5b 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -66,6 +66,7 @@ class Geosx(CMakePackage, CudaPackage): variant('suite-sparse', default=True, description='Build SuiteSparse support.') variant('trilinos', default=True, description='Build Trilinos support.') variant('hypre', default=True, description='Build HYPRE support.') + variant('hypre-cuda', default=False, description='Build HYPRE with CUDA support.') variant('petsc', default=True, description='Build PETSc support.') variant('lai', default='trilinos', description='Linear algebra interface.', values=('trilinos', 'hypre', 'petsc'), multi=False) @@ -140,7 +141,8 @@ class Geosx(CMakePackage, CudaPackage): depends_on('trilinos +blas_lowercase_no_underscore', when='+trilinos +essl') # depends_on('trilinos +force-new-lapack', when='+trilinos +essl') - depends_on('hypre@2.21.0: +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') + depends_on('hypre@2.20.1 +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') + depends_on('hypre@2.20.1 +cuda +shared +superlu-dist +mpi +openmp +unified-memory +cusparse', when='+hypre-cuda') petsc_build_options = '+shared +mpi' petsc_tpls = '+metis ~hdf5 ~hypre +superlu-dist +int64' @@ -175,9 +177,12 @@ class Geosx(CMakePackage, CudaPackage): conflicts('+essl ~cuda', msg='Cannot use ESSL without CUDA.') conflicts('~trilinos lai=trilinos', msg='To use Trilinos as the Linear Algebra Interface you must build it.') - conflicts('~hypre lai=hypre', msg='To use HYPRE as the Linear Algebra Interface you must build it.') + conflicts('~hypre ~hypre-cuda lai=hypre', msg='To use HYPRE as the Linear Algebra Interface you must build it.') conflicts('~petsc lai=petsc', msg='To use PETSc as the Linear Algebra Interface you must build it.') + conflicts('+hypre +hypre-cuda', msg='Only one of the two can be used at a time.') + conflicts('+hypre-cuda ~cuda', msg='When building hypre-cuda CUDA must be enabled.') + phases = ['hostconfig', 'cmake', 'build', 'install'] @run_after('build') @@ -289,6 +294,9 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): debug_flags = "-O0 -g" cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", debug_flags)) + if "%clang arch=linux-rhel7-ppc64le" in spec: + cfg.write(cmake_cache_entry("CMAKE_EXE_LINKER_FLAGS", "-Wl,--no-toc-optimize")) + cfg.write("#{0}\n".format("-" * 80)) cfg.write("# MPI\n") cfg.write("#{0}\n\n".format("-" * 80)) @@ -401,7 +409,7 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): ('superlu-dist', 'SUPERLU_DIST', True), ('suite-sparse', 'SUITESPARSE', '+suite-sparse' in spec), ('trilinos', 'TRILINOS', '+trilinos' in spec), - ('hypre', 'HYPRE', '+hypre' in spec), + ('hypre', 'HYPRE', '+hypre' in spec or '+hypre-cuda' in spec), ('petsc', 'PETSC', '+petsc' in spec)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Math TPLs\n') @@ -409,6 +417,8 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): for tpl, cmake_name, enable in math_tpls: if enable: cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) + if tpl == 'hypre' and '+hypre-cuda' in spec: + cfg.write(cmake_cache_option('ENABLE_HYPRE_CUDA'.format(cmake_name), True)) else: cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml index 309203cf..d59c746e 100644 --- a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml +++ b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml @@ -14,6 +14,21 @@ compilers: modules: [] environment: {} extra_rpaths: [] +- compiler: + spec: clang@11.0.1 + paths: + cc: /usr/tce/packages/clang/clang-ibm-11.0.1/bin/clang + cxx: /usr/tce/packages/clang/clang-ibm-11.0.1/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + cflags: -mcpu=native -mtune=native + cxxflags: -mcpu=native -mtune=native + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] - compiler: spec: gcc@8.3.1 paths: diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml index ca12d2c5..aa204efc 100644 --- a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml +++ b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml @@ -14,6 +14,8 @@ packages: prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/ - spec: spectrum-mpi@10.3.1.03rtm0 %clang@10.0.1 prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-10.0.1-gcc-8.3.1/ + - spec: spectrum-mpi@10.3.1.03rtm0 %clang@11.0.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-11.0.1/ essl: buildable: False diff --git a/scripts/uberenv/spack_configs/config.yaml b/scripts/uberenv/spack_configs/config.yaml index 9a6f85c8..2806a4a1 100644 --- a/scripts/uberenv/spack_configs/config.yaml +++ b/scripts/uberenv/spack_configs/config.yaml @@ -23,8 +23,8 @@ config: template_dirs: - $spack/templates - # install directory layout - install_path_scheme: "${ARCHITECTURE}-${COMPILERNAME}@${COMPILERVER}/${PACKAGE}@${VERSION}" + # # install directory layout + # install_path_scheme: "${ARCHITECTURE}-${COMPILERNAME}@${COMPILERVER}/${PACKAGE}@${VERSION}" # Locations where different types of modules should be installed. module_roots: From 9ce2b63e5a3444c186c2b284793df602f5715c15 Mon Sep 17 00:00:00 2001 From: Sergey Klevtsov Date: Mon, 27 Sep 2021 18:41:40 -0700 Subject: [PATCH 06/48] Use {fmt} for message formatting (#1568) --- scripts/uberenv/packages/geosx/package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index 8b0c6e5b..ecdf4281 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -119,6 +119,8 @@ class Geosx(CMakePackage, CudaPackage): depends_on('pugixml@1.8: +shared') + depends_on('fmt@8.0: +cxxstd=14 +pic') + # # Math # @@ -377,7 +379,8 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): ('adiak', 'ADIAK', '+caliper' in spec), ('caliper', 'CALIPER', '+caliper' in spec), ('pugixml', 'PUGIXML', True), - ('vtk', 'VTK', False)) + ('vtk', 'VTK', False) + ('fmt', 'FMT', True)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# IO TPLs\n') cfg.write('#{0}\n\n'.format('-' * 80)) From 1c7822aace82656a9a29502cd89a691c48c1e89c Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Fri, 15 Oct 2021 20:15:56 -0700 Subject: [PATCH 07/48] Adding features for Wellbore meshing (#1424) * added option to specify inner radius of cartesian mapping * fix error in silo output * modifications to wellbore parallel mesh gen + addNeighbor changes to allow ranks to be mutual periodic neighbors (doubly-neighbored) * add hard coded coordinatese in the radial direction * bugfix for integer overflow with hypre int * fixes for mgr on gpu * - Add additional instrumentation for using MGR (make restrictor, compute Auu) - Update hypre linear algebra interface to the latest hypre/mgr - Update MGR recipes for GPU * modified LAIHelperFunctions::separateComponentFilter to batch insert rows. Introduced MatrixBase::separateComponentFilter as a specialized filter, implemented HypreMatrix::separateComponentFilter. * some cleanup for HypreMatrix::separateComponentFilter Co-authored-by: Sy-Tuan Nguyen <45685596+sytuannguyen@users.noreply.github.com> * implement single read variant of HypreMatrix::separateComponentFilter * Use full matrix instead of SDC approximation for mechanics in hydrofrac solver. Fix bug in setting options for mechanics block solver. * Changes to run on Summit. (#1546) Co-authored-by: Randolph R. Settgast * fix bug from summit update * fix bug in SinglePhasePoromechanicsSolver::implicitStepComplete * resolve host-device ghost index array inconsistency * added annulus option to cylinder geometry. added error check for aperature table * Changes for new compilers on summit/lassen (#1611) * Updated hypre. * Force uberenv to use python3. * Added CUDA 11.0.3 on Summit. * Added GCC 9.1.0 to Summit * Added GCC 9.1.0 to Summit * Changes to work with GCC 9.1.0 on Summit. Co-authored-by: Benjamin Curtice Corbett * Updating function parCSRtoIJ required by latest hypre version Co-authored-by: wrtobin Co-authored-by: Quan Bui Co-authored-by: Sy-Tuan Nguyen <45685596+sytuannguyen@users.noreply.github.com> Co-authored-by: Ben Corbett <32752943+corbett5@users.noreply.github.com> Co-authored-by: Benjamin Curtice Corbett Co-authored-by: Nicola Castelletto --- scripts/uberenv/packages/geosx/package.py | 6 ++--- .../spack_configs/summit/compilers.yaml | 25 +++++++++++++++---- .../spack_configs/summit/packages.yaml | 25 +++++++++++-------- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index ecdf4281..f7e3d722 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -143,8 +143,8 @@ class Geosx(CMakePackage, CudaPackage): depends_on('trilinos +blas_lowercase_no_underscore', when='+trilinos +essl') # depends_on('trilinos +force-new-lapack', when='+trilinos +essl') - depends_on('hypre@2.20.1 +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') - depends_on('hypre@2.20.1 +cuda +shared +superlu-dist +mpi +openmp +unified-memory +cusparse', when='+hypre-cuda') + depends_on('hypre@2.20.300 +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') + depends_on('hypre@2.20.300 +cuda +shared +superlu-dist +mpi +openmp +unified-memory +cusparse', when='+hypre-cuda') petsc_build_options = '+shared +mpi' petsc_tpls = '+metis ~hdf5 ~hypre +superlu-dist +int64' @@ -307,7 +307,7 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_entry('MPI_C_COMPILER', spec['mpi'].mpicc)) cfg.write(cmake_cache_entry('MPI_CXX_COMPILER', spec['mpi'].mpicxx)) - if sys_type == 'linux-rhel7-ppc64le': + if sys_type in ('linux-rhel7-ppc64le', 'linux-rhel8-ppc64le'): cfg.write(cmake_cache_option('ENABLE_WRAP_ALL_TESTS_WITH_MPIEXEC', True)) if socket.gethostname().rstrip('1234567890') == "lassen": cfg.write(cmake_cache_entry('MPIEXEC', 'lrun')) diff --git a/scripts/uberenv/spack_configs/summit/compilers.yaml b/scripts/uberenv/spack_configs/summit/compilers.yaml index 1e72bfd5..2499a594 100644 --- a/scripts/uberenv/spack_configs/summit/compilers.yaml +++ b/scripts/uberenv/spack_configs/summit/compilers.yaml @@ -1,15 +1,30 @@ compilers: +- compiler: + spec: gcc@9.1.0 + paths: + cc: /sw/summit/gcc/9.1.0-alpha+20190716/bin/gcc + cxx: /sw/summit/gcc/9.1.0-alpha+20190716/bin/g++ + f77: /sw/summit/gcc/9.1.0-alpha+20190716/bin/gfortran + fc: /sw/summit/gcc/9.1.0-alpha+20190716/bin/gfortran + flags: + cflags: -mcpu=native -mtune=native + cxxflags: -mcpu=native -mtune=native + operating_system: rhel8 + target: ppc64le + modules: [gcc/9.1.0] + environment: {} + extra_rpaths: [] - compiler: spec: gcc@10.2.0 paths: - cc: /sw/summit/gcc/10.2.0/bin/gcc - cxx: /sw/summit/gcc/10.2.0/bin/g++ - f77: /sw/summit/gcc/10.2.0/bin/gfortran - fc: /sw/summit/gcc/10.2.0/bin/gfortran + cc: /sw/summit/gcc/10.2.0-2/bin/gcc + cxx: /sw/summit/gcc/10.2.0-2/bin/g++ + f77: /sw/summit/gcc/10.2.0-2/bin/gfortran + fc: /sw/summit/gcc/10.2.0-2/bin/gfortran flags: cflags: -mcpu=native -mtune=native cxxflags: -mcpu=native -mtune=native - operating_system: rhel7 + operating_system: rhel8 target: ppc64le modules: [gcc/10.2.0] environment: {} diff --git a/scripts/uberenv/spack_configs/summit/packages.yaml b/scripts/uberenv/spack_configs/summit/packages.yaml index 75c49318..30bd2940 100644 --- a/scripts/uberenv/spack_configs/summit/packages.yaml +++ b/scripts/uberenv/spack_configs/summit/packages.yaml @@ -10,30 +10,33 @@ packages: openblas: buildable: False externals: - - spec: openblas@0.3.9 threads=openmp + - spec: openblas@0.3.15 threads=openmp modules: - - openblas/0.3.9-omp + - openblas/0.3.15-omp spectrum-mpi: buildable: False externals: - - spec: spectrum-mpi@10.3.1.2-20200121 + - spec: spectrum-mpi@10.4.0.3-20210112 modules: - - spectrum-mpi/10.3.1.2-20200121 + - spectrum-mpi/10.4.0.3-20210112 cuda: buildable: False externals: - - spec: cuda@11.2.0 - modules: - - cuda/11.2.0 + - spec: cuda@11.0.3 + modules: + - cuda/11.0.3 + - spec: cuda@11.3.1 + modules: + - cuda/11.3.1 cmake: buildable: False externals: - - spec: cmake@3.14.5 + - spec: cmake@3.18.4 modules: - - cmake/3.14.2 + - cmake/3.18.4 readline: buildable: False @@ -62,6 +65,6 @@ packages: python: buildable: False externals: - - spec: python@3.7.0 + - spec: python@3.8 modules: - - python/3.7.0 + - python/3.8-anaconda3 From 1cebee60294d7c4d99a9e7a2b9d105b091e22319 Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Mon, 18 Jul 2022 15:48:37 -0700 Subject: [PATCH 08/48] Format python files with YAPF (#1947) Enabling yapf formatting of python files --- scripts/uberenv/packages/geosx/package.py | 74 ++++++++++------------- 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index f7e3d722..9cfd0dba 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -12,22 +12,22 @@ from os import environ as env from os.path import join as pjoin - # ./scripts/uberenv/uberenv.py --spec="%clang +mkl ^chai ^caliper+papi" # ./scripts/uberenv/uberenv.py --spec="%clang +mkl ^raja build_type=Release ^umpire build_type=Release ^chai build_type=Release ^adiak build_type=Release ^caliper+papi build_type=Release ^pugixml build_type=Release ^parmetis build_type=Release ^superlu-dist build_type=Release ^trilinos build_type=Release" # ./scripts/uberenv/uberenv.py --spec="%clang +essl +cuda ~petsc cuda_arch=70 ^raja build_type=Release cuda_arch=70 ^umpire build_type=Release cuda_arch=70 ^chai build_type=Release cuda_arch=70 ^adiak build_type=Release ^caliper~papi build_type=Release ^pugixml build_type=Release ^parmetis build_type=Release ^superlu-dist build_type=Release ^trilinos build_type=Release" - # PETSC doesn't compile on Lassen # ./scripts/uberenv/uberenv.py --spec="%gcc +essl ~petsc +cuda cuda_arch=70 ^cuda@10.1.243 ^raja cuda_arch=70 ^umpire cuda_arch=70 ^chai cuda_arch=70 ^caliper~papi" + def cmake_cache_entry(name, value, comment=""): """Generate a string for a cmake cache variable""" return 'set(%s "%s" CACHE PATH "%s")\n\n' % (name, value, comment) + def cmake_cache_list(name, value, comment=""): """Generate a list for a cmake cache variable""" @@ -53,7 +53,7 @@ class Geosx(CMakePackage, CudaPackage): """GEOSX simulation framework.""" homepage = "https://github.com/GEOSX/GEOSX" - git = "https://github.com/GEOSX/GEOSX.git" + git = "https://github.com/GEOSX/GEOSX.git" version('develop', branch='develop', submodules='True') @@ -68,8 +68,11 @@ class Geosx(CMakePackage, CudaPackage): variant('hypre', default=True, description='Build HYPRE support.') variant('hypre-cuda', default=False, description='Build HYPRE with CUDA support.') variant('petsc', default=True, description='Build PETSc support.') - variant('lai', default='trilinos', description='Linear algebra interface.', - values=('trilinos', 'hypre', 'petsc'), multi=False) + variant('lai', + default='trilinos', + description='Linear algebra interface.', + values=('trilinos', 'hypre', 'petsc'), + multi=False) variant('pygeosx', default=False, description='Build the GEOSX python interface.') # SPHINX_END_VARIANTS @@ -145,7 +148,7 @@ class Geosx(CMakePackage, CudaPackage): depends_on('hypre@2.20.300 +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') depends_on('hypre@2.20.300 +cuda +shared +superlu-dist +mpi +openmp +unified-memory +cusparse', when='+hypre-cuda') - + petsc_build_options = '+shared +mpi' petsc_tpls = '+metis ~hdf5 ~hypre +superlu-dist +int64' depends_on('petsc@3.13.0: ' + petsc_build_options + petsc_tpls, when='+petsc') @@ -190,7 +193,8 @@ class Geosx(CMakePackage, CudaPackage): @run_after('build') @on_package_attributes(run_tests=True) def check(self): - """Searches the CMake-generated Makefile for the target ``test`` + """ + Searches the CMake-generated Makefile for the target ``test`` and runs it if found. """ with working_dir(self.build_directory): @@ -215,9 +219,7 @@ def _get_host_config_path(self, spec): var = '-'.join([var, 'cuda']) hostname = socket.gethostname().rstrip('1234567890') - host_config_path = "%s-%s-%s%s.cmake" % (hostname, - self._get_sys_type(spec), - spec.compiler, var) + host_config_path = "%s-%s-%s%s.cmake" % (hostname, self._get_sys_type(spec), spec.compiler, var) dest_dir = self.stage.source_path host_config_path = os.path.abspath(pjoin(dest_dir, host_config_path)) @@ -330,8 +332,7 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_entry('CMAKE_CUDA_STANDARD', 14)) cudatoolkitdir = spec['cuda'].prefix - cfg.write(cmake_cache_entry('CUDA_TOOLKIT_ROOT_DIR', - cudatoolkitdir)) + cfg.write(cmake_cache_entry('CUDA_TOOLKIT_ROOT_DIR', cudatoolkitdir)) cudacompiler = '${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc' cfg.write(cmake_cache_entry('CMAKE_CUDA_COMPILER', cudacompiler)) @@ -351,19 +352,14 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS', cmake_cuda_flags)) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', - '-O3 -Xcompiler -O3 -DNDEBUG')) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', - '-O3 -g -lineinfo -Xcompiler -O3')) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', - '-O0 -Xcompiler -O0 -g -G')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', '-O3 -Xcompiler -O3 -DNDEBUG')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', '-O3 -g -lineinfo -Xcompiler -O3')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', '-O0 -Xcompiler -O0 -g -G')) else: cfg.write(cmake_cache_option('ENABLE_CUDA', False)) - performance_portability_tpls = (('raja', 'RAJA', True), - ('umpire', 'UMPIRE', True), - ('chai', 'CHAI', True)) + performance_portability_tpls = (('raja', 'RAJA', True), ('umpire', 'UMPIRE', True), ('chai', 'CHAI', True)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Performance Portability TPLs\n') cfg.write('#{0}\n\n'.format('-' * 80)) @@ -373,14 +369,10 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): else: cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) - io_tpls = (('hdf5', 'HDF5', True), - ('conduit', 'CONDUIT', True), - ('silo', 'SILO', True), - ('adiak', 'ADIAK', '+caliper' in spec), - ('caliper', 'CALIPER', '+caliper' in spec), - ('pugixml', 'PUGIXML', True), - ('vtk', 'VTK', False) - ('fmt', 'FMT', True)) + io_tpls = (('hdf5', 'HDF5', True), ('conduit', 'CONDUIT', True), ('silo', 'SILO', True), + ('adiak', 'ADIAK', '+caliper' + in spec), ('caliper', 'CALIPER', '+caliper' + in spec), ('pugixml', 'PUGIXML', True), ('vtk', 'VTK', False)('fmt', 'FMT', True)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# IO TPLs\n') cfg.write('#{0}\n\n'.format('-' * 80)) @@ -407,13 +399,12 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_list('BLAS_LIBRARIES', spec['blas'].libs)) cfg.write(cmake_cache_list('LAPACK_LIBRARIES', spec['lapack'].libs)) - math_tpls = (('metis', 'METIS', True), - ('parmetis', 'PARMETIS', True), - ('superlu-dist', 'SUPERLU_DIST', True), - ('suite-sparse', 'SUITESPARSE', '+suite-sparse' in spec), - ('trilinos', 'TRILINOS', '+trilinos' in spec), - ('hypre', 'HYPRE', '+hypre' in spec or '+hypre-cuda' in spec), - ('petsc', 'PETSC', '+petsc' in spec)) + math_tpls = (('metis', 'METIS', True), ('parmetis', 'PARMETIS', True), ('superlu-dist', 'SUPERLU_DIST', + True), + ('suite-sparse', 'SUITESPARSE', '+suite-sparse' + in spec), ('trilinos', 'TRILINOS', '+trilinos' + in spec), ('hypre', 'HYPRE', '+hypre' in spec + or '+hypre-cuda' in spec), ('petsc', 'PETSC', '+petsc' in spec)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Math TPLs\n') cfg.write('#{0}\n\n'.format('-' * 80)) @@ -446,12 +437,10 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write('#{0}\n\n'.format('-' * 80)) if '+docs' in spec: sphinx_bin_dir = spec['py-sphinx'].prefix.bin - cfg.write(cmake_cache_entry('SPHINX_EXECUTABLE', - os.path.join(sphinx_bin_dir, 'sphinx-build'))) + cfg.write(cmake_cache_entry('SPHINX_EXECUTABLE', os.path.join(sphinx_bin_dir, 'sphinx-build'))) doxygen_bin_dir = spec['doxygen'].prefix.bin - cfg.write(cmake_cache_entry('DOXYGEN_EXECUTABLE', - os.path.join(doxygen_bin_dir, 'doxygen'))) + cfg.write(cmake_cache_entry('DOXYGEN_EXECUTABLE', os.path.join(doxygen_bin_dir, 'doxygen'))) else: cfg.write(cmake_cache_option('ENABLE_DOCS', False)) cfg.write(cmake_cache_option('ENABLE_DOXYGEN', False)) @@ -460,8 +449,8 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Development tools\n') cfg.write('#{0}\n\n'.format('-' * 80)) - cfg.write(cmake_cache_entry('UNCRUSTIFY_EXECUTABLE', - os.path.join(spec['uncrustify'].prefix.bin, 'uncrustify'))) + cfg.write( + cmake_cache_entry('UNCRUSTIFY_EXECUTABLE', os.path.join(spec['uncrustify'].prefix.bin, 'uncrustify'))) # cfg.write('#{0}\n'.format('-' * 80)) # cfg.write('# addr2line\n') @@ -475,7 +464,6 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_option('ENABLE_MATHPRESSO', False)) cfg.write(cmake_cache_option('ENABLE_XML_UPDATES', False)) - def cmake_args(self): pass # spec = self.spec From bb56e1fb080a7c0c9161ec5469a4059ea350915f Mon Sep 17 00:00:00 2001 From: Sergey Klevtsov Date: Fri, 5 Aug 2022 15:31:51 -0700 Subject: [PATCH 09/48] Add PT-Scotch as a partitioning method option in VTKMesh (#1996) --- scripts/uberenv/packages/geosx/package.py | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index 9cfd0dba..9b6accb0 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -68,6 +68,7 @@ class Geosx(CMakePackage, CudaPackage): variant('hypre', default=True, description='Build HYPRE support.') variant('hypre-cuda', default=False, description='Build HYPRE with CUDA support.') variant('petsc', default=True, description='Build PETSc support.') + variant('scotch', default=True, description='Build Scotch support.') variant('lai', default='trilinos', description='Linear algebra interface.', @@ -122,7 +123,7 @@ class Geosx(CMakePackage, CudaPackage): depends_on('pugixml@1.8: +shared') - depends_on('fmt@8.0: +cxxstd=14 +pic') + depends_on('fmt@8.0: cxxstd=14 +pic') # # Math @@ -133,6 +134,8 @@ class Geosx(CMakePackage, CudaPackage): depends_on('parmetis@4.0.3: +shared +int64') + depends_on('scotch@6.0.9: +mpi +int64', when='+scotch') + depends_on('superlu-dist +int64 +openmp +shared', when='~petsc') depends_on('superlu-dist@6.3.0 +int64 +openmp +shared', when='+petsc') @@ -399,12 +402,19 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_list('BLAS_LIBRARIES', spec['blas'].libs)) cfg.write(cmake_cache_list('LAPACK_LIBRARIES', spec['lapack'].libs)) - math_tpls = (('metis', 'METIS', True), ('parmetis', 'PARMETIS', True), ('superlu-dist', 'SUPERLU_DIST', - True), - ('suite-sparse', 'SUITESPARSE', '+suite-sparse' - in spec), ('trilinos', 'TRILINOS', '+trilinos' - in spec), ('hypre', 'HYPRE', '+hypre' in spec - or '+hypre-cuda' in spec), ('petsc', 'PETSC', '+petsc' in spec)) + # yapf: disable + math_tpls = ( + ('metis', 'METIS', True), + ('parmetis', 'PARMETIS', True), + ('scotch', 'SCOTCH', '+scotch' in spec), + ('superlu-dist', 'SUPERLU_DIST', True), + ('suite-sparse', 'SUITESPARSE', '+suite-sparse' in spec), + ('trilinos', 'TRILINOS', '+trilinos' in spec), + ('hypre', 'HYPRE', '+hypre' in spec or '+hypre-cuda' in spec), + ('petsc', 'PETSC', '+petsc' in spec) + ) + # yapf: enable + cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Math TPLs\n') cfg.write('#{0}\n\n'.format('-' * 80)) @@ -444,7 +454,7 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): else: cfg.write(cmake_cache_option('ENABLE_DOCS', False)) cfg.write(cmake_cache_option('ENABLE_DOXYGEN', False)) - cfg.write(cmake_cache_option('ENABLE_SPHYNX', False)) + cfg.write(cmake_cache_option('ENABLE_SPHINX', False)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Development tools\n') From 7174fc20890f609a0f10f095bfe289e764cdfed3 Mon Sep 17 00:00:00 2001 From: TotoGaz <49004943+TotoGaz@users.noreply.github.com> Date: Fri, 14 Apr 2023 18:45:08 -0700 Subject: [PATCH 10/48] Change `geosx` to `geos` in macros, include guards, namespace... (#2392) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch aims at shrinking `GEOSX` into `GEOS`. - The `geosx` namespace is renamed `geos`. - All the `GEOSX_ASSERT`, `GEOSX_LOG`, … are renamed `GEOS_…` - All the include guards are modified. - All the paths to the old `http://gihub.com/GEOSX/GEOSX` are renamed appropriately - Mention to `GEOSX` in the text of the documentation is changed to `GEOS` Meanwhile, `GEOSX` is kept for the following cases - The executable is still named `geosx`, the examples in the doc still reflect the current naming. - All the tools named after `geosx` kept their `geosx` (_e.g._ `pygeox`, `geosx_xml_tools`) - All the `cmake` configuration flags (_e.g._ `GEOSX_TPL_DIR`, `GEOSX_USE_CUDA`) are unchanged. - The `host-config` files are not changed. - The variables names, classes or files containing `GEOSX` are not modified. --- scripts/uberenv/packages/geosx/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index 9b6accb0..4c1e3883 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -52,8 +52,8 @@ def cmake_cache_option(name, boolean_value, comment=""): class Geosx(CMakePackage, CudaPackage): """GEOSX simulation framework.""" - homepage = "https://github.com/GEOSX/GEOSX" - git = "https://github.com/GEOSX/GEOSX.git" + homepage = "https://github.com/GEOS-DEV/GEOS" + git = "https://github.com/GEOS-DEV/GEOS.git" version('develop', branch='develop', submodules='True') From f22db187669e5a36742f3fd9a5673cd4bfdc5252 Mon Sep 17 00:00:00 2001 From: William R Tobin <4522899+wrtobin@users.noreply.github.com> Date: Wed, 17 May 2023 00:05:39 -0700 Subject: [PATCH 11/48] Initial HIP/ROCM Support (#2453) --- scripts/uberenv/packages/geosx/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index 4c1e3883..dd099270 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -422,7 +422,9 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): if enable: cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) if tpl == 'hypre' and '+hypre-cuda' in spec: - cfg.write(cmake_cache_option('ENABLE_HYPRE_CUDA'.format(cmake_name), True)) + cfg.write(cmake_cache_string('ENABLE_HYPRE_DEVICE', "CUDA")) + elif tpl == 'hypre' and '+hypre-hip' in spec: + cfg.write(cmake_cache_string('ENABLE_HYPRE_DEVICE', "HIP")) else: cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) From f29a21e09ee1579cd5f52bb531985d5677b9bc8e Mon Sep 17 00:00:00 2001 From: William R Tobin <4522899+wrtobin@users.noreply.github.com> Date: Wed, 31 May 2023 14:02:35 -0700 Subject: [PATCH 12/48] Ensure unit tests are enabled by default. (#2464) * Add geos-specific option to suppress/enable unit tests, active by default. --- scripts/uberenv/packages/geosx/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/uberenv/packages/geosx/package.py index dd099270..0672ae77 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/uberenv/packages/geosx/package.py @@ -488,9 +488,9 @@ def cmake_args(self): # options.append(self.define_from_variant('BUILD_SHARED_LIBS', 'shared')) # if '~tests~examples~benchmarks' in spec: - # options.append('-DENABLE_TESTS=OFF') + # options.append('-DGEOS_ENABLE_TESTS=OFF') # else: - # options.append('-DENABLE_TESTS=ON') + # options.append('-DGEOS_ENABLE_TESTS=ON') # if '~test' in spec: # options.append('-DDISABLE_UNIT_TESTS=ON') From 7423737b7158d2b53c6e66d1daa3f4c819439684 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Tue, 23 Jan 2024 15:48:30 -0800 Subject: [PATCH 13/48] Spack Update (#2028) * Add mesa to packages.yaml, vtk issues * modify, add fmt recipe * remove cxx flags from blueos (consistent with RADIUSS and Axom) * Add specific uncrustify version, remove optimization flags from toss3 * Move spack configs and package recipes to separate folders; delete uberenv directory * Add uberenv as a submodule. Add uberenv config file * Bump conduit, add libtools external package * Bill's Conduit/HDF5 changes + switcharoo, try building latest pugixml * Add vtk patches + Try replace hypre-cuda with +hypre+cuda and caliper variant changes * Add camp dependency for RAJA path * make suite-sparse mandatory (spack is not always adding it to spec otherwise) * Change clang@upstream for blueos to clang@9 so clingo doesn't yell * gmpr fix * Use more accurate caliper version and correct readline version * Cleanup vtk script, vtk now builds on lassen * Update to spack 0.18.0 * Update hypre/silo/hdf5/conduit and use older trilinos recipe * Can build all blueos libraries - compilation errors - use netlib-lapack instead of essl * first pass at spack environments * Add spack.yaml for lassen; modify spack.yaml install_tree path to blueos_3_ppc64le_ib_p9_package * Generalize HDF5 and pugixml configuration so both thirdPartyLibs and spack builds work * Update umpire/raja/chai/hypre - only quartz re-tested so far * blueos config - set CUDA 11 as default * Cuda 11 explicit spec * Update CMake version; add gcc-toolchain flag for quartz * Update caliper, adiak, trilinos, cmake requirement, camp version in spack recipe * Update adiak namespace * Add cxx flags (std:: errors), disable hwloc dependency (runtime MPI error) for trilinos recipe * Guard adiak or adiak::adiak target * Add FESAPI spack recipe * pugixml and fmt changes for toss 3 quartz * Update CUDA to 11.2.2, update hypre, add -fPIC flag for hypre~shared, add missing libcublasLt path * use intel-oneapi-mkl instead of intel-mkl; use magic mvapich2; use mpi fortran in superlu-dist; disable fesapi default; update hypre; update cmake * Update CMake to 3.26.3; CMake fortran/CXX error with 3.23.1 * Missing fmt dependency * Upgrade to uberenv spack environments - update uberenv submodule, move to spack.yaml config files, comment out unused recipe patches * Move pygeosx dependencies to a separate spack recipe; update to latest spack release; use older hdf5 recipe; small trilinos change due to spack cmakepackage reorg; add spack environment files for pygeosx; adjust spec check for HYPRE cuda/hip enabled; add project json file for uberenv to build pygeosx; delete old python spec files * Mandate CMake >=3.23 * Spack environment file for toss 3 (rzgenie) * Remove cp unused * Omit uberenv from submodule check * Lock blt version to bypass raja/chai/camp blt::stub error * Make python required dependency; make pygeosx variant toggle * Generate separate host-config for LvArray * Update hypre and umpire versions, Remove some package recipes using git version specifiers where possible --- .uberenv_config.json | 11 + .../blueos_3_ppc64le_ib_p9/spack.yaml | 137 +++ scripts/pygeosx_configs/pygeosx.json | 11 + .../toss_4_x86_64_ib/spack.yaml | 142 +++ .../blueos_3_ppc64le_ib_p9/spack.yaml | 196 ++++ .../spack_configs/darwin/compilers.yaml | 0 .../spack_configs/darwin/packages.yaml | 0 .../spack_configs/summit/compilers.yaml | 0 .../spack_configs/summit/packages.yaml | 0 .../summit_python/compilers.yaml | 0 .../spack_configs/summit_python/packages.yaml | 0 .../spack_configs/toss_3_x86_64_ib/spack.yaml | 194 ++++ .../spack_configs/toss_4_x86_64_ib/spack.yaml | 182 ++++ .../spack_packages/packages/chai/package.py | 198 ++++ .../spack_packages/packages/essl/package.py | 49 + .../spack_packages/packages/fesapi/package.py | 46 + .../packages/geosx/package.py | 413 +++++--- .../spack_packages/packages/hdf5/package.py | 747 +++++++++++++++ .../py-pydata-sphinx-theme/package.py | 17 + .../py-sphinxcontrib-plantuml/package.py | 17 + .../packages/pygeosx/package.py | 21 + .../packages/trilinos/cray_secas.patch | 26 + .../trilinos/fix_clang_errors_12_18_1.patch | 39 + .../packages/trilinos/package.py | 890 ++++++++++++++++++ .../spack_packages/packages/umpire/package.py | 299 ++++++ .../spack_packages/packages/vtk/package.py | 102 ++ .../packages/vtk/vtkXMLReader-fpe.patch | 19 + scripts/spack_packages/repo.yaml | 2 + .../blueos_3_ppc64le_ib_p9/compilers.yaml | 46 - .../blueos_3_ppc64le_ib_p9/packages.yaml | 67 -- .../compilers.yaml | 31 - .../packages.yaml | 132 --- scripts/uberenv/spack_configs/config.yaml | 78 -- .../toss_3_x86_64_ib/compilers.yaml | 81 -- .../toss_3_x86_64_ib/packages.yaml | 70 -- .../toss_3_x86_64_ib_python/compilers.yaml | 1 - .../toss_3_x86_64_ib_python/packages.yaml | 146 --- 37 files changed, 3653 insertions(+), 757 deletions(-) create mode 100644 .uberenv_config.json create mode 100644 scripts/pygeosx_configs/blueos_3_ppc64le_ib_p9/spack.yaml create mode 100644 scripts/pygeosx_configs/pygeosx.json create mode 100644 scripts/pygeosx_configs/toss_4_x86_64_ib/spack.yaml create mode 100644 scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml rename scripts/{uberenv => }/spack_configs/darwin/compilers.yaml (100%) rename scripts/{uberenv => }/spack_configs/darwin/packages.yaml (100%) rename scripts/{uberenv => }/spack_configs/summit/compilers.yaml (100%) rename scripts/{uberenv => }/spack_configs/summit/packages.yaml (100%) rename scripts/{uberenv => }/spack_configs/summit_python/compilers.yaml (100%) rename scripts/{uberenv => }/spack_configs/summit_python/packages.yaml (100%) create mode 100644 scripts/spack_configs/toss_3_x86_64_ib/spack.yaml create mode 100644 scripts/spack_configs/toss_4_x86_64_ib/spack.yaml create mode 100644 scripts/spack_packages/packages/chai/package.py create mode 100644 scripts/spack_packages/packages/essl/package.py create mode 100644 scripts/spack_packages/packages/fesapi/package.py rename scripts/{uberenv => spack_packages}/packages/geosx/package.py (50%) create mode 100644 scripts/spack_packages/packages/hdf5/package.py create mode 100644 scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py create mode 100644 scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py create mode 100644 scripts/spack_packages/packages/pygeosx/package.py create mode 100644 scripts/spack_packages/packages/trilinos/cray_secas.patch create mode 100644 scripts/spack_packages/packages/trilinos/fix_clang_errors_12_18_1.patch create mode 100644 scripts/spack_packages/packages/trilinos/package.py create mode 100644 scripts/spack_packages/packages/umpire/package.py create mode 100644 scripts/spack_packages/packages/vtk/package.py create mode 100644 scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch create mode 100644 scripts/spack_packages/repo.yaml delete mode 100644 scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml delete mode 100644 scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml delete mode 100644 scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/compilers.yaml delete mode 100644 scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/packages.yaml delete mode 100644 scripts/uberenv/spack_configs/config.yaml delete mode 100644 scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml delete mode 100644 scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml delete mode 120000 scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/compilers.yaml delete mode 100644 scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/packages.yaml diff --git a/.uberenv_config.json b/.uberenv_config.json new file mode 100644 index 00000000..883612c2 --- /dev/null +++ b/.uberenv_config.json @@ -0,0 +1,11 @@ +{ +"package_name": "geosx", +"package_version": "develop", +"package_final_phase": "lvarray_hostconfig", +"package_source_dir": "../..", +"spack_url": "https://github.com/spack/spack", +"spack_commit": "e8658d6493887ef702dd38f0e9ee5870a1651c1e", +"spack_configs_path": "scripts/spack_configs", +"spack_packages_path": "scripts/spack_packages/packages", +"spack_concretizer": "clingo" +} diff --git a/scripts/pygeosx_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/pygeosx_configs/blueos_3_ppc64le_ib_p9/spack.yaml new file mode 100644 index 00000000..565a1207 --- /dev/null +++ b/scripts/pygeosx_configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -0,0 +1,137 @@ +#------------------------------------------------------------------------------------------------------------ +# SPDX-License-Identifier: LGPL-2.1-only +# +# Copyright (c) 2018-2020 Lawrence Livermore National Security LLC +# Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2018-2020 TotalEnergies +# Copyright (c) 2019- GEOSX Contributors +# All rights reserved +# +# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. +#------------------------------------------------------------------------------------------------------------ + +# %gcc@8.3.1 +# +# Uberenv command to build pygeosx dependencies: +# python3 ./scripts/uberenv/uberenv.py --spec="%gcc@8.3.1" --project-json="scripts/pygeosx_configs/pygeosx.json" + +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + view: + default: + root: ../view + projections: + all: '{name}-{version}' + + compilers:: + - compiler: + spec: gcc@8.3.1 + paths: + cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + # Fix for "undefined reference to `_gfortran_transfer_integer_write'" + ldlibs: -lgfortran + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] + + packages: + all: + compiler: [gcc] + providers: + mpi: [spectrum-mpi] + blas: [openblas] + lapack: [openblas] + + spectrum-mpi: + buildable: False + externals: + - spec: spectrum-mpi@release%gcc@8.3.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1 + + cuda: + buildable: False + externals: + - spec: cuda@11.2.2 +allow-unsupported-compilers + prefix: /usr/tce/packages/cuda/cuda-11.2.0 + + # System level packages to not build + cmake: + buildable: False + externals: + - spec: cmake@3.21.1 + prefix: /usr/tce/packages/cmake/cmake-3.21.1 + readline: + buildable: False + externals: + - spec: readline@7.0 + prefix: /collab/usr/gapps/python/build/spack-coralea.3/opt/spack/linux-rhel7-ppc64le/gcc-4.9.3/readline-7.0-owal6z2zh5zotgvdmwow6sgdn6cqfn43/ + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr + perl: + buildable: false + externals: + - spec: perl@5.16.3 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@0.27.1 + prefix: /usr + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin/ + autoconf: + buildable: False + externals: + - spec: autoconf@2.69 + prefix: /usr + automake: + buildable: False + externals: + - spec: automake@1.13.4 + prefix: /usr + libtool: + buildable: False + externals: + - spec: libtool@2.4.2 + prefix: /usr + bison: + buildable: False + externals: + - spec: bison@3.0.4 + prefix: /usr + flex: + buildable: False + externals: + - spec: flex@2.5.37 + prefix: /usr + tk: + buildable: False + externals: + - spec: tk@8.5 + prefix: /usr + tcl: + buildable: False + externals: + - spec: tcl@8.5 + prefix: /usr diff --git a/scripts/pygeosx_configs/pygeosx.json b/scripts/pygeosx_configs/pygeosx.json new file mode 100644 index 00000000..41b485dc --- /dev/null +++ b/scripts/pygeosx_configs/pygeosx.json @@ -0,0 +1,11 @@ +{ +"package_name": "pygeosx", +"package_version": "fakeversion", +"package_final_phase": "", +"package_source_dir": "../..", +"spack_url": "https://github.com/spack/spack", +"spack_commit": "e8658d6493887ef702dd38f0e9ee5870a1651c1e", +"spack_configs_path": "scripts/pygeosx_configs", +"spack_packages_path": "scripts/spack_packages/packages", +"spack_concretizer": "clingo" +} diff --git a/scripts/pygeosx_configs/toss_4_x86_64_ib/spack.yaml b/scripts/pygeosx_configs/toss_4_x86_64_ib/spack.yaml new file mode 100644 index 00000000..0fb9dc34 --- /dev/null +++ b/scripts/pygeosx_configs/toss_4_x86_64_ib/spack.yaml @@ -0,0 +1,142 @@ +#------------------------------------------------------------------------------------------------------------ +# SPDX-License-Identifier: LGPL-2.1-only +# +# Copyright (c) 2018-2020 Lawrence Livermore National Security LLC +# Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2018-2020 TotalEnergies +# Copyright (c) 2019- GEOSX Contributors +# All rights reserved +# +# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. +#------------------------------------------------------------------------------------------------------------ + +# %gcc@10.3.1 +# +# Uberenv command to build pygeosx dependencies: +# python3 ./scripts/uberenv/uberenv.py --spec="%gcc@10.3.1" --project-json="scripts/pygeosx_configs/pygeosx.json" + +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + view: + default: + root: ../view + projections: + all: '{name}-{version}' + + compilers:: + - compiler: + spec: gcc@10.3.1 + paths: + cc: /usr/tce/packages/gcc/gcc-10.3.1-magic/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-10.3.1-magic/bin/g++ + f77: /usr/tce/packages/gcc/gcc-10.3.1-magic/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-10.3.1-magic/bin/gfortran + operating_system: rhel8 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] + + packages: + all: + target: [ivybridge] + compiler: [clang] + providers: + mpi: [mvapich2] + blas: [intel-oneapi-mkl] + lapack: [intel-oneapi-mkl] + + # Lock down which MPI we are using + mvapich2: + buildable: False + externals: + - spec: mvapich2@2.3%gcc@10.3.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1-magic + + intel-oneapi-mkl: + externals: + - spec: "intel-oneapi-mkl@2023.0.0" + prefix: /opt/intel/oneapi + buildable: False + + # System level packages to not build + papi: + buildable: False + externals: + - spec: papi@6.0.0.1 + prefix: /usr/tce/packages/papi/papi-6.0.0.1/ + cmake: + version: [3.26.3] + buildable: false + externals: + - spec: cmake@3.26.3 + prefix: /usr/tce/packages/cmake/cmake-3.26.3 + readline: + externals: + - spec: readline@7.0 + prefix: /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/readline-7.0-e5jqqjmcjknidgwvi353pd6umpixzxr2 + buildable: false + m4: + buildable: False + externals: + - spec: m4@1.4.18 + prefix: /usr + perl: + buildable: false + externals: + - spec: perl@5.26.3 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@1.8.0 + prefix: /usr + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin + autoconf: + buildable: False + externals: + - spec: autoconf@2.69 + prefix: /usr + automake: + buildable: False + externals: + - spec: automake@1.16.1 + prefix: /usr + libtool: + buildable: False + externals: + - spec: libtool@2.4.6 + prefix: /usr + bison: + buildable: False + externals: + - spec: bison@3.0.4 + prefix: /usr + flex: + buildable: False + externals: + - spec: flex@2.6.1 + prefix: /usr + tk: + buildable: False + externals: + - spec: tk@8.6 + prefix: /usr + tcl: + buildable: False + externals: + - spec: tcl@8.6 + prefix: /usr diff --git a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml new file mode 100644 index 00000000..798f19bf --- /dev/null +++ b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -0,0 +1,196 @@ +#------------------------------------------------------------------------------------------------------------ +# SPDX-License-Identifier: LGPL-2.1-only +# +# Copyright (c) 2018-2020 Lawrence Livermore National Security LLC +# Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2018-2020 TotalEnergies +# Copyright (c) 2019- GEOSX Contributors +# All rights reserved +# +# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. +#------------------------------------------------------------------------------------------------------------ + +# geosx@develop%clang@10.0.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers +# geosx@develop%gcc@8.3.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers +# geosx@develop%clang@13.0.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers +# +# Uberenv command to build geos dependencies: +# python3 ./scripts/uberenv/uberenv.py --spec="%clang@10.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" +# +# python3 ./scripts/uberenv/uberenv.py --spec="%gcc@8.3.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" +# +# python3 ./scripts/uberenv/uberenv.py --spec="%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" + + +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + - compiler: + spec: clang@10.0.1 + paths: + cc: /usr/tce/packages/clang/clang-10.0.1-gcc-8.3.1/bin/clang + cxx: /usr/tce/packages/clang/clang-10.0.1-gcc-8.3.1/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: {} + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] + - compiler: + spec: clang@13.0.1 + paths: + cc: /usr/tce/packages/clang/clang-13.0.1-gcc-8.3.1/bin/clang + cxx: /usr/tce/packages/clang/clang-13.0.1-gcc-8.3.1/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: {} + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] + - compiler: + spec: gcc@8.3.1 + paths: + cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ + f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran + flags: + # Fix for "undefined reference to `_gfortran_transfer_integer_write'" + ldlibs: -lgfortran + operating_system: rhel7 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] + + packages: + all: + compiler: [gcc, clang] + providers: + mpi: [spectrum-mpi] + blas: [essl] + lapack: [essl] + + blt: + require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + + hypre: + require: "@git.57bfb26e268ddf003668c5d0b5938ae258922a83" + + umpire: + require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + + raja: + require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + + camp: + require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + + uncrustify: + require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" + + superlu-dist: + require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" + + spectrum-mpi: + buildable: False + externals: + - spec: spectrum-mpi@release%gcc@8.3.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1 + # Previously clang@upstream - clingo doesn't like "upstream" version + - spec: spectrum-mpi@release%clang@10.0.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1 + - spec: spectrum-mpi@release%clang@13.0.1 + prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-13.0.1-gcc-8.3.1 + + essl: + buildable: False + externals: + - spec: essl@6.3.0.2 + prefix: /usr/tcetmp/packages/essl/essl-6.3.0.2/ + + cuda: + buildable: False + externals: + - spec: cuda@11.8.0 +allow-unsupported-compilers + prefix: /usr/tce/packages/cuda/cuda-11.8.0 + + # System level packages to not build + cmake: + buildable: False + externals: + - spec: cmake@3.23.1 + prefix: /usr/tce/packages/cmake/cmake-3.23.1 + readline: + buildable: False + externals: + - spec: readline@7.0 + prefix: /collab/usr/gapps/python/build/spack-coralea.3/opt/spack/linux-rhel7-ppc64le/gcc-4.9.3/readline-7.0-owal6z2zh5zotgvdmwow6sgdn6cqfn43/ + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr + perl: + buildable: false + externals: + - spec: perl@5.16.3 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@0.27.1 + prefix: /usr + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin/ + # This needs to be the prefix to the python3 LC installation + # or pygeosx package built by spack/uberenv + python: + buildable: False + externals: + - spec: python@3.8.2 + prefix: /usr/gapps/GEOSX/thirdPartyLibs/python/lassen-gcc-python/python/ + autoconf: + buildable: False + externals: + - spec: autoconf@2.69 + prefix: /usr + automake: + buildable: False + externals: + - spec: automake@1.13.4 + prefix: /usr + libtool: + buildable: False + externals: + - spec: libtool@2.4.2 + prefix: /usr + bison: + buildable: False + externals: + - spec: bison@3.0.4 + prefix: /usr + flex: + buildable: False + externals: + - spec: flex@2.5.37 + prefix: /usr diff --git a/scripts/uberenv/spack_configs/darwin/compilers.yaml b/scripts/spack_configs/darwin/compilers.yaml similarity index 100% rename from scripts/uberenv/spack_configs/darwin/compilers.yaml rename to scripts/spack_configs/darwin/compilers.yaml diff --git a/scripts/uberenv/spack_configs/darwin/packages.yaml b/scripts/spack_configs/darwin/packages.yaml similarity index 100% rename from scripts/uberenv/spack_configs/darwin/packages.yaml rename to scripts/spack_configs/darwin/packages.yaml diff --git a/scripts/uberenv/spack_configs/summit/compilers.yaml b/scripts/spack_configs/summit/compilers.yaml similarity index 100% rename from scripts/uberenv/spack_configs/summit/compilers.yaml rename to scripts/spack_configs/summit/compilers.yaml diff --git a/scripts/uberenv/spack_configs/summit/packages.yaml b/scripts/spack_configs/summit/packages.yaml similarity index 100% rename from scripts/uberenv/spack_configs/summit/packages.yaml rename to scripts/spack_configs/summit/packages.yaml diff --git a/scripts/uberenv/spack_configs/summit_python/compilers.yaml b/scripts/spack_configs/summit_python/compilers.yaml similarity index 100% rename from scripts/uberenv/spack_configs/summit_python/compilers.yaml rename to scripts/spack_configs/summit_python/compilers.yaml diff --git a/scripts/uberenv/spack_configs/summit_python/packages.yaml b/scripts/spack_configs/summit_python/packages.yaml similarity index 100% rename from scripts/uberenv/spack_configs/summit_python/packages.yaml rename to scripts/spack_configs/summit_python/packages.yaml diff --git a/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml new file mode 100644 index 00000000..ce601ad9 --- /dev/null +++ b/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml @@ -0,0 +1,194 @@ +#------------------------------------------------------------------------------------------------------------ +# SPDX-License-Identifier: LGPL-2.1-only +# +# Copyright (c) 2018-2020 Lawrence Livermore National Security LLC +# Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2018-2020 TotalEnergies +# Copyright (c) 2019- GEOSX Contributors +# All rights reserved +# +# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. +#------------------------------------------------------------------------------------------------------------ + +# geosx@develop%clang@10.0.0 +# +# Uberenv command to build pygeosx dependencies: +# python3 ./scripts/uberenv/uberenv.py --spec="%clang@10.0.0" + +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + - compiler: + spec: clang@10.0.0 + paths: + cc: /usr/tce/packages/clang/clang-10.0.0/bin/clang + cxx: /usr/tce/packages/clang/clang-10.0.0/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran + flags: + cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 + cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] + - compiler: + spec: clang@10.0.1 + paths: + cc: /usr/tce/packages/clang/clang-10.0.1/bin/clang + cxx: /usr/tce/packages/clang/clang-10.0.1/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran + flags: + cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 + cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] + - compiler: + spec: gcc@8.1.0 + paths: + cc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-8.1.0/bin/g++ + f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran + flags: {} + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] + - compiler: + spec: intel@19.1.2 + paths: + cc: /usr/tce/packages/intel/intel-19.1.2/bin/icc + cxx: /usr/tce/packages/intel/intel-19.1.2/bin/icpc + f77: /usr/tce/packages/intel/intel-19.1.2/bin/ifort + fc: /usr/tce/packages/intel/intel-19.1.2/bin/ifort + flags: + cflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc + cxxflags: -gxx-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ + fflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc + operating_system: rhel7 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] + + packages: + all: + target: [ivybridge] + compiler: [gcc, clang, intel] + providers: + mpi: [mvapich2] + blas: [intel-mkl] + lapack: [intel-mkl] + + # Lock down which MPI we are using + mvapich2: + buildable: False + externals: + - spec: mvapich2@2.3%gcc@8.3.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/ + - spec: mvapich2@2.3%clang@10.0.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.1 + + # Lock down blas, lapack implementation + intel-mkl: + buildable: False + externals: + - spec: intel-mkl@2020.0.166 threads=openmp + prefix: /usr/tce/packages/mkl/mkl-2020.0/ + + # System level packages to not build + papi: + buildable: False + externals: + - spec: papi@5.5.1 + prefix: /usr/tce/packages/papi/papi-5.5.1/ + cmake: + version: [3.23.1] + buildable: false + externals: + - spec: cmake@3.23.1 + prefix: /usr/tce/packages/cmake/cmake-3.23.1 + readline: + externals: + - spec: readline@7.0 + prefix: /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/readline-7.0-e5jqqjmcjknidgwvi353pd6umpixzxr2 + buildable: false + zlib: + buildable: False + externals: + - spec: zlib@1.2.7 + prefix: /usr + m4: + buildable: False + externals: + - spec: m4@1.4.16 + prefix: /usr + perl: + buildable: false + externals: + - spec: perl@5.16.3 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@0.27.1 + prefix: /usr + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin + python: + buildable: False + externals: + - spec: python@3.8.2 + prefix: /usr/tce/packages/python/python-3.8.2/ + py-sphinx: + buildable: False + externals: + - spec: py-sphinx@1.6.3 + prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ + autoconf: + buildable: False + externals: + - spec: autoconf@2.69 + prefix: /usr + automake: + buildable: False + externals: + - spec: automake@1.13.4 + prefix: /usr + libtool: + buildable: False + externals: + - spec: libtool@2.4.2 + prefix: /usr + bison: + buildable: False + externals: + - spec: bison@3.0.4 + prefix: /usr + flex: + buildable: False + externals: + - spec: flex@2.5.37 + prefix: /usr diff --git a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml new file mode 100644 index 00000000..817a6e81 --- /dev/null +++ b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml @@ -0,0 +1,182 @@ +#------------------------------------------------------------------------------------------------------------ +# SPDX-License-Identifier: LGPL-2.1-only +# +# Copyright (c) 2018-2020 Lawrence Livermore National Security LLC +# Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2018-2020 TotalEnergies +# Copyright (c) 2019- GEOSX Contributors +# All rights reserved +# +# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. +#------------------------------------------------------------------------------------------------------------ + +# geosx@develop%clang@14.0.6 +# geosx@develop%gcc@12.1.1 +# +# Uberenv command to build pygeosx dependencies: +# python3 ./scripts/uberenv/uberenv.py --spec="%clang@14.0.6 +docs" +# +# python3 ./scripts/uberenv/uberenv.py --spec="%gcc@12.1.1 +docs" + +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + - compiler: + spec: clang@14.0.6 + paths: + cc: /usr/tce/packages/clang/clang-14.0.6-magic/bin/clang + cxx: /usr/tce/packages/clang/clang-14.0.6-magic/bin/clang++ + f77: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran + operating_system: rhel8 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] + - compiler: + spec: gcc@12.1.1 + paths: + cc: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/g++ + f77: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran + fc: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran + flags: {} + operating_system: rhel8 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] + + packages: + all: + target: [ivybridge] + compiler: [gcc, clang] + providers: + mpi: [mvapich2] + blas: [intel-oneapi-mkl] + lapack: [intel-oneapi-mkl] + + blt: + require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + + hypre: + require: "@git.57bfb26e268ddf003668c5d0b5938ae258922a83" + + umpire: + require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + + raja: + require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + + camp: + require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + + uncrustify: + require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" + + superlu-dist: + require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" + + # Lock down which MPI we are using + mvapich2: + buildable: False + externals: + - spec: mvapich2@2.3%gcc@12.1.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-12.1.1-magic + - spec: mvapich2@2.3%clang@14.0.6 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6-magic + + intel-oneapi-mkl: + externals: + - spec: "intel-oneapi-mkl@2023.2.0" + prefix: /opt/intel/oneapi + buildable: False + + # System level packages to not build + papi: + buildable: False + externals: + - spec: papi@6.0.0.1 + prefix: /usr/tce/packages/papi/papi-6.0.0.1/ + cmake: + version: [3.26.3] + buildable: false + externals: + - spec: cmake@3.26.3 + prefix: /usr/tce/packages/cmake/cmake-3.26.3 + readline: + externals: + - spec: readline@7.0 + prefix: /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/readline-7.0-e5jqqjmcjknidgwvi353pd6umpixzxr2 + buildable: false + m4: + buildable: False + externals: + - spec: m4@1.4.18 + prefix: /usr + perl: + buildable: false + externals: + - spec: perl@5.26.3 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@1.8.0 + prefix: /usr + diffutils: + buildable: False + externals: + - spec: diffutils@3.3 + prefix: /usr/bin + # This needs to be the prefix to the pygeosx LC installation + # or system install with pygeosx dependencies + python: + buildable: False + externals: + - spec: python@3.10.8 + prefix: /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python/ + # This needs to be the prefix to the pygeosx LC installation + # or system install with pygeosx dependencies + py-sphinx: + buildable: False + externals: + - spec: py-sphinx@1.6.3 + prefix: /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python/ + autoconf: + buildable: False + externals: + - spec: autoconf@2.69 + prefix: /usr + automake: + buildable: False + externals: + - spec: automake@1.16.1 + prefix: /usr + libtool: + buildable: False + externals: + - spec: libtool@2.4.6 + prefix: /usr + bison: + buildable: False + externals: + - spec: bison@3.0.4 + prefix: /usr + flex: + buildable: False + externals: + - spec: flex@2.6.1 + prefix: /usr diff --git a/scripts/spack_packages/packages/chai/package.py b/scripts/spack_packages/packages/chai/package.py new file mode 100644 index 00000000..6ce16a6a --- /dev/null +++ b/scripts/spack_packages/packages/chai/package.py @@ -0,0 +1,198 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import socket + +from spack.package import * + + +class Chai(CachedCMakePackage, CudaPackage, ROCmPackage): + """ + Copy-hiding array interface for data migration between memory spaces + """ + + homepage = "https://github.com/LLNL/CHAI" + git = "https://github.com/LLNL/CHAI.git" + tags = ["ecp", "e4s", "radiuss"] + + maintainers("davidbeckingsale") + + # GEOS_EDIT_START + version("2023.06.0", tag="v2023.06.0", submodules=False) + # GEOS_EDIT_END + + version("develop", branch="develop", submodules=False) + version("main", branch="main", submodules=False) + version("2022.03.0", tag="v2022.03.0", submodules=False) + version("2.4.0", tag="v2.4.0", submodules=True) + version("2.3.0", tag="v2.3.0", submodules=True) + version("2.2.2", tag="v2.2.2", submodules=True) + version("2.2.1", tag="v2.2.1", submodules=True) + version("2.2.0", tag="v2.2.0", submodules=True) + version("2.1.1", tag="v2.1.1", submodules=True) + version("2.1.0", tag="v2.1.0", submodules=True) + version("2.0.0", tag="v2.0.0", submodules=True) + version("1.2.0", tag="v1.2.0", submodules=True) + version("1.1.0", tag="v1.1.0", submodules=True) + version("1.0", tag="v1.0", submodules=True) + + variant("enable_pick", default=False, description="Enable pick method") + variant("shared", default=True, description="Build Shared Libs") + variant("raja", default=False, description="Build plugin for RAJA") + variant("benchmarks", default=False, description="Build benchmarks.") + variant("examples", default=True, description="Build examples.") + variant("openmp", default=False, description="Build using OpenMP") + # TODO: figure out gtest dependency and then set this default True + # and remove the +tests conflict below. + variant("tests", default=False, description="Build tests") + + depends_on("cmake@3.8:", type="build") + depends_on("cmake@3.9:", type="build", when="+cuda") + depends_on("cmake@3.14:", when="@2022.03.0:") + + # GEOS_EDIT_START + depends_on("blt@0.5.3:", type="build", when="@2023.06.0:") + # # GEOS_EDIT_END + depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") + depends_on("blt@0.4.1:", type="build", when="@2.4.0:") + depends_on("blt@0.4.0:", type="build", when="@2.3.0") + depends_on("blt@0.3.6:", type="build", when="@:2.2.2") + + depends_on("umpire") + # GEOS_EDIT_START + depends_on("umpire@2023.06.0:", when="@2023.06.0:") + # GEOS_EDIT_END + depends_on("umpire@2022.03.0:", when="@2022.03.0:") + depends_on("umpire@6.0.0", when="@2.4.0") + depends_on("umpire@4.1.2", when="@2.2.0:2.3.0") + depends_on("umpire@main", when="@main") + + with when("+cuda"): + depends_on("umpire+cuda") + for sm_ in CudaPackage.cuda_arch_values: + depends_on("umpire+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) + + with when("+rocm"): + depends_on("umpire+rocm") + for arch in ROCmPackage.amdgpu_targets: + depends_on( + "umpire+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) + ) + + with when("+raja"): + depends_on("raja~openmp", when="~openmp") + depends_on("raja+openmp", when="+openmp") + depends_on("raja@0.14.0", when="@2.4.0") + depends_on("raja@0.13.0", when="@2.3.0") + depends_on("raja@0.12.0", when="@2.2.0:2.2.2") + depends_on("raja@2022.03.0:", when="@2022.03.0:") + # GEOS_EDIT_START + depends_on("raja@2023.06.0:", when="@2023.06.0:") + # GEOS_EDIT_END + depends_on("raja@main", when="@main") + + with when("+cuda"): + depends_on("raja+cuda") + for sm_ in CudaPackage.cuda_arch_values: + depends_on("raja+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) + with when("+rocm"): + depends_on("raja+rocm") + for arch in ROCmPackage.amdgpu_targets: + depends_on( + "raja+rocm amdgpu_target={0}".format(arch), + when="amdgpu_target={0}".format(arch), + ) + + conflicts("+benchmarks", when="~tests") + + def _get_sys_type(self, spec): + sys_type = spec.architecture + if "SYS_TYPE" in env: + sys_type = env["SYS_TYPE"] + return sys_type + + @property + def cache_name(self): + hostname = socket.gethostname() + if "SYS_TYPE" in env: + hostname = hostname.rstrip("1234567890") + return "{0}-{1}-{2}@{3}.cmake".format( + hostname, + self._get_sys_type(self.spec), + self.spec.compiler.name, + self.spec.compiler.version, + ) + + def initconfig_compiler_entries(self): + spec = self.spec + entries = super(Chai, self).initconfig_compiler_entries() + if "+rocm" in spec: + entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) + return entries + + def initconfig_hardware_entries(self): + spec = self.spec + entries = super(Chai, self).initconfig_hardware_entries() + + entries.append(cmake_cache_option("ENABLE_OPENMP", "+openmp" in spec)) + + if "+cuda" in spec: + entries.append(cmake_cache_option("ENABLE_CUDA", True)) + # GEOS_EDIT_START + #entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True)) + #entries.append(cmake_cache_option("CUDA_SEPARABLE_COMPILATION", True)) + # GEOS_EDIT_END + + if not spec.satisfies("cuda_arch=none"): + cuda_arch = spec.variants["cuda_arch"].value + entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) + entries.append( + cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) + ) + flag = "-arch sm_{0}".format(cuda_arch[0]) + entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", "{0}".format(flag))) + else: + entries.append(cmake_cache_option("ENABLE_CUDA", False)) + + if "+rocm" in spec: + entries.append(cmake_cache_option("ENABLE_HIP", True)) + entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) + archs = self.spec.variants["amdgpu_target"].value + if archs != "none": + arch_str = ",".join(archs) + entries.append( + cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) + ) + else: + entries.append(cmake_cache_option("ENABLE_HIP", False)) + + return entries + + def initconfig_package_entries(self): + spec = self.spec + entries = [] + + option_prefix = "CHAI_" if spec.satisfies("@2022.03.0:") else "" + + entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) + if "+raja" in spec: + entries.append(cmake_cache_option("{}ENABLE_RAJA_PLUGIN".format(option_prefix), True)) + entries.append(cmake_cache_path("RAJA_DIR", spec["raja"].prefix)) + entries.append( + cmake_cache_option("{}ENABLE_PICK".format(option_prefix), "+enable_pick" in spec) + ) + entries.append(cmake_cache_path("umpire_DIR", spec["umpire"].prefix.share.umpire.cmake)) + entries.append(cmake_cache_option("ENABLE_TESTS", "+tests" in spec)) + entries.append(cmake_cache_option("ENABLE_BENCHMARKS", "+benchmarks" in spec)) + entries.append( + cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) + ) + entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) + + return entries + + def cmake_args(self): + options = [] + return options diff --git a/scripts/spack_packages/packages/essl/package.py b/scripts/spack_packages/packages/essl/package.py new file mode 100644 index 00000000..0a4377ff --- /dev/null +++ b/scripts/spack_packages/packages/essl/package.py @@ -0,0 +1,49 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.package import * + + +# Recipe for pre-built essl library on blueos machines. +# Defines additonal flags for blueos: +# https://lc.llnl.gov/confluence/display/SIERRA/Math+Libraries +class Essl(BundlePackage): + """IBM's Engineering and Scientific Subroutine Library (ESSL).""" + + homepage = "https://www.ibm.com/systems/power/software/essl/" + + version("6.3.0.2") + + provides("blas") + provides("lapack") + + @property + def blas_libs(self): + spec = self.spec + prefix = self.prefix + + essl_root = prefix.lib64 + essl_libs = ["libesslsmpcuda", "liblapackforessl", "liblapackforessl_"] + all_libs = find_libraries(essl_libs, root=essl_root, shared=True) + + cuda_toolkit_root = "/usr/tce/packages/cuda/cuda-11.8.0/lib64" + cuda_libs = ["libcublas", "libcudart", "libcublasLt"] + all_libs += find_libraries(cuda_libs, root=cuda_toolkit_root, shared=True) + + return all_libs + + @property + def lapack_libs(self): + spec = self.spec + prefix = self.prefix + + essl_root = prefix.lib64 + essl_libs = ["libesslsmpcuda", "liblapackforessl", "liblapackforessl_"] + all_libs = find_libraries(essl_libs, root=essl_root, shared=True) + + cuda_toolkit_root = "/usr/tce/packages/cuda/cuda-11.8.0/lib64" + cuda_libs = ["libcublas", "libcudart", "libcublasLt"] + all_libs += find_libraries(cuda_libs, root=cuda_toolkit_root, shared=True) + + return all_libs diff --git a/scripts/spack_packages/packages/fesapi/package.py b/scripts/spack_packages/packages/fesapi/package.py new file mode 100644 index 00000000..6e957799 --- /dev/null +++ b/scripts/spack_packages/packages/fesapi/package.py @@ -0,0 +1,46 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os +import sys + +from spack.package import * + + +class Fesapi(CMakePackage): + + url = "https://github.com/F2I-Consulting/fesapi/archive/refs/tags/v2.4.0.0.tar.gz" + git = "https://github.com/F2I-Consulting/fesapi.git" + + version("2.4.0.0", sha256="a711e8a1218c876a2799f4d05a9820da71eb5503b5d51b834fae98d9fe635381") + + depends_on("hdf5") + depends_on("boost@1.67.0") + depends_on("minizip") + + def cmake_args(self): + spec = self.spec + + cppflags = " ".join(spec.compiler_flags["cppflags"]) + cxxflags = cppflags + " ".join(spec.compiler_flags["cxxflags"]) + cmake_args = [ + self.define('CMAKE_C_COMPILER', spec['mpi'].mpicc), + self.define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), + self.define('CMAKE_CXX_FLAGS', cxxflags), + self.define('HDF5_ROOT', spec['hdf5'].prefix), + # fesAPI/spack can detect wrong version otherwise + self.define('HDF5_VERSION', spec['hdf5'].version), + self.define('MINIZIP_INCLUDE_DIR', spec['minizip'].prefix.include + "/minizip"), + self.define('MINIZIP_LIBRARY_RELEASE', spec['minizip'].prefix.lib), + self.define('Boost_INCLUDE_DIR', spec['boost'].prefix.include), + "-DWITH_EXAMPLE:BOOL=OFF", + "-DWITH_DOTNET_WRAPPING:BOOL=OFF", + "-DWITH_JAVA_WRAPPING:BOOL=OFF", + "-DWITH_PYTHON_WRAPPING:BOOL=OFF", + "-DWITH_RESQML2_2:BOOL=OFF", + "-DWITH_TEST:BOOL=OFF", + ] + + return cmake_args diff --git a/scripts/uberenv/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py similarity index 50% rename from scripts/uberenv/packages/geosx/package.py rename to scripts/spack_packages/packages/geosx/package.py index 0672ae77..85548940 100644 --- a/scripts/uberenv/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -1,4 +1,4 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,14 +12,9 @@ from os import environ as env from os.path import join as pjoin -# ./scripts/uberenv/uberenv.py --spec="%clang +mkl ^chai ^caliper+papi" +# Tested specs are located at scripts/spack_configs/<$SYS_TYPE>/spack.yaml (e.g. %clang@10.0.1) -# ./scripts/uberenv/uberenv.py --spec="%clang +mkl ^raja build_type=Release ^umpire build_type=Release ^chai build_type=Release ^adiak build_type=Release ^caliper+papi build_type=Release ^pugixml build_type=Release ^parmetis build_type=Release ^superlu-dist build_type=Release ^trilinos build_type=Release" - -# ./scripts/uberenv/uberenv.py --spec="%clang +essl +cuda ~petsc cuda_arch=70 ^raja build_type=Release cuda_arch=70 ^umpire build_type=Release cuda_arch=70 ^chai build_type=Release cuda_arch=70 ^adiak build_type=Release ^caliper~papi build_type=Release ^pugixml build_type=Release ^parmetis build_type=Release ^superlu-dist build_type=Release ^trilinos build_type=Release" - -# PETSC doesn't compile on Lassen -# ./scripts/uberenv/uberenv.py --spec="%gcc +essl ~petsc +cuda cuda_arch=70 ^cuda@10.1.243 ^raja cuda_arch=70 ^umpire cuda_arch=70 ^chai cuda_arch=70 ^caliper~papi" +# WARNING: +petsc variant is yet to be tested. def cmake_cache_entry(name, value, comment=""): @@ -55,40 +50,42 @@ class Geosx(CMakePackage, CudaPackage): homepage = "https://github.com/GEOS-DEV/GEOS" git = "https://github.com/GEOS-DEV/GEOS.git" - version('develop', branch='develop', submodules='True') + # GEOSX needs submodules to build, but not necessary to build dependencies + version('develop', branch='develop') # SPHINX_BEGIN_VARIANTS variant('shared', default=True, description='Build Shared Libs.') variant('caliper', default=True, description='Build Caliper support.') - variant('mkl', default=False, description='Use the Intel MKL library.') - variant('essl', default=False, description='Use the IBM ESSL library.') - variant('suite-sparse', default=True, description='Build SuiteSparse support.') + variant('vtk', default=True, description='Build VTK support.') + variant('fesapi', default=False, description='Build fesapi support.') variant('trilinos', default=True, description='Build Trilinos support.') variant('hypre', default=True, description='Build HYPRE support.') - variant('hypre-cuda', default=False, description='Build HYPRE with CUDA support.') - variant('petsc', default=True, description='Build PETSc support.') + variant('petsc', default=False, description='Build PETSc support.') variant('scotch', default=True, description='Build Scotch support.') + variant('uncrustify', default=True, description='Build Uncrustify support.') variant('lai', - default='trilinos', + default='hypre', description='Linear algebra interface.', values=('trilinos', 'hypre', 'petsc'), multi=False) - variant('pygeosx', default=False, description='Build the GEOSX python interface.') + variant('pygeosx', default=True, description='Enable pygeosx.') # SPHINX_END_VARIANTS # variant('tests', default=True, description='Build tests') # variant('benchmarks', default=False, description='Build benchmarks') # variant('examples', default=False, description='Build examples') - # variant('docs', default=False, description='Build docs') - # variant('addr2line', default=True, - # description='Build support for addr2line.') + + variant('docs', default=False, description='Build docs') + variant('addr2line', default=True, + description='Add support for addr2line.') # SPHINX_BEGIN_DEPENDS - depends_on('cmake@3.8:', type='build') - depends_on('cmake@3.9:', when='+cuda', type='build') + depends_on('cmake@3.23:', type='build') + + depends_on('blt') # # Virtual packages @@ -100,80 +97,79 @@ class Geosx(CMakePackage, CudaPackage): # # Performance portability # - depends_on('raja@0.12.1 +openmp +shared ~examples ~exercises') - depends_on('raja +cuda', when='+cuda') + depends_on('raja +openmp~examples~exercises~shared') + + depends_on('umpire +c+openmp~examples+fortran~device_alloc~shared') + + depends_on('chai@2023.06.0 +raja+openmp~examples~shared') - depends_on('umpire@4.1.2 ~c +shared +openmp ~examples') - depends_on('umpire +cuda', when='+cuda') + depends_on('camp') - depends_on('chai@2.2.2 +shared +raja ~benchmarks ~examples') - depends_on('chai@2.2.2 +cuda', when='+cuda') + with when('+cuda'): + for sm_ in CudaPackage.cuda_arch_values: + depends_on('raja+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) + depends_on('umpire+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) + depends_on('chai+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) + depends_on('camp+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) # # IO # - depends_on('hdf5@1.10.5: +shared +pic +mpi', when='~vtk') + depends_on('hdf5@1.12.1') + depends_on('silo@4.11~fortran') - depends_on('conduit@0.5.0 +shared ~test ~fortran +mpi +hdf5 ~hdf5_compat') + depends_on('conduit@0.8.2~test~fortran~hdf5_compat') - depends_on('silo@4.10: ~fortran +shared ~silex +pic +mpi ~zlib') + depends_on('adiak@0.2.2', when='+caliper') + depends_on('caliper@2.10.0~gotcha~sampler~libunwind~libdw', when='+caliper') - depends_on('adiak@0.2: +mpi +shared', when='+caliper') - depends_on('caliper@2.4: +shared +adiak +mpi ~callpath ~libpfm ~gotcha ~sampler', when='+caliper') + depends_on('pugixml@1.13') - depends_on('pugixml@1.8: +shared') + depends_on('fmt@10.0.0 cxxstd=14') + depends_on('vtk@9.2.6', when='+vtk') - depends_on('fmt@8.0: cxxstd=14 +pic') + depends_on('fesapi', when='+fesapi') # # Math # - depends_on('intel-mkl +shared ~ilp64', when='+mkl') + depends_on('parmetis@4.0.3+int64') - # depends_on('essl ~ilp64 threads=openmp +lapack +cuda', when='+essl') + depends_on('superlu-dist +int64+openmp') - depends_on('parmetis@4.0.3: +shared +int64') + depends_on('scotch@7.0.3 +mpi +int64', when='+scotch') - depends_on('scotch@6.0.9: +mpi +int64', when='+scotch') + depends_on('suite-sparse@5.10.1+openmp') - depends_on('superlu-dist +int64 +openmp +shared', when='~petsc') - depends_on('superlu-dist@6.3.0 +int64 +openmp +shared', when='+petsc') + trilinos_build_options = '+openmp' + trilinos_packages = '+aztec+stratimikos~amesos2~anasazi~belos~ifpack2~muelu~sacado+thyra' + depends_on('trilinos@13.4.1 ' + trilinos_build_options + trilinos_packages, when='+trilinos') - depends_on('suite-sparse@5.8.1: +pic +openmp +amd +camd +colamd +ccolamd +cholmod +umfpack', when='+suite-sparse') - depends_on('suite-sparse +blas-no-underscore', when='%gcc +suite-sparse +essl') + depends_on("hypre +superlu-dist+mixedint+mpi+openmp", when='+hypre~cuda') - trilinos_build_options = '~fortran +openmp +shared' - trilinos_tpls = '~boost ~glm ~gtest ~hdf5 ~hypre ~matio ~metis +mpi ~mumps ~netcdf ~suite-sparse' - trilinos_packages = '+amesos +aztec +epetra +epetraext +ifpack +kokkos +ml +stk +stratimikos +teuchos +tpetra ~amesos2 ~anasazi ~belos ~exodus ~ifpack2 ~muelu ~sacado ~zoltan ~zoltan2' - depends_on('trilinos@12.18.1 ' + trilinos_build_options + trilinos_tpls + trilinos_packages, when='+trilinos') - depends_on('trilinos +blas_lowercase_no_underscore', when='+trilinos +essl') - # depends_on('trilinos +force-new-lapack', when='+trilinos +essl') + depends_on("hypre +cuda+superlu-dist+mixedint+mpi+openmp+umpire+unified-memory cxxflags='-fPIC'", when='+hypre+cuda') + with when('+cuda'): + for sm_ in CudaPackage.cuda_arch_values: + depends_on('hypre+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) - depends_on('hypre@2.20.300 +shared +superlu-dist +mixedint +mpi +openmp', when='+hypre') - depends_on('hypre@2.20.300 +cuda +shared +superlu-dist +mpi +openmp +unified-memory +cusparse', when='+hypre-cuda') - - petsc_build_options = '+shared +mpi' - petsc_tpls = '+metis ~hdf5 ~hypre +superlu-dist +int64' - depends_on('petsc@3.13.0: ' + petsc_build_options + petsc_tpls, when='+petsc') + depends_on('petsc@3.13.0~hdf5~hypre+int64', when='+petsc') + depends_on('petsc+ptscotch', when='+petsc+scotch') # # Python # - depends_on('python +shared +pic', when='+pygeosx') - depends_on('py-numpy@1.19: +blas +lapack +force-parallel-build', when='+pygeosx') - depends_on('py-scipy@1.5.2: +force-parallel-build', when='+pygeosx') - depends_on('py-mpi4py@3.0.3:', when='+pygeosx') - depends_on('py-pip', when='+pygeosx') + depends_on('python') + # # Dev tools # - depends_on('uncrustify@0.71:') + depends_on('uncrustify', when='+uncrustify') # # Documentation # - depends_on('doxygen@1.8.13:', when='+docs', type='build') + depends_on('doxygen@1.8.20', when='+docs', type='build') depends_on('py-sphinx@1.6.3:', when='+docs', type='build') # SPHINX_END_DEPENDS @@ -181,17 +177,13 @@ class Geosx(CMakePackage, CudaPackage): # # Conflicts # - conflicts('+mkl +essl', msg='Cannot use both MKL and ESSL.') - conflicts('+essl ~cuda', msg='Cannot use ESSL without CUDA.') - conflicts('~trilinos lai=trilinos', msg='To use Trilinos as the Linear Algebra Interface you must build it.') - conflicts('~hypre ~hypre-cuda lai=hypre', msg='To use HYPRE as the Linear Algebra Interface you must build it.') + conflicts('~hypre lai=hypre', msg='To use HYPRE as the Linear Algebra Interface you must build it.') conflicts('~petsc lai=petsc', msg='To use PETSc as the Linear Algebra Interface you must build it.') - conflicts('+hypre +hypre-cuda', msg='Only one of the two can be used at a time.') - conflicts('+hypre-cuda ~cuda', msg='When building hypre-cuda CUDA must be enabled.') - - phases = ['hostconfig', 'cmake', 'build', 'install'] + # Only phases necessary for building dependencies and generate host configs + phases = ['geos_hostconfig', 'lvarray_hostconfig'] + #phases = ['hostconfig', 'cmake', 'build', 'install'] @run_after('build') @on_package_attributes(run_tests=True) @@ -216,19 +208,23 @@ def _get_sys_type(self, spec): sys_type = env["SYS_TYPE"] return sys_type - def _get_host_config_path(self, spec): + def _get_host_config_path(self, spec, lvarray=False): var = '' if '+cuda' in spec: var = '-'.join([var, 'cuda']) hostname = socket.gethostname().rstrip('1234567890') - host_config_path = "%s-%s-%s%s.cmake" % (hostname, self._get_sys_type(spec), spec.compiler, var) + + if lvarray: + hostname = "lvarray-" + hostname + + host_config_path = "%s-%s-%s%s.cmake" % (hostname, self._get_sys_type(spec), (str(spec.compiler)).replace('=',''), var) dest_dir = self.stage.source_path host_config_path = os.path.abspath(pjoin(dest_dir, host_config_path)) return host_config_path - def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): + def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): """ This method creates a 'host-config' file that specifies all of the options used to configure and build GEOSX. @@ -304,6 +300,12 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): if "%clang arch=linux-rhel7-ppc64le" in spec: cfg.write(cmake_cache_entry("CMAKE_EXE_LINKER_FLAGS", "-Wl,--no-toc-optimize")) + cfg.write("#{0}\n".format("-" * 80)) + cfg.write("# CMake Standard\n") + cfg.write("#{0}\n\n".format("-" * 80)) + + cfg.write(cmake_cache_string("BLT_CXX_STD", "c++17")) + cfg.write("#{0}\n".format("-" * 80)) cfg.write("# MPI\n") cfg.write("#{0}\n\n".format("-" * 80)) @@ -312,7 +314,7 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_entry('MPI_C_COMPILER', spec['mpi'].mpicc)) cfg.write(cmake_cache_entry('MPI_CXX_COMPILER', spec['mpi'].mpicxx)) - if sys_type in ('linux-rhel7-ppc64le', 'linux-rhel8-ppc64le'): + if sys_type in ('linux-rhel7-ppc64le', 'linux-rhel8-ppc64le', 'blueos_3_ppc64le_ib_p9'): cfg.write(cmake_cache_option('ENABLE_WRAP_ALL_TESTS_WITH_MPIEXEC', True)) if socket.gethostname().rstrip('1234567890') == "lassen": cfg.write(cmake_cache_entry('MPIEXEC', 'lrun')) @@ -332,7 +334,7 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write('#{0}\n\n'.format('-' * 80)) if '+cuda' in spec: cfg.write(cmake_cache_option('ENABLE_CUDA', True)) - cfg.write(cmake_cache_entry('CMAKE_CUDA_STANDARD', 14)) + cfg.write(cmake_cache_entry('CMAKE_CUDA_STANDARD', 17)) cudatoolkitdir = spec['cuda'].prefix cfg.write(cmake_cache_entry('CUDA_TOOLKIT_ROOT_DIR', cudatoolkitdir)) @@ -352,33 +354,52 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): if not spec.satisfies('cuda_arch=none'): cuda_arch = spec.variants['cuda_arch'].value cmake_cuda_flags += ' -arch sm_{0}'.format(cuda_arch[0]) + cfg.write(cmake_cache_string('CMAKE_CUDA_ARCHITECTURES', cuda_arch[0])) cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS', cmake_cuda_flags)) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', '-O3 -Xcompiler -O3 -DNDEBUG')) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', '-O3 -g -lineinfo -Xcompiler -O3')) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', '-O0 -Xcompiler -O0 -g -G')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', '-O3 -DNDEBUG -Xcompiler -DNDEBUG -Xcompiler -O3 -Xcompiler -mcpu=powerpc64le -Xcompiler -mtune=powerpc64le')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', '-g -lineinfo ${CMAKE_CUDA_FLAGS_RELEASE}')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', '-g -G -O0 -Xcompiler -O0')) else: cfg.write(cmake_cache_option('ENABLE_CUDA', False)) - performance_portability_tpls = (('raja', 'RAJA', True), ('umpire', 'UMPIRE', True), ('chai', 'CHAI', True)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Performance Portability TPLs\n') cfg.write('#{0}\n\n'.format('-' * 80)) - for tpl, cmake_name, enable in performance_portability_tpls: - if enable: - cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) - else: - cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) - io_tpls = (('hdf5', 'HDF5', True), ('conduit', 'CONDUIT', True), ('silo', 'SILO', True), - ('adiak', 'ADIAK', '+caliper' - in spec), ('caliper', 'CALIPER', '+caliper' - in spec), ('pugixml', 'PUGIXML', True), ('vtk', 'VTK', False)('fmt', 'FMT', True)) + cfg.write(cmake_cache_option('ENABLE_CHAI', True)) + cfg.write(cmake_cache_entry('CHAI_DIR', spec['chai'].prefix)) + + cfg.write(cmake_cache_entry('RAJA_DIR', spec['raja'].prefix)) + + cfg.write(cmake_cache_option('ENABLE_UMPIRE', True)) + cfg.write(cmake_cache_entry('UMPIRE_DIR', spec['umpire'].prefix)) + + cfg.write(cmake_cache_entry('CAMP_DIR', spec['camp'].prefix)) + + # yapf: disable + io_tpls = ( + ('hdf5', 'HDF5', True), + ('conduit', 'CONDUIT', True), + ('silo', 'SILO', True), + ('pugixml', 'PUGIXML', True), + ('vtk', 'VTK', '+vtk' in spec), + ('fesapi', 'FESAPI', '+fesapi' in spec), + ('fmt', 'FMT', True) + ) + # yapf: enable + cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# IO TPLs\n') cfg.write('#{0}\n\n'.format('-' * 80)) + + if '+caliper' in spec: + cfg.write(cmake_cache_option('ENABLE_CALIPER', True)) + cfg.write(cmake_cache_entry('CALIPER_DIR', spec['caliper'].prefix)) + cfg.write(cmake_cache_entry('adiak_DIR', spec['adiak'].prefix + '/lib/cmake/adiak')) + for tpl, cmake_name, enable in io_tpls: if enable: cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) @@ -388,7 +409,11 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# System Math Libraries\n') cfg.write('#{0}\n\n'.format('-' * 80)) - if '+mkl' in spec: + if '+intel-oneapi-mkl' in spec: + cfg.write(cmake_cache_option('ENABLE_MKL', True)) + cfg.write(cmake_cache_entry('MKL_INCLUDE_DIRS', spec['intel-oneapi-mkl'].prefix.include)) + cfg.write(cmake_cache_list('MKL_LIBRARIES', spec['intel-oneapi-mkl'].libs)) + elif '+mkl' in spec: cfg.write(cmake_cache_option('ENABLE_MKL', True)) cfg.write(cmake_cache_entry('MKL_INCLUDE_DIRS', spec['intel-mkl'].prefix.include)) cfg.write(cmake_cache_list('MKL_LIBRARIES', spec['intel-mkl'].libs)) @@ -404,14 +429,14 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): # yapf: disable math_tpls = ( - ('metis', 'METIS', True), - ('parmetis', 'PARMETIS', True), - ('scotch', 'SCOTCH', '+scotch' in spec), - ('superlu-dist', 'SUPERLU_DIST', True), - ('suite-sparse', 'SUITESPARSE', '+suite-sparse' in spec), - ('trilinos', 'TRILINOS', '+trilinos' in spec), - ('hypre', 'HYPRE', '+hypre' in spec or '+hypre-cuda' in spec), - ('petsc', 'PETSC', '+petsc' in spec) + ('metis', 'METIS', True), + ('parmetis', 'PARMETIS', True), + ('scotch', 'SCOTCH', '+scotch' in spec), + ('superlu-dist', 'SUPERLU_DIST', True), + ('suite-sparse', 'SUITESPARSE', True), + ('trilinos', 'TRILINOS', '+trilinos' in spec), + ('hypre', 'HYPRE', '+hypre' in spec), + ('petsc', 'PETSC', '+petsc' in spec) ) # yapf: enable @@ -421,13 +446,17 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): for tpl, cmake_name, enable in math_tpls: if enable: cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) - if tpl == 'hypre' and '+hypre-cuda' in spec: + + if tpl == 'hypre' and '+cuda' in spec: cfg.write(cmake_cache_string('ENABLE_HYPRE_DEVICE', "CUDA")) - elif tpl == 'hypre' and '+hypre-hip' in spec: + elif tpl == 'hypre' and '+hip' in spec: cfg.write(cmake_cache_string('ENABLE_HYPRE_DEVICE', "HIP")) else: cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) + if '+caliper' in spec and '+hypre' in spec and '+cuda' not in spec: + cfg.write(cmake_cache_option('ENABLE_CALIPER_HYPRE', True)) + if 'lai=trilinos' in spec: cfg.write(cmake_cache_entry('GEOSX_LA_INTERFACE', 'Trilinos')) if 'lai=hypre' in spec: @@ -438,9 +467,12 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Python\n') cfg.write('#{0}\n\n'.format('-' * 80)) + + cfg.write(cmake_cache_entry('Python3_ROOT_DIR', os.path.join(spec['python'].prefix))) + cfg.write(cmake_cache_entry('Python3_EXECUTABLE', os.path.join(spec['python'].prefix.bin, 'python3'))) + if '+pygeosx' in spec: cfg.write(cmake_cache_option('ENABLE_PYGEOSX', True)) - cfg.write(cmake_cache_entry('Python3_EXECUTABLE', os.path.join(spec['python'].prefix.bin, 'python3'))) else: cfg.write(cmake_cache_option('ENABLE_PYGEOSX', False)) @@ -461,13 +493,18 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Development tools\n') cfg.write('#{0}\n\n'.format('-' * 80)) - cfg.write( - cmake_cache_entry('UNCRUSTIFY_EXECUTABLE', os.path.join(spec['uncrustify'].prefix.bin, 'uncrustify'))) - # cfg.write('#{0}\n'.format('-' * 80)) - # cfg.write('# addr2line\n') - # cfg.write('#{0}\n\n'.format('-' * 80)) - # cfg.write(cmake_cache_option('ENABLE_ADDR2LINE', '+addr2line' in spec)) + cfg.write(cmake_cache_option('ENABLE_UNCRUSTIFY', '+uncrustify' in spec)) + if '+uncrustify' in spec: + cfg.write( + cmake_cache_entry('UNCRUSTIFY_EXECUTABLE', os.path.join(spec['uncrustify'].prefix.bin, 'uncrustify'))) + + if '+addr2line' in spec: + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# addr2line\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + cfg.write(cmake_cache_option('ENABLE_ADDR2LINE', True)) + cfg.write(cmake_cache_entry('ADDR2LINE_EXEC ', '/usr/bin/addr2line')) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Other\n') @@ -476,6 +513,172 @@ def hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_option('ENABLE_MATHPRESSO', False)) cfg.write(cmake_cache_option('ENABLE_XML_UPDATES', False)) + # ATS + # Lassen + if sys_type in ('blueos_3_ppc64le_ib_p9'): + cfg.write(cmake_cache_string('ATS_ARGUMENTS', '--ats jsrun_omp --ats jsrun_bind=packed')) + # Quartz + if sys_type in ('toss_4_x86_64_ib'): + cfg.write(cmake_cache_string('ATS_ARGUMENTS', '--machine slurm36')) + + def lvarray_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): + """ + This method creates a 'host-config' file that specifies + all of the options used to configure and build LvArray. + + Note: + The `py_site_pkgs_dir` arg exists to allow a package that + subclasses this package provide a specific site packages + dir when calling this function. `py_site_pkgs_dir` should + be an absolute path or `None`. + + This is necessary because the spack `site_packages_dir` + var will not exist in the base class. For more details + on this issue see: https://github.com/spack/spack/issues/6261 + """ + + ####################### + # Compiler Info + ####################### + c_compiler = env["SPACK_CC"] + cpp_compiler = env["SPACK_CXX"] + + ####################################################################### + # By directly fetching the names of the actual compilers we appear + # to doing something evil here, but this is necessary to create a + # 'host config' file that works outside of the spack install env. + ####################################################################### + + sys_type = self._get_sys_type(spec) + + ############################################## + # Find and record what CMake is used + ############################################## + + cmake_exe = spec['cmake'].command.path + cmake_exe = os.path.realpath(cmake_exe) + + host_config_path = self._get_host_config_path(spec, lvarray=True) + with open(host_config_path, "w") as cfg: + cfg.write("#{0}\n".format("#" * 80)) + cfg.write("# Generated host-config - Edit at own risk!\n") + cfg.write("#{0}\n".format("#" * 80)) + + cfg.write("#{0}\n".format("-" * 80)) + cfg.write("# SYS_TYPE: {0}\n".format(sys_type)) + cfg.write("# Compiler Spec: {0}\n".format(spec.compiler)) + cfg.write("# CMake executable path: %s\n" % cmake_exe) + cfg.write("#{0}\n\n".format("-" * 80)) + + ####################### + # Compiler Settings + ####################### + + cfg.write("#{0}\n".format("-" * 80)) + cfg.write("# Compilers\n") + cfg.write("#{0}\n\n".format("-" * 80)) + cfg.write(cmake_cache_entry("CMAKE_C_COMPILER", c_compiler)) + cflags = ' '.join(spec.compiler_flags['cflags']) + if cflags: + cfg.write(cmake_cache_entry("CMAKE_C_FLAGS", cflags)) + + cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler)) + cxxflags = ' '.join(spec.compiler_flags['cxxflags']) + if cxxflags: + cfg.write(cmake_cache_entry("CMAKE_CXX_FLAGS", cxxflags)) + + release_flags = "-O3 -DNDEBUG" + cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELEASE", release_flags)) + reldebinf_flags = "-O3 -g -DNDEBUG" + cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELWITHDEBINFO", reldebinf_flags)) + debug_flags = "-O0 -g" + cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", debug_flags)) + + if "%clang arch=linux-rhel7-ppc64le" in spec: + cfg.write(cmake_cache_entry("CMAKE_EXE_LINKER_FLAGS", "-Wl,--no-toc-optimize")) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Cuda\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + if '+cuda' in spec: + cfg.write(cmake_cache_option('ENABLE_CUDA', True)) + cfg.write(cmake_cache_entry('CMAKE_CUDA_STANDARD', 17)) + + cudatoolkitdir = spec['cuda'].prefix + cfg.write(cmake_cache_entry('CUDA_TOOLKIT_ROOT_DIR', cudatoolkitdir)) + cudacompiler = '${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc' + cfg.write(cmake_cache_entry('CMAKE_CUDA_COMPILER', cudacompiler)) + + cmake_cuda_flags = ('-restrict --expt-extended-lambda -Werror ' + 'cross-execution-space-call,reorder,' + 'deprecated-declarations') + + archSpecifiers = ('-mtune', '-mcpu', '-march', '-qtune', '-qarch') + for archSpecifier in archSpecifiers: + for compilerArg in spec.compiler_flags['cxxflags']: + if compilerArg.startswith(archSpecifier): + cmake_cuda_flags += ' -Xcompiler ' + compilerArg + + if not spec.satisfies('cuda_arch=none'): + cuda_arch = spec.variants['cuda_arch'].value + cmake_cuda_flags += ' -arch sm_{0}'.format(cuda_arch[0]) + cfg.write(cmake_cache_string('CMAKE_CUDA_ARCHITECTURES', cuda_arch[0])) + + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS', cmake_cuda_flags)) + + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', '-O3 -DNDEBUG -Xcompiler -DNDEBUG -Xcompiler -O3 -Xcompiler -mcpu=powerpc64le -Xcompiler -mtune=powerpc64le')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', '-g -lineinfo ${CMAKE_CUDA_FLAGS_RELEASE}')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', '-g -G -O0 -Xcompiler -O0')) + + else: + cfg.write(cmake_cache_option('ENABLE_CUDA', False)) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Performance Portability TPLs\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + + cfg.write(cmake_cache_option('ENABLE_CHAI', True)) + cfg.write(cmake_cache_entry('CHAI_DIR', spec['chai'].prefix)) + + cfg.write(cmake_cache_entry('RAJA_DIR', spec['raja'].prefix)) + + cfg.write(cmake_cache_option('ENABLE_UMPIRE', True)) + cfg.write(cmake_cache_entry('UMPIRE_DIR', spec['umpire'].prefix)) + + cfg.write(cmake_cache_entry('CAMP_DIR', spec['camp'].prefix)) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# IO TPLs\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + + if '+caliper' in spec: + cfg.write(cmake_cache_option('ENABLE_CALIPER', True)) + cfg.write(cmake_cache_entry('CALIPER_DIR', spec['caliper'].prefix)) + cfg.write(cmake_cache_entry('adiak_DIR', spec['adiak'].prefix + '/lib/cmake/adiak')) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Documentation\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + if '+docs' in spec: + sphinx_bin_dir = spec['py-sphinx'].prefix.bin + cfg.write(cmake_cache_entry('SPHINX_EXECUTABLE', os.path.join(sphinx_bin_dir, 'sphinx-build'))) + + doxygen_bin_dir = spec['doxygen'].prefix.bin + cfg.write(cmake_cache_entry('DOXYGEN_EXECUTABLE', os.path.join(doxygen_bin_dir, 'doxygen'))) + else: + cfg.write(cmake_cache_option('ENABLE_DOXYGEN', False)) + cfg.write(cmake_cache_option('ENABLE_SPHINX', False)) + + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# Development tools\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + + if '+addr2line' in spec: + cfg.write('#{0}\n'.format('-' * 80)) + cfg.write('# addr2line\n') + cfg.write('#{0}\n\n'.format('-' * 80)) + cfg.write(cmake_cache_option('ENABLE_ADDR2LINE', True)) + def cmake_args(self): pass # spec = self.spec diff --git a/scripts/spack_packages/packages/hdf5/package.py b/scripts/spack_packages/packages/hdf5/package.py new file mode 100644 index 00000000..061251f5 --- /dev/null +++ b/scripts/spack_packages/packages/hdf5/package.py @@ -0,0 +1,747 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# GEOS_EDIT_START +# Older hdf5 spack recipe that works on lassen +# (latest spack release fails with MPI related configuration failure) +# GEOS_EDIT_END + +import os +import shutil + +import llnl.util.tty as tty + +from spack.package import * + + +class Hdf5(CMakePackage): + """HDF5 is a data model, library, and file format for storing and managing + data. It supports an unlimited variety of datatypes, and is designed for + flexible and efficient I/O and for high volume and complex data. + """ + + homepage = "https://portal.hdfgroup.org" + url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.8/src/hdf5-1.10.8.tar.gz" + list_url = "https://support.hdfgroup.org/ftp/HDF5/releases" + list_depth = 3 + git = "https://github.com/HDFGroup/hdf5.git" + maintainers = [ + "lrknox", + "brtnfld", + "byrnHDF", + "ChristopherHogan", + "epourmal", + "gheber", + "hyoklee", + "lkurz", + "soumagne", + ] + + tags = ["e4s"] + + test_requires_compiler = True + + # The 'develop' version is renamed so that we could uninstall (or patch) it + # without affecting other develop version. + version("develop-1.13", branch="develop") + version("develop-1.12", branch="hdf5_1_12") + version("develop-1.10", branch="hdf5_1_10") + version("develop-1.8", branch="hdf5_1_8") + + # Odd versions are considered experimental releases + version("1.13.2", sha256="01643fa5b37dba7be7c4db6bbf3c5d07adf5c1fa17dbfaaa632a279b1b2f06da") + + # Even versions are maintenance versions + version( + "1.12.2", + sha256="2a89af03d56ce7502dcae18232c241281ad1773561ec00c0f0e8ee2463910f14", + preferred=True, + ) + version( + "1.12.1", + sha256="79c66ff67e666665369396e9c90b32e238e501f345afd2234186bfb8331081ca", + preferred=True, + ) + version( + "1.12.0", + sha256="a62dcb276658cb78e6795dd29bf926ed7a9bc4edf6e77025cd2c689a8f97c17a", + preferred=True, + ) + version( + "1.10.9", + sha256="f5b77f59b705a755a5a223372d0222c7bc408fe8db6fa8d9d7ecf8bce291b8dd", + preferred=True, + ) + version( + "1.10.8", + sha256="d341b80d380dd763753a0ebe22915e11e87aac4e44a084a850646ff934d19c80", + preferred=True, + ) + version( + "1.10.7", + sha256="7a1a0a54371275ce2dfc5cd093775bb025c365846512961e7e5ceaecb437ef15", + preferred=True, + ) + version( + "1.10.6", + sha256="5f9a3ee85db4ea1d3b1fa9159352aebc2af72732fc2f58c96a3f0768dba0e9aa", + preferred=True, + ) + version( + "1.10.5", + sha256="6d4ce8bf902a97b050f6f491f4268634e252a63dadd6656a1a9be5b7b7726fa8", + preferred=True, + ) + version( + "1.10.4", + sha256="8f60dc4dd6ab5fcd23c750d1dc5bca3d0453bdce5c8cdaf0a4a61a9d1122adb2", + preferred=True, + ) + version( + "1.10.3", + sha256="b600d7c914cfa80ae127cd1a1539981213fee9994ac22ebec9e3845e951d9b39", + preferred=True, + ) + version( + "1.10.2", + sha256="bfec1be8c366965a99812cf02ddc97e4b708c1754fccba5414d4adccdc073866", + preferred=True, + ) + version( + "1.10.1", + sha256="048a9d149fb99aaa1680a712963f5a78e9c43b588d0e79d55e06760ec377c172", + preferred=True, + ) + version( + "1.10.0-patch1", + sha256="6e78cfe32a10e6e0629393cdfddf6cfa536571efdaf85f08e35326e1b4e9eff0", + preferred=True, + ) + version( + "1.10.0", + sha256="81f6201aba5c30dced5dcd62f5d5477a2790fd5850e02ac514ca8bf3e2bb375a", + preferred=True, + ) + version( + "1.8.22", + sha256="8406d96d9355ef8961d2739fb8fd5474ad4cdf52f3cfac657733defd9709bfaa", + preferred=True, + ) + version( + "1.8.21", + sha256="87d8c82eba5cf766d97cd06c054f4639c1049c4adeaa3a79f77f8bd374f80f37", + preferred=True, + ) + version( + "1.8.19", + sha256="a4335849f19fae88c264fd0df046bc321a78c536b2548fc508627a790564dc38", + preferred=True, + ) + version( + "1.8.18", + sha256="cdb195ad8d9e6782acf24b2488061289f615628c2ccda8457b0a0c3fb7a8a063", + preferred=True, + ) + version( + "1.8.17", + sha256="d9cda297ee76ade9881c4208987939250d397bae6252d0ccb66fa7d24d67e263", + preferred=True, + ) + version( + "1.8.16", + sha256="ed17178abd9928a7237f30370189ba767b9e39e0db45917c2ac4665eb9cb4771", + preferred=True, + ) + version( + "1.8.15", + sha256="4e963216b7d32469596bc1321a8c3f6e0c278dcbbdb7be6414c63c081b34c275", + preferred=True, + ) + version( + "1.8.14", + sha256="1dbefeeef7f591897c632b2b090db96bb8d35ad035beaa36bc39cb2bc67e0639", + preferred=True, + ) + version( + "1.8.13", + sha256="82f6b38eec103b4fccfbf14892786e0c27a8135d3252d8601cf5bf20066d38c1", + preferred=True, + ) + version( + "1.8.12", + sha256="b5cccea850096962b5fd9e96f22c4f47d2379224bb41130d9bc038bb6c37dfcb", + preferred=True, + ) + version( + "1.8.10", + sha256="4813b79c5fb8701a625b9924b8203bc7154a77f9b826ad4e034144b4056a160a", + preferred=True, + ) + + variant("shared", default=True, description="Builds a shared version of the library") + + variant("hl", default=False, description="Enable the high-level library") + variant("cxx", default=False, description="Enable C++ support") + variant("fortran", default=False, description="Enable Fortran support") + variant("java", when="@1.10:", default=False, description="Enable Java support") + variant("threadsafe", default=False, description="Enable thread-safe capabilities") + variant("tools", default=True, description="Enable building tools") + variant("mpi", default=True, description="Enable MPI support") + variant("szip", default=False, description="Enable szip support") + # Build HDF5 with API compatibility. + variant( + "api", + default="default", + description="Choose api compatibility for earlier version", + values=("default", "v114", "v112", "v110", "v18", "v16"), + multi=False, + ) + + depends_on("cmake@3.12:", type="build") + + depends_on("mpi", when="+mpi") + depends_on("java", type=("build", "run"), when="+java") + depends_on("szip", when="+szip") + depends_on("zlib@1.1.2:") + + # The compiler wrappers (h5cc, h5fc, etc.) run 'pkg-config'. + depends_on("pkgconfig", type="run") + + conflicts("api=v114", when="@1.6:1.12", msg="v114 is not compatible with this release") + conflicts("api=v112", when="@1.6:1.10", msg="v112 is not compatible with this release") + conflicts("api=v110", when="@1.6:1.8", msg="v110 is not compatible with this release") + conflicts("api=v18", when="@1.6.0:1.6", msg="v18 is not compatible with this release") + + # The Java wrappers cannot be built without shared libs. + conflicts("+java", when="~shared") + # Fortran fails built with shared for old HDF5 versions + conflicts("+fortran", when="+shared@:1.8.15") + # See https://github.com/spack/spack/issues/31085 + conflicts("+fortran+mpi", when="@1.8.22") + + # GEOS_EDIT_START + # Commenting out unused patches + + # There are several officially unsupported combinations of the features: + # 1. Thread safety is not guaranteed via high-level C-API but in some cases + # it works. + # conflicts('+threadsafe+hl') + + # 2. Thread safety is not guaranteed via Fortran (CXX) API, but it's + # possible for a dependency tree to contain a package that uses Fortran + # (CXX) API in a single thread and another one that uses low-level C-API + # in multiple threads. To allow for such scenarios, we don't specify the + # following conflicts. + # conflicts('+threadsafe+cxx') + # conflicts('+threadsafe+fortran') + + # 3. Parallel features are not supported via CXX API, but for the reasons + # described in #2 we allow for such combination. + # conflicts('+mpi+cxx') + + # There are known build failures with intel@18.0.1. This issue is + # discussed and patch is provided at + # https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/747951. + #patch("h5f90global-mult-obj-same-equivalence-same-common-block.patch", when="@1.10.1%intel@18") + + # Turn line comments into block comments to conform with pre-C99 language + # standards. Versions of hdf5 after 1.8.10 don't require this patch, + # either because they conform to pre-C99 or neglect to ask for pre-C99 + # language standards from their compiler. The hdf5 build system adds + # the -ansi cflag (run 'man gcc' for info on -ansi) for some versions + # of some compilers (see hdf5-1.8.10/config/gnu-flags). The hdf5 build + # system does not provide an option to disable -ansi, but since the + # pre-C99 code is restricted to just five lines of line comments in + # three src files, this patch accomplishes the simple task of patching the + # three src files and leaves the hdf5 build system alone. + #patch("pre-c99-comments.patch", when="@1.8.10") + + # There are build errors with GCC 8, see + # https://forum.hdfgroup.org/t/1-10-2-h5detect-compile-error-gcc-8-1-0-on-centos-7-2-solved/4441 + # patch( + # "https://salsa.debian.org/debian-gis-team/hdf5/raw/bf94804af5f80f662cad80a5527535b3c6537df6/debian/patches/gcc-8.patch", + # sha256="57cee5ff1992b4098eda079815c36fc2da9b10e00a9056df054f2384c4fc7523", + # when="@1.10.2%gcc@8:", + # ) + + # Disable MPI C++ interface when C++ is disabled, otherwise downstream + # libraries fail to link; see https://github.com/spack/spack/issues/12586 + # patch( + # "h5public-skip-mpicxx.patch", + # when="@1.8.10:1.8.21,1.10.0:1.10.5+mpi~cxx", + # sha256="b61e2f058964ad85be6ee5ecea10080bf79e73f83ff88d1fa4b602d00209da9c", + # ) + + # Fixes BOZ literal constant error when compiled with GCC 10. + # The issue is described here: https://github.com/spack/spack/issues/18625 + # patch( + # "hdf5_1.8_gcc10.patch", + # when="@:1.8.21", + # sha256="0e20187cda3980a4fdff410da92358b63de7ebef2df1d7a425371af78e50f666", + # ) + + # patch("fortran-kinds.patch", when="@1.10.7") + + # This patch may only be needed with GCC11.2 on macOS, but it's valid for + # any of the head HDF5 versions as of 12/2021. Since it's impossible to + # tell what Fortran version is part of a mixed apple-clang toolchain on + # macOS (which is the norm), and this might be an issue for other compilers + # as well, we just apply it to all platforms. + # See https://github.com/HDFGroup/hdf5/issues/1157 + # patch("fortran-kinds-2.patch", when="@1.10.8,1.12.1") + + # The argument 'buf_size' of the C function 'h5fget_file_image_c' is + # declared as intent(in) though it is modified by the invocation. As a + # result, aggressive compilers such as Fujitsu's may do a wrong + # optimization to cause an error. + # GEOS_EDIT_END + + def patch(self): + filter_file( + "INTEGER(SIZE_T), INTENT(IN) :: buf_size", + "INTEGER(SIZE_T), INTENT(OUT) :: buf_size", + "fortran/src/H5Fff.F90", + string=True, + ignore_absent=True, + ) + filter_file( + "INTEGER(SIZE_T), INTENT(IN) :: buf_size", + "INTEGER(SIZE_T), INTENT(OUT) :: buf_size", + "fortran/src/H5Fff_F03.f90", + string=True, + ignore_absent=True, + ) + if self.run_tests: + # hdf5 has ~2200 CPU-intensive tests, some of them have races: + # Often, these loop endless(at least on one Xeon and one EPYC). + # testphdf5 fails indeterministic. This fixes finishing the tests + filter_file( + "REMOVE_ITEM H5P_TESTS", + "REMOVE_ITEM H5P_TESTS t_bigio t_shapesame testphdf5", + "testpar/CMakeTests.cmake", + ) + + # The parallel compiler wrappers (i.e. h5pcc, h5pfc, etc.) reference MPI + # compiler wrappers and do not need to be changed. + filter_compiler_wrappers( + "h5cc", "h5hlcc", "h5fc", "h5hlfc", "h5c++", "h5hlc++", relative_root="bin" + ) + + def url_for_version(self, version): + url = ( + "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-{0}/hdf5-{1}/src/hdf5-{1}.tar.gz" + ) + return url.format(version.up_to(2), version) + + def flag_handler(self, name, flags): + spec = self.spec + cmake_flags = [] + + if name == "cflags": + if spec.compiler.name in ["gcc", "clang", "apple-clang", "oneapi"]: + # Quiet warnings/errors about implicit declaration of functions + # in C99: + cmake_flags.append("-Wno-error=implicit-function-declaration") + # Note that this flag will cause an error if building %nvhpc. + if spec.satisfies("@:1.8.12~shared"): + # More recent versions set CMAKE_POSITION_INDEPENDENT_CODE to + # True and build with PIC flags. + cmake_flags.append(self.compiler.cc_pic_flag) + elif name == "cxxflags": + if spec.satisfies("@:1.8.12+cxx~shared"): + cmake_flags.append(self.compiler.cxx_pic_flag) + elif name == "fflags": + if spec.satisfies("%cce+fortran"): + # Cray compiler generates module files with uppercase names by + # default, which is not handled by the CMake scripts. The + # following flag forces the compiler to produce module files + # with lowercase names. + cmake_flags.append("-ef") + if spec.satisfies("@:1.8.12+fortran~shared"): + cmake_flags.append(self.compiler.fc_pic_flag) + elif name == "ldlibs": + if "+fortran %fj" in spec: + cmake_flags.extend(["-lfj90i", "-lfj90f", "-lfjsrcinfo", "-lelf"]) + + return flags, None, (cmake_flags or None) + + @property + def libs(self): + """HDF5 can be queried for the following parameters: + + - "hl": high-level interface + - "cxx": C++ APIs + - "fortran": Fortran APIs + - "java": Java APIs + + :return: list of matching libraries + """ + query_parameters = self.spec.last_query.extra_parameters + + shared = "+shared" in self.spec + + # This map contains a translation from query_parameters + # to the libraries needed + query2libraries = { + tuple(): ["libhdf5"], + ("cxx", "fortran", "hl", "java"): [ + # When installed with Autotools, the basename of the real + # library file implementing the High-level Fortran interface is + # 'libhdf5hl_fortran'. Starting versions 1.8.22, 1.10.5 and + # 1.12.0, the Autotools installation also produces a symbolic + # link 'libhdf5_hl_fortran.' to + # 'libhdf5hl_fortran.'. Note that in the case of the + # dynamic library, the latter is a symlink to the real sonamed + # file 'libhdf5_fortran.so.'. This means that all + # dynamically linked executables/libraries of the dependent + # packages need 'libhdf5_fortran.so.' with the same + # DT_SONAME entry. However, the CMake installation (at least + # starting version 1.8.10) does not produce it. Instead, the + # basename of the library file is 'libhdf5_hl_fortran'. Which + # means that switching to CMake requires rebuilding of all + # dependant packages that use the High-level Fortran interface. + # Therefore, we do not try to preserve backward compatibility + # with Autotools installations by creating symlinks. The only + # packages that could benefit from it would be those that + # hardcode the library name in their building systems. Such + # packages should simply be patched. + "libhdf5_hl_fortran", + "libhdf5_hl_f90cstub", + "libhdf5_hl_cpp", + "libhdf5_hl", + "libhdf5_fortran", + "libhdf5_f90cstub", + "libhdf5_java", + "libhdf5", + ], + ("cxx", "hl"): [ + "libhdf5_hl_cpp", + "libhdf5_hl", + "libhdf5", + ], + ("fortran", "hl"): [ + "libhdf5_hl_fortran", + "libhdf5_hl_f90cstub", + "libhdf5_hl", + "libhdf5_fortran", + "libhdf5_f90cstub", + "libhdf5", + ], + ("hl",): [ + "libhdf5_hl", + "libhdf5", + ], + ("cxx", "fortran"): [ + "libhdf5_fortran", + "libhdf5_f90cstub", + "libhdf5_cpp", + "libhdf5", + ], + ("cxx",): [ + "libhdf5_cpp", + "libhdf5", + ], + ("fortran",): [ + "libhdf5_fortran", + "libhdf5_f90cstub", + "libhdf5", + ], + ("java",): [ + "libhdf5_java", + "libhdf5", + ], + } + + # Turn the query into the appropriate key + key = tuple(sorted(query_parameters)) + libraries = query2libraries[key] + + return find_libraries(libraries, root=self.prefix, shared=shared, recursive=True) + + @when("@:1.8.21,1.10.0:1.10.5+szip") + def setup_build_environment(self, env): + env.set("SZIP_INSTALL", self.spec["szip"].prefix) + + @run_before("cmake") + def fortran_check(self): + if "+fortran" in self.spec and not self.compiler.fc: + msg = "cannot build a Fortran variant without a Fortran compiler" + raise RuntimeError(msg) + + def cmake_args(self): + spec = self.spec + + if spec.satisfies("@:1.8.15+shared"): + tty.warn("hdf5@:1.8.15+shared does not produce static libraries") + + args = [ + # Always enable this option. This does not actually enable any + # features: it only *allows* the user to specify certain + # combinations of other arguments. + self.define("ALLOW_UNSUPPORTED", True), + # Speed-up the building by skipping the examples: + self.define("HDF5_BUILD_EXAMPLES", False), + self.define( + "BUILD_TESTING", + self.run_tests or + # Version 1.8.22 fails to build the tools when shared libraries + # are enabled but the tests are disabled. + spec.satisfies("@1.8.22+shared+tools"), + ), + self.define("HDF5_ENABLE_Z_LIB_SUPPORT", True), + self.define_from_variant("HDF5_ENABLE_SZIP_SUPPORT", "szip"), + self.define_from_variant("HDF5_ENABLE_SZIP_ENCODING", "szip"), + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define("ONLY_SHARED_LIBS", False), + self.define_from_variant("HDF5_ENABLE_PARALLEL", "mpi"), + self.define_from_variant("HDF5_ENABLE_THREADSAFE", "threadsafe"), + self.define_from_variant("HDF5_BUILD_HL_LIB", "hl"), + self.define_from_variant("HDF5_BUILD_CPP_LIB", "cxx"), + self.define_from_variant("HDF5_BUILD_FORTRAN", "fortran"), + self.define_from_variant("HDF5_BUILD_JAVA", "java"), + self.define_from_variant("HDF5_BUILD_TOOLS", "tools"), + ] + + api = spec.variants["api"].value + if api != "default": + args.append(self.define("DEFAULT_API_VERSION", api)) + + if "+mpi" in spec: + args.append(self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc)) + + if "+cxx" in self.spec: + args.append(self.define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx)) + + if "+fortran" in self.spec: + args.append(self.define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc)) + + # work-around for https://github.com/HDFGroup/hdf5/issues/1320 + if spec.satisfies("@1.10.8,1.13.0"): + args.append(self.define("HDF5_INSTALL_CMAKE_DIR", "share/cmake/hdf5")) + + return args + + @run_after("install") + def ensure_parallel_compiler_wrappers(self): + # When installed with Autotools and starting at least version 1.8.10, + # the package produces C compiler wrapper called either 'h5cc' (when MPI + # support is disabled) or 'h5pcc' (when MPI support is enabled). The + # CMake installation produces the wrapper called 'h5cc' (regardless of + # whether MPI support is enabled) only starting versions 1.8.21, 1.10.2 + # and 1.12.0. The current develop versions also produce 'h5pcc' when MPI + # support is enabled and the file is identical to 'h5cc'. Here, we make + # sure that 'h5pcc' is available when MPI support is enabled (only for + # versions that generate 'h5cc'). + if self.spec.satisfies("@1.8.21:1.8.22,1.10.2:1.10.7,1.12.0+mpi"): + with working_dir(self.prefix.bin): + # No try/except here, fix the condition above instead: + symlink("h5cc", "h5pcc") + + # The same as for 'h5pcc'. However, the CMake installation produces the + # Fortran compiler wrapper called 'h5fc' only starting versions 1.8.22, + # 1.10.6 and 1.12.0. The current develop versions do not produce 'h5pfc' + # at all. Here, we make sure that 'h5pfc' is available when Fortran and + # MPI support are enabled (only for versions that generate 'h5fc'). + if self.spec.satisfies( + "@1.8.22:1.8," "1.10.6:1.10," "1.12.0:1.12," "develop:" "+fortran+mpi" + ): + with working_dir(self.prefix.bin): + # No try/except here, fix the condition above instead: + symlink("h5fc", "h5pfc") + + @run_after("install") + def fix_package_config(self): + # We need to fix the pkg-config files, which are also used by the + # compiler wrappers. The files are created starting versions 1.8.21, + # 1.10.2 and 1.12.0. However, they are broken (except for the version + # 1.8.22): the files are named -.pc but reference + # packages. This was fixed in the develop versions at some point: the + # files started referencing - packages but got broken + # again: the files got names .pc but references had not been + # updated accordingly. Another issue, which we address here, is that + # some Linux distributions install pkg-config files named hdf5.pc and we + # want to override them. Therefore, the following solution makes sure + # that each -.pc file is symlinked by .pc and all + # references to - packages in the original files are + # replaced with references to packages. + pc_files = find(self.prefix.lib.pkgconfig, "hdf5*.pc", recursive=False) + + if not pc_files: + # This also tells us that the pkgconfig directory does not exist. + return + + # Replace versioned references in all pkg-config files: + filter_file( + r"(Requires(?:\.private)?:.*)(hdf5[^\s,]*)(?:-[^\s,]*)(.*)", + r"\1\2\3", + *pc_files, + backup=False + ) + + # Create non-versioned symlinks to the versioned pkg-config files: + with working_dir(self.prefix.lib.pkgconfig): + for f in pc_files: + src_filename = os.path.basename(f) + version_sep_idx = src_filename.find("-") + if version_sep_idx > -1: + tgt_filename = src_filename[:version_sep_idx] + ".pc" + if not os.path.exists(tgt_filename): + symlink(src_filename, tgt_filename) + + @run_after("install") + @on_package_attributes(run_tests=True) + def check_install(self): + self._check_install() + + def _check_install(self): + # Build and run a small program to test the installed HDF5 library + spec = self.spec + print("Checking HDF5 installation...") + checkdir = "spack-check" + with working_dir(checkdir, create=True): + # Because the release number in a develop branch is not fixed, + # only the major and minor version numbers are compared. + # Otherwise all 3 numbers are checked. + if "develop" in str(spec.version.up_to(3)): + source = r""" +#include +#include +#include +int main(int argc, char **argv) { + unsigned majnum, minnum, relnum; + herr_t herr = H5get_libversion(&majnum, &minnum, &relnum); + assert(!herr); + printf("HDF5 version %d.%d %u.%u\n", H5_VERS_MAJOR, H5_VERS_MINOR, + majnum, minnum); + return 0; +} +""" + else: + source = r""" +#include +#include +#include +int main(int argc, char **argv) { + unsigned majnum, minnum, relnum; + herr_t herr = H5get_libversion(&majnum, &minnum, &relnum); + assert(!herr); + printf("HDF5 version %d.%d.%d %u.%u.%u\n", H5_VERS_MAJOR, H5_VERS_MINOR, + H5_VERS_RELEASE, majnum, minnum, relnum); + return 0; +} +""" + expected = """\ +HDF5 version {version} {version} +""".format( + version=str(spec.version.up_to(3)) + ) + if "develop" in expected: + # Remove 'develop-' from the version in spack for checking + # version against the version in the HDF5 code. + expected = """\ +HDF5 version {version} {version} +""".format( + version=str(spec.version.up_to(3)).partition("-")[2] + ) + with open("check.c", "w") as f: + f.write(source) + if "+mpi" in spec: + cc = Executable(spec["mpi"].mpicc) + else: + cc = Executable(self.compiler.cc) + cc(*(["-c", "check.c"] + spec["hdf5"].headers.cpp_flags.split())) + cc(*(["-o", "check", "check.o"] + spec["hdf5"].libs.ld_flags.split())) + try: + check = Executable("./check") + output = check(output=str) + except ProcessError: + output = "" + success = output == expected + if not success: + print("Produced output does not match expected output.") + print("Expected output:") + print("-" * 80) + print(expected) + print("-" * 80) + print("Produced output:") + print("-" * 80) + print(output) + print("-" * 80) + raise RuntimeError("HDF5 install check failed") + shutil.rmtree(checkdir) + + def _test_check_versions(self): + """Perform version checks on selected installed package binaries.""" + spec_vers_str = "Version {0}".format(self.spec.version) + if "develop" in spec_vers_str: + # Remove 'develop-' from the version in spack for checking + # version against the version in the HDF5 code. + spec_vers_str = spec_vers_str.partition("-")[2] + + exes = [ + "h5copy", + "h5diff", + "h5dump", + "h5format_convert", + "h5ls", + "h5mkgrp", + "h5repack", + "h5stat", + "h5unjam", + ] + use_short_opt = ["h52gif", "h5repart", "h5unjam"] + for exe in exes: + reason = "test: ensuring version of {0} is {1}".format(exe, spec_vers_str) + option = "-V" if exe in use_short_opt else "--version" + self.run_test( + exe, option, spec_vers_str, installed=True, purpose=reason, skip_missing=True + ) + + def _test_example(self): + """This test performs copy, dump, and diff on an example hdf5 file.""" + test_data_dir = self.test_suite.current_test_data_dir + + filename = "spack.h5" + h5_file = test_data_dir.join(filename) + + reason = "test: ensuring h5dump produces expected output" + expected = get_escaped_text_output(test_data_dir.join("dump.out")) + self.run_test( + "h5dump", + filename, + expected, + installed=True, + purpose=reason, + skip_missing=True, + work_dir=test_data_dir, + ) + + reason = "test: ensuring h5copy runs" + options = ["-i", h5_file, "-s", "Spack", "-o", "test.h5", "-d", "Spack"] + self.run_test( + "h5copy", options, [], installed=True, purpose=reason, skip_missing=True, work_dir="." + ) + + reason = "test: ensuring h5diff shows no differences between orig and" " copy" + self.run_test( + "h5diff", + [h5_file, "test.h5"], + [], + installed=True, + purpose=reason, + skip_missing=True, + work_dir=".", + ) + + def test(self): + """Perform smoke tests on the installed package.""" + # Simple version check tests on known binaries + self._test_check_versions() + + # Run sequence of commands on an hdf5 file + self._test_example() + + # Run existing install check + self._check_install() \ No newline at end of file diff --git a/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py b/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py new file mode 100644 index 00000000..2d922924 --- /dev/null +++ b/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py @@ -0,0 +1,17 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + +class PyPydataSphinxTheme(PythonPackage): + """A clean, three-column, Bootstrap-based Sphinx theme by and for the PyData community""" + + homepage = "https://github.com/pydata/pydata-sphinx-theme" + pypi = "pydata-sphinx-theme/pydata_sphinx_theme-0.13.3.tar.gz" + + version("0.13.3", sha256="827f16b065c4fd97e847c11c108bf632b7f2ff53a3bca3272f63f3f3ff782ecc") + + depends_on("python", type=("build", "run")) + depends_on("py-setuptools", type="build") \ No newline at end of file diff --git a/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py b/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py new file mode 100644 index 00000000..de642a3d --- /dev/null +++ b/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py @@ -0,0 +1,17 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + +class PySphinxcontribPlantuml(PythonPackage): + """PlantUML for Sphinx""" + + homepage = "https://github.com/sphinx-contrib/plantuml" + pypi = "sphinxcontrib-plantuml/sphinxcontrib-plantuml-0.26.tar.gz" + + version("0.26", sha256="adb3397d5cb0613632cd3dad7894381422bac24464c393cb050404dd6712b1a7") + + depends_on("python", type=("build", "run")) + depends_on("py-setuptools", type="build") \ No newline at end of file diff --git a/scripts/spack_packages/packages/pygeosx/package.py b/scripts/spack_packages/packages/pygeosx/package.py new file mode 100644 index 00000000..723ad48c --- /dev/null +++ b/scripts/spack_packages/packages/pygeosx/package.py @@ -0,0 +1,21 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + +class Pygeosx(BundlePackage): + """This is a set of libraries necessary for the pygeosx ATS environment""" + + version('fakeversion') + + depends_on("py-numpy@1.21.0:1.23.4+blas+lapack") + depends_on('py-mpi4py') + depends_on('py-virtualenv') + depends_on('python@3.10:+shared+pic+tkinter+optimizations') + depends_on("py-scipy") + depends_on("openblas") + depends_on("py-matplotlib") + depends_on("py-sphinx") + depends_on("py-sphinx-argparse") \ No newline at end of file diff --git a/scripts/spack_packages/packages/trilinos/cray_secas.patch b/scripts/spack_packages/packages/trilinos/cray_secas.patch new file mode 100644 index 00000000..14eb4ad3 --- /dev/null +++ b/scripts/spack_packages/packages/trilinos/cray_secas.patch @@ -0,0 +1,26 @@ +From f29f61e8ebcb8c887c271bc4a764192976910ca3 Mon Sep 17 00:00:00 2001 +From: Howard Pritchard +Date: Mon, 17 Aug 2020 16:05:47 -0600 +Subject: [PATCH] secas: patch FortranSettings for Cray fortran + +compiler. This problem showed up in spack based builds of LANL LAP project dependencies +on one of our cray systems using CCE. + +Signed-off-by: Howard Pritchard + +diff --git a/packages/seacas/cmake/FortranSettings.cmake b/packages/seacas/cmake/FortranSettings.cmake +index c3447d57..7a73ce5f 100644 +--- a/packages/seacas/cmake/FortranSettings.cmake ++++ b/packages/seacas/cmake/FortranSettings.cmake +@@ -8,6 +8,8 @@ IF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer -fdefault-real-8 -fdefault-integer-8 -fno-range-check") + ELSEIF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "XL") + SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -WF,-D__XLF__ -qintsize=8 -qrealsize=8 -qfixed") ++ELSEIF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Cray") ++ SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -sdefault64") + ELSE() + SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i8") + ENDIF() +-- +2.18.4 + diff --git a/scripts/spack_packages/packages/trilinos/fix_clang_errors_12_18_1.patch b/scripts/spack_packages/packages/trilinos/fix_clang_errors_12_18_1.patch new file mode 100644 index 00000000..6da3f431 --- /dev/null +++ b/scripts/spack_packages/packages/trilinos/fix_clang_errors_12_18_1.patch @@ -0,0 +1,39 @@ +From 01b88601a85691da73042089778db6db5bf6cf01 Mon Sep 17 00:00:00 2001 +From: Jean-Paul Pelteret +Date: Sat, 1 Feb 2020 05:48:48 +0100 +Subject: [PATCH] Fix Clang 8.0.0 compiler errors 12.18.1 + +--- + packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp | 2 +- + packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp b/packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp +index d4f72bc..302dfc2 100644 +--- a/packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp ++++ b/packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp +@@ -126,7 +126,7 @@ public: + virtual void + getDefaultParameters (Teuchos::ParameterList& params) const + { +- const SolverInput input; ++ const SolverInput input{}; + const int verbosity = 0; + const std::string implResScal = input.needToScale ? + "Norm of Preconditioned Initial Residual" : "None"; // ??? +diff --git a/packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp b/packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp +index 051a2df..a703aff 100644 +--- a/packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp ++++ b/packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp +@@ -143,7 +143,7 @@ namespace MueLu { + + // Usage: GetMLSubList(paramList, "smoother", 2); + const Teuchos::ParameterList & GetMLSubList(const Teuchos::ParameterList & paramList, const std::string & type, int levelID) { +- static const Teuchos::ParameterList emptyParamList; ++ static const Teuchos::ParameterList emptyParamList{}; + + char levelChar[11]; + sprintf(levelChar, "(level %d)", levelID); +-- +2.10.1 (Apple Git-78) + diff --git a/scripts/spack_packages/packages/trilinos/package.py b/scripts/spack_packages/packages/trilinos/package.py new file mode 100644 index 00000000..a34d0203 --- /dev/null +++ b/scripts/spack_packages/packages/trilinos/package.py @@ -0,0 +1,890 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# GEOSX_EDIT_START +# This is an older, modified version of the spack recipe (Commit date: 3/8/22, Spack PR: #29256): +# https://github.com/spack/spack/blob/b2a02861bbbe8c989d24b8c7fbd202e31abc6bd0/var/spack/repos/builtin/packages/trilinos/package.py +# GEOSX_EDIT_END +# yapf: disable + +import os +import sys + +from spack import * +from spack.build_environment import dso_suffix +from spack.error import NoHeadersError +from spack.operating_systems.mac_os import macos_version +from spack.pkg.builtin.kokkos import Kokkos + +# Trilinos is complicated to build, as an inspiration a couple of links to +# other repositories which build it: +# https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/t/trilinos.py#L111 +# https://github.com/koecher/candi/blob/master/deal.II-toolchain/packages/trilinos.package +# https://gitlab.com/configurations/cluster-config/blob/master/trilinos.sh +# https://github.com/Homebrew/homebrew-science/blob/master/trilinos.rb and some +# relevant documentation/examples: +# https://github.com/trilinos/Trilinos/issues/175 + + +class Trilinos(CMakePackage, CudaPackage, ROCmPackage): + """The Trilinos Project is an effort to develop algorithms and enabling + technologies within an object-oriented software framework for the solution + of large-scale, complex multi-physics engineering and scientific problems. + A unique design feature of Trilinos is its focus on packages. + """ + homepage = "https://trilinos.org/" + url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-12-12-1.tar.gz" + git = "https://github.com/trilinos/Trilinos.git" + + maintainers = ['keitat', 'sethrj', 'kuberry'] + + tags = ['e4s'] + + # ###################### Versions ########################## + + version('master', branch='master') + version('develop', branch='develop') + version("13.4.1", sha256="5465cbff3de7ef4ac7d40eeff9d99342c00d9d20eee0a5f64f0a523093f5f1b3") + version("13.4.0", sha256="39550006e059043b7e2177f10467ae2f77fe639901aee91cbc1e359516ff8d3e") + version('13.2.0', commit='4a5f7906a6420ee2f9450367e9cc95b28c00d744') # tag trilinos-release-13-2-0 + version('13.0.1', commit='4796b92fb0644ba8c531dd9953e7a4878b05c62d', preferred=True) # tag trilinos-release-13-0-1 + version('13.0.0', commit='9fec35276d846a667bc668ff4cbdfd8be0dfea08') # tag trilinos-release-13-0-0 + version('12.18.1', commit='55a75997332636a28afc9db1aee4ae46fe8d93e7') # tag trilinos-release-12-8-1 + version('12.14.1', sha256='52a4406cca2241f5eea8e166c2950471dd9478ad6741cbb2a7fc8225814616f0') + version('12.12.1', sha256='5474c5329c6309224a7e1726cf6f0d855025b2042959e4e2be2748bd6bb49e18') + version('12.10.1', sha256='ab81d917196ffbc21c4927d42df079dd94c83c1a08bda43fef2dd34d0c1a5512') + version('12.8.1', sha256='d20fe60e31e3ba1ef36edecd88226240a518f50a4d6edcc195b88ee9dda5b4a1') + version('12.6.4', sha256='1c7104ba60ee8cc4ec0458a1c4f6a26130616bae7580a7b15f2771a955818b73') + version('12.6.3', sha256='4d28298bb4074eef522db6cd1626f1a934e3d80f292caf669b8846c0a458fe81') + version('12.6.2', sha256='8be7e3e1166cc05aea7f856cc8033182e8114aeb8f87184cb38873bfb2061779') + version('12.6.1', sha256='4b38ede471bed0036dcb81a116fba8194f7bf1a9330da4e29c3eb507d2db18db') + version('12.4.2', sha256='fd2c12e87a7cedc058bcb8357107ffa2474997aa7b17b8e37225a1f7c32e6f0e') + version('12.2.1', sha256='088f303e0dc00fb4072b895c6ecb4e2a3ad9a2687b9c62153de05832cf242098') + version('12.0.1', sha256='eee7c19ca108538fa1c77a6651b084e06f59d7c3307dae77144136639ab55980') + version('11.14.3', sha256='e37fa5f69103576c89300e14d43ba77ad75998a54731008b25890d39892e6e60') + version('11.14.2', sha256='f22b2b0df7b88e28b992e19044ba72b845292b93cbbb3a948488199647381119') + version('11.14.1', sha256='f10fc0a496bf49427eb6871c80816d6e26822a39177d850cc62cf1484e4eec07') + + # ###################### Variants ########################## + + # Build options + variant('complex', default=False, description='Enable complex numbers in Trilinos') + variant('cuda_rdc', default=False, description='Turn on RDC for CUDA build') + variant('rocm_rdc', default=False, description='Turn on RDC for ROCm build') + variant('cxxstd', default='14', values=['11', '14', '17'], multi=False) + variant('debug', default=False, description='Enable runtime safety and debug checks') + variant('explicit_template_instantiation', default=True, description='Enable explicit template instantiation (ETI)') + variant('float', default=False, description='Enable single precision (float) numbers in Trilinos') + variant('fortran', default=True, description='Compile with Fortran support') + variant('gotype', default='long_long', + values=('int', 'long', 'long_long', 'all'), + multi=False, + description='global ordinal type for Tpetra') + variant('openmp', default=False, description='Enable OpenMP') + variant('python', default=False, description='Build PyTrilinos wrappers') + variant('shared', default=True, description='Enables the build of shared libraries') + variant('uvm', default=False, when='@13.2: +cuda', description='Turn on UVM for CUDA build') + variant('wrapper', default=False, description='Use nvcc-wrapper for CUDA build') + + # TPLs (alphabet order) + variant('adios2', default=False, description='Enable ADIOS2') + variant('boost', default=False, description='Compile with Boost') + variant('hdf5', default=False, description='Compile with HDF5') + variant('hypre', default=False, description='Compile with Hypre preconditioner') + variant('mpi', default=True, description='Compile with MPI parallelism') + variant('mumps', default=False, description='Compile with support for MUMPS solvers') + variant('suite-sparse', default=False, description='Compile with SuiteSparse solvers') + variant('superlu-dist', default=False, description='Compile with SuperluDist solvers') + variant('superlu', default=False, description='Compile with SuperLU solvers') + variant('strumpack', default=False, description='Compile with STRUMPACK solvers') + variant('x11', default=False, description='Compile with X11 when +exodus') + + # Package options (alphabet order) + variant('amesos', default=True, description='Compile with Amesos') + variant('amesos2', default=True, description='Compile with Amesos2') + variant('anasazi', default=True, description='Compile with Anasazi') + variant('aztec', default=True, description='Compile with Aztec') + variant('belos', default=True, description='Compile with Belos') + variant('chaco', default=False, description='Compile with Chaco from SEACAS') + variant('epetra', default=True, description='Compile with Epetra') + variant('epetraext', default=True, description='Compile with EpetraExt') + variant('exodus', default=False, description='Compile with Exodus from SEACAS') + variant('ifpack', default=True, description='Compile with Ifpack') + variant('ifpack2', default=True, description='Compile with Ifpack2') + variant('intrepid', default=False, description='Enable Intrepid') + variant('intrepid2', default=False, description='Enable Intrepid2') + variant('isorropia', default=False, description='Compile with Isorropia') + variant('gtest', default=False, description='Build vendored Googletest') + variant('kokkos', default=True, description='Compile with Kokkos') + variant('ml', default=True, description='Compile with ML') + variant('minitensor', default=False, description='Compile with MiniTensor') + variant('muelu', default=True, description='Compile with Muelu') + variant('nox', default=False, description='Compile with NOX') + variant('panzer', default=False, description='Compile with Panzer') + variant('piro', default=False, description='Compile with Piro') + variant('phalanx', default=False, description='Compile with Phalanx') + variant('rol', default=False, description='Compile with ROL') + variant('rythmos', default=False, description='Compile with Rythmos') + variant('sacado', default=True, description='Compile with Sacado') + variant('stk', default=False, description='Compile with STK') + variant('shards', default=False, description='Compile with Shards') + variant('shylu', default=False, description='Compile with ShyLU') + variant('stokhos', default=False, description='Compile with Stokhos') + variant('stratimikos', default=False, description='Compile with Stratimikos') + variant('teko', default=False, description='Compile with Teko') + variant('tempus', default=False, description='Compile with Tempus') + variant('thyra', default=False, description='Compile with Thyra') + variant('tpetra', default=True, description='Compile with Tpetra') + variant('trilinoscouplings', default=False, description='Compile with TrilinosCouplings') + variant('zoltan', default=False, description='Compile with Zoltan') + variant('zoltan2', default=False, description='Compile with Zoltan2') + + # Internal package options (alphabetical order) + variant('basker', default=False, description='Compile with the Basker solver in Amesos2') + variant('epetraextbtf', default=False, description='Compile with BTF in EpetraExt') + variant('epetraextexperimental', default=False, description='Compile with experimental in EpetraExt') + variant('epetraextgraphreorderings', default=False, description='Compile with graph reorderings in EpetraExt') + + # External package options + variant('dtk', default=False, description='Enable DataTransferKit (deprecated)') + variant('scorec', default=False, description='Enable SCOREC') + variant('mesquite', default=False, description='Enable Mesquite (deprecated)') + + resource(name='dtk', + git='https://github.com/ornl-cees/DataTransferKit.git', + commit='4fe4d9d56cfd4f8a61f392b81d8efd0e389ee764', # branch dtk-3.0 + placement='DataTransferKit', + when='+dtk @12.14.0:12.14') + resource(name='dtk', + git='https://github.com/ornl-cees/DataTransferKit.git', + commit='edfa050cd46e2274ab0a0b7558caca0079c2e4ca', # tag 3.1-rc1 + placement='DataTransferKit', + submodules=True, + when='+dtk @12.18.0:12.18') + resource(name='scorec', + git='https://github.com/SCOREC/core.git', + commit='73c16eae073b179e45ec625a5abe4915bc589af2', # tag v2.2.5 + placement='SCOREC', + when='+scorec') + resource(name='mesquite', + url='https://github.com/trilinos/mesquite/archive/trilinos-release-12-12-1.tar.gz', + sha256='e0d09b0939dbd461822477449dca611417316e8e8d8268fd795debb068edcbb5', + placement='packages/mesquite', + when='+mesquite @12.12.1:12.16') + resource(name='mesquite', + git='https://github.com/trilinos/mesquite.git', + commit='20a679679b5cdf15bf573d66c5dc2b016e8b9ca1', # branch trilinos-release-12-12-1 + placement='packages/mesquite', + when='+mesquite @12.18.1:12.18') + resource(name='mesquite', + git='https://github.com/trilinos/mesquite.git', + tag='develop', + placement='packages/mesquite', + when='+mesquite @master') + + # ###################### Conflicts ########################## + + # Epetra stack + with when('~epetra'): + conflicts('+amesos') + conflicts('+aztec') + conflicts('+epetraext') + conflicts('+ifpack') + conflicts('+isorropia') + conflicts('+ml', when='@13.2:') + with when('~epetraext'): + conflicts('+isorropia') + conflicts('+teko') + conflicts('+epetraextbtf') + conflicts('+epetraextexperimental') + conflicts('+epetraextgraphreorderings') + with when('+teko'): + conflicts('~stratimikos') + conflicts('@:12 gotype=long') + with when('+piro'): + conflicts('~stratimikos') + conflicts('~nox') + + # Tpetra stack + with when('~kokkos'): + conflicts('+cuda') + conflicts('+rocm') + conflicts('+tpetra') + conflicts('+intrepid2') + conflicts('+phalanx') + with when('~tpetra'): + conflicts('+amesos2') + conflicts('+dtk') + conflicts('+ifpack2') + conflicts('+muelu') + conflicts('+teko') + conflicts('+zoltan2') + + with when('~zoltan'): + conflicts('+isorropia') + conflicts('+scorec') + conflicts('+shylu') + conflicts('+zoltan2') + with when('~shards'): + conflicts('+intrepid') + conflicts('+intrepid2') + conflicts('+scorec') + conflicts('+stk') + with when('+scorec'): + conflicts('~mpi') + conflicts('~stk') + + # Panzer is not gen-2 library + with when('+panzer'): + conflicts('~intrepid2') + conflicts('~mpi') + conflicts('~phalanx') + conflicts('~sacado') + conflicts('~tpetra') + conflicts('~thyra') + conflicts('~zoltan') + conflicts('~nox') + conflicts('~rythmos') + conflicts('~piro') + conflicts('~stratimikos') + conflicts('~stk') + conflicts('~ml') + conflicts('~ifpack') + conflicts('~aztec') + + # Known requirements from tribits dependencies + conflicts('~thyra', when='+stratimikos') + conflicts('+aztec', when='~fortran') + conflicts('+basker', when='~amesos2') + conflicts('+ifpack2', when='~belos') + conflicts('+intrepid', when='~sacado') + conflicts('+minitensor', when='~boost') + conflicts('+phalanx', when='~sacado') + conflicts('+stokhos', when='~kokkos') + conflicts('+tempus', when='~nox') + + # Only allow DTK with Trilinos 12.14, 12.18 + conflicts('+dtk', when='~boost') + conflicts('+dtk', when='~intrepid2') + conflicts('+dtk', when='@:12.12,13:') + + # Installed FindTrilinos are broken in SEACAS if Fortran is disabled + # see https://github.com/trilinos/Trilinos/issues/3346 + conflicts('+exodus', when='@:13.0.1 ~fortran') + # Only allow Mesquite with Trilinos 12.12 and up, and master + conflicts('+mesquite', when='@:12.10,master') + # Strumpack is only available as of mid-2021 + conflicts('+strumpack', when='@:13.0') + # Can only use one type of SuperLU + conflicts('+superlu-dist', when='+superlu') + # For Trilinos v11 we need to force SuperLUDist=OFF, since only the + # deprecated SuperLUDist v3.3 together with an Amesos patch is working. + conflicts('+superlu-dist', when='@11.4.1:11.14.3') + # see https://github.com/trilinos/Trilinos/issues/3566 + conflicts('+superlu-dist', when='+float+amesos2+explicit_template_instantiation^superlu-dist@5.3.0:') + # Amesos, conflicting types of double and complex SLU_D + # see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html + # and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html + conflicts('+superlu-dist', when='+complex+amesos2') + # https://github.com/trilinos/Trilinos/issues/2994 + conflicts( + '+shared', when='+stk platform=darwin', + msg='Cannot build Trilinos with STK as a shared library on Darwin.' + ) + conflicts('+adios2', when='@:12.14.1') + conflicts('cxxstd=11', when='@13.2:') + conflicts('cxxstd=17', when='@:12') + conflicts('cxxstd=11', when='+wrapper ^cuda@6.5.14') + conflicts('cxxstd=14', when='+wrapper ^cuda@6.5.14:8.0.61') + conflicts('cxxstd=17', when='+wrapper ^cuda@6.5.14:10.2.89') + + # Multi-value gotype only applies to trilinos through 12.14 + conflicts('gotype=all', when='@12.15:') + + # CUDA without wrapper requires clang + for _compiler in spack.compilers.supported_compilers(): + if _compiler != 'clang': + conflicts('+cuda', when='~wrapper %' + _compiler, + msg='trilinos~wrapper+cuda can only be built with the ' + 'Clang compiler') + conflicts('+cuda_rdc', when='~cuda') + conflicts('+rocm_rdc', when='~rocm') + conflicts('+wrapper', when='~cuda') + conflicts('+wrapper', when='%clang') + + # Old trilinos fails with new CUDA (see #27180) + conflicts('@:13.0.1 +cuda', when='^cuda@11:') + # Build hangs with CUDA 11.6 (see #28439) + conflicts('+cuda +stokhos', when='^cuda@11.6:') + # Cuda UVM must be enabled prior to 13.2 + # See https://github.com/spack/spack/issues/28869 + conflicts('~uvm', when='@:13.1 +cuda') + + # stokhos fails on xl/xl_r + conflicts('+stokhos', when='%xl') + conflicts('+stokhos', when='%xl_r') + + # ###################### Dependencies ########################## + + depends_on('adios2', when='+adios2') + depends_on('blas') + depends_on('boost', when='+boost') + # Need to revisit the requirement of STK + depends_on('boost', when='+stk') + + # + depends_on('cgns', when='+exodus') + depends_on('hdf5+hl', when='+hdf5') + depends_on('hypre~internal-superlu~int64', when='+hypre') + depends_on('kokkos-nvcc-wrapper', when='+wrapper') + depends_on('lapack') + # depends_on('perl', type=('build',)) # TriBITS finds but doesn't use... + depends_on('libx11', when='+x11') + depends_on('matio', when='+exodus') + depends_on('metis', when='+zoltan') + depends_on('mpi', when='+mpi') + depends_on('netcdf-c', when="+exodus") + depends_on('parallel-netcdf', when='+exodus+mpi') + depends_on('parmetis', when='+mpi +zoltan') + depends_on('parmetis', when='+scorec') + depends_on('py-mpi4py', when='+mpi+python', type=('build', 'run')) + depends_on('py-numpy', when='+python', type=('build', 'run')) + depends_on('python', when='+python') + depends_on('python', when='@13.2: +ifpack +hypre', type='build') + depends_on('python', when='@13.2: +ifpack2 +hypre', type='build') + depends_on('scalapack', when='+mumps') + depends_on('scalapack', when='+strumpack+mpi') + depends_on('strumpack+shared', when='+strumpack') + depends_on('suite-sparse', when='+suite-sparse') + depends_on('superlu-dist', when='+superlu-dist') + depends_on('superlu@4.3 +pic', when='+superlu') + depends_on('swig', when='+python') + depends_on('zlib', when='+zoltan') + + # Trilinos' Tribits config system is limited which makes it very tricky to + # link Amesos with static MUMPS, see + # https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html + # One could work it out by getting linking flags from mpif90 --showme:link + # (or alike) and adding results to -DTrilinos_EXTRA_LINK_FLAGS together + # with Blas and Lapack and ScaLAPACK and Blacs and -lgfortran and it may + # work at the end. But let's avoid all this by simply using shared libs + depends_on('mumps@5.0:+shared', when='+mumps') + + for _flag in ('~mpi', '+mpi'): + depends_on('hdf5' + _flag, when='+hdf5' + _flag) + depends_on('mumps' + _flag, when='+mumps' + _flag) + for _flag in ('~openmp', '+openmp'): + depends_on('mumps' + _flag, when='+mumps' + _flag) + + # GEOSX_EDIT_START + # Do not force hwloc as dependency (MPI error on quartz) + #depends_on('hwloc', when='@13: +kokkos') + #depends_on('hwloc+cuda', when='@13: +kokkos+cuda') + # GEOSX_EDIT_END + depends_on('hypre@develop', when='@master: +hypre') + depends_on('netcdf-c+mpi+parallel-netcdf', when="+exodus+mpi@12.12.1:") + depends_on('superlu-dist@4.4:5.3', when='@12.6.2:12.12.1+superlu-dist') + depends_on('superlu-dist@5.4:6.2.0', when='@12.12.2:13.0.0+superlu-dist') + depends_on('superlu-dist@6.3.0:', when='@13.0.1:99 +superlu-dist') + depends_on('superlu-dist@:4.3', when='@11.14.1:12.6.1+superlu-dist') + depends_on('superlu-dist@develop', when='@master: +superlu-dist') + + # ###################### Patches ########################## + + # GEOSX_EDIT_START + # Comment out unused patches + + #patch('umfpack_from_suitesparse.patch', when='@11.14.1:12.8.1') + #for _compiler in ['xl', 'xl_r', 'clang']: + # patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %' + _compiler) + # patch('xlf_tpetra.patch', when='@12.12.1 %' + _compiler) + patch('fix_clang_errors_12_18_1.patch', when='@12.18.1%clang') + #patch('cray_secas_12_12_1.patch', when='@12.12.1%cce') + patch('cray_secas.patch', when='@12.14.1:%cce') + + # workaround an NVCC bug with c++14 (https://github.com/trilinos/Trilinos/issues/6954) + # avoid calling deprecated functions with CUDA-11 + #patch('fix_cxx14_cuda11.patch', when='@13.0.0:13.0.1 cxxstd=14 ^cuda@11:') + # Allow building with +teko gotype=long + #patch('https://github.com/trilinos/Trilinos/commit/b17f20a0b91e0b9fc5b1b0af3c8a34e2a4874f3f.patch', + # sha256='dee6c55fe38eb7f6367e1896d6bc7483f6f9ab8fa252503050cc0c68c6340610', + # when='@13.0.0:13.0.1 +teko gotype=long') + # GEOSX_EDIT_END + + def flag_handler(self, name, flags): + is_cce = self.spec.satisfies('%cce') + + if name == 'cxxflags': + spec = self.spec + if '+mumps' in spec: + # see https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS + flags.append('-DMUMPS_5_0') + if '+stk platform=darwin' in spec: + flags.append('-DSTK_NO_BOOST_STACKTRACE') + if '+stk%intel' in spec: + # Workaround for Intel compiler segfaults with STK and IPO + flags.append('-no-ipo') + if '+wrapper' in spec: + flags.append('--expt-extended-lambda') + elif name == 'ldflags' and is_cce: + flags.append('-fuse-ld=gold') + + # GEOSX_EDIT_START + # Property insert gcc-toolchain flag through environment + if name in ['cflags', 'cxxflags', 'cppflags']: + return (None, None, flags) + # GEOSX_EDIT_END + + if is_cce: + return (None, None, flags) + return (flags, None, None) + + def url_for_version(self, version): + url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-{0}.tar.gz" + return url.format(version.dashed) + + def setup_dependent_run_environment(self, env, dependent_spec): + if '+cuda' in self.spec: + # currently Trilinos doesn't perform the memory fence so + # it relies on blocking CUDA kernel launch. This is needed + # in case the dependent app also run a CUDA backend via Trilinos + env.set('CUDA_LAUNCH_BLOCKING', '1') + + def setup_dependent_package(self, module, dependent_spec): + if '+wrapper' in self.spec: + self.spec.kokkos_cxx = self.spec["kokkos-nvcc-wrapper"].kokkos_cxx + else: + self.spec.kokkos_cxx = spack_cxx + + def setup_build_environment(self, env): + spec = self.spec + if '+cuda' in spec and '+wrapper' in spec: + if '+mpi' in spec: + env.set('OMPI_CXX', spec["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set('MPICH_CXX', spec["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set('MPICXX_CXX', spec["kokkos-nvcc-wrapper"].kokkos_cxx) + else: + env.set('CXX', spec["kokkos-nvcc-wrapper"].kokkos_cxx) + + if '+rocm' in spec: + if '+mpi' in spec: + env.set('OMPI_CXX', self.spec['hip'].hipcc) + env.set('MPICH_CXX', self.spec['hip'].hipcc) + env.set('MPICXX_CXX', self.spec['hip'].hipcc) + else: + env.set('CXX', self.spec['hip'].hipcc) + if '+stk' in spec: + # Using CXXFLAGS for hipcc which doesn't use flags in the spack wrappers + env.set('CXXFLAGS', '-DSTK_NO_BOOST_STACKTRACE') + + def cmake_args(self): + options = [] + + spec = self.spec + # GEOSX_EDIT_START + #define = CMakePackage.define + define = self.define + # GEOSX_EDIT_END + define_from_variant = self.define_from_variant + + def _make_definer(prefix): + def define_enable(suffix, value=None): + key = prefix + suffix + if value is None: + # Default to lower-case spec + value = suffix.lower() + elif isinstance(value, bool): + # Explicit true/false + return define(key, value) + return define_from_variant(key, value) + return define_enable + + # Return "Trilinos_ENABLE_XXX" for spec "+xxx" or boolean value + define_trilinos_enable = _make_definer("Trilinos_ENABLE_") + # Same but for TPLs + define_tpl_enable = _make_definer("TPL_ENABLE_") + + # #################### Base Settings ####################### + + options.extend([ + define('Trilinos_VERBOSE_CONFIGURE', False), + define_from_variant('BUILD_SHARED_LIBS', 'shared'), + define_trilinos_enable('ALL_OPTIONAL_PACKAGES', False), + define_trilinos_enable('ALL_PACKAGES', False), + define_trilinos_enable('CXX11', True), + define_trilinos_enable('DEBUG', 'debug'), + define_trilinos_enable('EXAMPLES', False), + define_trilinos_enable('SECONDARY_TESTED_CODE', True), + define_trilinos_enable('TESTS', False), + define_trilinos_enable('Fortran'), + define_trilinos_enable('OpenMP'), + define_trilinos_enable('EXPLICIT_INSTANTIATION', + 'explicit_template_instantiation') + ]) + + if spec.version >= Version('13'): + options.append(define_from_variant('CMAKE_CXX_STANDARD', 'cxxstd')) + else: + # Prior to version 13, Trilinos would erroneously inject + # '-std=c++11' regardless of CMAKE_CXX_STANDARD value + options.append(define( + 'Trilinos_CXX11_FLAGS', + self.compiler.cxx14_flag + if spec.variants['cxxstd'].value == '14' + else self.compiler.cxx11_flag + )) + + # ################## Trilinos Packages ##################### + + options.extend([ + define_trilinos_enable('Amesos'), + define_trilinos_enable('Amesos2'), + define_trilinos_enable('Anasazi'), + define_trilinos_enable('AztecOO', 'aztec'), + define_trilinos_enable('Belos'), + define_trilinos_enable('Epetra'), + define_trilinos_enable('EpetraExt'), + define_trilinos_enable('FEI', False), + define_trilinos_enable('Gtest'), + define_trilinos_enable('Ifpack'), + define_trilinos_enable('Ifpack2'), + define_trilinos_enable('Intrepid'), + define_trilinos_enable('Intrepid2'), + define_trilinos_enable('Isorropia'), + define_trilinos_enable('Kokkos'), + define_trilinos_enable('MiniTensor'), + define_trilinos_enable('Mesquite'), + define_trilinos_enable('ML'), + define_trilinos_enable('MueLu'), + define_trilinos_enable('NOX'), + define_trilinos_enable('Pamgen', False), + define_trilinos_enable('Panzer'), + define_trilinos_enable('Pike', False), + define_trilinos_enable('Piro'), + define_trilinos_enable('Phalanx'), + define_trilinos_enable('PyTrilinos', 'python'), + define_trilinos_enable('ROL'), + define_trilinos_enable('Rythmos'), + define_trilinos_enable('Sacado'), + define_trilinos_enable('SCOREC'), + define_trilinos_enable('Shards'), + define_trilinos_enable('ShyLU'), + define_trilinos_enable('STK'), + define_trilinos_enable('Stokhos'), + define_trilinos_enable('Stratimikos'), + define_trilinos_enable('Teko'), + define_trilinos_enable('Tempus'), + define_trilinos_enable('Thyra'), + define_trilinos_enable('Tpetra'), + define_trilinos_enable('TrilinosCouplings'), + define_trilinos_enable('Zoltan'), + define_trilinos_enable('Zoltan2'), + define_from_variant('EpetraExt_BUILD_BTF', 'epetraextbtf'), + define_from_variant('EpetraExt_BUILD_EXPERIMENTAL', + 'epetraextexperimental'), + define_from_variant('EpetraExt_BUILD_GRAPH_REORDERINGS', + 'epetraextgraphreorderings'), + define_from_variant('Amesos2_ENABLE_Basker', 'basker'), + define_from_variant('Amesos2_ENABLE_LAPACK', 'amesos2'), + ]) + + if '+dtk' in spec: + options.extend([ + define('Trilinos_EXTRA_REPOSITORIES', 'DataTransferKit'), + define_trilinos_enable('DataTransferKit', True), + ]) + + if '+exodus' in spec: + options.extend([ + define_trilinos_enable('SEACAS', True), + define_trilinos_enable('SEACASExodus', True), + define_trilinos_enable('SEACASIoss', True), + define_trilinos_enable('SEACASEpu', True), + define_trilinos_enable('SEACASExodiff', True), + define_trilinos_enable('SEACASNemspread', True), + define_trilinos_enable('SEACASNemslice', True), + ]) + else: + options.extend([ + define_trilinos_enable('SEACASExodus', False), + define_trilinos_enable('SEACASIoss', False), + ]) + + if '+chaco' in spec: + options.extend([ + define_trilinos_enable('SEACAS', True), + define_trilinos_enable('SEACASChaco', True), + ]) + else: + # don't disable SEACAS, could be needed elsewhere + options.extend([ + define_trilinos_enable('SEACASChaco', False), + define_trilinos_enable('SEACASNemslice', False) + ]) + + if '+stratimikos' in spec: + # Explicitly enable Thyra (ThyraCore is required). If you don't do + # this, then you get "NOT setting ${pkg}_ENABLE_Thyra=ON since + # Thyra is NOT enabled at this point!" leading to eventual build + # errors if using MueLu because `Xpetra_ENABLE_Thyra` is set to + # off. + + # Add thyra adapters based on package enables + options.extend( + define_trilinos_enable('Thyra' + pkg + 'Adapters', pkg.lower()) + for pkg in ['Epetra', 'EpetraExt', 'Tpetra']) + + # ######################### TPLs ############################# + + def define_tpl(trilinos_name, spack_name, have_dep): + options.append(define('TPL_ENABLE_' + trilinos_name, have_dep)) + if not have_dep: + return + depspec = spec[spack_name] + libs = depspec.libs + try: + options.extend([ + define(trilinos_name + '_INCLUDE_DIRS', + depspec.headers.directories), + ]) + except NoHeadersError: + # Handle case were depspec does not have headers + pass + + options.extend([ + define(trilinos_name + '_ROOT', depspec.prefix), + define(trilinos_name + '_LIBRARY_NAMES', libs.names), + define(trilinos_name + '_LIBRARY_DIRS', libs.directories), + ]) + + # Enable these TPLs explicitly from variant options. + # Format is (TPL name, variant name, Spack spec name) + tpl_variant_map = [ + ('ADIOS2', 'adios2', 'adios2'), + ('Boost', 'boost', 'boost'), + ('CUDA', 'cuda', 'cuda'), + ('HDF5', 'hdf5', 'hdf5'), + ('HYPRE', 'hypre', 'hypre'), + ('MUMPS', 'mumps', 'mumps'), + ('UMFPACK', 'suite-sparse', 'suite-sparse'), + ('SuperLU', 'superlu', 'superlu'), + ('SuperLUDist', 'superlu-dist', 'superlu-dist'), + ('X11', 'x11', 'libx11'), + ] + if spec.satisfies('@13.0.2:'): + tpl_variant_map.append(('STRUMPACK', 'strumpack', 'strumpack')) + + for tpl_name, var_name, spec_name in tpl_variant_map: + define_tpl(tpl_name, spec_name, spec.variants[var_name].value) + + # Enable these TPLs based on whether they're in our spec; prefer to + # require this way so that packages/features disable availability + tpl_dep_map = [ + ('BLAS', 'blas'), + ('CGNS', 'cgns'), + ('LAPACK', 'lapack'), + ('Matio', 'matio'), + ('METIS', 'metis'), + ('Netcdf', 'netcdf-c'), + ('SCALAPACK', 'scalapack'), + ('Zlib', 'zlib'), + ] + if spec.satisfies('@12.12.1:'): + tpl_dep_map.append(('Pnetcdf', 'parallel-netcdf')) + + # GEOSX_EDIT_START + #if spec.satisfies('@13:'): + # tpl_dep_map.append(('HWLOC', 'hwloc')) + # GEOSX_EDIT_END + + for tpl_name, dep_name in tpl_dep_map: + define_tpl(tpl_name, dep_name, dep_name in spec) + + # MPI settings + options.append(define_tpl_enable('MPI')) + if '+mpi' in spec: + # Force Trilinos to use the MPI wrappers instead of raw compilers + # to propagate library link flags for linkers that require fully + # resolved symbols in shared libs (such as macOS and some newer + # Ubuntu) + options.extend([ + define('CMAKE_C_COMPILER', spec['mpi'].mpicc), + define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), + define('CMAKE_Fortran_COMPILER', spec['mpi'].mpifc), + define('MPI_BASE_DIR', spec['mpi'].prefix), + ]) + + # ParMETIS dependencies have to be transitive explicitly + have_parmetis = 'parmetis' in spec + options.append(define_tpl_enable('ParMETIS', have_parmetis)) + if have_parmetis: + options.extend([ + define('ParMETIS_LIBRARY_DIRS', [ + spec['parmetis'].prefix.lib, spec['metis'].prefix.lib + ]), + define('ParMETIS_LIBRARY_NAMES', ['parmetis', 'metis']), + define('TPL_ParMETIS_INCLUDE_DIRS', + spec['parmetis'].headers.directories + + spec['metis'].headers.directories), + ]) + + if spec.satisfies('^superlu-dist@4.0:'): + options.extend([ + define('HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG', True), + ]) + + if spec.satisfies('^parallel-netcdf'): + options.extend([ + define('TPL_Netcdf_Enables_Netcdf4', True), + define('TPL_Netcdf_PARALLEL', True), + define('PNetCDF_ROOT', spec['parallel-netcdf'].prefix), + ]) + + options.append(define_tpl_enable('Cholmod', False)) + + if spec.satisfies('platform=darwin'): + # Don't let TriBITS define `libdl` as an absolute path to + # the MacOSX{nn.n}.sdk since that breaks at every xcode update + options.append(define_tpl_enable('DLlib', False)) + + # ################# Explicit template instantiation ################# + + complex_s = spec.variants['complex'].value + float_s = spec.variants['float'].value + + options.extend([ + define('Teuchos_ENABLE_COMPLEX', complex_s), + define('Teuchos_ENABLE_FLOAT', float_s), + ]) + + if '+tpetra +explicit_template_instantiation' in spec: + options.append(define_from_variant('Tpetra_INST_OPENMP', 'openmp')) + options.extend([ + define('Tpetra_INST_DOUBLE', True), + define('Tpetra_INST_COMPLEX_DOUBLE', complex_s), + define('Tpetra_INST_COMPLEX_FLOAT', float_s and complex_s), + define('Tpetra_INST_FLOAT', float_s), + define('Tpetra_INST_SERIAL', True), + ]) + + gotype = spec.variants['gotype'].value + if gotype == 'all': + # default in older Trilinos versions to enable multiple GOs + options.extend([ + define('Tpetra_INST_INT_INT', True), + define('Tpetra_INST_INT_LONG', True), + define('Tpetra_INST_INT_LONG_LONG', True), + ]) + else: + options.extend([ + define('Tpetra_INST_INT_INT', gotype == 'int'), + define('Tpetra_INST_INT_LONG', gotype == 'long'), + define('Tpetra_INST_INT_LONG_LONG', gotype == 'long_long'), + ]) + + # ################# Kokkos ###################### + + if '+kokkos' in spec: + arch = Kokkos.get_microarch(spec.target) + if arch: + options.append(define("Kokkos_ARCH_" + arch.upper(), True)) + + define_kok_enable = _make_definer("Kokkos_ENABLE_") + options.extend([ + define_kok_enable('CUDA'), + define_kok_enable('OPENMP' if spec.version >= Version('13') + else 'OpenMP'), + ]) + if '+cuda' in spec: + use_uvm = '+uvm' in spec + options.extend([ + define_kok_enable('CUDA_UVM', use_uvm), + define_kok_enable('CUDA_LAMBDA', True), + define_kok_enable('CUDA_RELOCATABLE_DEVICE_CODE', 'cuda_rdc') + ]) + arch_map = Kokkos.spack_cuda_arch_map + options.extend( + define("Kokkos_ARCH_" + arch_map[arch].upper(), True) + for arch in spec.variants['cuda_arch'].value + ) + + if '+rocm' in spec: + options.extend([ + define_kok_enable('ROCM', False), + define_kok_enable('HIP', True), + define_kok_enable('HIP_RELOCATABLE_DEVICE_CODE', 'rocm_rdc') + ]) + if '+tpetra' in spec: + options.append(define('Tpetra_INST_HIP', True)) + amdgpu_arch_map = Kokkos.amdgpu_arch_map + for amd_target in spec.variants['amdgpu_target'].value: + try: + arch = amdgpu_arch_map[amd_target] + except KeyError: + pass + else: + options.append(define("Kokkos_ARCH_" + arch.upper(), True)) + + # ################# System-specific ###################### + + # Fortran lib (assumes clang is built with gfortran!) + if ('+fortran' in spec + and spec.compiler.name in ['gcc', 'clang', 'apple-clang']): + fc = Executable(spec['mpi'].mpifc) if ( + '+mpi' in spec) else Executable(spack_fc) + libgfortran = fc('--print-file-name', + 'libgfortran.' + dso_suffix, + output=str).strip() + # if libgfortran is equal to "libgfortran." then + # print-file-name failed, use static library instead + if libgfortran == 'libgfortran.' + dso_suffix: + libgfortran = fc('--print-file-name', + 'libgfortran.a', + output=str).strip() + # -L -lgfortran required for OSX + # https://github.com/spack/spack/pull/25823#issuecomment-917231118 + options.append( + define('Trilinos_EXTRA_LINK_FLAGS', + '-L%s/ -lgfortran' % os.path.dirname(libgfortran))) + + if sys.platform == 'darwin' and macos_version() >= Version('10.12'): + # use @rpath on Sierra due to limit of dynamic loader + options.append(define('CMAKE_MACOSX_RPATH', True)) + else: + options.append(define('CMAKE_INSTALL_NAME_DIR', self.prefix.lib)) + + return options + + @run_after('install') + def filter_python(self): + # When trilinos is built with Python, libpytrilinos is included + # through cmake configure files. Namely, Trilinos_LIBRARIES in + # TrilinosConfig.cmake contains pytrilinos. This leads to a + # run-time error: Symbol not found: _PyBool_Type and prevents + # Trilinos to be used in any C++ code, which links executable + # against the libraries listed in Trilinos_LIBRARIES. See + # https://github.com/trilinos/Trilinos/issues/569 and + # https://github.com/trilinos/Trilinos/issues/866 + # A workaround is to remove PyTrilinos from the COMPONENTS_LIST + # and to remove -lpytrilonos from Makefile.export.Trilinos + if '+python' in self.spec: + filter_file(r'(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)', + (r'\1\3'), + '%s/cmake/Trilinos/TrilinosConfig.cmake' % + self.prefix.lib) + filter_file(r'-lpytrilinos', '', + '%s/Makefile.export.Trilinos' % + self.prefix.include) + + def setup_run_environment(self, env): + if '+exodus' in self.spec: + env.prepend_path('PYTHONPATH', self.prefix.lib) + + if '+cuda' in self.spec: + # currently Trilinos doesn't perform the memory fence so + # it relies on blocking CUDA kernel launch. + env.set('CUDA_LAUNCH_BLOCKING', '1') + +# yapf: enable diff --git a/scripts/spack_packages/packages/umpire/package.py b/scripts/spack_packages/packages/umpire/package.py new file mode 100644 index 00000000..a37abf70 --- /dev/null +++ b/scripts/spack_packages/packages/umpire/package.py @@ -0,0 +1,299 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os +import socket + +import llnl.util.tty as tty + +from spack.package import * +from spack.pkg.builtin.camp import hip_repair_cache + + +class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): + """An application-focused API for memory management on NUMA & GPU + architectures""" + + homepage = "https://github.com/LLNL/Umpire" + git = "https://github.com/LLNL/Umpire.git" + tags = ["radiuss", "e4s"] + + maintainers("davidbeckingsale") + + # GEOS_EDIT_START + version("2023.06.0", branch="v2023.06.0", submodules=False) + # GEOS_EDIT_END + + + version("develop", branch="develop", submodules=False) + version("main", branch="main", submodules=False) + version("2022.03.1", tag="v2022.03.1", submodules=False) + version("2022.03.0", tag="v2022.03.0", submodules=False) + version("6.0.0", tag="v6.0.0", submodules=True) + version("5.0.1", tag="v5.0.1", submodules=True) + version("5.0.0", tag="v5.0.0", submodules=True) + version("4.1.2", tag="v4.1.2", submodules=True) + version("4.1.1", tag="v4.1.1", submodules=True) + version("4.1.0", tag="v4.1.0", submodules=True) + version("4.0.1", tag="v4.0.1", submodules=True) + version("4.0.0", tag="v4.0.0", submodules=True) + version("3.0.0", tag="v3.0.0", submodules=True) + version("2.1.0", tag="v2.1.0", submodules=True) + version("2.0.0", tag="v2.0.0", submodules=True) + version("1.1.0", tag="v1.1.0", submodules=True) + version("1.0.1", tag="v1.0.1", submodules=True) + version("1.0.0", tag="v1.0.0", submodules=True) + version("0.3.5", tag="v0.3.5", submodules=True) + version("0.3.4", tag="v0.3.4", submodules=True) + version("0.3.3", tag="v0.3.3", submodules=True) + version("0.3.2", tag="v0.3.2", submodules=True) + version("0.3.1", tag="v0.3.1", submodules=True) + version("0.3.0", tag="v0.3.0", submodules=True) + version("0.2.4", tag="v0.2.4", submodules=True) + version("0.2.3", tag="v0.2.3", submodules=True) + version("0.2.2", tag="v0.2.2", submodules=True) + version("0.2.1", tag="v0.2.1", submodules=True) + version("0.2.0", tag="v0.2.0", submodules=True) + version("0.1.4", tag="v0.1.4", submodules=True) + version("0.1.3", tag="v0.1.3", submodules=True) + + # GEOS_EDIT_START + # Unused patches + + #patch("std-filesystem-pr784.patch", when="@2022.03.1 +rocm ^blt@0.5.2:") + #patch("camp_target_umpire_3.0.0.patch", when="@3.0.0") + # patch("cmake_version_check.patch", when="@4.1") + #patch("missing_header_for_numeric_limits.patch", when="@4.1:5.0.1") + # GEOS_EDIT_END + + # export targets when building pre-6.0.0 release with BLT 0.4.0+ + patch( + "https://github.com/LLNL/Umpire/commit/5773ce9af88952c8d23f9bcdcb2e503ceda40763.patch?full_index=1", + sha256="f3b21335ce5cf9c0fecc852a94dfec90fb5703032ac97f9fee104af9408d8899", + when="@:5.0.1 ^blt@0.4:", + ) + + variant("fortran", default=False, description="Build C/Fortran API") + variant("c", default=True, description="Build C API") + variant("numa", default=False, description="Enable NUMA support") + variant("shared", default=True, description="Enable Shared libs") + variant("openmp", default=False, description="Build with OpenMP support") + variant("deviceconst", default=False, description="Enables support for constant device memory") + variant("examples", default=True, description="Build Umpire Examples") + variant( + "tests", + default="none", + values=("none", "basic", "benchmarks"), + multi=False, + description="Tests to run", + ) + variant("device_alloc", default=True, description="Build Umpire Device Allocator") + + depends_on("cmake@3.8:", type="build") + depends_on("cmake@3.9:", when="+cuda", type="build") + depends_on("cmake@3.14:", when="@2022.03.0:") + + # GEOS_EDIT_START + depends_on("blt@0.5.3:", type="build", when="@2023.06.0:") + # GEOS_EDIT_END + depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") + depends_on("blt@0.4.1", type="build", when="@6.0.0") + depends_on("blt@0.4.0:", type="build", when="@4.1.3:5.0.1") + depends_on("blt@0.3.6:", type="build", when="@:4.1.2") + + depends_on("camp", when="@5.0.0:") + depends_on("camp@0.2.2:0.2.3", when="@6.0.0") + depends_on("camp@0.1.0", when="@5.0.0:5.0.1") + depends_on("camp@2022.03.2:", when="@2022.03.0:") + # GEOS_EDIT_START + depends_on("camp@2023.06.0:", when="@2023.06.0:") + # GEOS_EDIT_END + depends_on("camp@main", when="@main") + depends_on("camp@main", when="@develop") + depends_on("camp+openmp", when="+openmp") + depends_on("camp~cuda", when="~cuda") + + with when("@5.0.0:"): + with when("+cuda"): + depends_on("camp+cuda") + for sm_ in CudaPackage.cuda_arch_values: + depends_on("camp+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) + + with when("+rocm"): + depends_on("camp+rocm") + for arch_ in ROCmPackage.amdgpu_targets: + depends_on( + "camp+rocm amdgpu_target={0}".format(arch_), + when="amdgpu_target={0}".format(arch_), + ) + + conflicts("+numa", when="@:0.3.2") + conflicts("~c", when="+fortran", msg="Fortran API requires C API") + conflicts("+device_alloc", when="@:2022.03.0") + + # device allocator exports device code, which requires static libs + # currently only available for cuda. + conflicts("+shared", when="+cuda") + + # https://github.com/LLNL/Umpire/issues/653 + # This range looks weird, but it ensures the concretizer looks at it as a + # range, not as a concrete version, so that it also matches 10.3.* versions. + conflicts("%gcc@10.3.0:10.3", when="+cuda") + + def _get_sys_type(self, spec): + sys_type = spec.architecture + if "SYS_TYPE" in env: + sys_type = env["SYS_TYPE"] + return sys_type + + @property + def cache_name(self): + hostname = socket.gethostname() + if "SYS_TYPE" in env: + hostname = hostname.rstrip("1234567890") + return "{0}-{1}-{2}@{3}.cmake".format( + hostname, + self._get_sys_type(self.spec), + self.spec.compiler.name, + self.spec.compiler.version, + ) + + def initconfig_compiler_entries(self): + spec = self.spec + entries = super().initconfig_compiler_entries() + + if "+rocm" in spec: + entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) + + option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" + + if "+fortran" in spec and self.compiler.fc is not None: + entries.append(cmake_cache_option("ENABLE_FORTRAN", True)) + else: + entries.append(cmake_cache_option("ENABLE_FORTRAN", False)) + + entries.append(cmake_cache_option("{}ENABLE_C".format(option_prefix), "+c" in spec)) + + return entries + + def initconfig_hardware_entries(self): + spec = self.spec + entries = super().initconfig_hardware_entries() + + option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" + + if "+cuda" in spec: + entries.append(cmake_cache_option("ENABLE_CUDA", True)) + + if not spec.satisfies("cuda_arch=none"): + cuda_arch = spec.variants["cuda_arch"].value + entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) + entries.append( + cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) + ) + flag = "-arch sm_{0}".format(cuda_arch[0]) + entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", "{0}".format(flag))) + + entries.append( + cmake_cache_option( + "{}ENABLE_DEVICE_CONST".format(option_prefix), spec.satisfies("+deviceconst") + ) + ) + else: + entries.append(cmake_cache_option("ENABLE_CUDA", False)) + + if "+rocm" in spec: + entries.append(cmake_cache_option("ENABLE_HIP", True)) + entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) + hip_repair_cache(entries, spec) + archs = self.spec.variants["amdgpu_target"].value + if archs != "none": + arch_str = ",".join(archs) + entries.append( + cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) + ) + entries.append( + cmake_cache_string("CMAKE_HIP_ARCHITECTURES", "{0}".format(arch_str)) + ) + else: + entries.append(cmake_cache_option("ENABLE_HIP", False)) + + return entries + + def initconfig_package_entries(self): + spec = self.spec + entries = [] + + option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" + + # TPL locations + entries.append("#------------------{0}".format("-" * 60)) + entries.append("# TPLs") + entries.append("#------------------{0}\n".format("-" * 60)) + + entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) + if spec.satisfies("@5.0.0:"): + entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) + entries.append(cmake_cache_option("{}ENABLE_NUMA".format(option_prefix), "+numa" in spec)) + # GEOS_EDIT_START + + # The wrong way to initialize OpenMP from spack upstream + # entries.append( + # cmake_cache_option("{}ENABLE_OPENMP".format(option_prefix), "+openmp" in spec) + # ) + entries.append(cmake_cache_option( + "ENABLE_OPENMP", "+openmp" in spec)) + # GEOS_EDIT_END + entries.append(cmake_cache_option("ENABLE_BENCHMARKS", "tests=benchmarks" in spec)) + entries.append( + cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) + ) + entries.append(cmake_cache_option("{}ENABLE_DOCS".format(option_prefix), False)) + entries.append( + cmake_cache_option("UMPIRE_ENABLE_DEVICE_ALLOCATOR", "+device_alloc" in spec) + ) + entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) + entries.append(cmake_cache_option("ENABLE_TESTS", "tests=none" not in spec)) + + return entries + + def cmake_args(self): + options = [] + return options + + def test(self): + """Perform stand-alone checks on the installed package.""" + if self.spec.satisfies("@:1") or not os.path.isdir(self.prefix.bin): + tty.info("Skipping: checks not installed in bin for v{0}".format(self.version)) + return + + # Run a subset of examples PROVIDED installed + # tutorials with readily checkable outputs. + checks = { + "malloc": ["99 should be 99"], + "recipe_dynamic_pool_heuristic": ["in the pool", "releas"], + "recipe_no_introspection": ["has allocated", "used"], + "strategy_example": ["Available allocators", "HOST"], + "tut_copy": ["Copied source data"], + "tut_introspection": ["Allocator used is HOST", "size of the allocation"], + "tut_memset": ["Set data from HOST"], + "tut_move": ["Moved source data", "HOST"], + "tut_reallocate": ["Reallocated data"], + "vector_allocator": [""], + } + + for exe in checks: + expected = checks[exe] + reason = "test: checking output from {0}".format(exe) + self.run_test( + exe, + [], + expected, + 0, + installed=False, + purpose=reason, + skip_missing=True, + work_dir=self.prefix.bin, + ) \ No newline at end of file diff --git a/scripts/spack_packages/packages/vtk/package.py b/scripts/spack_packages/packages/vtk/package.py new file mode 100644 index 00000000..b1a666f8 --- /dev/null +++ b/scripts/spack_packages/packages/vtk/package.py @@ -0,0 +1,102 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os +import sys + +from spack import * + + +class Vtk(CMakePackage): + """The Visualization Toolkit (VTK) is an open-source, freely + available software system for 3D computer graphics, image + processing and visualization. """ + + homepage = "http://www.vtk.org" + url = "https://www.vtk.org/files/release/9.0/VTK-9.0.0.tar.gz" + list_url = "http://www.vtk.org/download/" + + maintainers = ['chuckatkins', 'danlipsa'] + + version("9.2.6", sha256="06fc8d49c4e56f498c40fcb38a563ed8d4ec31358d0101e8988f0bb4d539dd12") + version('9.1.0', sha256='8fed42f4f8f1eb8083107b68eaa9ad71da07110161a3116ad807f43e5ca5ce96') + version('9.0.3', sha256='bc3eb9625b2b8dbfecb6052a2ab091fc91405de4333b0ec68f3323815154ed8a') + version('9.0.1', sha256='1b39a5e191c282861e7af4101eaa8585969a2de05f5646c9199a161213a622c7') + version('9.0.0', sha256='15def4e6f84d72f82386617fe595ec124dda3cbd13ea19a0dcd91583197d8715') + version('8.2.0', sha256='34c3dc775261be5e45a8049155f7228b6bd668106c72a3c435d95730d17d57bb') + version('8.1.2', sha256='0995fb36857dd76ccfb8bb07350c214d9f9099e80b1e66b4a8909311f24ff0db') + version('8.1.1', sha256='71a09b4340f0a9c58559fe946dc745ab68a866cf20636a41d97b6046cb736324') + version('8.1.0', sha256='6e269f07b64fb13774f5925161fb4e1f379f4e6a0131c8408c555f6b58ef3cb7') + version('8.0.1', sha256='49107352923dea6de05a7b4c3906aaf98ef39c91ad81c383136e768dcf304069') + version('7.1.0', sha256='5f3ea001204d4f714be972a810a62c0f2277fbb9d8d2f8df39562988ca37497a') + version('7.0.0', sha256='78a990a15ead79cdc752e86b83cfab7dbf5b7ef51ba409db02570dbdd9ec32c3') + version('6.3.0', sha256='92a493354c5fa66bea73b5fc014154af5d9f3f6cee8d20a826f4cd5d4b0e8a5e') + version('6.1.0', sha256='bd7df10a479606d529a8b71f466c44a2bdd11fd534c62ce0aa44fad91883fa34') + + variant('python', default=False, description='Enable Python support') + variant('mpi', default=True, description='Enable MPI support') + + patch('vtkXMLReader-fpe.patch', when='@9.1.0:') + + extends('python', when='+python') + + # Acceptable python versions depend on vtk version + # We need vtk at least 8.0.1 for python@3, + # and at least 9.0 for python@3.8 + depends_on('python@2.7:2.9', when='@:8.0 +python', type=('build', 'run')) + depends_on('python@2.7:3.7.99', when='@8.0.1:8.9 +python', type=('build', 'run')) + depends_on('python@2.7:', when='@9.0: +python', type=('build', 'run')) + + # We need mpi4py if buidling python wrappers and using MPI + depends_on('py-mpi4py', when='+python+mpi', type='run') + + depends_on('mpi', when='+mpi') + + def cmake_args(self): + spec = self.spec + + # yapf: disable + # Added GEOSX Arguments + if '+mpi' in spec: + mpi_args = [ + self.define('CMAKE_C_COMPILER', spec['mpi'].mpicc), + self.define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), + self.define('CMAKE_CXX_FLAGS', self.spec.compiler_flags["cxxflags"]), + '-DVTK_USE_MPI=ON', + '-DVTK_MODULE_ENABLE_VTK_IOParallelXML=YES', + '-DVTK_MODULE_ENABLE_VTK_FiltersParallelDIY2=YES' + ] + else: + mpi_args = [ + self.define('CMAKE_C_COMPILER', self.compiler.cc), + self.define('CMAKE_CXX_COMPILER', self.compiler.cxx), + self.define('CMAKE_CXX_FLAGS', self.spec.compiler_flags["cxxflags"]), + '-DVTK_USE_MPI=OFF', + '-DVTK_MODULE_ENABLE_VTK_IOParallelXML=NO', + '-DVTK_MODULE_ENABLE_VTK_FiltersParallelDIY2=NO', + ] + + cmake_args= [ + '-DVTK_GROUP_ENABLE_Imaging=DONT_WANT', + '-DVTK_GROUP_ENABLE_MPI=DONT_WANT', + '-DVTK_GROUP_ENABLE_Qt=DONT_WANT', + '-DVTK_GROUP_ENABLE_Rendering=DONT_WANT', + '-DVTK_GROUP_ENABLE_StandAlone=DONT_WANT', + '-DVTK_GROUP_ENABLE_Views=DONT_WANT', + '-DVTK_GROUP_ENABLE_Web=DONT_WANT', + '-DVTK_BUILD_ALL_MODULES=OFF', + '-DVTK_WRAP_PYTHON=OFF', + '-DVTK_WRAP_JAVA=OFF', + '-DVTK_MODULE_ENABLE_VTK_vtkm=DONT_WANT', + '-DVTK_MODULE_ENABLE_VTK_IOXML=YES', + '-DVTK_MODULE_ENABLE_VTK_IOLegacy=YES', + '-DVTK_BUILD_TESTING=OFF', + '-DVTK_LEGACY_REMOVE=ON' + ] + # yapf: enable + + cmake_args = mpi_args + cmake_args + + return cmake_args diff --git a/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch b/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch new file mode 100644 index 00000000..c998db19 --- /dev/null +++ b/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch @@ -0,0 +1,19 @@ +--- a/IO/XML/vtkXMLReader.cxx 2023-02-14 20:03:53.000000000 -0800 ++++ b/IO/XML/vtkXMLReader.cxx.patch 2023-05-12 08:52:36.017274000 -0700 +@@ -53,6 +53,7 @@ + #include + #include + #include ++#include + #include + #include // C++ locale + #include +@@ -1958,7 +1959,7 @@ + if (!this->AbortExecute) + { + // Round progress to nearest 100th. +- float rounded = static_cast(int((progress * 100) + 0.5f)) / 100.f; ++ float const rounded = std::round(progress * 100) * 0.01; + if (this->GetProgress() != rounded) + { + this->UpdateProgress(rounded); \ No newline at end of file diff --git a/scripts/spack_packages/repo.yaml b/scripts/spack_packages/repo.yaml new file mode 100644 index 00000000..19bb9d85 --- /dev/null +++ b/scripts/spack_packages/repo.yaml @@ -0,0 +1,2 @@ +repo: + namespace: geos diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml deleted file mode 100644 index d59c746e..00000000 --- a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/compilers.yaml +++ /dev/null @@ -1,46 +0,0 @@ -compilers: -- compiler: - spec: clang@10.0.1 - paths: - cc: /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/bin/clang - cxx: /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - cflags: -mcpu=native -mtune=native -Wl,--no-toc-optimize - cxxflags: -mcpu=native -mtune=native -Wl,--no-toc-optimize - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: clang@11.0.1 - paths: - cc: /usr/tce/packages/clang/clang-ibm-11.0.1/bin/clang - cxx: /usr/tce/packages/clang/clang-ibm-11.0.1/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - cflags: -mcpu=native -mtune=native - cxxflags: -mcpu=native -mtune=native - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: gcc@8.3.1 - paths: - cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - cflags: -mcpu=native -mtune=native - cxxflags: -mcpu=native -mtune=native - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml deleted file mode 100644 index aa204efc..00000000 --- a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9/packages.yaml +++ /dev/null @@ -1,67 +0,0 @@ -packages: - all: - target: [default] - compiler: [gcc, clang] - providers: - mpi: [spectrum-mpi] - blas: [essl] - lapack: [essl] - - spectrum-mpi: - buildable: False - externals: - - spec: spectrum-mpi@10.3.1.03rtm0 %gcc@8.3.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/ - - spec: spectrum-mpi@10.3.1.03rtm0 %clang@10.0.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-10.0.1-gcc-8.3.1/ - - spec: spectrum-mpi@10.3.1.03rtm0 %clang@11.0.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-11.0.1/ - - essl: - buildable: False - externals: - - spec: essl@6.2.1 ~ilp64 threads=openmp +cuda +lapack - prefix: /usr/tcetmp/packages/essl/essl-6.2.1/ - - cuda: - buildable: False - externals: - - spec: cuda@10.1.243 - modules: - - cuda/10.1.243 - - cmake: - buildable: False - externals: - - spec: cmake@3.14.5 - prefix: /usr/tce/packages/cmake/cmake-3.14.5 - - readline: - buildable: False - externals: - - spec: readline@6.2 - prefix: /usr/lib64/ - - zlib: - buildable: False - externals: - - spec: zlib@1.2.7 - prefix: /usr/ - - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr/bin/ - - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin/ - - python: - buildable: False - externals: - - spec: python@3.8.2 - prefix: /usr/tce/packages/python/python-3.8.2/ diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/compilers.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/compilers.yaml deleted file mode 100644 index 6de2dd3c..00000000 --- a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/compilers.yaml +++ /dev/null @@ -1,31 +0,0 @@ -compilers: -- compiler: - spec: clang@10.0.1 - paths: - cc: /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/bin/clang - cxx: /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - cflags: -mcpu=native -mtune=native - cxxflags: -mcpu=native -mtune=native - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: gcc@8.3.1 - paths: - cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - cflags: -mcpu=native -mtune=native - cxxflags: -mcpu=native -mtune=native - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] diff --git a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/packages.yaml b/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/packages.yaml deleted file mode 100644 index dd9466ff..00000000 --- a/scripts/uberenv/spack_configs/blueos_3_ppc64le_ib_p9_python/packages.yaml +++ /dev/null @@ -1,132 +0,0 @@ -packages: - all: - target: [default] - compiler: [gcc, clang] - providers: - mpi: [spectrum-mpi] - blas: [essl] - lapack: [essl] - - spectrum-mpi: - buildable: False - externals: - - spec: spectrum-mpi@10.3.1.03rtm0 %gcc@8.3.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/ - - spec: spectrum-mpi@10.3.1.03rtm0 %clang@10.0.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-10.0.1-gcc-8.3.1/ - - essl: - buildable: False - externals: - - spec: essl@6.2.1 ~ilp64 threads=openmp +cuda +lapack - prefix: /usr/tcetmp/packages/essl/essl-6.2.1/ - - cuda: - buildable: False - externals: - - spec: cuda@10.1.243 - modules: - - cuda/10.1.243 - - cmake: - buildable: False - externals: - - spec: cmake@3.14.5 - prefix: /usr/tce/packages/cmake/cmake-3.14.5 - - readline: - buildable: False - externals: - - spec: readline@6.2 - prefix: /usr/lib64/ - - zlib: - buildable: False - externals: - - spec: zlib@1.2.7 - prefix: /usr/ - - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr/bin/ - - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin/ - - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr/bin/ - - flex: - buildable: False - externals: - - spec: flex@2.5.37 - prefix: /usr/bin/ - - bzip2: - buildable: False - externals: - - spec: bzip2@1.0.6 - prefix: /usr/bin/ - - expat: - buildable: False - externals: - - spec: expat@1.6.0 - prefix: /usr/lib64/ - - gdbm: - buildable: False - externals: - - spec: gdbm@4.0.0 - prefix: /usr/lib64/ - - gettext: - buildable: False - externals: - - spec: gettext@0.19.8.1 - prefix: /usr/bin/ - - openssl: - buildable: False - externals: - - spec: openssl@1.0.2k-fips - prefix: /usr/ - - libffi: - buildable: False - externals: - - spec: libffi@6.0.1 - prefix: /usr/lib64/ - - libuuid: - buildable: False - externals: - - spec: libuuid@1.3.0 - prefix: /usr/lib64/ - - ncurses: - buildable: False - externals: - - spec: ncurses@5.9 - prefix: /usr/lib64/ - - xz: - buildable: False - externals: - - spec: xz@5.2.2 - prefix: /usr/bin/ - - pkg-config: - buildable: False - externals: - - spec: pkg-config@0.27.1 - prefix: /usr/bin/ - diff --git a/scripts/uberenv/spack_configs/config.yaml b/scripts/uberenv/spack_configs/config.yaml deleted file mode 100644 index 2806a4a1..00000000 --- a/scripts/uberenv/spack_configs/config.yaml +++ /dev/null @@ -1,78 +0,0 @@ -# ------------------------------------------------------------------------- -# This is the default spack configuration file. -# -# Settings here are versioned with Spack and are intended to provide -# sensible defaults out of the box. Spack maintainers should edit this -# file to keep it current. -# -# Users can override these settings by editing the following files. -# -# Per-spack-instance settings (overrides defaults): -# $SPACK_ROOT/etc/spack/config.yaml -# Per-user settings (overrides default and site settings): -# ~/.spack/config.yaml -# -# See https://spack.readthedocs.io/en/latest/config_yaml.html -# ------------------------------------------------------------------------- -config: - # This is the path to the root of the Spack install tree. - # You can use $spack here to refer to the root of the spack instance. - install_tree: $spack/.. - - # Locations where templates should be found - template_dirs: - - $spack/templates - - # # install directory layout - # install_path_scheme: "${ARCHITECTURE}-${COMPILERNAME}@${COMPILERVER}/${PACKAGE}@${VERSION}" - - # Locations where different types of modules should be installed. - module_roots: - tcl: $spack/share/spack/modules - lmod: $spack/share/spack/lmod - - - # Temporary locations Spack can try to use for builds. - # - # Spack will use the first one it finds that exists and is writable. - # You can use $tempdir to refer to the system default temp directory - # (as returned by tempfile.gettempdir()). - # - # A value of $spack/var/spack/stage indicates that Spack should run - # builds directly inside its install directory without staging them in - # temporary space. - # - # The build stage can be purged with `spack purge --stage`. - build_stage: - - $spack/../builds - - - # Cache directory already downloaded source tarballs and archived - # repositories. This can be purged with `spack purge --downloads`. - source_cache: $spack/var/spack/cache - - - # Cache directory for miscellaneous files, like the package index. - # This can be purged with `spack purge --misc-cache` - misc_cache: .spack/misccache - - - # If this is false, tools like curl that use SSL will not verify - # certifiates. (e.g., curl will use use the -k option) - verify_ssl: true - - - # If set to true, Spack will always check checksums after downloading - # archives. If false, Spack skips the checksum step. - checksum: true - - - # If set to true, `spack install` and friends will NOT clean - # potentially harmful variables from the build environment. Use wisely. - dirty: false - - - # The default number of jobs to use when running `make` in parallel. - # Spack will use up to this many jobs but limits it to the physical core count. - # The default value is 16. - build_jobs: 1000 diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml deleted file mode 100644 index e8a7b553..00000000 --- a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/compilers.yaml +++ /dev/null @@ -1,81 +0,0 @@ -compilers: -- compiler: - spec: clang@10.0.0 - paths: - cc: /usr/tce/packages/clang/clang-10.0.0/bin/clang - cxx: /usr/tce/packages/clang/clang-10.0.0/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-4.9.3/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-4.9.3/bin/gfortran - flags: - cflags: -march=native -mtune=native - cxxflags: -march=native -mtune=native - fflags: -march=native -mtune=native - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: clang@10.0.1 - paths: - cc: /usr/tce/packages/clang/clang-10.0.1/bin/clang - cxx: /usr/tce/packages/clang/clang-10.0.1/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - cflags: -march=native -mtune=native - cxxflags: -march=native -mtune=native - fflags: -march=native -mtune=native - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: gcc@8.1.0 - paths: - cc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.1.0/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - flags: - cflags: -march=native -mtune=native - cxxflags: -march=native -mtune=native - fflags: -march=native -mtune=native - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: gcc@8.3.1 - paths: - cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - cflags: -march=native -mtune=native - cxxflags: -march=native -mtune=native - fflags: -march=native -mtune=native - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: intel@19.1.2 - paths: - cc: /usr/tce/packages/intel/intel-19.1.2/bin/icc - cxx: /usr/tce/packages/intel/intel-19.1.2/bin/icpc - f77: /usr/tce/packages/intel/intel-19.1.2/bin/ifort - fc: /usr/tce/packages/intel/intel-19.1.2/bin/ifort - flags: - cflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc -march=native -mtune=native - cxxflags: -gxx-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ -march=native -mtune=native - fflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc -march=native -mtune=native - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml deleted file mode 100644 index 234367ee..00000000 --- a/scripts/uberenv/spack_configs/toss_3_x86_64_ib/packages.yaml +++ /dev/null @@ -1,70 +0,0 @@ -packages: - all: - target: [default] - compiler: [gcc, clang, intel] - providers: - mpi: [mvapich2] - blas: [intel-mkl] - lapack: [intel-mkl] - - mvapich2: - buildable: False - externals: - - spec: mvapich2@2.3 %gcc@8.3.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/ - - spec: mvapich2@2.3 %clang@10.0.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.1 - - intel-mkl: - buildable: False - externals: - - spec: intel-mkl@2020.0.166 threads=openmp - prefix: /usr/tce/packages/mkl/mkl-2020.0/ - - papi: - buildable: False - externals: - - spec: papi@5.5.1 - prefix: /usr/tce/packages/papi/papi-5.5.1/ - - cmake: - buildable: False - externals: - - spec: cmake@3.14.5 - prefix: /usr/tce/packages/cmake/cmake-3.14.5/ - - readline: - buildable: False - externals: - - spec: readline@6.2 - prefix: /usr/lib64/ - - zlib: - buildable: False - externals: - - spec: zlib@1.2.7 - prefix: /usr/ - - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr/bin - - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin - - python: - buildable: False - externals: - - spec: python@3.8.2 - prefix: /usr/tce/packages/python/python-3.8.2/ - - py-sphinx: - buildable: False - externals: - - spec: py-sphinx@1.6.3 - prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/compilers.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/compilers.yaml deleted file mode 120000 index af5c3714..00000000 --- a/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/compilers.yaml +++ /dev/null @@ -1 +0,0 @@ -../toss_3_x86_64_ib/compilers.yaml \ No newline at end of file diff --git a/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/packages.yaml b/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/packages.yaml deleted file mode 100644 index f3d0c55e..00000000 --- a/scripts/uberenv/spack_configs/toss_3_x86_64_ib_python/packages.yaml +++ /dev/null @@ -1,146 +0,0 @@ -packages: - all: - target: [default] - compiler: [gcc, clang, intel] - providers: - mpi: [mvapich2] - blas: [intel-mkl] - lapack: [intel-mkl] - - mvapich2: - buildable: False - externals: - - spec: mvapich2@2.3 %clang@10.0.0 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0 - - spec: mvapich2@2.3 %clang@10.0.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.1 - - spec: mvapich2@2.3 %gcc@8.1.0 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.1.0/ - - spec: mvapich2@2.3 %gcc@8.3.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/ - - intel-mkl: - buildable: False - externals: - - spec: intel-mkl@2019.0 threads=openmp %clang@10.0.0 - prefix: /usr/tce/packages/mkl/mkl-2019.0/ - - spec: intel-mkl@2020.0.166 threads=openmp %clang@10.0.1 - prefix: /usr/tce/packages/mkl/mkl-2020.0/ - - spec: intel-mkl@2019.0 threads=openmp %gcc@8.1.0 - prefix: /usr/tce/packages/mkl/mkl-2019.0/ - - spec: intel-mkl@2020.0.166 threads=openmp %gcc@8.3.1 - prefix: /usr/tce/packages/mkl/mkl-2020.0/ - - papi: - buildable: False - externals: - - spec: papi@5.5.1 - prefix: /usr/tce/packages/papi/papi-5.5.1/ - - cmake: - buildable: False - externals: - - spec: cmake@3.14.5 - prefix: /usr/tce/packages/cmake/cmake-3.14.5/ - - readline: - buildable: False - externals: - - spec: readline@6.2 - prefix: /usr/lib64/ - - zlib: - buildable: False - externals: - - spec: zlib@1.2.7 - prefix: /usr/ - - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr/bin - - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin - - py-sphinx: - buildable: False - externals: - - spec: py-sphinx@1.6.3 - prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ - - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr/bin/ - - flex: - buildable: False - externals: - - spec: flex@2.5.37 - prefix: /usr/bin/ - - bzip2: - buildable: False - externals: - - spec: bzip2@1.0.6 - prefix: /usr/bin/ - - expat: - buildable: False - externals: - - spec: expat@1.6.0 - prefix: /usr/lib64/ - - gdbm: - buildable: False - externals: - - spec: gdbm@4.0.0 - prefix: /usr/lib64/ - - gettext: - buildable: False - externals: - - spec: gettext@0.19.8.1 - prefix: /usr/bin/ - - openssl: - buildable: False - externals: - - spec: openssl@1.0.2 - prefix: /usr/ - - libffi: - buildable: False - externals: - - spec: libffi@6.0.1 - prefix: /usr/lib64/ - - libuuid: - buildable: False - externals: - - spec: libuuid@1.3.0 - prefix: /usr/lib64/ - - ncurses: - buildable: False - externals: - - spec: ncurses@5.9 - prefix: /usr/lib64/ - - xz: - buildable: False - externals: - - spec: xz@5.2.2 - prefix: /usr/bin/ - - pkg-config: - buildable: False - externals: - - spec: pkg-config@0.27.1 - prefix: /usr/bin/ From 8b687f15e9fe5424f57aec953a71605c98ff6012 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 1 Feb 2024 08:12:46 -0800 Subject: [PATCH 14/48] Update spack commit, remove chai and umpire recipes --- .uberenv_config.json | 2 +- .../blueos_3_ppc64le_ib_p9/spack.yaml | 18 +- .../spack_configs/toss_4_x86_64_ib/spack.yaml | 9 +- .../spack_packages/packages/chai/package.py | 198 ------------ .../spack_packages/packages/fesapi/package.py | 40 +-- .../spack_packages/packages/geosx/package.py | 4 +- .../spack_packages/packages/umpire/package.py | 299 ------------------ 7 files changed, 42 insertions(+), 528 deletions(-) delete mode 100644 scripts/spack_packages/packages/chai/package.py delete mode 100644 scripts/spack_packages/packages/umpire/package.py diff --git a/.uberenv_config.json b/.uberenv_config.json index 883612c2..9bce41d3 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -4,7 +4,7 @@ "package_final_phase": "lvarray_hostconfig", "package_source_dir": "../..", "spack_url": "https://github.com/spack/spack", -"spack_commit": "e8658d6493887ef702dd38f0e9ee5870a1651c1e", +"spack_commit": "2721b4c10d27afde281ea0cdb0480a7343ce0863", "spack_configs_path": "scripts/spack_configs", "spack_packages_path": "scripts/spack_packages/packages", "spack_concretizer": "clingo" diff --git a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml index 798f19bf..685241bb 100644 --- a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -93,6 +93,9 @@ spack: hypre: require: "@git.57bfb26e268ddf003668c5d0b5938ae258922a83" + chai: + require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + umpire: require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" @@ -184,13 +187,18 @@ spack: externals: - spec: libtool@2.4.2 prefix: /usr - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr flex: buildable: False externals: - spec: flex@2.5.37 prefix: /usr + gettext: + buildable: False + externals: + - spec: gettext@0.19.8.1 + prefix: /usr/bin/ + zlib: + buildable: false + externals: + - spec: zlib@1.2.7 + prefix: /usr diff --git a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml index 817a6e81..d68e6238 100644 --- a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml +++ b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml @@ -74,6 +74,9 @@ spack: hypre: require: "@git.57bfb26e268ddf003668c5d0b5938ae258922a83" + chai: + require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + umpire: require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" @@ -170,11 +173,11 @@ spack: externals: - spec: libtool@2.4.6 prefix: /usr - bison: + gettext: buildable: False externals: - - spec: bison@3.0.4 - prefix: /usr + - spec: gettext@0.19.8.1 + prefix: /usr/bin/ flex: buildable: False externals: diff --git a/scripts/spack_packages/packages/chai/package.py b/scripts/spack_packages/packages/chai/package.py deleted file mode 100644 index 6ce16a6a..00000000 --- a/scripts/spack_packages/packages/chai/package.py +++ /dev/null @@ -1,198 +0,0 @@ -# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import socket - -from spack.package import * - - -class Chai(CachedCMakePackage, CudaPackage, ROCmPackage): - """ - Copy-hiding array interface for data migration between memory spaces - """ - - homepage = "https://github.com/LLNL/CHAI" - git = "https://github.com/LLNL/CHAI.git" - tags = ["ecp", "e4s", "radiuss"] - - maintainers("davidbeckingsale") - - # GEOS_EDIT_START - version("2023.06.0", tag="v2023.06.0", submodules=False) - # GEOS_EDIT_END - - version("develop", branch="develop", submodules=False) - version("main", branch="main", submodules=False) - version("2022.03.0", tag="v2022.03.0", submodules=False) - version("2.4.0", tag="v2.4.0", submodules=True) - version("2.3.0", tag="v2.3.0", submodules=True) - version("2.2.2", tag="v2.2.2", submodules=True) - version("2.2.1", tag="v2.2.1", submodules=True) - version("2.2.0", tag="v2.2.0", submodules=True) - version("2.1.1", tag="v2.1.1", submodules=True) - version("2.1.0", tag="v2.1.0", submodules=True) - version("2.0.0", tag="v2.0.0", submodules=True) - version("1.2.0", tag="v1.2.0", submodules=True) - version("1.1.0", tag="v1.1.0", submodules=True) - version("1.0", tag="v1.0", submodules=True) - - variant("enable_pick", default=False, description="Enable pick method") - variant("shared", default=True, description="Build Shared Libs") - variant("raja", default=False, description="Build plugin for RAJA") - variant("benchmarks", default=False, description="Build benchmarks.") - variant("examples", default=True, description="Build examples.") - variant("openmp", default=False, description="Build using OpenMP") - # TODO: figure out gtest dependency and then set this default True - # and remove the +tests conflict below. - variant("tests", default=False, description="Build tests") - - depends_on("cmake@3.8:", type="build") - depends_on("cmake@3.9:", type="build", when="+cuda") - depends_on("cmake@3.14:", when="@2022.03.0:") - - # GEOS_EDIT_START - depends_on("blt@0.5.3:", type="build", when="@2023.06.0:") - # # GEOS_EDIT_END - depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") - depends_on("blt@0.4.1:", type="build", when="@2.4.0:") - depends_on("blt@0.4.0:", type="build", when="@2.3.0") - depends_on("blt@0.3.6:", type="build", when="@:2.2.2") - - depends_on("umpire") - # GEOS_EDIT_START - depends_on("umpire@2023.06.0:", when="@2023.06.0:") - # GEOS_EDIT_END - depends_on("umpire@2022.03.0:", when="@2022.03.0:") - depends_on("umpire@6.0.0", when="@2.4.0") - depends_on("umpire@4.1.2", when="@2.2.0:2.3.0") - depends_on("umpire@main", when="@main") - - with when("+cuda"): - depends_on("umpire+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("umpire+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - with when("+rocm"): - depends_on("umpire+rocm") - for arch in ROCmPackage.amdgpu_targets: - depends_on( - "umpire+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) - ) - - with when("+raja"): - depends_on("raja~openmp", when="~openmp") - depends_on("raja+openmp", when="+openmp") - depends_on("raja@0.14.0", when="@2.4.0") - depends_on("raja@0.13.0", when="@2.3.0") - depends_on("raja@0.12.0", when="@2.2.0:2.2.2") - depends_on("raja@2022.03.0:", when="@2022.03.0:") - # GEOS_EDIT_START - depends_on("raja@2023.06.0:", when="@2023.06.0:") - # GEOS_EDIT_END - depends_on("raja@main", when="@main") - - with when("+cuda"): - depends_on("raja+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("raja+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - with when("+rocm"): - depends_on("raja+rocm") - for arch in ROCmPackage.amdgpu_targets: - depends_on( - "raja+rocm amdgpu_target={0}".format(arch), - when="amdgpu_target={0}".format(arch), - ) - - conflicts("+benchmarks", when="~tests") - - def _get_sys_type(self, spec): - sys_type = spec.architecture - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - @property - def cache_name(self): - hostname = socket.gethostname() - if "SYS_TYPE" in env: - hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}.cmake".format( - hostname, - self._get_sys_type(self.spec), - self.spec.compiler.name, - self.spec.compiler.version, - ) - - def initconfig_compiler_entries(self): - spec = self.spec - entries = super(Chai, self).initconfig_compiler_entries() - if "+rocm" in spec: - entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - return entries - - def initconfig_hardware_entries(self): - spec = self.spec - entries = super(Chai, self).initconfig_hardware_entries() - - entries.append(cmake_cache_option("ENABLE_OPENMP", "+openmp" in spec)) - - if "+cuda" in spec: - entries.append(cmake_cache_option("ENABLE_CUDA", True)) - # GEOS_EDIT_START - #entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True)) - #entries.append(cmake_cache_option("CUDA_SEPARABLE_COMPILATION", True)) - # GEOS_EDIT_END - - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) - entries.append( - cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) - ) - flag = "-arch sm_{0}".format(cuda_arch[0]) - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", "{0}".format(flag))) - else: - entries.append(cmake_cache_option("ENABLE_CUDA", False)) - - if "+rocm" in spec: - entries.append(cmake_cache_option("ENABLE_HIP", True)) - entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - entries.append( - cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) - ) - else: - entries.append(cmake_cache_option("ENABLE_HIP", False)) - - return entries - - def initconfig_package_entries(self): - spec = self.spec - entries = [] - - option_prefix = "CHAI_" if spec.satisfies("@2022.03.0:") else "" - - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) - if "+raja" in spec: - entries.append(cmake_cache_option("{}ENABLE_RAJA_PLUGIN".format(option_prefix), True)) - entries.append(cmake_cache_path("RAJA_DIR", spec["raja"].prefix)) - entries.append( - cmake_cache_option("{}ENABLE_PICK".format(option_prefix), "+enable_pick" in spec) - ) - entries.append(cmake_cache_path("umpire_DIR", spec["umpire"].prefix.share.umpire.cmake)) - entries.append(cmake_cache_option("ENABLE_TESTS", "+tests" in spec)) - entries.append(cmake_cache_option("ENABLE_BENCHMARKS", "+benchmarks" in spec)) - entries.append( - cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) - ) - entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) - - return entries - - def cmake_args(self): - options = [] - return options diff --git a/scripts/spack_packages/packages/fesapi/package.py b/scripts/spack_packages/packages/fesapi/package.py index 6e957799..57a511f8 100644 --- a/scripts/spack_packages/packages/fesapi/package.py +++ b/scripts/spack_packages/packages/fesapi/package.py @@ -1,21 +1,21 @@ -# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os -import sys - from spack.package import * class Fesapi(CMakePackage): + """Allow access in reading and writing to ENERGISTICS standards data + (mainly RESQML, some of WITSML™ and PRODML)""" - url = "https://github.com/F2I-Consulting/fesapi/archive/refs/tags/v2.4.0.0.tar.gz" git = "https://github.com/F2I-Consulting/fesapi.git" + url = "https://github.com/F2I-Consulting/fesapi/archive/refs/tags/v2.4.0.0.tar.gz" version("2.4.0.0", sha256="a711e8a1218c876a2799f4d05a9820da71eb5503b5d51b834fae98d9fe635381") + depends_on("mpi") depends_on("hdf5") depends_on("boost@1.67.0") depends_on("minizip") @@ -26,21 +26,21 @@ def cmake_args(self): cppflags = " ".join(spec.compiler_flags["cppflags"]) cxxflags = cppflags + " ".join(spec.compiler_flags["cxxflags"]) cmake_args = [ - self.define('CMAKE_C_COMPILER', spec['mpi'].mpicc), - self.define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), - self.define('CMAKE_CXX_FLAGS', cxxflags), - self.define('HDF5_ROOT', spec['hdf5'].prefix), - # fesAPI/spack can detect wrong version otherwise - self.define('HDF5_VERSION', spec['hdf5'].version), - self.define('MINIZIP_INCLUDE_DIR', spec['minizip'].prefix.include + "/minizip"), - self.define('MINIZIP_LIBRARY_RELEASE', spec['minizip'].prefix.lib), - self.define('Boost_INCLUDE_DIR', spec['boost'].prefix.include), - "-DWITH_EXAMPLE:BOOL=OFF", - "-DWITH_DOTNET_WRAPPING:BOOL=OFF", - "-DWITH_JAVA_WRAPPING:BOOL=OFF", - "-DWITH_PYTHON_WRAPPING:BOOL=OFF", - "-DWITH_RESQML2_2:BOOL=OFF", - "-DWITH_TEST:BOOL=OFF", + self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc), + self.define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx), + self.define("CMAKE_CXX_FLAGS", cxxflags), + self.define("HDF5_ROOT", spec["hdf5"].prefix), + # fesAPI/spack can detect wrong HDF5 version otherwise + self.define("HDF5_VERSION", spec["hdf5"].version), + self.define("MINIZIP_INCLUDE_DIR", spec["minizip"].prefix.include + "/minizip"), + self.define("MINIZIP_LIBRARY_RELEASE", spec["minizip"].prefix.lib), + self.define("Boost_INCLUDE_DIR", spec["boost"].prefix.include), + self.define("WITH_EXAMPLE", "OFF"), + self.define("WITH_DOTNET_WRAPPING", "OFF"), + self.define("WITH_JAVA_WRAPPING", "OFF"), + self.define("WITH_PYTHON_WRAPPING", "OFF"), + self.define("WITH_RESQML2_2", "OFF"), + self.define("WITH_TEST", "OFF"), ] return cmake_args diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 85548940..c0d8fc8d 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -101,7 +101,7 @@ class Geosx(CMakePackage, CudaPackage): depends_on('umpire +c+openmp~examples+fortran~device_alloc~shared') - depends_on('chai@2023.06.0 +raja+openmp~examples~shared') + depends_on('chai +raja+openmp~examples~shared') depends_on('camp') @@ -109,7 +109,7 @@ class Geosx(CMakePackage, CudaPackage): for sm_ in CudaPackage.cuda_arch_values: depends_on('raja+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) depends_on('umpire+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) - depends_on('chai+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) + depends_on('chai+cuda~separable_compilation cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) depends_on('camp+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) # diff --git a/scripts/spack_packages/packages/umpire/package.py b/scripts/spack_packages/packages/umpire/package.py deleted file mode 100644 index a37abf70..00000000 --- a/scripts/spack_packages/packages/umpire/package.py +++ /dev/null @@ -1,299 +0,0 @@ -# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import os -import socket - -import llnl.util.tty as tty - -from spack.package import * -from spack.pkg.builtin.camp import hip_repair_cache - - -class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): - """An application-focused API for memory management on NUMA & GPU - architectures""" - - homepage = "https://github.com/LLNL/Umpire" - git = "https://github.com/LLNL/Umpire.git" - tags = ["radiuss", "e4s"] - - maintainers("davidbeckingsale") - - # GEOS_EDIT_START - version("2023.06.0", branch="v2023.06.0", submodules=False) - # GEOS_EDIT_END - - - version("develop", branch="develop", submodules=False) - version("main", branch="main", submodules=False) - version("2022.03.1", tag="v2022.03.1", submodules=False) - version("2022.03.0", tag="v2022.03.0", submodules=False) - version("6.0.0", tag="v6.0.0", submodules=True) - version("5.0.1", tag="v5.0.1", submodules=True) - version("5.0.0", tag="v5.0.0", submodules=True) - version("4.1.2", tag="v4.1.2", submodules=True) - version("4.1.1", tag="v4.1.1", submodules=True) - version("4.1.0", tag="v4.1.0", submodules=True) - version("4.0.1", tag="v4.0.1", submodules=True) - version("4.0.0", tag="v4.0.0", submodules=True) - version("3.0.0", tag="v3.0.0", submodules=True) - version("2.1.0", tag="v2.1.0", submodules=True) - version("2.0.0", tag="v2.0.0", submodules=True) - version("1.1.0", tag="v1.1.0", submodules=True) - version("1.0.1", tag="v1.0.1", submodules=True) - version("1.0.0", tag="v1.0.0", submodules=True) - version("0.3.5", tag="v0.3.5", submodules=True) - version("0.3.4", tag="v0.3.4", submodules=True) - version("0.3.3", tag="v0.3.3", submodules=True) - version("0.3.2", tag="v0.3.2", submodules=True) - version("0.3.1", tag="v0.3.1", submodules=True) - version("0.3.0", tag="v0.3.0", submodules=True) - version("0.2.4", tag="v0.2.4", submodules=True) - version("0.2.3", tag="v0.2.3", submodules=True) - version("0.2.2", tag="v0.2.2", submodules=True) - version("0.2.1", tag="v0.2.1", submodules=True) - version("0.2.0", tag="v0.2.0", submodules=True) - version("0.1.4", tag="v0.1.4", submodules=True) - version("0.1.3", tag="v0.1.3", submodules=True) - - # GEOS_EDIT_START - # Unused patches - - #patch("std-filesystem-pr784.patch", when="@2022.03.1 +rocm ^blt@0.5.2:") - #patch("camp_target_umpire_3.0.0.patch", when="@3.0.0") - # patch("cmake_version_check.patch", when="@4.1") - #patch("missing_header_for_numeric_limits.patch", when="@4.1:5.0.1") - # GEOS_EDIT_END - - # export targets when building pre-6.0.0 release with BLT 0.4.0+ - patch( - "https://github.com/LLNL/Umpire/commit/5773ce9af88952c8d23f9bcdcb2e503ceda40763.patch?full_index=1", - sha256="f3b21335ce5cf9c0fecc852a94dfec90fb5703032ac97f9fee104af9408d8899", - when="@:5.0.1 ^blt@0.4:", - ) - - variant("fortran", default=False, description="Build C/Fortran API") - variant("c", default=True, description="Build C API") - variant("numa", default=False, description="Enable NUMA support") - variant("shared", default=True, description="Enable Shared libs") - variant("openmp", default=False, description="Build with OpenMP support") - variant("deviceconst", default=False, description="Enables support for constant device memory") - variant("examples", default=True, description="Build Umpire Examples") - variant( - "tests", - default="none", - values=("none", "basic", "benchmarks"), - multi=False, - description="Tests to run", - ) - variant("device_alloc", default=True, description="Build Umpire Device Allocator") - - depends_on("cmake@3.8:", type="build") - depends_on("cmake@3.9:", when="+cuda", type="build") - depends_on("cmake@3.14:", when="@2022.03.0:") - - # GEOS_EDIT_START - depends_on("blt@0.5.3:", type="build", when="@2023.06.0:") - # GEOS_EDIT_END - depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") - depends_on("blt@0.4.1", type="build", when="@6.0.0") - depends_on("blt@0.4.0:", type="build", when="@4.1.3:5.0.1") - depends_on("blt@0.3.6:", type="build", when="@:4.1.2") - - depends_on("camp", when="@5.0.0:") - depends_on("camp@0.2.2:0.2.3", when="@6.0.0") - depends_on("camp@0.1.0", when="@5.0.0:5.0.1") - depends_on("camp@2022.03.2:", when="@2022.03.0:") - # GEOS_EDIT_START - depends_on("camp@2023.06.0:", when="@2023.06.0:") - # GEOS_EDIT_END - depends_on("camp@main", when="@main") - depends_on("camp@main", when="@develop") - depends_on("camp+openmp", when="+openmp") - depends_on("camp~cuda", when="~cuda") - - with when("@5.0.0:"): - with when("+cuda"): - depends_on("camp+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("camp+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - with when("+rocm"): - depends_on("camp+rocm") - for arch_ in ROCmPackage.amdgpu_targets: - depends_on( - "camp+rocm amdgpu_target={0}".format(arch_), - when="amdgpu_target={0}".format(arch_), - ) - - conflicts("+numa", when="@:0.3.2") - conflicts("~c", when="+fortran", msg="Fortran API requires C API") - conflicts("+device_alloc", when="@:2022.03.0") - - # device allocator exports device code, which requires static libs - # currently only available for cuda. - conflicts("+shared", when="+cuda") - - # https://github.com/LLNL/Umpire/issues/653 - # This range looks weird, but it ensures the concretizer looks at it as a - # range, not as a concrete version, so that it also matches 10.3.* versions. - conflicts("%gcc@10.3.0:10.3", when="+cuda") - - def _get_sys_type(self, spec): - sys_type = spec.architecture - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - @property - def cache_name(self): - hostname = socket.gethostname() - if "SYS_TYPE" in env: - hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}.cmake".format( - hostname, - self._get_sys_type(self.spec), - self.spec.compiler.name, - self.spec.compiler.version, - ) - - def initconfig_compiler_entries(self): - spec = self.spec - entries = super().initconfig_compiler_entries() - - if "+rocm" in spec: - entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - if "+fortran" in spec and self.compiler.fc is not None: - entries.append(cmake_cache_option("ENABLE_FORTRAN", True)) - else: - entries.append(cmake_cache_option("ENABLE_FORTRAN", False)) - - entries.append(cmake_cache_option("{}ENABLE_C".format(option_prefix), "+c" in spec)) - - return entries - - def initconfig_hardware_entries(self): - spec = self.spec - entries = super().initconfig_hardware_entries() - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - if "+cuda" in spec: - entries.append(cmake_cache_option("ENABLE_CUDA", True)) - - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) - entries.append( - cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) - ) - flag = "-arch sm_{0}".format(cuda_arch[0]) - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", "{0}".format(flag))) - - entries.append( - cmake_cache_option( - "{}ENABLE_DEVICE_CONST".format(option_prefix), spec.satisfies("+deviceconst") - ) - ) - else: - entries.append(cmake_cache_option("ENABLE_CUDA", False)) - - if "+rocm" in spec: - entries.append(cmake_cache_option("ENABLE_HIP", True)) - entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) - hip_repair_cache(entries, spec) - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - entries.append( - cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) - ) - entries.append( - cmake_cache_string("CMAKE_HIP_ARCHITECTURES", "{0}".format(arch_str)) - ) - else: - entries.append(cmake_cache_option("ENABLE_HIP", False)) - - return entries - - def initconfig_package_entries(self): - spec = self.spec - entries = [] - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - # TPL locations - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# TPLs") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) - if spec.satisfies("@5.0.0:"): - entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) - entries.append(cmake_cache_option("{}ENABLE_NUMA".format(option_prefix), "+numa" in spec)) - # GEOS_EDIT_START - - # The wrong way to initialize OpenMP from spack upstream - # entries.append( - # cmake_cache_option("{}ENABLE_OPENMP".format(option_prefix), "+openmp" in spec) - # ) - entries.append(cmake_cache_option( - "ENABLE_OPENMP", "+openmp" in spec)) - # GEOS_EDIT_END - entries.append(cmake_cache_option("ENABLE_BENCHMARKS", "tests=benchmarks" in spec)) - entries.append( - cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) - ) - entries.append(cmake_cache_option("{}ENABLE_DOCS".format(option_prefix), False)) - entries.append( - cmake_cache_option("UMPIRE_ENABLE_DEVICE_ALLOCATOR", "+device_alloc" in spec) - ) - entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) - entries.append(cmake_cache_option("ENABLE_TESTS", "tests=none" not in spec)) - - return entries - - def cmake_args(self): - options = [] - return options - - def test(self): - """Perform stand-alone checks on the installed package.""" - if self.spec.satisfies("@:1") or not os.path.isdir(self.prefix.bin): - tty.info("Skipping: checks not installed in bin for v{0}".format(self.version)) - return - - # Run a subset of examples PROVIDED installed - # tutorials with readily checkable outputs. - checks = { - "malloc": ["99 should be 99"], - "recipe_dynamic_pool_heuristic": ["in the pool", "releas"], - "recipe_no_introspection": ["has allocated", "used"], - "strategy_example": ["Available allocators", "HOST"], - "tut_copy": ["Copied source data"], - "tut_introspection": ["Allocator used is HOST", "size of the allocation"], - "tut_memset": ["Set data from HOST"], - "tut_move": ["Moved source data", "HOST"], - "tut_reallocate": ["Reallocated data"], - "vector_allocator": [""], - } - - for exe in checks: - expected = checks[exe] - reason = "test: checking output from {0}".format(exe) - self.run_test( - exe, - [], - expected, - 0, - installed=False, - purpose=reason, - skip_missing=True, - work_dir=self.prefix.bin, - ) \ No newline at end of file From 9da3f99a8943f2f817f37c047e75779491999c19 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 8 Feb 2024 08:42:46 -0800 Subject: [PATCH 15/48] Remove fesapi support from spack --- .../spack_packages/packages/fesapi/package.py | 46 ------------------- .../spack_packages/packages/geosx/package.py | 4 -- 2 files changed, 50 deletions(-) delete mode 100644 scripts/spack_packages/packages/fesapi/package.py diff --git a/scripts/spack_packages/packages/fesapi/package.py b/scripts/spack_packages/packages/fesapi/package.py deleted file mode 100644 index 57a511f8..00000000 --- a/scripts/spack_packages/packages/fesapi/package.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class Fesapi(CMakePackage): - """Allow access in reading and writing to ENERGISTICS standards data - (mainly RESQML, some of WITSML™ and PRODML)""" - - git = "https://github.com/F2I-Consulting/fesapi.git" - url = "https://github.com/F2I-Consulting/fesapi/archive/refs/tags/v2.4.0.0.tar.gz" - - version("2.4.0.0", sha256="a711e8a1218c876a2799f4d05a9820da71eb5503b5d51b834fae98d9fe635381") - - depends_on("mpi") - depends_on("hdf5") - depends_on("boost@1.67.0") - depends_on("minizip") - - def cmake_args(self): - spec = self.spec - - cppflags = " ".join(spec.compiler_flags["cppflags"]) - cxxflags = cppflags + " ".join(spec.compiler_flags["cxxflags"]) - cmake_args = [ - self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc), - self.define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx), - self.define("CMAKE_CXX_FLAGS", cxxflags), - self.define("HDF5_ROOT", spec["hdf5"].prefix), - # fesAPI/spack can detect wrong HDF5 version otherwise - self.define("HDF5_VERSION", spec["hdf5"].version), - self.define("MINIZIP_INCLUDE_DIR", spec["minizip"].prefix.include + "/minizip"), - self.define("MINIZIP_LIBRARY_RELEASE", spec["minizip"].prefix.lib), - self.define("Boost_INCLUDE_DIR", spec["boost"].prefix.include), - self.define("WITH_EXAMPLE", "OFF"), - self.define("WITH_DOTNET_WRAPPING", "OFF"), - self.define("WITH_JAVA_WRAPPING", "OFF"), - self.define("WITH_PYTHON_WRAPPING", "OFF"), - self.define("WITH_RESQML2_2", "OFF"), - self.define("WITH_TEST", "OFF"), - ] - - return cmake_args diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index c0d8fc8d..daf721c0 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -58,7 +58,6 @@ class Geosx(CMakePackage, CudaPackage): variant('shared', default=True, description='Build Shared Libs.') variant('caliper', default=True, description='Build Caliper support.') variant('vtk', default=True, description='Build VTK support.') - variant('fesapi', default=False, description='Build fesapi support.') variant('trilinos', default=True, description='Build Trilinos support.') variant('hypre', default=True, description='Build HYPRE support.') variant('petsc', default=False, description='Build PETSc support.') @@ -128,8 +127,6 @@ class Geosx(CMakePackage, CudaPackage): depends_on('fmt@10.0.0 cxxstd=14') depends_on('vtk@9.2.6', when='+vtk') - depends_on('fesapi', when='+fesapi') - # # Math # @@ -386,7 +383,6 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): ('silo', 'SILO', True), ('pugixml', 'PUGIXML', True), ('vtk', 'VTK', '+vtk' in spec), - ('fesapi', 'FESAPI', '+fesapi' in spec), ('fmt', 'FMT', True) ) # yapf: enable From 3884ee9b37e3de7a95b0f419a657f6d104998cde Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 8 Feb 2024 08:46:08 -0800 Subject: [PATCH 16/48] Remove toss_3 recipe (no more toss_3 systems) --- .../spack_configs/toss_3_x86_64_ib/spack.yaml | 194 ------------------ 1 file changed, 194 deletions(-) delete mode 100644 scripts/spack_configs/toss_3_x86_64_ib/spack.yaml diff --git a/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml deleted file mode 100644 index ce601ad9..00000000 --- a/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml +++ /dev/null @@ -1,194 +0,0 @@ -#------------------------------------------------------------------------------------------------------------ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright (c) 2018-2020 Lawrence Livermore National Security LLC -# Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University -# Copyright (c) 2018-2020 TotalEnergies -# Copyright (c) 2019- GEOSX Contributors -# All rights reserved -# -# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. -#------------------------------------------------------------------------------------------------------------ - -# geosx@develop%clang@10.0.0 -# -# Uberenv command to build pygeosx dependencies: -# python3 ./scripts/uberenv/uberenv.py --spec="%clang@10.0.0" - -spack: - config: - install_tree: - root: $spack/.. - projections: - all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' - misc_cache: $spack/../misc_cache - test_stage: $spack/../test_stage - build_stage:: - - $spack/../build_stage - - # Regular TPLs do not need views - view: false - - compilers:: - - compiler: - spec: clang@10.0.0 - paths: - cc: /usr/tce/packages/clang/clang-10.0.0/bin/clang - cxx: /usr/tce/packages/clang/clang-10.0.0/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - flags: - cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 - cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: clang@10.0.1 - paths: - cc: /usr/tce/packages/clang/clang-10.0.1/bin/clang - cxx: /usr/tce/packages/clang/clang-10.0.1/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - flags: - cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 - cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: gcc@8.1.0 - paths: - cc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.1.0/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - flags: {} - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: intel@19.1.2 - paths: - cc: /usr/tce/packages/intel/intel-19.1.2/bin/icc - cxx: /usr/tce/packages/intel/intel-19.1.2/bin/icpc - f77: /usr/tce/packages/intel/intel-19.1.2/bin/ifort - fc: /usr/tce/packages/intel/intel-19.1.2/bin/ifort - flags: - cflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - cxxflags: -gxx-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ - fflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - packages: - all: - target: [ivybridge] - compiler: [gcc, clang, intel] - providers: - mpi: [mvapich2] - blas: [intel-mkl] - lapack: [intel-mkl] - - # Lock down which MPI we are using - mvapich2: - buildable: False - externals: - - spec: mvapich2@2.3%gcc@8.3.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/ - - spec: mvapich2@2.3%clang@10.0.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.1 - - # Lock down blas, lapack implementation - intel-mkl: - buildable: False - externals: - - spec: intel-mkl@2020.0.166 threads=openmp - prefix: /usr/tce/packages/mkl/mkl-2020.0/ - - # System level packages to not build - papi: - buildable: False - externals: - - spec: papi@5.5.1 - prefix: /usr/tce/packages/papi/papi-5.5.1/ - cmake: - version: [3.23.1] - buildable: false - externals: - - spec: cmake@3.23.1 - prefix: /usr/tce/packages/cmake/cmake-3.23.1 - readline: - externals: - - spec: readline@7.0 - prefix: /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/readline-7.0-e5jqqjmcjknidgwvi353pd6umpixzxr2 - buildable: false - zlib: - buildable: False - externals: - - spec: zlib@1.2.7 - prefix: /usr - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr - perl: - buildable: false - externals: - - spec: perl@5.16.3 - prefix: /usr - pkg-config: - buildable: false - externals: - - spec: pkg-config@0.27.1 - prefix: /usr - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin - python: - buildable: False - externals: - - spec: python@3.8.2 - prefix: /usr/tce/packages/python/python-3.8.2/ - py-sphinx: - buildable: False - externals: - - spec: py-sphinx@1.6.3 - prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ - autoconf: - buildable: False - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - buildable: False - externals: - - spec: automake@1.13.4 - prefix: /usr - libtool: - buildable: False - externals: - - spec: libtool@2.4.2 - prefix: /usr - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr - flex: - buildable: False - externals: - - spec: flex@2.5.37 - prefix: /usr From e45a801c6fbd8358068f80ee8e960aaa6955e6c6 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 8 Feb 2024 10:35:48 -0800 Subject: [PATCH 17/48] hypre update --- scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml | 2 +- scripts/spack_configs/toss_4_x86_64_ib/spack.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml index 685241bb..56d7d9a6 100644 --- a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -91,7 +91,7 @@ spack: require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" hypre: - require: "@git.57bfb26e268ddf003668c5d0b5938ae258922a83" + require: "@git.eab5f9f7f18e5a5c6de34b7652b6ee5b9407d597" chai: require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" diff --git a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml index d68e6238..6551690c 100644 --- a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml +++ b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml @@ -72,7 +72,7 @@ spack: require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" hypre: - require: "@git.57bfb26e268ddf003668c5d0b5938ae258922a83" + require: "@git.eab5f9f7f18e5a5c6de34b7652b6ee5b9407d597" chai: require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" From 615fc7d336af542672c7f0c01ffeb8f15600a412 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 6 Mar 2024 15:49:05 -0800 Subject: [PATCH 18/48] Remove unneeded dependencies for pygeosx, add recommendation to build python3 using Linux package manager > spack --- .../packages/py-pydata-sphinx-theme/package.py | 17 ----------------- .../py-sphinxcontrib-plantuml/package.py | 17 ----------------- .../spack_packages/packages/pygeosx/package.py | 8 ++++++-- 3 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py delete mode 100644 scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py diff --git a/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py b/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py deleted file mode 100644 index 2d922924..00000000 --- a/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - -class PyPydataSphinxTheme(PythonPackage): - """A clean, three-column, Bootstrap-based Sphinx theme by and for the PyData community""" - - homepage = "https://github.com/pydata/pydata-sphinx-theme" - pypi = "pydata-sphinx-theme/pydata_sphinx_theme-0.13.3.tar.gz" - - version("0.13.3", sha256="827f16b065c4fd97e847c11c108bf632b7f2ff53a3bca3272f63f3f3ff782ecc") - - depends_on("python", type=("build", "run")) - depends_on("py-setuptools", type="build") \ No newline at end of file diff --git a/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py b/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py deleted file mode 100644 index de642a3d..00000000 --- a/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - -class PySphinxcontribPlantuml(PythonPackage): - """PlantUML for Sphinx""" - - homepage = "https://github.com/sphinx-contrib/plantuml" - pypi = "sphinxcontrib-plantuml/sphinxcontrib-plantuml-0.26.tar.gz" - - version("0.26", sha256="adb3397d5cb0613632cd3dad7894381422bac24464c393cb050404dd6712b1a7") - - depends_on("python", type=("build", "run")) - depends_on("py-setuptools", type="build") \ No newline at end of file diff --git a/scripts/spack_packages/packages/pygeosx/package.py b/scripts/spack_packages/packages/pygeosx/package.py index 723ad48c..aaa1ddc4 100644 --- a/scripts/spack_packages/packages/pygeosx/package.py +++ b/scripts/spack_packages/packages/pygeosx/package.py @@ -6,7 +6,10 @@ from spack import * class Pygeosx(BundlePackage): - """This is a set of libraries necessary for the pygeosx ATS environment""" + """This is a set of libraries necessary for the pygeosx ATS environment. + NOTE: It is recommended to download and install python3 and package + dependencies using your Linux distribution's package manager (Spack + builds of python tend to be much slower). """ version('fakeversion') @@ -18,4 +21,5 @@ class Pygeosx(BundlePackage): depends_on("openblas") depends_on("py-matplotlib") depends_on("py-sphinx") - depends_on("py-sphinx-argparse") \ No newline at end of file + depends_on("py-sphinx-argparse") + depends_on("py-test") From 50a73749fe01dae19fda4c1428a7c6d703facbe4 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 4 Apr 2024 08:32:15 -0700 Subject: [PATCH 19/48] Attempt to add openmp variant --- .../spack_packages/packages/geosx/package.py | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index daf721c0..e31e1e04 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -55,6 +55,7 @@ class Geosx(CMakePackage, CudaPackage): # SPHINX_BEGIN_VARIANTS + variant('openmp', default=True, description='Build with OpenMP support.') variant('shared', default=True, description='Build Shared Libs.') variant('caliper', default=True, description='Build Caliper support.') variant('vtk', default=True, description='Build VTK support.') @@ -96,11 +97,17 @@ class Geosx(CMakePackage, CudaPackage): # # Performance portability # - depends_on('raja +openmp~examples~exercises~shared') + depends_on('raja ~examples~exercises~shared') + depends_on("raja~openmp", when="~openmp") + depends_on("raja+openmp", when="+openmp") - depends_on('umpire +c+openmp~examples+fortran~device_alloc~shared') + depends_on('umpire +c~examples+fortran~device_alloc~shared') + depends_on("umpire~openmp", when="~openmp") + depends_on("umpire+openmp", when="+openmp") - depends_on('chai +raja+openmp~examples~shared') + depends_on('chai +raja~examples~shared') + depends_on("chai~openmp", when="~openmp") + depends_on("chai+openmp", when="+openmp") depends_on('camp') @@ -132,19 +139,26 @@ class Geosx(CMakePackage, CudaPackage): # depends_on('parmetis@4.0.3+int64') - depends_on('superlu-dist +int64+openmp') + depends_on('superlu-dist +int64') + depends_on("superlu-dist~openmp", when="~openmp") + depends_on("superlu-dist+openmp", when="+openmp") depends_on('scotch@7.0.3 +mpi +int64', when='+scotch') - depends_on('suite-sparse@5.10.1+openmp') + depends_on('suite-sparse@5.10.1') + depends_on("suite-sparse~openmp", when="~openmp") + depends_on("suite-sparse+openmp", when="+openmp") - trilinos_build_options = '+openmp' trilinos_packages = '+aztec+stratimikos~amesos2~anasazi~belos~ifpack2~muelu~sacado+thyra' - depends_on('trilinos@13.4.1 ' + trilinos_build_options + trilinos_packages, when='+trilinos') + depends_on('trilinos@13.4.1 ' + trilinos_packages, when='+trilinos') + depends_on("trilinos~openmp", when="~openmp") + depends_on("trilinos+openmp", when="+openmp") - depends_on("hypre +superlu-dist+mixedint+mpi+openmp", when='+hypre~cuda') + depends_on("hypre +superlu-dist+mixedint+mpi", when='+hypre~cuda') - depends_on("hypre +cuda+superlu-dist+mixedint+mpi+openmp+umpire+unified-memory cxxflags='-fPIC'", when='+hypre+cuda') + depends_on("hypre +cuda+superlu-dist+mixedint+mpi+umpire+unified-memory cxxflags='-fPIC'", when='+hypre+cuda') + depends_on("hypre~openmp", when="~openmp") + depends_on("hypre+openmp", when="+openmp") with when('+cuda'): for sm_ in CudaPackage.cuda_arch_values: depends_on('hypre+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) @@ -324,7 +338,10 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write("# OpenMP\n") cfg.write("#{0}\n\n".format("-" * 80)) - cfg.write(cmake_cache_option('ENABLE_OPENMP', True)) + if '+openmp' in spec: + cfg.write(cmake_cache_option('ENABLE_OPENMP', True)) + else: + cfg.write(cmake_cache_option('ENABLE_OPENMP', False)) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Cuda\n') From 081a2c4f51baaf40819c308a0dbbb0603e7669b2 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 11 Apr 2024 11:01:42 -0700 Subject: [PATCH 20/48] Try adding fPIC to cflag as well... --- scripts/spack_packages/packages/geosx/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index e31e1e04..05ebaf9a 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -156,7 +156,7 @@ class Geosx(CMakePackage, CudaPackage): depends_on("hypre +superlu-dist+mixedint+mpi", when='+hypre~cuda') - depends_on("hypre +cuda+superlu-dist+mixedint+mpi+umpire+unified-memory cxxflags='-fPIC'", when='+hypre+cuda') + depends_on("hypre +cuda+superlu-dist+mixedint+mpi+umpire+unified-memory cflags='-fPIC' cxxflags='-fPIC'", when='+hypre+cuda') depends_on("hypre~openmp", when="~openmp") depends_on("hypre+openmp", when="+openmp") with when('+cuda'): From 6c93a565c0d15ed8460c5bd9c53dfc6e95b86815 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 24 Apr 2024 14:18:27 -0700 Subject: [PATCH 21/48] Guard the cuda release flags --- scripts/spack_packages/packages/geosx/package.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 05ebaf9a..e9890ca0 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -372,8 +372,12 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS', cmake_cuda_flags)) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', '-O3 -DNDEBUG -Xcompiler -DNDEBUG -Xcompiler -O3 -Xcompiler -mcpu=powerpc64le -Xcompiler -mtune=powerpc64le')) + # System specific flags + if sys_type in ('linux-rhel7-ppc64le', 'linux-rhel8-ppc64le', 'blueos_3_ppc64le_ib_p9'): + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', '-O3 -DNDEBUG -Xcompiler -DNDEBUG -Xcompiler -O3 -Xcompiler -mcpu=powerpc64le -Xcompiler -mtune=powerpc64le')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', '-g -lineinfo ${CMAKE_CUDA_FLAGS_RELEASE}')) + cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', '-g -G -O0 -Xcompiler -O0')) else: From 90c59d2594a23f5ea601cbc86f8724cb829365a7 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 25 Apr 2024 14:30:26 -0700 Subject: [PATCH 22/48] Update hypre hash --- scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml | 2 +- scripts/spack_configs/toss_4_x86_64_ib/spack.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml index 56d7d9a6..0ca90a26 100644 --- a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -91,7 +91,7 @@ spack: require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" hypre: - require: "@git.eab5f9f7f18e5a5c6de34b7652b6ee5b9407d597" + require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" chai: require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" diff --git a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml index 6551690c..cd287cf6 100644 --- a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml +++ b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml @@ -72,7 +72,7 @@ spack: require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" hypre: - require: "@git.eab5f9f7f18e5a5c6de34b7652b6ee5b9407d597" + require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" chai: require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" From 15869e76a62868e8fc1d5f77339280d1df7cf125 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 16 May 2024 14:08:12 -0700 Subject: [PATCH 23/48] Try adding cached_cmake.py logic for determining MPIEXEC --- .../spack_packages/packages/geosx/package.py | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index e9890ca0..00336819 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -333,6 +333,48 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): else: cfg.write(cmake_cache_entry('MPIEXEC', 'jsrun')) cfg.write(cmake_cache_list('MPIEXEC_NUMPROC_FLAG', ['-g1', '--bind', 'rs', '-n'])) + else: + # Taken from cached_cmake class: + # https://github.com/spack/spack/blob/develop/lib/spack/spack/build_systems/cached_cmake.py#L180-234 + + # Check for slurm + using_slurm = False + slurm_checks = ["+slurm", "schedulers=slurm", "process_managers=slurm"] + if any(spec["mpi"].satisfies(variant) for variant in slurm_checks): + using_slurm = True + + # Determine MPIEXEC + if using_slurm: + if spec["mpi"].external: + # Heuristic until we have dependents on externals + mpiexec = "/usr/bin/srun" + else: + mpiexec = os.path.join(spec["slurm"].prefix.bin, "srun") + elif hasattr(spec["mpi"].package, "mpiexec"): + mpiexec = spec["mpi"].package.mpiexec + else: + mpiexec = os.path.join(spec["mpi"].prefix.bin, "mpirun") + if not os.path.exists(mpiexec): + mpiexec = os.path.join(spec["mpi"].prefix.bin, "mpiexec") + + if not os.path.exists(mpiexec): + msg = "Unable to determine MPIEXEC, %s tests may fail" % self.pkg.name + cfg.write("# {0}\n".format(msg)) + tty.warn(msg) + else: + # starting with cmake 3.10, FindMPI expects MPIEXEC_EXECUTABLE + # vs the older versions which expect MPIEXEC + if spec["cmake"].satisfies("@3.10:"): + cfg.write(cmake_cache_path("MPIEXEC_EXECUTABLE", mpiexec)) + else: + cfg.write(cmake_cache_path("MPIEXEC", mpiexec)) + + # Determine MPIEXEC_NUMPROC_FLAG + if using_slurm: + cfg.write(cmake_cache_string("MPIEXEC_NUMPROC_FLAG", "-n")) + else: + cfg.write(cmake_cache_string("MPIEXEC_NUMPROC_FLAG", "-np")) + cfg.write("#{0}\n".format("-" * 80)) cfg.write("# OpenMP\n") From f19e7ddcef7e7de2901e5b849f33313f7f4e74dd Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 13 Dec 2023 14:03:12 -0800 Subject: [PATCH 24/48] Testing spacked docker images --- .github/workflows/docker_build_tpls.yml | 1 + docker/Stanford/Dockerfile | 48 ++++- docker/TotalEnergies/Dockerfile | 52 ++++- docker/spack.yaml | 256 ++++++++++++++++++++++++ docker/stanford-spack.yaml | 168 ++++++++++++++++ docker/total-spack.yaml | 187 +++++++++++++++++ docker/tpl-centos-gcc-cuda.Dockerfile | 80 ++++---- docker/tpl-ubuntu-clang-cuda.Dockerfile | 73 +++---- docker/tpl-ubuntu-clang.Dockerfile | 79 +++++--- docker/tpl-ubuntu-gcc.Dockerfile | 84 +++++--- scripts/docker-build-and-push.sh | 5 + 11 files changed, 894 insertions(+), 139 deletions(-) create mode 100644 docker/spack.yaml create mode 100644 docker/stanford-spack.yaml create mode 100644 docker/total-spack.yaml diff --git a/.github/workflows/docker_build_tpls.yml b/.github/workflows/docker_build_tpls.yml index 58772621..0bc5abf4 100644 --- a/.github/workflows/docker_build_tpls.yml +++ b/.github/workflows/docker_build_tpls.yml @@ -89,6 +89,7 @@ jobs: DOCKER_COMPILER_BUILD_ARG: ${{ matrix.DOCKER_COMPILER_BUILD_ARG }} INSTALL_DIR_ROOT: ${{ matrix.INSTALL_DIR_ROOT || '/opt/GEOS' }} HOST_CONFIG: ${{ matrix.HOST_CONFIG || 'host-configs/environment.cmake'}} + SPEC: ${{ matrix.SPEC || 'undefined' }} DOCKER_ROOT_IMAGE: ${{ matrix.DOCKER_ROOT_IMAGE || 'undefined' }} PULL_REQUEST_NUMBER: ${{ github.event.number }} BUILD_NUMBER: ${{ github.run_number }} diff --git a/docker/Stanford/Dockerfile b/docker/Stanford/Dockerfile index 7615be1d..f7371227 100644 --- a/docker/Stanford/Dockerfile +++ b/docker/Stanford/Dockerfile @@ -15,7 +15,18 @@ RUN yum install -y \ ca-certificates \ curl \ python3 \ - zlib-devel + zlib-devel \ +# Additional spack dependencies + python3-pip \ + pkgconfig \ + # xz \ + unzip \ + bzip2 \ + && pip3 install virtualenv + +# Install clingo for Spack +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install clingo RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh @@ -29,20 +40,43 @@ RUN yum install -y \ file \ bison \ flex \ - patch + patch \ + ca-certificates \ + autoconf \ + automake \ + git -ARG HOST_CONFIG +ARG SPEC -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh -WORKDIR $BLD_DIR -RUN --mount=src=.,dst=$SRC_DIR make +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ + ./scripts/uberenv/uberenv.py \ + # spack spec defined per image + --spec "${SPEC}" \ + --spack-env-file=${SRC_DIR}/docker/stanford-spack.yaml \ + --project-json=.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack_env/ .spack-db/ FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain ARG SRC_DIR COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR -RUN yum -y install \ +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated.cmake / + +RUN yum install -y \ openssh-clients \ ca-certificates \ curl \ diff --git a/docker/TotalEnergies/Dockerfile b/docker/TotalEnergies/Dockerfile index 929cd081..2c796542 100644 --- a/docker/TotalEnergies/Dockerfile +++ b/docker/TotalEnergies/Dockerfile @@ -11,11 +11,22 @@ ARG SRC_DIR ARG INSTALL_DIR ENV GEOSX_TPL_DIR=$INSTALL_DIR -RUN yum install -y \ +RUN yum install --disablerepo=intel-mkl-repo -y \ ca-certificates \ curl \ python3 \ - zlib-devel + zlib-devel \ +# Additional spack dependencies + python3-pip \ + pkgconfig \ + # xz \ + unzip \ + bzip2 \ + && pip3 install virtualenv + +# Install clingo for Spack +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install clingo RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh @@ -23,26 +34,49 @@ FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain ARG SRC_DIR ARG BLD_DIR -RUN yum install -y \ +RUN yum install --disablerepo=intel-mkl-repo -y \ make \ bc \ file \ bison \ flex \ - patch + patch \ + ca-certificates \ + autoconf \ + automake \ + git -ARG HOST_CONFIG +ARG SPEC -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh -WORKDIR $BLD_DIR -RUN --mount=src=.,dst=$SRC_DIR make +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ + ./scripts/uberenv/uberenv.py \ + # spack spec defined per image + --spec "${SPEC}" \ + --spack-env-file=${SRC_DIR}/docker/total-spack.yaml \ + --project-json=.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack_env/ .spack-db/ FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain ARG SRC_DIR COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR -RUN yum -y install \ +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated.cmake / + +RUN yum install --disablerepo=intel-mkl-repo -y \ openssh-clients \ ca-certificates \ curl \ diff --git a/docker/spack.yaml b/docker/spack.yaml new file mode 100644 index 00000000..58489b0e --- /dev/null +++ b/docker/spack.yaml @@ -0,0 +1,256 @@ +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: ubuntu22.04 + paths: + cc: /usr/bin/clang-15 + cxx: /usr/bin/clang++-15 + f77: /usr/bin/gfortran-11 + fc: /usr/bin/gfortran-11 + spec: clang@15 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: ubuntu20.04 + paths: + cc: /usr/bin/clang + cxx: /usr/bin/clang++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + spec: clang@10 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: ubuntu22.04 + paths: + cc: /usr/bin/gcc-12 + cxx: /usr/bin/g++-12 + f77: /usr/bin/gfortran-12 + fc: /usr/bin/gfortran-12 + spec: gcc@12 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: ubuntu22.04 + paths: + cc: /usr/bin/gcc-11 + cxx: /usr/bin/g++-11 + f77: /usr/bin/gfortran-11 + fc: /usr/bin/gfortran-11 + spec: gcc@11 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: ubuntu20.04 + paths: + cc: /usr/bin/gcc-10 + cxx: /usr/bin/g++-10 + f77: /usr/bin/gfortran-10 + fc: /usr/bin/gfortran-10 + spec: gcc@10 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: ubuntu20.04 + paths: + cc: /usr/bin/gcc-9 + cxx: /usr/bin/g++-9 + f77: /usr/bin/gfortran-9 + fc: /usr/bin/gfortran-9 + spec: gcc@9 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: centos7 + paths: + cc: /opt/rh/devtoolset-8/root/usr/bin/gcc + cxx: /opt/rh/devtoolset-8/root/usr/bin/g++ + f77: /opt/rh/devtoolset-8/root/usr/bin/gfortran + fc: /opt/rh/devtoolset-8/root/usr/bin/gfortran + spec: gcc@8 + target: x86_64 + + packages: + all: + target: [x86_64] + compiler: [gcc, clang] + providers: + blas: [netlib-blas] + lapack: [netlib-lapack] + mpi: [openmpi] + + + blt: + require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + + hypre: + require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + + chai: + require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + + umpire: + require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + + raja: + require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + + camp: + require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + + uncrustify: + require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" + + superlu-dist: + require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" + + autoconf: + version: [2.71] + buildable: false + externals: + - spec: autoconf@2.71 + prefix: /usr + automake: + version: [1.16.5] + buildable: false + externals: + - spec: automake@1.16.5 + prefix: /usr + bison: + version: [3.8.2] + buildable: false + externals: + - spec: bison@3.8.2 + prefix: /usr + cmake: + version: [3.28.3] + buildable: false + externals: + - spec: cmake@3.28.3 + prefix: /usr/local + cuda: + buildable: False + externals: + - spec: cuda@11.8.0 +allow-unsupported-compilers + prefix: /usr/local/cuda + flex: + version: [2.6.4] + buildable: false + externals: + - spec: flex@2.6.4 + prefix: /usr + m4: + buildable: false + externals: + - spec: m4@1.4.18 + prefix: /usr + + # Spack may grab for mpi & we don't want to use them + mpi: + buildable: false + + netlib-lapack: + buildable: false + externals: + - spec: netlib-lapack@3.10.0 + prefix: /usr + netlib-blas: + buildable: false + externals: + - spec: netlib-blas@3.10.0 + prefix: /usr + openmpi: + externals: + - spec: openmpi@4.1.2%clang + prefix: /usr + - spec: openmpi@1.10.7%gcc@8 + prefix: /usr/lib64/openmpi + modules: [mpi] + - spec: openmpi@4.1.2%gcc@9 + prefix: /usr + - spec: openmpi@4.1.2%gcc@10 + prefix: /usr + - spec: openmpi@4.1.2%gcc@11 + prefix: /usr + - spec: openmpi@4.1.2%gcc@12 + prefix: /usr + perl: + buildable: false + externals: + - spec: perl@5.34.0 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@0.29.2 + prefix: /usr + py-sphinx: + buildable: false + externals: + - spec: py-sphinx@4.3.2 + prefix: /usr + python: + buildable: false + externals: + - spec: python@3.10.12 + prefix: /usr + tar: + buildable: false + externals: + - spec: tar@1.34 + prefix: /usr + unzip: + buildable: false + externals: + - spec: unzip@6.0 + prefix: /usr + xz: + buildable: false + externals: + - spec: xz@5.2.5 + prefix: /usr diff --git a/docker/stanford-spack.yaml b/docker/stanford-spack.yaml new file mode 100644 index 00000000..cb84a267 --- /dev/null +++ b/docker/stanford-spack.yaml @@ -0,0 +1,168 @@ +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + # Sherlock CPU/GPU Compiler + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: centos7 + paths: + cc: /share/software/user/open/gcc/10.1.0/bin/gcc + cxx: /share/software/user/open/gcc/10.1.0/bin/g++ + f77: /share/software/user/open/gcc/10.1.0/bin/gfortran + fc: /share/software/user/open/gcc/10.1.0/bin/gfortran + spec: gcc@10.1.0 + target: x86_64 + + packages: + all: + target: [x86_64] + compiler: [gcc, clang] + providers: + blas: [openblas] + lapack: [openblas] + mpi: [openmpi] + + + blt: + require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + + hypre: + require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + + chai: + require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + + umpire: + require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + + raja: + require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + + camp: + require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + + uncrustify: + require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" + + superlu-dist: + require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" + + autoconf: + version: [2.71] + buildable: false + externals: + - spec: autoconf@2.71 + prefix: /usr + automake: + version: [1.16.5] + buildable: false + externals: + - spec: automake@1.16.5 + prefix: /usr + bison: + version: [3.8.2] + buildable: false + externals: + - spec: bison@3.8.2 + prefix: /usr + cmake: + version: [3.28.3] + buildable: false + externals: + - spec: cmake@3.28.3 + prefix: /usr/local + cuda: + buildable: False + externals: + - spec: cuda@11.7.1 +allow-unsupported-compilers + prefix: /share/software/user/open/cuda/11.7.1/ + flex: + version: [2.6.4] + buildable: false + externals: + - spec: flex@2.6.4 + prefix: /usr + + # Lock down blas, lapack implementation + intel-mkl: + buildable: False + + openblas: + buildable: false + externals: + - spec: openblas@0.3.10 + prefix: /share/software/user/open/openblas/0.3.10/ + + blas: + buildable: false + + lapack: + buildable: false + + m4: + buildable: false + externals: + - spec: m4@1.4.18 + prefix: /usr + + # Spack may grab for mpi & we don't want to use them + mpi: + buildable: false + + openmpi: + externals: + # Sherlock CPU/GPU + - spec: openmpi@4.1.2%gcc@10.1.0 + prefix: /share/software/user/open/openmpi/4.1.2 + perl: + buildable: false + externals: + - spec: perl@5.34.0 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@0.29.2 + prefix: /usr + py-sphinx: + buildable: false + externals: + - spec: py-sphinx@4.3.2 + prefix: /usr + python: + buildable: false + externals: + - spec: python@3.10.12 + prefix: /usr + tar: + buildable: false + externals: + - spec: tar@1.34 + prefix: /usr + unzip: + buildable: false + externals: + - spec: unzip@6.0 + prefix: /usr + xz: + buildable: false + externals: + - spec: xz@5.2.5 + prefix: /usr diff --git a/docker/total-spack.yaml b/docker/total-spack.yaml new file mode 100644 index 00000000..dd1c6f97 --- /dev/null +++ b/docker/total-spack.yaml @@ -0,0 +1,187 @@ +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + # Pangea 2 compiler + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: centos7 + paths: + cc: /data_local/sw/gcc/RHEL7/8.3.0/bin/gcc + cxx: /data_local/sw/gcc/RHEL7/8.3.0/bin/g++ + f77: /data_local/sw/gcc/RHEL7/8.3.0/bin/gfortran + fc: /data_local/sw/gcc/RHEL7/8.3.0/bin/gfortran + spec: gcc@8.3.0 + target: x86_64 + # Pecan CPU/GPU compiler + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: centos7 + paths: + cc: /apps/gcc/8.2.0/x86_64/bin/gcc + cxx: /apps/gcc/8.2.0/x86_64/bin/g++ + f77: /apps/gcc/8.2.0/x86_64/bin/gfortran + fc: /apps/gcc/8.2.0/x86_64/bin/gfortran + spec: gcc@8.2.0 + target: x86_64 + + packages: + all: + target: [x86_64] + compiler: [gcc, clang] + providers: + blas: [intel-mkl] + lapack: [intel-mkl] + mpi: [openmpi] + + + blt: + require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + + hypre: + require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + + chai: + require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + + umpire: + require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + + raja: + require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + + camp: + require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + + uncrustify: + require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" + + superlu-dist: + require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" + + autoconf: + version: [2.71] + buildable: false + externals: + - spec: autoconf@2.71 + prefix: /usr + automake: + version: [1.16.5] + buildable: false + externals: + - spec: automake@1.16.5 + prefix: /usr + bison: + version: [3.8.2] + buildable: false + externals: + - spec: bison@3.8.2 + prefix: /usr + cmake: + version: [3.28.3] + buildable: false + externals: + - spec: cmake@3.28.3 + prefix: /usr/local + cuda: + buildable: False + externals: + - spec: cuda@11.5.1 +allow-unsupported-compilers + prefix: /hrtc/apps/cuda/11.5.119/x86_64/centos7 + flex: + version: [2.6.4] + buildable: false + externals: + - spec: flex@2.6.4 + prefix: /usr + + # Lock down blas, lapack implementation + intel-mkl: + buildable: False + externals: + # Pangea 2 + - spec: intel-mkl@2019.3.199%gcc@8.3.0 threads=openmp + prefix: /opt/intel/compilers_and_libraries_2019.3.199/linux/mkl/ + # Pecan CPU/GPU + - spec: intel-mkl@2019.5.281%gcc@8.2.0 threads=openmp + prefix: /opt/intel/compilers_and_libraries_2019.5.281/linux/mkl/ + blas: + buildable: false + + lapack: + buildable: false + + m4: + buildable: false + externals: + - spec: m4@1.4.18 + prefix: /usr + + # Spack may grab for mpi & we don't want to use them + mpi: + buildable: false + + openmpi: + externals: + # Pangea2 + - spec: openmpi@2.1.5%gcc@8.3.0 + prefix: /data_local/sw/OpenMPI/RHEL7/2.1.5/gcc/8.3.0 + # Pecan CPU/GPU + - spec: openmpi@4.0.1%gcc@8.2.0 + prefix: /hrtc/apps/mpi/openmpi/4.0.1/RDHPC/gcc/8.2.0 + perl: + buildable: false + externals: + - spec: perl@5.34.0 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@0.29.2 + prefix: /usr + py-sphinx: + buildable: false + externals: + - spec: py-sphinx@4.3.2 + prefix: /usr + python: + buildable: false + externals: + - spec: python@3.10.12 + prefix: /usr + tar: + buildable: false + externals: + - spec: tar@1.34 + prefix: /usr + unzip: + buildable: false + externals: + - spec: unzip@6.0 + prefix: /usr + xz: + buildable: false + externals: + - spec: xz@5.2.5 + prefix: /usr diff --git a/docker/tpl-centos-gcc-cuda.Dockerfile b/docker/tpl-centos-gcc-cuda.Dockerfile index a02b350a..3262c77f 100644 --- a/docker/tpl-centos-gcc-cuda.Dockerfile +++ b/docker/tpl-centos-gcc-cuda.Dockerfile @@ -41,29 +41,26 @@ RUN yum -y install \ lapack-devel \ zlib-devel \ openmpi-devel \ - python3 + python3 \ +# Additional spack dependencies + python3-pip \ + # pkgconfig \ + # xz \ + unzip \ + bzip2 \ + && pip3 install virtualenv + +# Install clingo for Spack +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install clingo RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh -ENV CC=/opt/rh/devtoolset-8/root/usr/bin/gcc \ - CXX=/opt/rh/devtoolset-8/root/usr/bin/g++ \ - MPICC=/usr/lib64/openmpi/bin/mpicc \ - MPICXX=/usr/lib64/openmpi/bin/mpicxx \ - MPIEXEC=/usr/lib64/openmpi/bin/mpirun -ENV OMPI_CC=$CC \ - OMPI_CXX=$CXX -ENV ENABLE_CUDA=ON \ - CMAKE_CUDA_FLAGS="-restrict -arch sm_70 --expt-extended-lambda -Werror cross-execution-space-call,reorder,deprecated-declarations" - # Installing TPL's FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain ARG SRC_DIR ARG BLD_DIR -ENV FC=/opt/rh/devtoolset-8/root/usr/bin/gfortran \ - MPIFC=/usr/lib64/openmpi/bin/mpifort -ENV OMPI_FC=$FC - RUN yum install -y \ tbb-devel \ make \ @@ -71,33 +68,42 @@ RUN yum install -y \ file \ bison \ flex \ - patch - -ARG HOST_CONFIG - -ARG CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -ARG CUDA_ARCH=sm_70 -ARG CMAKE_CUDA_COMPILER=$CUDA_TOOLKIT_ROOT_DIR/bin/nvcc -ARG CMAKE_CUDA_ARCHITECTURES=70 - -ENV HYPRE_CUDA_SM=70 -ENV CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR + patch \ + ca-certificates \ + autoconf \ + automake \ + git -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh \ - -DENABLE_CUDA=$ENABLE_CUDA \ - -DENABLE_HYPRE_DEVICE="CUDA" \ - -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR \ - -DCUDA_ARCH=$CUDA_ARCH \ - -DCMAKE_CUDA_ARCHITECTURES=$CMAKE_CUDA_ARCHITECTURES \ - -DCMAKE_CUDA_COMPILER=$CMAKE_CUDA_COMPILER -WORKDIR $BLD_DIR -RUN --mount=src=.,dst=$SRC_DIR make +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ +# Create symlink to openmpi include directory + ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include && \ + ./scripts/uberenv/uberenv.py \ + --spec "%gcc@8+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers ^caliper@2.10.0~gotcha~sampler~libunwind~libdw~papi" \ + --spack-env-file=${SRC_DIR}/docker/spack.yaml \ + --project-json=.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack_env/ .spack-db/ # Extract only TPL's from previous stage FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain ARG SRC_DIR COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR + +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated.cmake / + RUN yum install -y \ openssh-client \ ca-certificates \ @@ -105,7 +111,9 @@ RUN yum install -y \ python3 \ texlive \ graphviz \ - git + git && \ +# Regenerate symlink to openmpi include directory + ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-ninja.sh diff --git a/docker/tpl-ubuntu-clang-cuda.Dockerfile b/docker/tpl-ubuntu-clang-cuda.Dockerfile index 991ef500..c17c6385 100644 --- a/docker/tpl-ubuntu-clang-cuda.Dockerfile +++ b/docker/tpl-ubuntu-clang-cuda.Dockerfile @@ -24,56 +24,56 @@ RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime && \ openmpi-bin \ libopenmpi-dev \ python3 \ - clang + clang \ +# Additional spack dependencies + python3-pip \ + pkg-config \ + xz-utils \ + unzip \ + libmpfr-dev \ + lbzip2 \ + virtualenv + +# Install clingo for Spack +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install clingo RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh -ENV CC=/usr/bin/clang \ - CXX=/usr/bin/clang++ \ - MPICC=/usr/bin/mpicc \ - MPICXX=/usr/bin/mpicxx \ - MPIEXEC=/usr/bin/mpirun -ENV OMPI_CC=$CC \ - OMPI_CXX=$CXX -ENV ENABLE_CUDA=ON \ - CMAKE_CUDA_FLAGS="-restrict -arch sm_70 --expt-extended-lambda -Werror cross-execution-space-call,reorder,deprecated-declarations" - # Installing TPL's FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain ARG SRC_DIR ARG BLD_DIR -ENV FC=/usr/bin/gfortran \ - MPIFC=/usr/bin/mpifort -ENV OMPI_FC=$FC - RUN apt-get install -y --no-install-recommends \ libtbb-dev \ bc \ file \ bison \ flex \ - patch - -ARG HOST_CONFIG - -ARG CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -ARG CUDA_ARCH=sm_70 -ARG CMAKE_CUDA_COMPILER=$CUDA_TOOLKIT_ROOT_DIR/bin/nvcc -ARG CMAKE_CUDA_ARCHITECTURES=70 - -ENV HYPRE_CUDA_SM=70 -ENV CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR + patch \ + ca-certificates \ + git + +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ + ./scripts/uberenv/uberenv.py \ + --spec "%clang@10+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers ^caliper@2.10.0~gotcha~sampler~libunwind~libdw~papi" \ + --spack-env-file=${SRC_DIR}/docker/spack.yaml \ + --project-json=.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack_env/ .spack-db/ -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh \ - -DENABLE_CUDA=$ENABLE_CUDA \ - -DENABLE_HYPRE_DEVICE="CUDA" \ - -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR \ - -DCUDA_ARCH=$CUDA_ARCH \ - -DCMAKE_CUDA_ARCHITECTURES=$CMAKE_CUDA_ARCHITECTURES \ - -DCMAKE_CUDA_COMPILER=$CMAKE_CUDA_COMPILER -WORKDIR $BLD_DIR -RUN --mount=src=.,dst=$SRC_DIR make # Extract only TPL's from previous stage FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain @@ -81,6 +81,9 @@ ARG SRC_DIR COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated.cmake / + RUN apt-get install -y --no-install-recommends \ openssh-client \ ca-certificates \ diff --git a/docker/tpl-ubuntu-clang.Dockerfile b/docker/tpl-ubuntu-clang.Dockerfile index ab7c6aee..e25e85d5 100644 --- a/docker/tpl-ubuntu-clang.Dockerfile +++ b/docker/tpl-ubuntu-clang.Dockerfile @@ -19,6 +19,7 @@ RUN apt-get update RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ apt-get install -y --no-install-recommends \ clang-$CLANG_MAJOR_VERSION \ + libomp-$CLANG_MAJOR_VERSION-dev \ ca-certificates \ curl \ libtbb2 \ @@ -27,18 +28,24 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ zlib1g-dev \ openmpi-bin \ libopenmpi-dev \ - python3 - + python3 \ + python3-pip \ + python3-sphinx \ + doxygen \ + pkg-config \ + xz-utils \ + unzip \ + libmpfr-dev \ + lbzip2 \ + virtualenv + +# Install clingo for Spack +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install clingo + +# Install CMake RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh -ENV CC=/usr/bin/clang-$CLANG_MAJOR_VERSION \ - CXX=/usr/bin/clang++-$CLANG_MAJOR_VERSION \ - MPICC=/usr/bin/mpicc \ - MPICXX=/usr/bin/mpicxx \ - MPIEXEC=/usr/bin/mpirun -ENV OMPI_CC=$CC \ - OMPI_CXX=$CXX - # Installing TPLs FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain ARG SRC_DIR @@ -46,10 +53,6 @@ ARG BLD_DIR ARG GCC_MAJOR_VERSION -ENV FC=/usr/bin/gfortran-$GCC_MAJOR_VERSION \ - MPIFC=/usr/bin/mpifort -ENV OMPI_FC=$FC - RUN apt-get install -y --no-install-recommends \ gfortran-$GCC_MAJOR_VERSION \ libtbb-dev \ @@ -58,13 +61,30 @@ RUN apt-get install -y --no-install-recommends \ file \ bison \ flex \ - patch - -ARG HOST_CONFIG - -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh -WORKDIR $BLD_DIR -RUN --mount=src=.,dst=$SRC_DIR make +# GEOS patches some tpl. Remove when it's not the case anymore. + patch \ +# `ca-certificates` needed by `git` to download spack repo. + ca-certificates \ + git + +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ + ./scripts/uberenv/uberenv.py \ + --spec "%clang@${CLANG_MAJOR_VERSION} ~openmp+docs ^caliper@2.10.0~gotcha~sampler~libunwind~libdw~papi" \ + --spack-env-file=${SRC_DIR}/docker/spack.yaml \ + --project-json=.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack_env/ .spack-db/ # Extract only TPLs from previous stage FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain @@ -72,7 +92,11 @@ ARG SRC_DIR COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR -RUN apt-get install -y --no-install-recommends \ +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated.cmake / + +RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ + apt-get install -y --no-install-recommends \ openssh-client \ ca-certificates \ curl \ @@ -83,7 +107,16 @@ RUN apt-get install -y --no-install-recommends \ libxml2-utils \ git \ ghostscript \ - ninja-build + ninja-build \ +## Necessary dependencies for pygeosx unit tests + python3-dev \ + python3-sphinx \ + python3-mpi4py \ + python3-scipy \ + python3-virtualenv \ + python3-matplotlib \ + python3-venv \ + python3-pytest RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-sccache.sh ENV SCCACHE=/opt/sccache/bin/sccache diff --git a/docker/tpl-ubuntu-gcc.Dockerfile b/docker/tpl-ubuntu-gcc.Dockerfile index c3117ed5..f73f7004 100644 --- a/docker/tpl-ubuntu-gcc.Dockerfile +++ b/docker/tpl-ubuntu-gcc.Dockerfile @@ -52,20 +52,23 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ # And we want to test GEOSX's python configuration script. # Unfortunately argparse (standard library's package used by GEOSX) # is not in the python-minimal package so we install the whole std lib. - python3 + python3 \ + python3-pip \ + python3-sphinx \ + doxygen \ + pkg-config \ + xz-utils \ + unzip \ + libmpfr-dev \ + lbzip2 \ + virtualenv + +# Install clingo for Spack +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install clingo RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh -ENV CC=/usr/bin/gcc-$GCC_MAJOR_VERSION \ - CXX=/usr/bin/g++-$GCC_MAJOR_VERSION \ - MPICC=/usr/bin/mpicc \ - MPICXX=/usr/bin/mpicxx \ - MPIEXEC=/usr/bin/mpirun -# The multi-line definition of arguments does not seem happy -# when a variable uses the value of another variable previously defined on the same line. -ENV OMPI_CC=$CC \ - OMPI_CXX=$CXX - # This stage is dedicated to TPLs uniquely. # A multi-stage build patern will allow to extract what we need for the GEOSX build. FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain @@ -76,11 +79,6 @@ ARG BLD_DIR # It is repeated because docker forgets about the ARGs after FROM statements. ARG GCC_MAJOR_VERSION -ENV FC=/usr/bin/gfortran-$GCC_MAJOR_VERSION \ - MPIFC=/usr/bin/mpifort -# Again, troublesome multi-line definition. -ENV OMPI_FC=$FC - RUN apt-get install -y --no-install-recommends \ libtbb-dev \ gfortran-$GCC_MAJOR_VERSION \ @@ -89,16 +87,31 @@ RUN apt-get install -y --no-install-recommends \ file \ bison \ flex \ - patch - -# Get host config file from docker build arguments -ARG HOST_CONFIG - -# We now configure the build... -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh -# ... before we compile the TPLs! -WORKDIR $BLD_DIR -RUN --mount=src=.,dst=$SRC_DIR make +# GEOS patches some tpl. Remove when it's not the case anymore. + patch \ +# `ca-certificates` needed by `git` to download spack repo. + ca-certificates \ + git + + +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ + ./scripts/uberenv/uberenv.py \ + --spec "%gcc@${GCC_MAJOR_VERSION} +docs" \ + --spack-env-file=${SRC_DIR}/docker/spack.yaml \ + --project-json=${SRC_DIR}/.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack-env/ .spack-db/ # Last step is setting everything for a complete slave that will build GEOSX. FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain @@ -107,9 +120,13 @@ ARG SRC_DIR # I extract the deployed TPLs from the TPL building stqge. COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated.cmake / + # Any tool specific to building GEOSX shall be installed in this stage. -RUN apt-get install -y --no-install-recommends \ - openssh-client \ +RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ + apt-get install -y --no-install-recommends \ + openssh-client \ # `ca-certificates` is needed by `sccache` to download the cached compilations. ca-certificates \ curl \ @@ -120,7 +137,16 @@ RUN apt-get install -y --no-install-recommends \ libxml2-utils \ git \ ghostscript \ - ninja-build + ninja-build \ +# Necessary dependencies for pygeosx unit tests + python3-dev \ + python3-sphinx \ + python3-mpi4py \ + python3-scipy \ + python3-virtualenv \ + python3-matplotlib \ + python3-venv \ + python3-pytest # Install `sccache` binaries to speed up the build of `geos` RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-sccache.sh diff --git a/scripts/docker-build-and-push.sh b/scripts/docker-build-and-push.sh index 8c34a7b4..297806a7 100644 --- a/scripts/docker-build-and-push.sh +++ b/scripts/docker-build-and-push.sh @@ -3,6 +3,10 @@ env # We save memory for the docker context echo .git > .dockerignore + +# Get uberenv submodule +git submodule update --init scripts/uberenv + # This script will build and push a DOCKER_REPOSITORY:DOCKER_TAG image build from DOCKERFILE # with (optional) DOCKER_COMPILER_BUILD_ARG build arguments. # A specific host-config file can be defined through variable HOST_CONFIG. @@ -19,6 +23,7 @@ docker build ${DOCKER_COMPILER_BUILD_ARG} \ --build-arg HOST_CONFIG=${HOST_CONFIG} \ --build-arg DOCKER_ROOT_IMAGE=${DOCKER_ROOT_IMAGE} \ --build-arg INSTALL_DIR=${INSTALL_DIR} \ +--build-arg SPEC="${SPEC}" \ --tag ${DOCKER_REPOSITORY}:${DOCKER_TAG} \ --file ${DOCKERFILE} \ --label "org.opencontainers.image.created=$(date --rfc-3339=seconds)" \ From b904228f8ed123f32ada3bbd6f509bec39d085f1 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 29 Aug 2024 08:18:52 -0700 Subject: [PATCH 25/48] Added uberenv as submodule --- .gitmodules | 3 +++ scripts/uberenv | 1 + 2 files changed, 4 insertions(+) create mode 160000 scripts/uberenv diff --git a/.gitmodules b/.gitmodules index 71c162e1..b88da2f1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "cmake/blt"] path = cmake/blt url = ../../LLNL/blt.git +[submodule "scripts/uberenv"] + path = scripts/uberenv + url = ../../LLNL/uberenv.git diff --git a/scripts/uberenv b/scripts/uberenv new file mode 160000 index 00000000..205672b8 --- /dev/null +++ b/scripts/uberenv @@ -0,0 +1 @@ +Subproject commit 205672b8b2520d7dc69acefe8738960cd5db0937 From 9949b579655543ffd54f539a5c9dc1a0e5292342 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 11 Jul 2024 11:05:58 -0700 Subject: [PATCH 26/48] Try rocky --- docker/rocky-spack.yaml | 159 ++++++++++++++++++ .../tpl-rockylinux-clang-cuda-12.Dockerfile | 133 ++++++++++----- .../spack_packages/packages/geosx/package.py | 2 +- 3 files changed, 248 insertions(+), 46 deletions(-) create mode 100644 docker/rocky-spack.yaml diff --git a/docker/rocky-spack.yaml b/docker/rocky-spack.yaml new file mode 100644 index 00000000..ba20a4b9 --- /dev/null +++ b/docker/rocky-spack.yaml @@ -0,0 +1,159 @@ +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: rocky8 + paths: + cc: /usr/bin/clang + cxx: /usr/bin/clang++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + spec: clang@17.0.6 + target: x86_64 + + packages: + all: + target: [x86_64] + compiler: [gcc, clang] + providers: + blas: [netlib-blas] + lapack: [netlib-lapack] + mpi: [openmpi] + + + blt: + require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + + hypre: + require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + + chai: + require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + + umpire: + require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + + raja: + require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + + camp: + require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + + uncrustify: + require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" + + superlu-dist: + require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" + + autoconf: + version: [2.71] + buildable: false + externals: + - spec: autoconf@2.71 + prefix: /usr + automake: + version: [1.16.5] + buildable: false + externals: + - spec: automake@1.16.5 + prefix: /usr + bison: + version: [3.8.2] + buildable: false + externals: + - spec: bison@3.8.2 + prefix: /usr + cmake: + version: [3.28.3] + buildable: false + externals: + - spec: cmake@3.28.3 + prefix: /usr/local + cuda: + buildable: False + externals: + - spec: cuda@12.5.0 +allow-unsupported-compilers + prefix: /usr/local/cuda + flex: + version: [2.6.4] + buildable: false + externals: + - spec: flex@2.6.4 + prefix: /usr + m4: + buildable: false + externals: + - spec: m4@1.4.18 + prefix: /usr + + # Spack may grab for mpi & we don't want to use them + mpi: + buildable: false + + netlib-lapack: + buildable: false + externals: + - spec: netlib-lapack@3.8.0 + prefix: /usr + netlib-blas: + buildable: false + externals: + - spec: netlib-blas@3.8.0 + prefix: /usr + openmpi: + externals: + - spec: openmpi@4.1.1 + prefix: /usr/lib64/openmpi + perl: + buildable: false + externals: + - spec: perl@5.26.3 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@1.4.2 + prefix: /usr + py-sphinx: + buildable: false + externals: + - spec: py-sphinx@4.3.2 + prefix: /usr + python: + buildable: false + externals: + - spec: python@3.6.8 + prefix: /usr + tar: + buildable: false + externals: + - spec: tar@1.34 + prefix: /usr + unzip: + buildable: false + externals: + - spec: unzip@6.0 + prefix: /usr + xz: + buildable: false + externals: + - spec: xz@5.2.5 + prefix: /usr diff --git a/docker/tpl-rockylinux-clang-cuda-12.Dockerfile b/docker/tpl-rockylinux-clang-cuda-12.Dockerfile index 96d13da2..64a40915 100644 --- a/docker/tpl-rockylinux-clang-cuda-12.Dockerfile +++ b/docker/tpl-rockylinux-clang-cuda-12.Dockerfile @@ -22,47 +22,58 @@ RUN dnf clean all && \ blas \ lapack \ openmpi \ - openmpi-devel + openmpi-devel \ + # Additional spack dependencies + python3-pip \ + unzip \ + mpfr-devel \ + bzip2 \ + xz \ + python3-virtualenv RUN dnf config-manager --set-enabled & - + +# Install clingo for Spack +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install clingo + # Find the location of mpicc, blas and lapack and add to PATH -RUN MPI_PATH=$(find /usr -name mpicc | head -n 1) && \ - MPI_DIR=$(dirname $MPI_PATH) && \ - BLAS_DIR=$(find / -name "libblas*") && \ - LAPACK_DIR=$(find -name "liblapack*") && \ - echo "MPI binary directory: $MPI_DIR" && \ - echo "Blas directory: $BLAS_DIR" && \ - echo "Lapack directory: $LAPACK_DIR" && \ - export PATH=$PATH:$MPI_DIR && \ - export PATH=$PATH:$BLAS_DIR && \ - export PATH=$PATH:$LAPACK_DIR && \ - echo $PATH +#RUN MPI_PATH=$(find /usr -name mpicc | head -n 1) && \ +# MPI_DIR=$(dirname $MPI_PATH) && \ +# BLAS_DIR=$(find / -name "libblas*") && \ +# LAPACK_DIR=$(find -name "liblapack*") && \ +# echo "MPI binary directory: $MPI_DIR" && \ +# echo "Blas directory: $BLAS_DIR" && \ +# echo "Lapack directory: $LAPACK_DIR" && \ +# export PATH=$PATH:$MPI_DIR && \ +# export PATH=$PATH:$BLAS_DIR && \ +# export PATH=$PATH:$LAPACK_DIR && \ +# echo $PATH RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh -ENV CC=/usr/bin/clang \ - CXX=/usr/bin/clang++ \ - MPICC=/usr/lib64/openmpi/bin/mpicc \ - MPICXX=/usr/lib64/openmpi/bin/mpicxx \ - MPIEXEC=/usr/lib64/openmpi/bin/mpirun \ - BLAS_LIBRARIES="/usr/lib64/libblas.so.3.8.0" \ - LAPACK_LIBRARIES="/usr/lib64/liblapack.so.3.8.0" +#ENV CC=/usr/bin/clang \ +# CXX=/usr/bin/clang++ \ +# MPICC=/usr/lib64/openmpi/bin/mpicc \ +# MPICXX=/usr/lib64/openmpi/bin/mpicxx \ +# MPIEXEC=/usr/lib64/openmpi/bin/mpirun \ +# BLAS_LIBRARIES="/usr/lib64/libblas.so.3.8.0" \ +# LAPACK_LIBRARIES="/usr/lib64/liblapack.so.3.8.0" -ENV OMPI_CC=$CC \ - OMPI_CXX=$CXX +#ENV OMPI_CC=$CC \ +# OMPI_CXX=$CXX -ENV ENABLE_CUDA=ON \ - CMAKE_CUDA_FLAGS="-restrict -arch sm_70 --expt-extended-lambda -Werror cross-execution-space-call,reorder,deprecated-declarations" +#ENV ENABLE_CUDA=ON \ +# CMAKE_CUDA_FLAGS="-restrict -arch sm_70 --expt-extended-lambda -Werror cross-execution-space-call,reorder,deprecated-declarations" # Installing TPL's FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain ARG SRC_DIR ARG BLD_DIR -ENV FC=/usr/bin/gfortran \ - MPIFC=/usr/lib64/openmpi/bin/mpifort -ENV OMPI_FC=$FC +#ENV FC=/usr/bin/gfortran \ +# MPIFC=/usr/lib64/openmpi/bin/mpifort +#ENV OMPI_FC=$FC # Install required packages using dnf RUN dnf clean all && \ @@ -73,32 +84,58 @@ RUN dnf clean all && \ file \ bison \ flex \ - patch + patch \ + ca-certificates \ + autoconf \ + automake \ + m4 \ + git -ARG HOST_CONFIG +#ARG HOST_CONFIG -ARG CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -ARG CUDA_ARCH=sm_70 -ARG CMAKE_CUDA_COMPILER=$CUDA_TOOLKIT_ROOT_DIR/bin/nvcc -ARG CMAKE_CUDA_ARCHITECTURES=70 +#ARG CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda +#ARG CUDA_ARCH=sm_70 +#ARG CMAKE_CUDA_COMPILER=$CUDA_TOOLKIT_ROOT_DIR/bin/nvcc +#ARG CMAKE_CUDA_ARCHITECTURES=70 -ENV HYPRE_CUDA_SM=70 -ENV CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR +#ENV HYPRE_CUDA_SM=70 +#ENV CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR # Run the configuration script -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh \ - -DENABLE_CUDA=$ENABLE_CUDA \ - -DENABLE_HYPRE_DEVICE="CUDA" \ - -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR \ - -DCUDA_ARCH=$CUDA_ARCH \ - -DCMAKE_CUDA_ARCHITECTURES=$CMAKE_CUDA_ARCHITECTURES \ - -DCMAKE_CUDA_COMPILER=$CMAKE_CUDA_COMPILER +#RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh \ +# -DENABLE_CUDA=$ENABLE_CUDA \ +# -DENABLE_HYPRE_DEVICE="CUDA" \ +# -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR \ +# -DCUDA_ARCH=$CUDA_ARCH \ +# -DCMAKE_CUDA_ARCHITECTURES=$CMAKE_CUDA_ARCHITECTURES \ +# -DCMAKE_CUDA_COMPILER=$CMAKE_CUDA_COMPILER # Set the working directory -WORKDIR $BLD_DIR +#WORKDIR $BLD_DIR # Build the project -RUN --mount=src=.,dst=$SRC_DIR make +#RUN --mount=src=.,dst=$SRC_DIR make + +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ +# Create symlink to openmpi include directory + ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include && \ + ./scripts/uberenv/uberenv.py \ + --spec "%clang@17.0.6+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@12.5.0+allow-unsupported-compilers ^caliper@2.10.0~gotcha~sampler~libunwind~libdw~papi" \ + --spack-env-file=${SRC_DIR}/docker/rocky-spack.yaml \ + --project-json=.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack_env/ .spack-db/ # Extract only TPL's from the previous stage FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain @@ -106,6 +143,9 @@ ARG SRC_DIR COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated.cmake / + # Install required packages using dnf RUN dnf clean all && \ rm -rf /var/cache/dnf && \ @@ -119,7 +159,10 @@ RUN dnf clean all && \ python3 \ texlive \ graphviz \ - ninja-build + ninja-build \ + git && \ +# Regenerate symlink to openmpi include directory + ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include # Run the installation script RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-sccache.sh diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 00336819..b2c8e8c3 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -150,7 +150,7 @@ class Geosx(CMakePackage, CudaPackage): depends_on("suite-sparse+openmp", when="+openmp") trilinos_packages = '+aztec+stratimikos~amesos2~anasazi~belos~ifpack2~muelu~sacado+thyra' - depends_on('trilinos@13.4.1 ' + trilinos_packages, when='+trilinos') + depends_on("trilinos@13.4.1 cxxflags='-include cstdint'" + trilinos_packages, when='+trilinos') depends_on("trilinos~openmp", when="~openmp") depends_on("trilinos+openmp", when="+openmp") From 70aecbe23efcdcbede860d362f954ecb876f6968 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 1 Aug 2024 10:20:24 -0700 Subject: [PATCH 27/48] Changes to get things working with tpl version updates - includes spack recipe changes, spack version update --- .uberenv_config.json | 2 +- docker/rocky-spack.yaml | 22 ++++++++++++++----- docker/spack.yaml | 22 ++++++++++++++----- docker/stanford-spack.yaml | 22 ++++++++++++++----- docker/total-spack.yaml | 22 ++++++++++++++----- .../tpl-rockylinux-clang-cuda-12.Dockerfile | 10 +++++++-- docker/tpl-ubuntu-clang-cuda.Dockerfile | 2 +- docker/tpl-ubuntu-clang.Dockerfile | 2 +- docker/tpl-ubuntu-gcc.Dockerfile | 2 +- .../spack_packages/packages/geosx/package.py | 8 +++---- .../packages/trilinos/package.py | 9 +++++++- 11 files changed, 88 insertions(+), 35 deletions(-) diff --git a/.uberenv_config.json b/.uberenv_config.json index 9bce41d3..aa91ad8d 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -4,7 +4,7 @@ "package_final_phase": "lvarray_hostconfig", "package_source_dir": "../..", "spack_url": "https://github.com/spack/spack", -"spack_commit": "2721b4c10d27afde281ea0cdb0480a7343ce0863", +"spack_commit": "d66dce2d668a6234504594661506cdd1eaca4adc", "spack_configs_path": "scripts/spack_configs", "spack_packages_path": "scripts/spack_packages/packages", "spack_concretizer": "clingo" diff --git a/docker/rocky-spack.yaml b/docker/rocky-spack.yaml index ba20a4b9..7f6722d2 100644 --- a/docker/rocky-spack.yaml +++ b/docker/rocky-spack.yaml @@ -39,23 +39,33 @@ spack: mpi: [openmpi] + # v0.6.2 blt: - require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + require: "@git.9ff77344f0b2a6ee345e452bddd6bfd46cbbfa35=develop" + # Develop - 7/31/24 hypre: - require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" + # v2024.0.2.2 chai: - require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + require: "@git.5ba0944d862513f600432c34b009824875df27e5=develop" + # v2024.02.1 umpire: - require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + require: "@git.3058d562fc707650e904f9321b1ee9bcebad3ae2=develop" + # v2024.02.2 raja: - require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + require: "@git.593f756b14ac57ded33ee61d8d2292d4beb840e6=develop" + # v2024.02.1 camp: - require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + require: "@git.79c320fa09db987923b56884afdc9f82f4b70fc4=main" + + # v0.9.2 + conduit: + require: "@git.ad86e316ad56a75c099d30ca5ce75cff275b5924=develop" uncrustify: require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" diff --git a/docker/spack.yaml b/docker/spack.yaml index 58489b0e..dbd8bc07 100644 --- a/docker/spack.yaml +++ b/docker/spack.yaml @@ -125,23 +125,33 @@ spack: mpi: [openmpi] + # v0.6.2 blt: - require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + require: "@git.9ff77344f0b2a6ee345e452bddd6bfd46cbbfa35=develop" + # Develop - 7/31/24 hypre: - require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" + # v2024.0.2.2 chai: - require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + require: "@git.5ba0944d862513f600432c34b009824875df27e5=develop" + # v2024.02.1 umpire: - require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + require: "@git.3058d562fc707650e904f9321b1ee9bcebad3ae2=develop" + # v2024.02.2 raja: - require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + require: "@git.593f756b14ac57ded33ee61d8d2292d4beb840e6=develop" + # v2024.02.1 camp: - require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + require: "@git.79c320fa09db987923b56884afdc9f82f4b70fc4=main" + + # v0.9.2 + conduit: + require: "@git.ad86e316ad56a75c099d30ca5ce75cff275b5924=develop" uncrustify: require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" diff --git a/docker/stanford-spack.yaml b/docker/stanford-spack.yaml index cb84a267..f00ed8bd 100644 --- a/docker/stanford-spack.yaml +++ b/docker/stanford-spack.yaml @@ -40,23 +40,33 @@ spack: mpi: [openmpi] + # v0.6.2 blt: - require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + require: "@git.9ff77344f0b2a6ee345e452bddd6bfd46cbbfa35=develop" + # Develop - 7/31/24 hypre: - require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" + # v2024.0.2.2 chai: - require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + require: "@git.5ba0944d862513f600432c34b009824875df27e5=develop" + # v2024.02.1 umpire: - require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + require: "@git.3058d562fc707650e904f9321b1ee9bcebad3ae2=develop" + # v2024.02.2 raja: - require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + require: "@git.593f756b14ac57ded33ee61d8d2292d4beb840e6=develop" + # v2024.02.1 camp: - require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + require: "@git.79c320fa09db987923b56884afdc9f82f4b70fc4=main" + + # v0.9.2 + conduit: + require: "@git.ad86e316ad56a75c099d30ca5ce75cff275b5924=develop" uncrustify: require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" diff --git a/docker/total-spack.yaml b/docker/total-spack.yaml index dd1c6f97..8155ee7b 100644 --- a/docker/total-spack.yaml +++ b/docker/total-spack.yaml @@ -56,23 +56,33 @@ spack: mpi: [openmpi] + # v0.6.2 blt: - require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + require: "@git.9ff77344f0b2a6ee345e452bddd6bfd46cbbfa35=develop" + # Develop - 7/31/24 hypre: - require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" + # v2024.0.2.2 chai: - require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + require: "@git.5ba0944d862513f600432c34b009824875df27e5=develop" + # v2024.02.1 umpire: - require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + require: "@git.3058d562fc707650e904f9321b1ee9bcebad3ae2=develop" + # v2024.02.2 raja: - require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + require: "@git.593f756b14ac57ded33ee61d8d2292d4beb840e6=develop" + # v2024.02.1 camp: - require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + require: "@git.79c320fa09db987923b56884afdc9f82f4b70fc4=main" + + # v0.9.2 + conduit: + require: "@git.ad86e316ad56a75c099d30ca5ce75cff275b5924=develop" uncrustify: require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" diff --git a/docker/tpl-rockylinux-clang-cuda-12.Dockerfile b/docker/tpl-rockylinux-clang-cuda-12.Dockerfile index 64a40915..b71cd2f8 100644 --- a/docker/tpl-rockylinux-clang-cuda-12.Dockerfile +++ b/docker/tpl-rockylinux-clang-cuda-12.Dockerfile @@ -123,8 +123,11 @@ RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ mkdir -p ${GEOSX_TPL_DIR} && \ # Create symlink to openmpi include directory ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include && \ +# Create symlinks to blas/lapack libraries + ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so && \ + ln -s /usr/lib64/liblapack.so.3 /usr/lib64/liblapack.so && \ ./scripts/uberenv/uberenv.py \ - --spec "%clang@17.0.6+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@12.5.0+allow-unsupported-compilers ^caliper@2.10.0~gotcha~sampler~libunwind~libdw~papi" \ + --spec "%clang@17.0.6+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@12.5.0+allow-unsupported-compilers ^caliper@2.11.0~gotcha~sampler~libunwind~libdw~papi" \ --spack-env-file=${SRC_DIR}/docker/rocky-spack.yaml \ --project-json=.uberenv_config.json \ --prefix ${GEOSX_TPL_DIR} \ @@ -162,7 +165,10 @@ RUN dnf clean all && \ ninja-build \ git && \ # Regenerate symlink to openmpi include directory - ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include + ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include && \ +# Regenerate symlinks to blas/lapack libraries + ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so && \ + ln -s /usr/lib64/liblapack.so.3 /usr/lib64/liblapack.so # Run the installation script RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-sccache.sh diff --git a/docker/tpl-ubuntu-clang-cuda.Dockerfile b/docker/tpl-ubuntu-clang-cuda.Dockerfile index c17c6385..65bc09f5 100644 --- a/docker/tpl-ubuntu-clang-cuda.Dockerfile +++ b/docker/tpl-ubuntu-clang-cuda.Dockerfile @@ -61,7 +61,7 @@ RUN apt-get install -y --no-install-recommends \ RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ mkdir -p ${GEOSX_TPL_DIR} && \ ./scripts/uberenv/uberenv.py \ - --spec "%clang@10+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers ^caliper@2.10.0~gotcha~sampler~libunwind~libdw~papi" \ + --spec "%clang@10+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers ^caliper@2.11.0~gotcha~sampler~libunwind~libdw~papi" \ --spack-env-file=${SRC_DIR}/docker/spack.yaml \ --project-json=.uberenv_config.json \ --prefix ${GEOSX_TPL_DIR} \ diff --git a/docker/tpl-ubuntu-clang.Dockerfile b/docker/tpl-ubuntu-clang.Dockerfile index e25e85d5..d6ee2c8e 100644 --- a/docker/tpl-ubuntu-clang.Dockerfile +++ b/docker/tpl-ubuntu-clang.Dockerfile @@ -73,7 +73,7 @@ RUN apt-get install -y --no-install-recommends \ RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ mkdir -p ${GEOSX_TPL_DIR} && \ ./scripts/uberenv/uberenv.py \ - --spec "%clang@${CLANG_MAJOR_VERSION} ~openmp+docs ^caliper@2.10.0~gotcha~sampler~libunwind~libdw~papi" \ + --spec "%clang@${CLANG_MAJOR_VERSION} ~openmp+docs ^caliper@2.11.0~gotcha~sampler~libunwind~libdw~papi" \ --spack-env-file=${SRC_DIR}/docker/spack.yaml \ --project-json=.uberenv_config.json \ --prefix ${GEOSX_TPL_DIR} \ diff --git a/docker/tpl-ubuntu-gcc.Dockerfile b/docker/tpl-ubuntu-gcc.Dockerfile index f73f7004..a4ed2211 100644 --- a/docker/tpl-ubuntu-gcc.Dockerfile +++ b/docker/tpl-ubuntu-gcc.Dockerfile @@ -37,6 +37,7 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ # gfortran 8, 9 and 10 depend on libgfortran5. gcc-$GCC_MAJOR_VERSION \ g++-$GCC_MAJOR_VERSION \ + gfortran-$GCC_MAJOR_VERSION \ libgfortran5 \ # Several scientific (or close) libraries. # Note the difference between runtime and development packages. @@ -81,7 +82,6 @@ ARG GCC_MAJOR_VERSION RUN apt-get install -y --no-install-recommends \ libtbb-dev \ - gfortran-$GCC_MAJOR_VERSION \ make \ bc \ file \ diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index b2c8e8c3..2c7be701 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -124,10 +124,10 @@ class Geosx(CMakePackage, CudaPackage): depends_on('hdf5@1.12.1') depends_on('silo@4.11~fortran') - depends_on('conduit@0.8.2~test~fortran~hdf5_compat') + depends_on('conduit~test~fortran~hdf5_compat') - depends_on('adiak@0.2.2', when='+caliper') - depends_on('caliper@2.10.0~gotcha~sampler~libunwind~libdw', when='+caliper') + depends_on('adiak@0.4.0', when='+caliper') + depends_on('caliper@2.11.0~gotcha~sampler~libunwind~libdw', when='+caliper') depends_on('pugixml@1.13') @@ -150,7 +150,7 @@ class Geosx(CMakePackage, CudaPackage): depends_on("suite-sparse+openmp", when="+openmp") trilinos_packages = '+aztec+stratimikos~amesos2~anasazi~belos~ifpack2~muelu~sacado+thyra' - depends_on("trilinos@13.4.1 cxxflags='-include cstdint'" + trilinos_packages, when='+trilinos') + depends_on("trilinos@15.1.1 cxxflags='-include cstdint'" + trilinos_packages, when='+trilinos') depends_on("trilinos~openmp", when="~openmp") depends_on("trilinos+openmp", when="+openmp") diff --git a/scripts/spack_packages/packages/trilinos/package.py b/scripts/spack_packages/packages/trilinos/package.py index a34d0203..665da98b 100644 --- a/scripts/spack_packages/packages/trilinos/package.py +++ b/scripts/spack_packages/packages/trilinos/package.py @@ -46,6 +46,9 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): version('master', branch='master') version('develop', branch='develop') + # GEOS Added + version("15.1.1", sha256="2108d633d2208ed261d09b2d6b2fbae7a9cdc455dd963c9c94412d38d8aaefe4") + version("13.4.1", sha256="5465cbff3de7ef4ac7d40eeff9d99342c00d9d20eee0a5f64f0a523093f5f1b3") version("13.4.0", sha256="39550006e059043b7e2177f10467ae2f77fe639901aee91cbc1e359516ff8d3e") version('13.2.0', commit='4a5f7906a6420ee2f9450367e9cc95b28c00d744') # tag trilinos-release-13-2-0 @@ -73,7 +76,11 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): variant('complex', default=False, description='Enable complex numbers in Trilinos') variant('cuda_rdc', default=False, description='Turn on RDC for CUDA build') variant('rocm_rdc', default=False, description='Turn on RDC for ROCm build') - variant('cxxstd', default='14', values=['11', '14', '17'], multi=False) + + # GEOS Adjusted + variant('cxxstd', default='17', values=['11', '14', '17'], multi=False) + # variant('cxxstd', default='14', values=['11', '14', '17'], multi=False) + variant('debug', default=False, description='Enable runtime safety and debug checks') variant('explicit_template_instantiation', default=True, description='Enable explicit template instantiation (ETI)') variant('float', default=False, description='Enable single precision (float) numbers in Trilinos') From 4af6e2c28b349653285f8de00061946965002c92 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 7 Aug 2024 14:02:42 -0700 Subject: [PATCH 28/48] Try rocky gcc --- docker/rocky-spack.yaml | 15 ++ docker/tpl-rockylinux-gcc-cuda-12.Dockerfile | 137 +++++++++++++------ 2 files changed, 108 insertions(+), 44 deletions(-) diff --git a/docker/rocky-spack.yaml b/docker/rocky-spack.yaml index 7f6722d2..c0a247f4 100644 --- a/docker/rocky-spack.yaml +++ b/docker/rocky-spack.yaml @@ -28,6 +28,21 @@ spack: fc: /usr/bin/gfortran spec: clang@17.0.6 target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: rocky8 + paths: + cc: /usr/bin/gcc + cxx: /usr/bin/g++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + spec: gcc@8.5.0 + target: x86_64 packages: all: diff --git a/docker/tpl-rockylinux-gcc-cuda-12.Dockerfile b/docker/tpl-rockylinux-gcc-cuda-12.Dockerfile index 5091d116..d6580756 100644 --- a/docker/tpl-rockylinux-gcc-cuda-12.Dockerfile +++ b/docker/tpl-rockylinux-gcc-cuda-12.Dockerfile @@ -21,46 +21,57 @@ RUN dnf clean all && \ blas \ lapack \ openmpi \ - openmpi-devel + openmpi-devel \ + # Additional spack dependencies + python3-pip \ + unzip \ + mpfr-devel \ + bzip2 \ + xz \ + python3-virtualenv + +# Install clingo for Spack +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install clingo # Setup PATH for MPI, BLAS, and LAPACK -RUN MPI_PATH=$(find /usr -name mpicc | head -n 1) && \ - MPI_DIR=$(dirname $MPI_PATH) && \ - BLAS_DIR=$(find / -name "libblas*") && \ - LAPACK_DIR=$(find -name "liblapack*") && \ - echo "MPI binary directory: $MPI_DIR" && \ - echo "Blas directory: $BLAS_DIR" && \ - echo "Lapack directory: $LAPACK_DIR" && \ - export PATH=$PATH:$MPI_DIR && \ - export PATH=$PATH:$BLAS_DIR && \ - export PATH=$PATH:$LAPACK_DIR && \ - echo $PATH +#RUN MPI_PATH=$(find /usr -name mpicc | head -n 1) && \ +# MPI_DIR=$(dirname $MPI_PATH) && \ +# BLAS_DIR=$(find / -name "libblas*") && \ +# LAPACK_DIR=$(find -name "liblapack*") && \ +# echo "MPI binary directory: $MPI_DIR" && \ +# echo "Blas directory: $BLAS_DIR" && \ +# echo "Lapack directory: $LAPACK_DIR" && \ +# export PATH=$PATH:$MPI_DIR && \ +# export PATH=$PATH:$BLAS_DIR && \ +# export PATH=$PATH:$LAPACK_DIR && \ +# echo $PATH # Custom install script for CMake or other tools RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh -ENV CC=/usr/bin/gcc \ - CXX=/usr/bin/g++ \ - MPICC=/usr/lib64/openmpi/bin/mpicc \ - MPICXX=/usr/lib64/openmpi/bin/mpicxx \ - MPIEXEC=/usr/lib64/openmpi/bin/mpirun \ - BLAS_LIBRARIES="/usr/lib64/libblas.so.3.8.0" \ - LAPACK_LIBRARIES="/usr/lib64/liblapack.so.3.8.0" +#ENV CC=/usr/bin/gcc \ +# CXX=/usr/bin/g++ \ +# MPICC=/usr/lib64/openmpi/bin/mpicc \ +# MPICXX=/usr/lib64/openmpi/bin/mpicxx \ +# MPIEXEC=/usr/lib64/openmpi/bin/mpirun \ +# BLAS_LIBRARIES="/usr/lib64/libblas.so.3.8.0" \ +# LAPACK_LIBRARIES="/usr/lib64/liblapack.so.3.8.0" -ENV OMPI_CC=$CC \ - OMPI_CXX=$CXX +#ENV OMPI_CC=$CC \ +# OMPI_CXX=$CXX -ENV ENABLE_CUDA=ON \ - CMAKE_CUDA_FLAGS="-restrict -arch sm_70 --expt-extended-lambda -Werror cross-execution-space-call,reorder,deprecated-declarations" +#ENV ENABLE_CUDA=ON \ +# CMAKE_CUDA_FLAGS="-restrict -arch sm_70 --expt-extended-lambda -Werror cross-execution-space-call,reorder,deprecated-declarations" # Installing TPL's FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain ARG SRC_DIR ARG BLD_DIR -ENV FC=/usr/bin/gfortran \ - MPIFC=/usr/lib64/openmpi/bin/mpifort -ENV OMPI_FC=$FC +#ENV FC=/usr/bin/gfortran \ +# MPIFC=/usr/lib64/openmpi/bin/mpifort +#ENV OMPI_FC=$FC # Install additional required packages RUN dnf clean all && \ @@ -71,32 +82,61 @@ RUN dnf clean all && \ file \ bison \ flex \ - patch + patch \ + ca-certificates \ + autoconf \ + automake \ + m4 \ + git # Environment and toolkit setup for CUDA and other libraries -ARG HOST_CONFIG -ARG CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -ARG CUDA_ARCH=sm_70 -ARG CMAKE_CUDA_COMPILER=$CUDA_TOOLKIT_ROOT_DIR/bin/nvcc -ARG CMAKE_CUDA_ARCHITECTURES=70 +#ARG HOST_CONFIG +#ARG CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda +#ARG CUDA_ARCH=sm_70 +#ARG CMAKE_CUDA_COMPILER=$CUDA_TOOLKIT_ROOT_DIR/bin/nvcc +#ARG CMAKE_CUDA_ARCHITECTURES=70 -ENV HYPRE_CUDA_SM=70 -ENV CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR +#ENV HYPRE_CUDA_SM=70 +#ENV CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR # Configure and build TPL -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh \ - -DENABLE_CUDA=$ENABLE_CUDA \ - -DENABLE_HYPRE_DEVICE="CUDA" \ - -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR \ - -DCUDA_ARCH=$CUDA_ARCH \ - -DCMAKE_CUDA_ARCHITECTURES=$CMAKE_CUDA_ARCHITECTURES \ - -DCMAKE_CUDA_COMPILER=$CMAKE_CUDA_COMPILER +#RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh \ +# -DENABLE_CUDA=$ENABLE_CUDA \ +# -DENABLE_HYPRE_DEVICE="CUDA" \ +# -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR \ +# -DCUDA_ARCH=$CUDA_ARCH \ +# -DCMAKE_CUDA_ARCHITECTURES=$CMAKE_CUDA_ARCHITECTURES \ +# -DCMAKE_CUDA_COMPILER=$CMAKE_CUDA_COMPILER # Set working directory for the build -WORKDIR $BLD_DIR +#WORKDIR $BLD_DIR # Build command -RUN --mount=src=.,dst=$SRC_DIR make +#RUN --mount=src=.,dst=$SRC_DIR make + +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ +# Create symlink to openmpi include directory + ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include && \ +# Create symlinks to blas/lapack libraries + ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so && \ + ln -s /usr/lib64/liblapack.so.3 /usr/lib64/liblapack.so && \ + ./scripts/uberenv/uberenv.py \ + --spec "%gcc@8.5.0+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@12.5.0+allow-unsupported-compilers ^caliper@2.11.0~gotcha~sampler~libunwind~libdw~papi" \ + --spack-env-file=${SRC_DIR}/docker/rocky-spack.yaml \ + --project-json=.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack_env/ .spack-db/ # Extract only TPL's from the previous stage FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain @@ -104,6 +144,9 @@ ARG SRC_DIR COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated.cmake / + # Final installation of packages and tools RUN dnf clean all && \ rm -rf /var/cache/dnf && \ @@ -117,7 +160,13 @@ RUN dnf clean all && \ python3 \ texlive \ graphviz \ - ninja-build + ninja-build \ + git && \ +# Regenerate symlink to openmpi include directory + ln -s /usr/include/openmpi-x86_64 /usr/lib64/openmpi/include && \ +# Regenerate symlinks to blas/lapack libraries + ln -s /usr/lib64/libblas.so.3 /usr/lib64/libblas.so && \ + ln -s /usr/lib64/liblapack.so.3 /usr/lib64/liblapack.so # Install sccache RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-sccache.sh From f5ce06febf457888960260bed08ba0da45a9c5fd Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 14 Aug 2024 11:09:51 -0700 Subject: [PATCH 29/48] Find mpfr, reduce build size --- docker/spack.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/spack.yaml b/docker/spack.yaml index dbd8bc07..b672b6d3 100644 --- a/docker/spack.yaml +++ b/docker/spack.yaml @@ -199,6 +199,11 @@ spack: externals: - spec: m4@1.4.18 prefix: /usr + mpfr: + buildable: false + externals: + - spec: mpfr@6.0.2 + prefix: /usr # Spack may grab for mpi & we don't want to use them mpi: @@ -249,6 +254,11 @@ spack: externals: - spec: python@3.10.12 prefix: /usr + readline: + buildable: false + externals: + - spec: readline@8.0 + prefix: /usr tar: buildable: false externals: From c2d6d6987867c28af504bf4bd7f914d0738d846f Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 22 Aug 2024 08:03:51 -0700 Subject: [PATCH 30/48] Do not build pygeosx for gcc, build silo~shared --- docker/spack.yaml | 11 +++++++++++ docker/tpl-ubuntu-gcc.Dockerfile | 13 ++----------- scripts/spack_packages/packages/geosx/package.py | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docker/spack.yaml b/docker/spack.yaml index b672b6d3..fb0e60bd 100644 --- a/docker/spack.yaml +++ b/docker/spack.yaml @@ -194,6 +194,12 @@ spack: externals: - spec: flex@2.6.4 prefix: /usr + findutils: + version: [4.7.0] + buildable: false + externals: + - spec: findutils@4.7.0 + prefix: /usr m4: buildable: false externals: @@ -274,3 +280,8 @@ spack: externals: - spec: xz@5.2.5 prefix: /usr + zlib: + buildable: false + externals: + - spec: zlib@1.2.11 + prefix: /usr diff --git a/docker/tpl-ubuntu-gcc.Dockerfile b/docker/tpl-ubuntu-gcc.Dockerfile index a4ed2211..7e420571 100644 --- a/docker/tpl-ubuntu-gcc.Dockerfile +++ b/docker/tpl-ubuntu-gcc.Dockerfile @@ -100,7 +100,7 @@ RUN apt-get install -y --no-install-recommends \ RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ mkdir -p ${GEOSX_TPL_DIR} && \ ./scripts/uberenv/uberenv.py \ - --spec "%gcc@${GCC_MAJOR_VERSION} +docs" \ + --spec "%gcc@${GCC_MAJOR_VERSION} ~pygeosx +docs" \ --spack-env-file=${SRC_DIR}/docker/spack.yaml \ --project-json=${SRC_DIR}/.uberenv_config.json \ --prefix ${GEOSX_TPL_DIR} \ @@ -137,16 +137,7 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ libxml2-utils \ git \ ghostscript \ - ninja-build \ -# Necessary dependencies for pygeosx unit tests - python3-dev \ - python3-sphinx \ - python3-mpi4py \ - python3-scipy \ - python3-virtualenv \ - python3-matplotlib \ - python3-venv \ - python3-pytest + ninja-build # Install `sccache` binaries to speed up the build of `geos` RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-sccache.sh diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 2c7be701..97f4b22b 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -122,7 +122,7 @@ class Geosx(CMakePackage, CudaPackage): # IO # depends_on('hdf5@1.12.1') - depends_on('silo@4.11~fortran') + depends_on('silo@4.11~fortran~shared') depends_on('conduit~test~fortran~hdf5_compat') From ced46779ab158aa428e49747d98bb79811edba9b Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 28 Aug 2024 14:55:51 -0700 Subject: [PATCH 31/48] Update raja suite and vtk for github action images --- docker/rocky-spack.yaml | 16 ++++++++-------- docker/spack.yaml | 16 ++++++++-------- docker/stanford-spack.yaml | 16 ++++++++-------- docker/total-spack.yaml | 16 ++++++++-------- .../spack_packages/packages/geosx/package.py | 2 +- .../spack_packages/packages/vtk/package.py | 3 +-- .../packages/vtk/vtkXMLReader-fpe.patch | 19 ------------------- 7 files changed, 34 insertions(+), 54 deletions(-) delete mode 100644 scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch diff --git a/docker/rocky-spack.yaml b/docker/rocky-spack.yaml index c0a247f4..2cdcd2f9 100644 --- a/docker/rocky-spack.yaml +++ b/docker/rocky-spack.yaml @@ -62,21 +62,21 @@ spack: hypre: require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" - # v2024.0.2.2 + # v2024.07.0 chai: - require: "@git.5ba0944d862513f600432c34b009824875df27e5=develop" + require: "@git.df7741f1dbbdc5fff5f7d626151fdf1904e62b19=develop" - # v2024.02.1 + # v2024.07.0 umpire: - require: "@git.3058d562fc707650e904f9321b1ee9bcebad3ae2=develop" + require: "@git.abd729f40064175e999a83d11d6b073dac4c01d2=develop" - # v2024.02.2 + # v2024.07.0 raja: - require: "@git.593f756b14ac57ded33ee61d8d2292d4beb840e6=develop" + require: "@git.4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1=develop" - # v2024.02.1 + # v2024.07.0 camp: - require: "@git.79c320fa09db987923b56884afdc9f82f4b70fc4=main" + require: "@git.0f07de4240c42e0b38a8d872a20440cb4b33d9f5=main" # v0.9.2 conduit: diff --git a/docker/spack.yaml b/docker/spack.yaml index fb0e60bd..e4cea89f 100644 --- a/docker/spack.yaml +++ b/docker/spack.yaml @@ -133,21 +133,21 @@ spack: hypre: require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" - # v2024.0.2.2 + # v2024.07.0 chai: - require: "@git.5ba0944d862513f600432c34b009824875df27e5=develop" + require: "@git.df7741f1dbbdc5fff5f7d626151fdf1904e62b19=develop" - # v2024.02.1 + # v2024.07.0 umpire: - require: "@git.3058d562fc707650e904f9321b1ee9bcebad3ae2=develop" + require: "@git.abd729f40064175e999a83d11d6b073dac4c01d2=develop" - # v2024.02.2 + # v2024.07.0 raja: - require: "@git.593f756b14ac57ded33ee61d8d2292d4beb840e6=develop" + require: "@git.4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1=develop" - # v2024.02.1 + # v2024.07.0 camp: - require: "@git.79c320fa09db987923b56884afdc9f82f4b70fc4=main" + require: "@git.0f07de4240c42e0b38a8d872a20440cb4b33d9f5=main" # v0.9.2 conduit: diff --git a/docker/stanford-spack.yaml b/docker/stanford-spack.yaml index f00ed8bd..992687d4 100644 --- a/docker/stanford-spack.yaml +++ b/docker/stanford-spack.yaml @@ -48,21 +48,21 @@ spack: hypre: require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" - # v2024.0.2.2 + # v2024.07.0 chai: - require: "@git.5ba0944d862513f600432c34b009824875df27e5=develop" + require: "@git.df7741f1dbbdc5fff5f7d626151fdf1904e62b19=develop" - # v2024.02.1 + # v2024.07.0 umpire: - require: "@git.3058d562fc707650e904f9321b1ee9bcebad3ae2=develop" + require: "@git.abd729f40064175e999a83d11d6b073dac4c01d2=develop" - # v2024.02.2 + # v2024.07.0 raja: - require: "@git.593f756b14ac57ded33ee61d8d2292d4beb840e6=develop" + require: "@git.4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1=develop" - # v2024.02.1 + # v2024.07.0 camp: - require: "@git.79c320fa09db987923b56884afdc9f82f4b70fc4=main" + require: "@git.0f07de4240c42e0b38a8d872a20440cb4b33d9f5=main" # v0.9.2 conduit: diff --git a/docker/total-spack.yaml b/docker/total-spack.yaml index 8155ee7b..0c71cd4b 100644 --- a/docker/total-spack.yaml +++ b/docker/total-spack.yaml @@ -64,21 +64,21 @@ spack: hypre: require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" - # v2024.0.2.2 + # v2024.07.0 chai: - require: "@git.5ba0944d862513f600432c34b009824875df27e5=develop" + require: "@git.df7741f1dbbdc5fff5f7d626151fdf1904e62b19=develop" - # v2024.02.1 + # v2024.07.0 umpire: - require: "@git.3058d562fc707650e904f9321b1ee9bcebad3ae2=develop" + require: "@git.abd729f40064175e999a83d11d6b073dac4c01d2=develop" - # v2024.02.2 + # v2024.07.0 raja: - require: "@git.593f756b14ac57ded33ee61d8d2292d4beb840e6=develop" + require: "@git.4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1=develop" - # v2024.02.1 + # v2024.07.0 camp: - require: "@git.79c320fa09db987923b56884afdc9f82f4b70fc4=main" + require: "@git.0f07de4240c42e0b38a8d872a20440cb4b33d9f5=main" # v0.9.2 conduit: diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 97f4b22b..58ecac8c 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -132,7 +132,7 @@ class Geosx(CMakePackage, CudaPackage): depends_on('pugixml@1.13') depends_on('fmt@10.0.0 cxxstd=14') - depends_on('vtk@9.2.6', when='+vtk') + depends_on('vtk@9.3.1', when='+vtk') # # Math diff --git a/scripts/spack_packages/packages/vtk/package.py b/scripts/spack_packages/packages/vtk/package.py index b1a666f8..40443461 100644 --- a/scripts/spack_packages/packages/vtk/package.py +++ b/scripts/spack_packages/packages/vtk/package.py @@ -20,6 +20,7 @@ class Vtk(CMakePackage): maintainers = ['chuckatkins', 'danlipsa'] + version("9.3.1", sha256="8354ec084ea0d2dc3d23dbe4243823c4bfc270382d0ce8d658939fd50061cab8") version("9.2.6", sha256="06fc8d49c4e56f498c40fcb38a563ed8d4ec31358d0101e8988f0bb4d539dd12") version('9.1.0', sha256='8fed42f4f8f1eb8083107b68eaa9ad71da07110161a3116ad807f43e5ca5ce96') version('9.0.3', sha256='bc3eb9625b2b8dbfecb6052a2ab091fc91405de4333b0ec68f3323815154ed8a') @@ -38,8 +39,6 @@ class Vtk(CMakePackage): variant('python', default=False, description='Enable Python support') variant('mpi', default=True, description='Enable MPI support') - patch('vtkXMLReader-fpe.patch', when='@9.1.0:') - extends('python', when='+python') # Acceptable python versions depend on vtk version diff --git a/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch b/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch deleted file mode 100644 index c998db19..00000000 --- a/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/IO/XML/vtkXMLReader.cxx 2023-02-14 20:03:53.000000000 -0800 -+++ b/IO/XML/vtkXMLReader.cxx.patch 2023-05-12 08:52:36.017274000 -0700 -@@ -53,6 +53,7 @@ - #include - #include - #include -+#include - #include - #include // C++ locale - #include -@@ -1958,7 +1959,7 @@ - if (!this->AbortExecute) - { - // Round progress to nearest 100th. -- float rounded = static_cast(int((progress * 100) + 0.5f)) / 100.f; -+ float const rounded = std::round(progress * 100) * 0.01; - if (this->GetProgress() != rounded) - { - this->UpdateProgress(rounded); \ No newline at end of file From a62fc20210b68a026285dd04c387b969a46828a8 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 28 Aug 2024 15:02:57 -0700 Subject: [PATCH 32/48] spack environment file updates for LC --- .../blueos_3_ppc64le_ib_p9/spack.yaml | 27 ++++++++++++++---- .../spack_configs/toss_4_x86_64_ib/spack.yaml | 28 +++++++++++++------ .../spack_packages/packages/geosx/package.py | 4 ++- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml index 0ca90a26..099a2b40 100644 --- a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -13,6 +13,7 @@ # geosx@develop%clang@10.0.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers # geosx@develop%gcc@8.3.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers # geosx@develop%clang@13.0.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers +# geosx@develop%clang@13.0.1+cuda cuda_arch=70 ^cuda@12.0.0+allow-unsupported-compilers # # Uberenv command to build geos dependencies: # python3 ./scripts/uberenv/uberenv.py --spec="%clang@10.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" @@ -20,6 +21,8 @@ # python3 ./scripts/uberenv/uberenv.py --spec="%gcc@8.3.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" # # python3 ./scripts/uberenv/uberenv.py --spec="%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" +# +# python3 ./scripts/uberenv/uberenv.py --spec="%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@12.0.0+allow-unsupported-compilers" spack: @@ -87,23 +90,33 @@ spack: blas: [essl] lapack: [essl] + # v0.6.2 blt: - require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + require: "@git.9ff77344f0b2a6ee345e452bddd6bfd46cbbfa35=develop" + # Develop - 7/31/24 hypre: - require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" + # v2024.07.0 chai: - require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + require: "@git.df7741f1dbbdc5fff5f7d626151fdf1904e62b19=develop" + # v2024.07.0 umpire: - require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + require: "@git.abd729f40064175e999a83d11d6b073dac4c01d2=develop" + # v2024.07.0 raja: - require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + require: "@git.4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1=develop" + # v2024.07.0 camp: - require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + require: "@git.0f07de4240c42e0b38a8d872a20440cb4b33d9f5=main" + + # v0.9.2 + conduit: + require: "@git.ad86e316ad56a75c099d30ca5ce75cff275b5924=develop" uncrustify: require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" @@ -133,6 +146,8 @@ spack: externals: - spec: cuda@11.8.0 +allow-unsupported-compilers prefix: /usr/tce/packages/cuda/cuda-11.8.0 + - spec: cuda@12.0.0 +allow-unsupported-compilers + prefix: /usr/tce/packages/cuda/cuda-12.0.0 # System level packages to not build cmake: diff --git a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml index cd287cf6..033a7b0e 100644 --- a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml +++ b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml @@ -13,7 +13,7 @@ # geosx@develop%clang@14.0.6 # geosx@develop%gcc@12.1.1 # -# Uberenv command to build pygeosx dependencies: +# Uberenv command to build geos dependencies: # python3 ./scripts/uberenv/uberenv.py --spec="%clang@14.0.6 +docs" # # python3 ./scripts/uberenv/uberenv.py --spec="%gcc@12.1.1 +docs" @@ -68,23 +68,33 @@ spack: blas: [intel-oneapi-mkl] lapack: [intel-oneapi-mkl] + # v0.6.2 blt: - require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" + require: "@git.9ff77344f0b2a6ee345e452bddd6bfd46cbbfa35=develop" + # Develop - 7/31/24 hypre: - require: "@git.d475cdfc63ac59ea9a554493a06e4033b8d6fade" + require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" + # v2024.07.0 chai: - require: "@git.6fe3470ad020303530af2f3dbbfe18826bd3319b=develop" + require: "@git.df7741f1dbbdc5fff5f7d626151fdf1904e62b19=develop" + # v2024.07.0 umpire: - require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" + require: "@git.abd729f40064175e999a83d11d6b073dac4c01d2=develop" + # v2024.07.0 raja: - require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" + require: "@git.4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1=develop" + # v2024.07.0 camp: - require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" + require: "@git.0f07de4240c42e0b38a8d872a20440cb4b33d9f5=main" + + # v0.9.2 + conduit: + require: "@git.ad86e316ad56a75c099d30ca5ce75cff275b5924=develop" uncrustify: require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" @@ -96,9 +106,9 @@ spack: mvapich2: buildable: False externals: - - spec: mvapich2@2.3%gcc@12.1.1 + - spec: mvapich2@2.3%gcc@12.1.1 process_managers=slurm prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-12.1.1-magic - - spec: mvapich2@2.3%clang@14.0.6 + - spec: mvapich2@2.3%clang@14.0.6 process_managers=slurm prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6-magic intel-oneapi-mkl: diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 58ecac8c..8129575d 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -9,6 +9,8 @@ import socket import os +import llnl.util.tty as tty + from os import environ as env from os.path import join as pjoin @@ -358,7 +360,7 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): mpiexec = os.path.join(spec["mpi"].prefix.bin, "mpiexec") if not os.path.exists(mpiexec): - msg = "Unable to determine MPIEXEC, %s tests may fail" % self.pkg.name + msg = "Unable to determine MPIEXEC, geos tests may fail" cfg.write("# {0}\n".format(msg)) tty.warn(msg) else: From bdacbff7082dc2141d539cde6bcfb5621bb2962f Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 29 Aug 2024 09:02:07 -0700 Subject: [PATCH 33/48] Try curl with error --- docker/install-cmake.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/install-cmake.sh b/docker/install-cmake.sh index cceb5ba2..54210436 100755 --- a/docker/install-cmake.sh +++ b/docker/install-cmake.sh @@ -5,5 +5,5 @@ set -xe VERSION=${1-3.28.3} PREFIX=${2-/usr/local} -curl -s https://cmake.org/files/v${VERSION%.[0-9]*}/cmake-$VERSION-linux-x86_64.tar.gz | \ +curl -S https://cmake.org/files/v${VERSION%.[0-9]*}/cmake-$VERSION-linux-x86_64.tar.gz | \ tar --directory=$PREFIX --strip-components=1 -xzf - From d6922a91be99b334d23ac20b2454a1ea3da54c2b Mon Sep 17 00:00:00 2001 From: Brian Han Date: Tue, 3 Sep 2024 13:35:00 -0700 Subject: [PATCH 34/48] Update .gitignore for spack, update cmake version for blueos --- .gitignore | 4 +++- scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index eef8eceb..b1b2a770 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ build-*/ install-*/ .cproject .project -.pydevproject \ No newline at end of file +.pydevproject +spack-*.txt +__pycache__ diff --git a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml index 099a2b40..882d3510 100644 --- a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -153,8 +153,8 @@ spack: cmake: buildable: False externals: - - spec: cmake@3.23.1 - prefix: /usr/tce/packages/cmake/cmake-3.23.1 + - spec: cmake@3.29.2 + prefix: /usr/tce/packages/cmake/cmake-3.29.2 readline: buildable: False externals: From 153263fde935aca33a4c2300f35e96e720c93627 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Tue, 3 Sep 2024 13:44:16 -0700 Subject: [PATCH 35/48] Remove environment variable sets from rocky linux Dockerfiles --- .../tpl-rockylinux-clang-cuda-12.Dockerfile | 56 ------------------- docker/tpl-rockylinux-gcc-cuda-12.Dockerfile | 56 ------------------- 2 files changed, 112 deletions(-) diff --git a/docker/tpl-rockylinux-clang-cuda-12.Dockerfile b/docker/tpl-rockylinux-clang-cuda-12.Dockerfile index b71cd2f8..177c0e5f 100644 --- a/docker/tpl-rockylinux-clang-cuda-12.Dockerfile +++ b/docker/tpl-rockylinux-clang-cuda-12.Dockerfile @@ -37,44 +37,13 @@ RUN dnf config-manager --set-enabled & RUN python3 -m pip install --upgrade pip && \ python3 -m pip install clingo -# Find the location of mpicc, blas and lapack and add to PATH -#RUN MPI_PATH=$(find /usr -name mpicc | head -n 1) && \ -# MPI_DIR=$(dirname $MPI_PATH) && \ -# BLAS_DIR=$(find / -name "libblas*") && \ -# LAPACK_DIR=$(find -name "liblapack*") && \ -# echo "MPI binary directory: $MPI_DIR" && \ -# echo "Blas directory: $BLAS_DIR" && \ -# echo "Lapack directory: $LAPACK_DIR" && \ -# export PATH=$PATH:$MPI_DIR && \ -# export PATH=$PATH:$BLAS_DIR && \ -# export PATH=$PATH:$LAPACK_DIR && \ -# echo $PATH - RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh -#ENV CC=/usr/bin/clang \ -# CXX=/usr/bin/clang++ \ -# MPICC=/usr/lib64/openmpi/bin/mpicc \ -# MPICXX=/usr/lib64/openmpi/bin/mpicxx \ -# MPIEXEC=/usr/lib64/openmpi/bin/mpirun \ -# BLAS_LIBRARIES="/usr/lib64/libblas.so.3.8.0" \ -# LAPACK_LIBRARIES="/usr/lib64/liblapack.so.3.8.0" - -#ENV OMPI_CC=$CC \ -# OMPI_CXX=$CXX - -#ENV ENABLE_CUDA=ON \ -# CMAKE_CUDA_FLAGS="-restrict -arch sm_70 --expt-extended-lambda -Werror cross-execution-space-call,reorder,deprecated-declarations" - # Installing TPL's FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain ARG SRC_DIR ARG BLD_DIR -#ENV FC=/usr/bin/gfortran \ -# MPIFC=/usr/lib64/openmpi/bin/mpifort -#ENV OMPI_FC=$FC - # Install required packages using dnf RUN dnf clean all && \ dnf -y update && \ @@ -91,31 +60,6 @@ RUN dnf clean all && \ m4 \ git -#ARG HOST_CONFIG - -#ARG CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -#ARG CUDA_ARCH=sm_70 -#ARG CMAKE_CUDA_COMPILER=$CUDA_TOOLKIT_ROOT_DIR/bin/nvcc -#ARG CMAKE_CUDA_ARCHITECTURES=70 - -#ENV HYPRE_CUDA_SM=70 -#ENV CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR - -# Run the configuration script -#RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh \ -# -DENABLE_CUDA=$ENABLE_CUDA \ -# -DENABLE_HYPRE_DEVICE="CUDA" \ -# -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR \ -# -DCUDA_ARCH=$CUDA_ARCH \ -# -DCMAKE_CUDA_ARCHITECTURES=$CMAKE_CUDA_ARCHITECTURES \ -# -DCMAKE_CUDA_COMPILER=$CMAKE_CUDA_COMPILER - -# Set the working directory -#WORKDIR $BLD_DIR - -# Build the project -#RUN --mount=src=.,dst=$SRC_DIR make - # Run uberenv # Have to create install directory first for uberenv # -k flag is to ignore SSL errors diff --git a/docker/tpl-rockylinux-gcc-cuda-12.Dockerfile b/docker/tpl-rockylinux-gcc-cuda-12.Dockerfile index d6580756..d6501775 100644 --- a/docker/tpl-rockylinux-gcc-cuda-12.Dockerfile +++ b/docker/tpl-rockylinux-gcc-cuda-12.Dockerfile @@ -34,45 +34,14 @@ RUN dnf clean all && \ RUN python3 -m pip install --upgrade pip && \ python3 -m pip install clingo -# Setup PATH for MPI, BLAS, and LAPACK -#RUN MPI_PATH=$(find /usr -name mpicc | head -n 1) && \ -# MPI_DIR=$(dirname $MPI_PATH) && \ -# BLAS_DIR=$(find / -name "libblas*") && \ -# LAPACK_DIR=$(find -name "liblapack*") && \ -# echo "MPI binary directory: $MPI_DIR" && \ -# echo "Blas directory: $BLAS_DIR" && \ -# echo "Lapack directory: $LAPACK_DIR" && \ -# export PATH=$PATH:$MPI_DIR && \ -# export PATH=$PATH:$BLAS_DIR && \ -# export PATH=$PATH:$LAPACK_DIR && \ -# echo $PATH - # Custom install script for CMake or other tools RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh -#ENV CC=/usr/bin/gcc \ -# CXX=/usr/bin/g++ \ -# MPICC=/usr/lib64/openmpi/bin/mpicc \ -# MPICXX=/usr/lib64/openmpi/bin/mpicxx \ -# MPIEXEC=/usr/lib64/openmpi/bin/mpirun \ -# BLAS_LIBRARIES="/usr/lib64/libblas.so.3.8.0" \ -# LAPACK_LIBRARIES="/usr/lib64/liblapack.so.3.8.0" - -#ENV OMPI_CC=$CC \ -# OMPI_CXX=$CXX - -#ENV ENABLE_CUDA=ON \ -# CMAKE_CUDA_FLAGS="-restrict -arch sm_70 --expt-extended-lambda -Werror cross-execution-space-call,reorder,deprecated-declarations" - # Installing TPL's FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain ARG SRC_DIR ARG BLD_DIR -#ENV FC=/usr/bin/gfortran \ -# MPIFC=/usr/lib64/openmpi/bin/mpifort -#ENV OMPI_FC=$FC - # Install additional required packages RUN dnf clean all && \ dnf -y update && \ @@ -89,31 +58,6 @@ RUN dnf clean all && \ m4 \ git -# Environment and toolkit setup for CUDA and other libraries -#ARG HOST_CONFIG -#ARG CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -#ARG CUDA_ARCH=sm_70 -#ARG CMAKE_CUDA_COMPILER=$CUDA_TOOLKIT_ROOT_DIR/bin/nvcc -#ARG CMAKE_CUDA_ARCHITECTURES=70 - -#ENV HYPRE_CUDA_SM=70 -#ENV CUDA_HOME=$CUDA_TOOLKIT_ROOT_DIR - -# Configure and build TPL -#RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh \ -# -DENABLE_CUDA=$ENABLE_CUDA \ -# -DENABLE_HYPRE_DEVICE="CUDA" \ -# -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR \ -# -DCUDA_ARCH=$CUDA_ARCH \ -# -DCMAKE_CUDA_ARCHITECTURES=$CMAKE_CUDA_ARCHITECTURES \ -# -DCMAKE_CUDA_COMPILER=$CMAKE_CUDA_COMPILER - -# Set working directory for the build -#WORKDIR $BLD_DIR - -# Build command -#RUN --mount=src=.,dst=$SRC_DIR make - # Run uberenv # Have to create install directory first for uberenv # -k flag is to ignore SSL errors From f971b98cecc5e4af74df48ec1247296c22410417 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Tue, 3 Sep 2024 14:08:47 -0700 Subject: [PATCH 36/48] Attempt to update LC build script for uberenv --- scripts/setupLC-TPL-uberenv-helper.bash | 2 +- scripts/setupLC-TPL-uberenv.bash | 36 +++++++------------------ 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/scripts/setupLC-TPL-uberenv-helper.bash b/scripts/setupLC-TPL-uberenv-helper.bash index 9ac31a6a..4cbb61ff 100755 --- a/scripts/setupLC-TPL-uberenv-helper.bash +++ b/scripts/setupLC-TPL-uberenv-helper.bash @@ -22,7 +22,7 @@ echo "Building the TPLs on $MACHINE for $COMPILER to be installed at $INSTALL_DI ssh $MACHINE -t " . /etc/profile && -cd $PWD/tempGEOS && +cd $PWD && $GET_A_NODE ./scripts/uberenv/uberenv.py --spec ${SPEC} --prefix ${INSTALL_DIR}/${CONFIG}_tpls --spack-env-name ${CONFIG}_env && exit" > $LOG_FILE 2>&1 diff --git a/scripts/setupLC-TPL-uberenv.bash b/scripts/setupLC-TPL-uberenv.bash index 89c09446..12c28906 100755 --- a/scripts/setupLC-TPL-uberenv.bash +++ b/scripts/setupLC-TPL-uberenv.bash @@ -1,8 +1,7 @@ #!/bin/bash ## Builds the TPLs on all LC systems. Must be run from the top level TPL directory. -## Usage ./setupLC-TPL.bash branchToBuild pathToInstallDirectory -GEOS_BRANCH=$1 +## Usage ./setupLC-TPL.bash pathToInstallDirectory INSTALL_DIR=$2 ## Eat up the command line arguments so the rest can be forwarded to setupLC-TPL-helper. @@ -20,11 +19,8 @@ killall() { echo DONE } -# Check if branch exists -branch_exists=$(git ls-remote https://github.com/GEOS-DEV/GEOS.git $GEOS_BRANCH | wc -l) - -if [[ $branch_exists != 1 ]] ; then - echo "Branch $GEOS_BRANCH does not exist in GEOS repository" +if [[ ! -e "scripts/uberenv/uberenv.py" ]]; then + echo "uberenv.py script not found. Please initialize uberenv submodule first." exit fi @@ -43,34 +39,22 @@ if [[ ! "$INSTALL_DIR" = /* ]]; then exit fi -# Clone GEOS repo to build with uberenv -echo "Cloning branch $GEOS_BRANCH in temporary GEOS repo directory tempGEOS to build TPLs with uberenv..." -rm -rf tempGEOS -git clone -b $GEOS_BRANCH https://github.com/GEOS-DEV/GEOS.git tempGEOS - -cd tempGEOS -git submodule init scripts/uberenv -git submodule update -cd .. - echo "Building all LC TPLs from $GEOS_BRANCH to be installed at $INSTALL_DIR..." -chmod -R g+rx $INSTALL_DIR -chgrp -R GEOS $INSTALL_DIR -./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR quartz clang-14 "%clang@14.0.6 +docs" "salloc -N 1 -t 150 " $@ & -./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR quartz gcc-12 "%gcc@12.1.1 +docs" "salloc -N 1 -t 150 " $@ & + +./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR ruby clang-14 "%clang@14.0.6 +docs" "salloc -N 1 -n 1 -t 150 -A vortex" $@ & +./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR ruby gcc-12 "%gcc@12.1.1 +docs" "salloc -N 1 -n 1 -t 150 -A vortex" $@ & +./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR dane gcc-12 "%gcc@12.1.1 +docs" "salloc -N 1 -n 1 -t 150 -A vortex" $@ & ./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen gcc-8-cuda-11 "%gcc@8.3.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & ./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-13-cuda-11 "%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & ./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-10-cuda-11 "%clang@10.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & +./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-13-cuda-11 "%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@12.0.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & # Note: Estimated completion time is ~90 minutes. # Check log files for unreported completion of jobs. wait -echo "Copying generated host-configs from tempGEOS directory..." -cd tempGEOS && cp *.cmake .. - -echo "Removing temporary GEOS repo tempGEOS..." -rm -rf tempGEOS +chmod -R g+rx $INSTALL_DIR +chgrp -R GEOS $INSTALL_DIR echo "Complete" From 33f21b019905a6dcfb50c8c23e5d50b83ee9bb5e Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 5 Sep 2024 08:24:04 -0700 Subject: [PATCH 37/48] Script arg indexing --- scripts/setupLC-TPL-uberenv.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setupLC-TPL-uberenv.bash b/scripts/setupLC-TPL-uberenv.bash index 12c28906..befed3a0 100755 --- a/scripts/setupLC-TPL-uberenv.bash +++ b/scripts/setupLC-TPL-uberenv.bash @@ -2,7 +2,7 @@ ## Builds the TPLs on all LC systems. Must be run from the top level TPL directory. ## Usage ./setupLC-TPL.bash pathToInstallDirectory -INSTALL_DIR=$2 +INSTALL_DIR=$1 ## Eat up the command line arguments so the rest can be forwarded to setupLC-TPL-helper. shift From 3aa681019889cb831cbd7a45522f0ddb069c5755 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 5 Sep 2024 10:51:34 -0700 Subject: [PATCH 38/48] Script clang13-cuda12 naming --- scripts/setupLC-TPL-uberenv.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setupLC-TPL-uberenv.bash b/scripts/setupLC-TPL-uberenv.bash index befed3a0..28776454 100755 --- a/scripts/setupLC-TPL-uberenv.bash +++ b/scripts/setupLC-TPL-uberenv.bash @@ -47,7 +47,7 @@ echo "Building all LC TPLs from $GEOS_BRANCH to be installed at $INSTALL_DIR..." ./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen gcc-8-cuda-11 "%gcc@8.3.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & ./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-13-cuda-11 "%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & ./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-10-cuda-11 "%clang@10.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & -./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-13-cuda-11 "%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@12.0.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & +./scripts/setupLC-TPL-uberenv-helper.bash $INSTALL_DIR lassen clang-13-cuda-12 "%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@12.0.0+allow-unsupported-compilers" "lalloc 1 -W 150" $@ & # Note: Estimated completion time is ~90 minutes. # Check log files for unreported completion of jobs. From 1bde35cbbc37cdaa8c71af3ed42aba511438348f Mon Sep 17 00:00:00 2001 From: Brian Han Date: Tue, 10 Sep 2024 16:40:19 -0700 Subject: [PATCH 39/48] Keep gcc env vars for mpi4py installation --- docker/tpl-ubuntu-gcc.Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/tpl-ubuntu-gcc.Dockerfile b/docker/tpl-ubuntu-gcc.Dockerfile index 7e420571..16073f61 100644 --- a/docker/tpl-ubuntu-gcc.Dockerfile +++ b/docker/tpl-ubuntu-gcc.Dockerfile @@ -70,6 +70,16 @@ RUN python3 -m pip install --upgrade pip && \ RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh +ENV CC=/usr/bin/gcc-$GCC_MAJOR_VERSION \ + CXX=/usr/bin/g++-$GCC_MAJOR_VERSION \ + MPICC=/usr/bin/mpicc \ + MPICXX=/usr/bin/mpicxx \ + MPIEXEC=/usr/bin/mpirun +# The multi-line definition of arguments does not seem happy +# when a variable uses the value of another variable previously defined on the same line. +ENV OMPI_CC=$CC \ + OMPI_CXX=$CXX + # This stage is dedicated to TPLs uniquely. # A multi-stage build patern will allow to extract what we need for the GEOSX build. FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain From 48a18308ce59b5a4a0164f7243a74a44bf30637f Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 26 Sep 2024 09:41:15 -0700 Subject: [PATCH 40/48] Try pangea3, separate total environment file into separate pangea and pecan --- .github/workflows/docker_build_tpls.yml | 1 - docker/TotalEnergies/Pangea3.Dockerfile | 50 ++++- docker/pangea-spack.yaml | 200 ++++++++++++++++++ docker/{total-spack.yaml => pecan-spack.yaml} | 22 -- docker/rocky-spack.yaml | 5 - 5 files changed, 246 insertions(+), 32 deletions(-) create mode 100644 docker/pangea-spack.yaml rename docker/{total-spack.yaml => pecan-spack.yaml} (84%) diff --git a/.github/workflows/docker_build_tpls.yml b/.github/workflows/docker_build_tpls.yml index 6e6924c7..0b314d73 100644 --- a/.github/workflows/docker_build_tpls.yml +++ b/.github/workflows/docker_build_tpls.yml @@ -64,7 +64,6 @@ jobs: - name: Pangea 3 (AlmaLinux 8.8, gcc 9.4.0, open-mpi 4.1.2, cuda 11.5.0, openblas 0.3.10) DOCKER_REPOSITORY: geosx/pangea3-almalinux8-gcc9.4-openmpi4.1.2-cuda11.5.0-openblas0.3.18 TPL_DOCKERFILE: docker/TotalEnergies/Pangea3.Dockerfile - HOST_CONFIG: host-configs/TOTAL/pangea3-gcc8.4.1-openmpi-4.1.2.cmake DOCKER_ROOT_IMAGE: 7g8efcehpff/pangea-almalinux8-gcc9.4-openmpi4.1.2-cuda11.5.0-openblas0.3.18:4 HOST_ARCH: ppc64le RUNS_ON: streak2 diff --git a/docker/TotalEnergies/Pangea3.Dockerfile b/docker/TotalEnergies/Pangea3.Dockerfile index 974f79dd..f3888849 100644 --- a/docker/TotalEnergies/Pangea3.Dockerfile +++ b/docker/TotalEnergies/Pangea3.Dockerfile @@ -10,6 +10,15 @@ FROM $DOCKER_ROOT_IMAGE as tpl_toolchain_intersect_geosx_toolchain ARG SRC_DIR ARG BLD_DIR +# Install additional required packages for spack +RUN dnf clean all && \ + dnf -y update && \ + dnf -y install \ + autoconf \ + automake \ + libtool \ + unzip + # All the environment variables defined in this Dockerfile # (GEOSX_TPL_DIR but also compiler information like CC, CXX...) # are part of the image contract (otherwise ARG is used). @@ -21,18 +30,51 @@ ARG INSTALL_DIR ENV GEOSX_TPL_DIR=$INSTALL_DIR # Get host config file from docker build arguments -ARG HOST_CONFIG +#ARG HOST_CONFIG FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain + # We now configure the build... -RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh +#RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh # ... before we compile the TPLs! -WORKDIR $BLD_DIR -RUN --mount=src=.,dst=$SRC_DIR make +#WORKDIR $BLD_DIR +#RUN --mount=src=.,dst=$SRC_DIR make + +# Run uberenv +# Have to create install directory first for uberenv +# -k flag is to ignore SSL errors +RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ + mkdir -p ${GEOSX_TPL_DIR} && \ + ./scripts/uberenv/uberenv.py \ + --spec "%gcc@9.4.0+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@11.5.0+allow-unsupported-compilers ^caliper@2.11.0~gotcha~sampler~libunwind~libdw~papi" \ + --spack-env-file=${SRC_DIR}/docker/pangea-spack.yaml \ + --project-json=.uberenv_config.json \ + --prefix ${GEOSX_TPL_DIR} \ + -k && \ +# Remove host-config generated for LvArray + rm lvarray* && \ +# Rename and copy spack-generated host-config to root directory + cp *.cmake /spack-generated-wave-solver-only.cmake && \ +# Remove extraneous spack files + cd ${GEOSX_TPL_DIR} && \ + rm -rf bin/ build_stage/ misc_cache/ spack/ spack_env/ .spack-db/ + +# Build only the wave solver for Pangea 3 +RUN echo 'set ( GEOS_ENABLE_CONTACT OFF CACHE BOOL "" FORCE )' >> /spack-generated-wave-solver-only.cmake && \ + echo 'set ( GEOS_ENABLE_FLUIDFLOW OFF CACHE BOOL "" FORCE )' >> /spack-generated-wave-solver-only.cmake && \ + echo 'set ( GEOS_ENABLE_INDUCEDSEISMICITY OFF CACHE BOOL "" FORCE )' >> /spack-generated-wave-solver-only.cmake && \ + echo 'set ( GEOS_ENABLE_MULTIPHYSICS OFF CACHE BOOL "" FORCE )' >> /spack-generated-wave-solver-only.cmake && \ + echo 'set ( GEOS_ENABLE_SIMPLEPDE OFF CACHE BOOL "" FORCE )' >> /spack-generated-wave-solver-only.cmake && \ + echo 'set ( GEOS_ENABLE_SOLIDMECHANICS OFF CACHE BOOL "" FORCE )' >> /spack-generated-wave-solver-only.cmake && \ + echo 'set ( GEOS_ENABLE_SURFACEGENERATION OFF CACHE BOOL "" FORCE )' >> /spack-generated-wave-solver-only.cmake + # Extract only TPL's from previous stage FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR +# Extract the generated host-config +COPY --from=tpl_toolchain /spack-generated-wave-solver-only.cmake / + ENV SCCACHE=/opt/sccache/bin/sccache diff --git a/docker/pangea-spack.yaml b/docker/pangea-spack.yaml new file mode 100644 index 00000000..5a5a7302 --- /dev/null +++ b/docker/pangea-spack.yaml @@ -0,0 +1,200 @@ +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + - compiler: + spec: gcc@=9.4.0 + paths: + cc: /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/bin/gcc + cxx: /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/bin/g++ + f77: /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/bin/gfortran + fc: /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/bin/gfortran + flags: {} + operating_system: almalinux8 + target: ppc64le + modules: [] + environment: {} + extra_rpaths: [] + + packages: + all: + target: [x86_64] + compiler: [gcc] + providers: + blas: [openblas] + lapack: [openblas] + mpi: [openmpi] + + + # v0.6.2 + blt: + require: "@git.9ff77344f0b2a6ee345e452bddd6bfd46cbbfa35=develop" + + # Develop - 7/31/24 + hypre: + require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" + + # v2024.07.0 + chai: + require: "@git.df7741f1dbbdc5fff5f7d626151fdf1904e62b19=develop" + + # v2024.07.0 + umpire: + require: "@git.abd729f40064175e999a83d11d6b073dac4c01d2=develop" + + # v2024.07.0 + raja: + require: "@git.4d7fcba55ebc7cb972b7cc9f6778b48e43792ea1=develop" + + # v2024.07.0 + camp: + require: "@git.0f07de4240c42e0b38a8d872a20440cb4b33d9f5=main" + + # v0.9.2 + conduit: + require: "@git.ad86e316ad56a75c099d30ca5ce75cff275b5924=develop" + + uncrustify: + require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" + + superlu-dist: + require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" + + autoconf: + externals: + - spec: autoconf@2.69 + prefix: /usr + buildable: false + automake: + externals: + - spec: automake@1.16.1 + prefix: /usr + buildable: false + bison: + externals: + - spec: bison@3.0.4 + prefix: /usr + buildable: false + cmake: + externals: + - spec: cmake@3.26.4 + prefix: /data_local/appli_local/MTS/GEOSX/cmake/3.26.4 + buildable: false + cuda: + externals: + - spec: cuda@11.5.0 +allow-unsupported-compilers + prefix: /data_local/sw/cuda/11.5.0 + buildable: false + flex: + externals: + - spec: flex@2.6.1+lex + prefix: /usr + buildable: false + gettext: + externals: + - spec: gettext@0.19.8.1 + prefix: /usr + buildable: false + glibc: + externals: + - spec: glibc@2.28 + prefix: /usr + buildable: false + gmp: + externals: + - spec: gmp@6.1.2 + prefix: /usr + buildable: false + gmake: + externals: + - spec: gmake@4.2.1 + prefix: /usr + buildable: false + + openblas: + externals: + - spec: openblas@0.3.18 + prefix: /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-9.4.0/openblas-0.3.18-vk36pzksytuhylqesg4cca7667np5sjp + buildable: false + blas: + buildable: false + lapack: + buildable: false + + libtool: + externals: + - spec: libtool@2.4.6 + prefix: /usr + buildable: false + m4: + externals: + - spec: m4@1.4.18 + prefix: /usr + buildable: false + + # Spack may grab for mpi & we don't want to use them + mpi: + buildable: false + + openmpi: + externals: + - spec: openmpi@4.1.2%gcc@9.4.0 + prefix: /data_local/sw/openmpi/4.1.2/env/gcc-8.4.1 + + ncurses: + externals: + - spec: ncurses@6.1 + prefix: /usr + buildable: false + + perl: + externals: + - spec: perl@5.26.3~cpanm+opcode+open+shared+threads + prefix: /usr + buildable: false + pkgconf: + externals: + - spec: pkgconf@1.4.2 + prefix: /usr + buildable: false + python: + externals: + - spec: python@3.8.17+bz2+crypt+ctypes+dbm+lzma+nis+pyexpat~pythoncmd+readline+sqlite3+ssl~tkinter+uuid+zlib + prefix: /usr + buildable: false + readline: + externals: + - spec: readline@7.0 + prefix: /usr + buildable: false + tar: + externals: + - spec: tar@1.30 + prefix: /usr + buildable: false + unzip: + buildable: false + externals: + - spec: unzip@6.0 + prefix: /usr + xz: + externals: + - spec: xz@5.2.4 + prefix: /usr + buildable: false + zlib: + externals: + - spec: zlib@1.2.11 + prefix: /usr + buildable: false diff --git a/docker/total-spack.yaml b/docker/pecan-spack.yaml similarity index 84% rename from docker/total-spack.yaml rename to docker/pecan-spack.yaml index 0c71cd4b..95f93c37 100644 --- a/docker/total-spack.yaml +++ b/docker/pecan-spack.yaml @@ -13,22 +13,6 @@ spack: view: false compilers:: - # Pangea 2 compiler - - compiler: - environment: {} - extra_rpaths: [] - flags: - cflags: -pthread - cxxflags: -pthread - modules: [] - operating_system: centos7 - paths: - cc: /data_local/sw/gcc/RHEL7/8.3.0/bin/gcc - cxx: /data_local/sw/gcc/RHEL7/8.3.0/bin/g++ - f77: /data_local/sw/gcc/RHEL7/8.3.0/bin/gfortran - fc: /data_local/sw/gcc/RHEL7/8.3.0/bin/gfortran - spec: gcc@8.3.0 - target: x86_64 # Pecan CPU/GPU compiler - compiler: environment: {} @@ -130,9 +114,6 @@ spack: intel-mkl: buildable: False externals: - # Pangea 2 - - spec: intel-mkl@2019.3.199%gcc@8.3.0 threads=openmp - prefix: /opt/intel/compilers_and_libraries_2019.3.199/linux/mkl/ # Pecan CPU/GPU - spec: intel-mkl@2019.5.281%gcc@8.2.0 threads=openmp prefix: /opt/intel/compilers_and_libraries_2019.5.281/linux/mkl/ @@ -154,9 +135,6 @@ spack: openmpi: externals: - # Pangea2 - - spec: openmpi@2.1.5%gcc@8.3.0 - prefix: /data_local/sw/OpenMPI/RHEL7/2.1.5/gcc/8.3.0 # Pecan CPU/GPU - spec: openmpi@4.0.1%gcc@8.2.0 prefix: /hrtc/apps/mpi/openmpi/4.0.1/RDHPC/gcc/8.2.0 diff --git a/docker/rocky-spack.yaml b/docker/rocky-spack.yaml index 2cdcd2f9..04d34159 100644 --- a/docker/rocky-spack.yaml +++ b/docker/rocky-spack.yaml @@ -157,11 +157,6 @@ spack: externals: - spec: pkg-config@1.4.2 prefix: /usr - py-sphinx: - buildable: false - externals: - - spec: py-sphinx@4.3.2 - prefix: /usr python: buildable: false externals: From 86e4f0f0d7b375b3c74fff1ac103fea1cfcfbe66 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 26 Sep 2024 09:50:14 -0700 Subject: [PATCH 41/48] Remove leftover merge comment --- scripts/docker-build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/docker-build.sh b/scripts/docker-build.sh index 0cbfdf19..8cd56c39 100644 --- a/scripts/docker-build.sh +++ b/scripts/docker-build.sh @@ -3,7 +3,6 @@ env # We save memory for the docker context echo .git > .dockerignore -<<<<<<< HEAD:scripts/docker-build-and-push.sh # Get uberenv submodule git submodule update --init scripts/uberenv From d216b25ca240997c2f4b567c8ada1e61da0cd995 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 26 Sep 2024 12:04:27 -0700 Subject: [PATCH 42/48] change openmpi spec --- docker/pangea-spack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/pangea-spack.yaml b/docker/pangea-spack.yaml index 5a5a7302..6a94c597 100644 --- a/docker/pangea-spack.yaml +++ b/docker/pangea-spack.yaml @@ -149,7 +149,7 @@ spack: openmpi: externals: - - spec: openmpi@4.1.2%gcc@9.4.0 + - spec: openmpi@4.1.2%gcc@9.4.0 +cuda~cxx~cxx_exceptions~java+lustre~memchecker+pmi+static~wrapper-rpath schedulers=lsf prefix: /data_local/sw/openmpi/4.1.2/env/gcc-8.4.1 ncurses: From 9e96477b5db44d694adc02be0c41859e463f1fcd Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 26 Sep 2024 15:46:58 -0700 Subject: [PATCH 43/48] Spelling, flag geosx recipe adjustments --- scripts/spack_packages/packages/geosx/package.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 8129575d..74161f8d 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -519,11 +519,11 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): cfg.write(cmake_cache_option('ENABLE_CALIPER_HYPRE', True)) if 'lai=trilinos' in spec: - cfg.write(cmake_cache_entry('GEOSX_LA_INTERFACE', 'Trilinos')) + cfg.write(cmake_cache_entry('GEOS_LA_INTERFACE', 'Trilinos')) if 'lai=hypre' in spec: - cfg.write(cmake_cache_entry('GEOSX_LA_INTERFACE', 'Hypre')) + cfg.write(cmake_cache_entry('GEOS_LA_INTERFACE', 'Hypre')) if 'lai=petsc' in spec: - cfg.write(cmake_cache_entry('GEOSX_LA_INTERFACE', 'Petsc')) + cfg.write(cmake_cache_entry('GEOS_LA_INTERFACE', 'Petsc')) cfg.write('#{0}\n'.format('-' * 80)) cfg.write('# Python\n') @@ -650,9 +650,9 @@ def lvarray_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): release_flags = "-O3 -DNDEBUG" cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELEASE", release_flags)) - reldebinf_flags = "-O3 -g -DNDEBUG" + reldebinf_flags = "-O2 -g -DNDEBUG" cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELWITHDEBINFO", reldebinf_flags)) - debug_flags = "-O0 -g" + debug_flags = "-g" cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", debug_flags)) if "%clang arch=linux-rhel7-ppc64le" in spec: From 1f2c29f1564d7ad075ad9e46d10eeea4a6098b4d Mon Sep 17 00:00:00 2001 From: Brian Han Date: Tue, 8 Oct 2024 09:08:48 -0700 Subject: [PATCH 44/48] Possible rpaths and LD_LIBRARY_PATH options for pangea-3 --- docker/pangea-spack.yaml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/docker/pangea-spack.yaml b/docker/pangea-spack.yaml index 6a94c597..8006394e 100644 --- a/docker/pangea-spack.yaml +++ b/docker/pangea-spack.yaml @@ -24,8 +24,22 @@ spack: operating_system: almalinux8 target: ppc64le modules: [] - environment: {} + # environment: {} + environment: + prepend_path: + LD_LIBRARY_PATH: /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib + # LD_LIBRARY_PATH: /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-9.4.0/openblas-0.3.18-vk36pzksytuhylqesg4cca7667np5sjp/lib:/data_local/sw/cuda/11.5.0/lib64:/data_local/sw/cuda/11.5.0/extras/CUPTI/lib64:/data_local/sw/openmpi/4.1.2/env/gcc-8.4.1/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib64 extra_rpaths: [] + # extra_rpaths: + # - /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib + # extra_rpaths: + # - /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib + # - /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-9.4.0/openblas-0.3.18-vk36pzksytuhylqesg4cca7667np5sjp/lib + # - /data_local/sw/cuda/11.5.0/lib64 + # - /data_local/sw/cuda/11.5.0/extras/CUPTI/lib64 + # - /data_local/sw/openmpi/4.1.2/env/gcc-8.4.1/lib + # - /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib + # - /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib64 packages: all: @@ -151,7 +165,11 @@ spack: externals: - spec: openmpi@4.1.2%gcc@9.4.0 +cuda~cxx~cxx_exceptions~java+lustre~memchecker+pmi+static~wrapper-rpath schedulers=lsf prefix: /data_local/sw/openmpi/4.1.2/env/gcc-8.4.1 - + # extra_attributes: + # environment: + # prepend_path: + # #LD_LIBRARY_PATH: /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib:/lib64:/usr/lib64 + # LD_LIBRARY_PATH: /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-9.4.0/openblas-0.3.18-vk36pzksytuhylqesg4cca7667np5sjp/lib:/data_local/sw/cuda/11.5.0/lib64:/data_local/sw/cuda/11.5.0/extras/CUPTI/lib64:/data_local/sw/openmpi/4.1.2/env/gcc-8.4.1/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib64 ncurses: externals: - spec: ncurses@6.1 From 480eedae5a5425f5e9b1b748b2323a6d582c7435 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Tue, 8 Oct 2024 13:29:39 -0700 Subject: [PATCH 45/48] cleanup paths, add symlinks so spack can find link dependencies, bump cmake requirement --- docker/TotalEnergies/Pangea3.Dockerfile | 14 ++++++++++++++ docker/pangea-spack.yaml | 17 ----------------- .../spack_packages/packages/geosx/package.py | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/docker/TotalEnergies/Pangea3.Dockerfile b/docker/TotalEnergies/Pangea3.Dockerfile index f3888849..2704a85e 100644 --- a/docker/TotalEnergies/Pangea3.Dockerfile +++ b/docker/TotalEnergies/Pangea3.Dockerfile @@ -45,6 +45,13 @@ FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain # -k flag is to ignore SSL errors RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \ mkdir -p ${GEOSX_TPL_DIR} && \ +# Create symlink to existing libraries sp spack can find + ln -s /usr/lib64/libhwloc.so.15 /usr/lib64/libhwloc.so && \ + ln -s /usr/lib64/libibverbs.so.1.14.48.0 /usr/lib64/libibverbs.so && \ + ln -s /usr/lib64/libnsl.so.2.0.0 /usr/lib64/libnsl.so && \ + ln -s /usr/lib64/librdmacm.so.1.3.48.0 /usr/lib64/librdmacm.so && \ + ln -s /usr/lib64/liblustreapi.so.1 /usr/lib64/liblustreapi.so && \ +# Run uberenv ./scripts/uberenv/uberenv.py \ --spec "%gcc@9.4.0+cuda~uncrustify~openmp~pygeosx cuda_arch=70 ^cuda@11.5.0+allow-unsupported-compilers ^caliper@2.11.0~gotcha~sampler~libunwind~libdw~papi" \ --spack-env-file=${SRC_DIR}/docker/pangea-spack.yaml \ @@ -77,4 +84,11 @@ COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR # Extract the generated host-config COPY --from=tpl_toolchain /spack-generated-wave-solver-only.cmake / +# Regenerate symlinks for existing libraries +RUN ln -s /usr/lib64/libhwloc.so.15 /usr/lib64/libhwloc.so && \ + ln -s /usr/lib64/libibverbs.so.1.14.48.0 /usr/lib64/libibverbs.so && \ + ln -s /usr/lib64/libnsl.so.2.0.0 /usr/lib64/libnsl.so && \ + ln -s /usr/lib64/librdmacm.so.1.3.48.0 /usr/lib64/librdmacm.so && \ + ln -s /usr/lib64/liblustreapi.so.1 /usr/lib64/liblustreapi.so + ENV SCCACHE=/opt/sccache/bin/sccache diff --git a/docker/pangea-spack.yaml b/docker/pangea-spack.yaml index 8006394e..e08028c6 100644 --- a/docker/pangea-spack.yaml +++ b/docker/pangea-spack.yaml @@ -24,22 +24,10 @@ spack: operating_system: almalinux8 target: ppc64le modules: [] - # environment: {} environment: prepend_path: LD_LIBRARY_PATH: /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib - # LD_LIBRARY_PATH: /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-9.4.0/openblas-0.3.18-vk36pzksytuhylqesg4cca7667np5sjp/lib:/data_local/sw/cuda/11.5.0/lib64:/data_local/sw/cuda/11.5.0/extras/CUPTI/lib64:/data_local/sw/openmpi/4.1.2/env/gcc-8.4.1/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib64 extra_rpaths: [] - # extra_rpaths: - # - /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib - # extra_rpaths: - # - /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib - # - /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-9.4.0/openblas-0.3.18-vk36pzksytuhylqesg4cca7667np5sjp/lib - # - /data_local/sw/cuda/11.5.0/lib64 - # - /data_local/sw/cuda/11.5.0/extras/CUPTI/lib64 - # - /data_local/sw/openmpi/4.1.2/env/gcc-8.4.1/lib - # - /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib - # - /data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib64 packages: all: @@ -165,11 +153,6 @@ spack: externals: - spec: openmpi@4.1.2%gcc@9.4.0 +cuda~cxx~cxx_exceptions~java+lustre~memchecker+pmi+static~wrapper-rpath schedulers=lsf prefix: /data_local/sw/openmpi/4.1.2/env/gcc-8.4.1 - # extra_attributes: - # environment: - # prepend_path: - # #LD_LIBRARY_PATH: /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib:/lib64:/usr/lib64 - # LD_LIBRARY_PATH: /data_local/sw/lsf/10.1/linux3.10-glibc2.17-ppc64le/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-9.4.0/openblas-0.3.18-vk36pzksytuhylqesg4cca7667np5sjp/lib:/data_local/sw/cuda/11.5.0/lib64:/data_local/sw/cuda/11.5.0/extras/CUPTI/lib64:/data_local/sw/openmpi/4.1.2/env/gcc-8.4.1/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib:/data_local/sw/spack/0.17.0/opt/spack/linux-rhel8-power9le/gcc-8.4.1/gcc-9.4.0-xe5cqnyajaqz75up3gflln5zlj2rue5v/lib64 ncurses: externals: - spec: ncurses@6.1 diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 74161f8d..10599467 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -85,7 +85,7 @@ class Geosx(CMakePackage, CudaPackage): # SPHINX_BEGIN_DEPENDS - depends_on('cmake@3.23:', type='build') + depends_on('cmake@3.24:', type='build') depends_on('blt') From 24b6d226948e3b8d59d6ded23f0f2e191c6526ad Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 9 Oct 2024 16:19:58 -0700 Subject: [PATCH 46/48] Have spack build part of texinfo dependencies, install bzip2 for tar --- docker/TotalEnergies/Pangea3.Dockerfile | 1 + docker/pangea-spack.yaml | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docker/TotalEnergies/Pangea3.Dockerfile b/docker/TotalEnergies/Pangea3.Dockerfile index 2704a85e..c60002cc 100644 --- a/docker/TotalEnergies/Pangea3.Dockerfile +++ b/docker/TotalEnergies/Pangea3.Dockerfile @@ -17,6 +17,7 @@ RUN dnf clean all && \ autoconf \ automake \ libtool \ + bzip2 \ unzip # All the environment variables defined in this Dockerfile diff --git a/docker/pangea-spack.yaml b/docker/pangea-spack.yaml index e08028c6..38ffff86 100644 --- a/docker/pangea-spack.yaml +++ b/docker/pangea-spack.yaml @@ -88,6 +88,11 @@ spack: - spec: bison@3.0.4 prefix: /usr buildable: false + bzip2: + externals: + - spec: bzip2@1.0.6 + prefix: /usr + buildable: false cmake: externals: - spec: cmake@3.26.4 @@ -103,11 +108,11 @@ spack: - spec: flex@2.6.1+lex prefix: /usr buildable: false - gettext: - externals: - - spec: gettext@0.19.8.1 - prefix: /usr - buildable: false + # gettext: + # externals: + # - spec: gettext@0.19.8.1 + # prefix: /usr + # buildable: false glibc: externals: - spec: glibc@2.28 From cc2fdfaa38191fbd47c9f4ccfd0265bea5d11d10 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 10 Oct 2024 08:20:47 -0700 Subject: [PATCH 47/48] Let spack build ncurses --- docker/pangea-spack.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/pangea-spack.yaml b/docker/pangea-spack.yaml index 38ffff86..8f590bea 100644 --- a/docker/pangea-spack.yaml +++ b/docker/pangea-spack.yaml @@ -158,11 +158,11 @@ spack: externals: - spec: openmpi@4.1.2%gcc@9.4.0 +cuda~cxx~cxx_exceptions~java+lustre~memchecker+pmi+static~wrapper-rpath schedulers=lsf prefix: /data_local/sw/openmpi/4.1.2/env/gcc-8.4.1 - ncurses: - externals: - - spec: ncurses@6.1 - prefix: /usr - buildable: false + # ncurses: + # externals: + # - spec: ncurses@6.1 + # prefix: /usr + # buildable: false perl: externals: From fa0f98c30d34b48dd1d17f4ecf65eb27fb2cb3ca Mon Sep 17 00:00:00 2001 From: Brian Han Date: Thu, 10 Oct 2024 11:56:26 -0700 Subject: [PATCH 48/48] Use built gettext --- docker/pangea-spack.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docker/pangea-spack.yaml b/docker/pangea-spack.yaml index 8f590bea..e0104f25 100644 --- a/docker/pangea-spack.yaml +++ b/docker/pangea-spack.yaml @@ -108,11 +108,11 @@ spack: - spec: flex@2.6.1+lex prefix: /usr buildable: false - # gettext: - # externals: - # - spec: gettext@0.19.8.1 - # prefix: /usr - # buildable: false + gettext: + externals: + - spec: gettext@0.19.8.1 + prefix: /usr + buildable: false glibc: externals: - spec: glibc@2.28 @@ -158,12 +158,13 @@ spack: externals: - spec: openmpi@4.1.2%gcc@9.4.0 +cuda~cxx~cxx_exceptions~java+lustre~memchecker+pmi+static~wrapper-rpath schedulers=lsf prefix: /data_local/sw/openmpi/4.1.2/env/gcc-8.4.1 + + # Built-in ncurses causes spack failure # ncurses: # externals: # - spec: ncurses@6.1 # prefix: /usr # buildable: false - perl: externals: - spec: perl@5.26.3~cpanm+opcode+open+shared+threads