* ceed bundle package including OCCA, MAGMA, Nek5000, mfem, and PETSc

Very preliminary, a lot of ad hoc decisions, fragile, missing functionality
All packages do build on my MacOS laptop with Cuda

Funded-by: ECP
Project: CEED
Time: 4 hours
Reported-by: Tzanio Kolev <kolev1@llnl.gov>

* Some adjustments in a few CEED-related packages.

This is still very preliminary, but with these changes I'm able to build from
scratch on a Mac laptop and a Linux desktop (RHEL7).

Note that there doesn't seem to be a good way to support CUDA in Spack, so
you'll have to install that manually yourself. You will also need a Fortran
compiler, in particular on a Mac where you also have to make sure that it
is being picked up in ~/.spack/darwin/compilers.yaml.

* ceed bundle package including OCCA, MAGMA, Nek5000, mfem, and PETSc

Very preliminary, a lot of ad hoc decisions, fragile, missing functionality
All packages do build on my MacOS laptop with Cuda

Funded-by: ECP
Project: CEED
Time: 4 hours
Reported-by: Tzanio Kolev <kolev1@llnl.gov>

* Reverting Mac-related CUDA checks in the OCCA and MAGMA packages.

A much better solution is to install CUDA manually and add it to
~/.spack/darwin/packages.yaml:

packages:
    cuda:
        paths:
            cuda@8.0.54: /usr/local/cuda

* Fix flake8 warnings

Funded-by: CEED
Project: CEED/Spack

* remove unneeded commented out code

Funded-by: CEED
Project: CEED/Spack

* Don't have PETSc use MUMPS to speedup install time, try parallel installs for Magma

Funded-by: CEED
Project: CEED/Spack

* Added libceed package and made changes to get the ceed metapackage up and running.

* Get the ceed package up and running and added installing the .h file in the libceed package.

* All packages are now pointed at specific versions (either tagged or git hashed.

* Changed some of the specific versions in the CEED metapackage.

* Some version updates.

* Applied Cameron Smith's patch for the latest pumi.

* Merge

* Nek5000: Use tarball instead of git tag

* Major update of the mfem package - needs more testing. Add a testing
shell script for mfem, test_builds.sh, in the mfem directory. It builds
a number of mfem configurations to ensure they all work.

Add 'suite-sparse' variant to petsc.

Add 'develop' version of libceed.

Add 'metis' variant of laghos.

Update the dependencies of ceed.

* Changes in petsc's handling of zlib to make the latest build work on Mac.

* [MFEM] When using '+libunwind', mfem needs '-ldl'.

* [OCCA] Remove debug print statements.

* [PETSc] Replace the check ('zlib' in spec) with ('+zlib' in spec) - the
latter checks if 'zlib' variant of petsc is enabled which is incorrect;
the former checks if petsc is configured to depend on 'zlib'.

* [MFEM] Add conduit variant.

* [libCEED] Enable testing using 'make prove'.

* [MFEM] Tweak test_builds.sh - all builds pass on fedora 27.

* Add a post install test

* Add a post installation check for NekCEM

* pumi: bump git hash, remove unused patch

* Fixed testing of Laghos package

* Adding variants in CEED package

* Empty file for URL didn't work on LLNL/LC. Replacing with bundle-package.txt -> README.md.

* [MFEM] If the spec defines the 'cxxflags' compiler flags, use that value
to set the CXXFLAGS value in the mfem build system.

* Disabling HDF5 by default.

You can still build it with "spack install ceed+hdf5".

* libceed: fix use of prefix versus DESTDIR

* Added cuda variant for libCEED (off by default)

* [libCEED] When building v0.1, fix ceed.pc before installing it.

* [CEED] Add variants for OCCA and PUMI. Replace the hdf5 variant with
a variant called quickbuild that disables variants in packages to
speedup the build - currently hdf5, boost, and superlu-dist in PETSc.

* [libCEED] Remove unused 'import os'.

* [MAGMA] Add version 2.3.0.

* [OCCA] Major update of occa/package.py.

* [libCEED] Several improvements.

* [CEED] Use fixed versions for occa and libceed.

* [OCCA] Fix a bug in CUDA setup.

* NekCEM doesn't need depends_on('python')

* [OCCA,libCEED,MFEM,CEED] Update occa and libceed versions plus a few
tweaks in occa and mfem.

* Switching to gslib-1.0.2 to fix summitdev bug.

* [Nek5000] Use the Fortran 77 compiler instead of the 'fc' compiler.
Propagate any 'fflags' and 'cflags' specifications to the Nek tools.

* [MFEM] Tweak for 'ppc64le'.

* attempt to override fips compatibility error for md5

* Compiler option changes in libCEED to fix summitdev build.

* Disable the nekcem install test until it can be fixed.

* [NekCEM] Major update of the package to fix various issues.

* [NekCEM] Fix formatting

* zoltan: remove non-portable -g0 flag

the pgi compiler does not accept it

* pumi: specify dependency on cmake > 3

* [Nek5000] Add dependency on libx11 when needed. Various hacks to
support IBM XL compilers.

* [NekCEM] Link with the pthreads library - it is required.

* [MAGMA] Add a patch for magma v2.3.0 when building with gcc <= 4.8.
Add dependency on BLAS.

* [CEED] Update to magma 2.3.0. When building with gcc < 4.9 constrain
the used suite-sparse version to <= 5.1.0 - starting with v5.2.0,
suite-sparse requires gcc >= 4.9.

* Small updates

* [libceed, gslib] Fix style

* [Nek5000] Need 'libxt' as a dependency as well.

* [MUMPS] Temporary workaround for ray.

* Updating occa and libceed to laters pre-1.0.0 and pre-0.2 hashes

* petsc: add pkg-config patch for variable quoting

Variable definitions in pkg-config are processed more like make than a
shell, so don't need quoting.  Older versions of pkg-config (<= 0.28)
did not remove the quotes when printing the value.

Freedesktop #67904 (https://bugs.freedesktop.org/show_bug.cgi?id=67904)

Reported-by: Tzanio Kolev <kolev1@llnl.gov>

* petsc: add 3.8.4 and myself as co-maintainer

* Updating libceed to latest pre-0.2 hash.

* [PETSc] Add the 'headers' and 'libs' properties.

* [MFEM] Explicitly add rpaths to link flags for external packages.
This is necessary when MFEM's exported options (in config.mk) are
used outside of Spack for linking against MFEM.

* Unset MFEM_DIR before building MFEM

* [PETSc] As observed by @jedbrown, there is no need to define the 'libs'
property explicitly - the default handler works fine too.

* Build MAGMA shared by default, install a few additional headers

* Forgot a self

* Switching to OCCA tag v1.0.0-alpha.4.

Adding urls for OCCA and libCEED ('spack uninstall' complains otherwise).

* Removed FIXMEs for OCCA tag

* [occa] Cleaned up tagged versions

* [libceed] Updated occa to v1.0.0-alpha.5

* [ceed] Updated occa to v1.0.0-alpha.5

* [libCEED] Always define the 'NDEBUG' makefile option based on the
'debug' variant setting - this should always work regardless of the
default setting inside the libceed makefile.

* [MUMPS] Revert a temporary workaround.

* [CEED, libCEED] Minor tweaks.

* libCEED v0.2 release

* [CEED] Use version 0.2 of libCEED.

* [HPGMG] Remove duplicate version.

* [CEED] Update the hpgmg version

* hpgmg: use tarball for 0.3

The Git repository contains somewhat heavy documentation so the tarballs
are much faster.

* hpgmg: +fe was default for the 0.3 release

* hpgmg: explicitly name build directory to avoid use of ambient PETSC_ARCH

* [HPGMG] Fix flake8 formatting

* libceed@0.2: work around occaFree issue
This commit is contained in:
Aaron Fisher
2018-03-31 00:47:32 -07:00
committed by Veselin Dobrev
parent b3f6015e32
commit b62ed20f3f
19 changed files with 1100 additions and 213 deletions

View File

@@ -25,6 +25,7 @@
from spack import *
import numbers
import os
def is_integral(x):
@@ -46,8 +47,9 @@ class Nek5000(Package):
tags = ['cfd', 'flow', 'hpc', 'solver', 'navier-stokes',
'spectral-elements', 'fluid']
version('17.0', git='https://github.com/Nek5000/Nek5000.git',
commit='469daf94d3f9aa3ba9d258d8eee9ebde6893a702')
version('17.0', '6a13bfad2ce023897010dd88f54a0a87',
url="https://github.com/Nek5000/Nek5000/releases/download/"
"v17.0/Nek5000-v17.0.tar.gz")
version('develop', git='https://github.com/Nek5000/Nek5000.git',
branch='master')
@@ -56,6 +58,9 @@ class Nek5000(Package):
variant('profiling', default=True, description='Build with profiling data.')
variant('visit', default=False, description='Build with Visit.')
# TODO: add a variant 'blas' or 'external-blas' to enable the usage of
# Spack installed/configured blas.
# Variant for MAXNEL, we need to read this from user
variant(
'MAXNEL',
@@ -76,27 +81,106 @@ class Nek5000(Package):
# Dependencies
depends_on('mpi', when="+mpi")
depends_on('libx11', when="+prenek")
depends_on('libx11', when="+postnek")
# libxt is needed for X11/Intrinsic.h but not for linking
depends_on('libxt', when="+prenek")
depends_on('libxt', when="+postnek")
depends_on('visit', when="+visit")
@run_before('install')
def fortran_check(self):
if not self.compiler.fc:
msg = 'Cannot build Nek5000 without a Fortran compiler.'
if not self.compiler.f77:
msg = 'Cannot build Nek5000 without a Fortran 77 compiler.'
raise RuntimeError(msg)
@run_after('install')
def test_install(self):
currentDir = os.getcwd()
eddyDir = 'short_tests/eddy'
os.chdir(eddyDir)
os.system(join_path(self.prefix.bin, 'makenek') + ' eddy_uv')
if not os.path.isfile(join_path(os.getcwd(), 'nek5000')):
msg = 'Cannot build example: short_tests/eddy.'
raise RuntimeError(msg)
os.chdir(currentDir)
def install(self, spec, prefix):
toolsDir = 'tools'
binDir = 'bin'
FC = self.compiler.fc
# Do not use the Spack compiler wrappers.
# Use directly the compilers:
FC = self.compiler.f77
CC = self.compiler.cc
fflags = spec.compiler_flags['fflags']
cflags = spec.compiler_flags['cflags']
if ('+prenek' in spec) or ('+postnek' in spec):
libx11_h = find_headers('Xlib', spec['libx11'].prefix.include,
recursive=True)
if not libx11_h:
raise RuntimeError('Xlib.h not found in %s' %
spec['libx11'].prefix.include)
cflags += ['-I%s' % os.path.dirname(libx11_h.directories[0])]
libxt_h = find_headers('Intrinsic', spec['libxt'].prefix.include,
recursive=True)
if not libxt_h:
raise RuntimeError('X11/Intrinsic.h not found in %s' %
spec['libxt'].prefix.include)
cflags += ['-I%s' % os.path.dirname(libxt_h.directories[0])]
if self.compiler.name in ['xl', 'xl_r']:
# Use '-qextname' to add underscores.
# Use '-WF,-qnotrigraph' to fix an error about a string: '... ??'
fflags += ['-qextname', '-WF,-qnotrigraph']
fflags = ' '.join(fflags)
cflags = ' '.join(cflags)
# Build the tools, maketools copy them to Nek5000/bin by default.
# We will then install Nek5000/bin under prefix after that.
with working_dir(toolsDir):
# Update the maketools script to use correct compilers
filter_file(r'^FC\s*=.*', 'FC="{0}"'.format(FC), 'maketools')
filter_file(r'^CC\s*=.*', 'CC="{0}"'.format(CC), 'maketools')
filter_file(r'^#FC\s*=.*', 'FC="{0}"'.format(FC), 'maketools')
filter_file(r'^#CC\s*=.*', 'CC="{0}"'.format(CC), 'maketools')
if fflags:
filter_file(r'^#FFLAGS=.*', 'FFLAGS="{0}"'.format(fflags),
'maketools')
if cflags:
filter_file(r'^#CFLAGS=.*', 'CFLAGS="{0}"'.format(cflags),
'maketools')
if self.compiler.name in ['xl', 'xl_r']:
# Patch 'maketools' to use '-qextname' when checking for
# underscore becasue 'xl'/'xl_r' use this option to enable the
# addition of the underscore.
filter_file(r'^\$FC -c ', '$FC -qextname -c ', 'maketools')
libx11_lib = find_libraries('libX11', spec['libx11'].prefix.lib,
shared=True, recursive=True)
if not libx11_lib:
libx11_lib = \
find_libraries('libX11', spec['libx11'].prefix.lib64,
shared=True, recursive=True)
if not libx11_lib:
raise RuntimeError('libX11 not found in %s/{lib,lib64}' %
spec['libx11'].prefix)
# There is no other way to set the X11 library path except brute
# force:
filter_file(r'-L\$\(X\)', libx11_lib.search_flags,
join_path('prenek', 'makefile'))
filter_file(r'-L\$\(X\)', libx11_lib.search_flags,
join_path('postnek', 'makefile'))
if self.compiler.name in ['xl', 'xl_r']:
# Use '-qextname' when compiling mxm.f
filter_file('\$\(OLAGS\)', '-qextname $(OLAGS)',
join_path('postnek', 'makefile'))
# Define 'rename_' function that calls 'rename'
with open(join_path('postnek', 'xdriver.c'), 'a') as xdriver:
xdriver.write('\nvoid rename_(char *from, char *to)\n{\n'
' rename(from, to);\n}\n')
maxnel = self.spec.variants['MAXNEL'].value
filter_file(r'^#MAXNEL\s*=.*', 'MAXNEL=' + maxnel, 'maketools')
@@ -106,8 +190,9 @@ def install(self, spec, prefix):
# Build the tools
if '+genbox' in spec:
makeTools('genbox')
if '+int_tp' in spec and self.version == Version('17.0.0-beta2'):
makeTools('int_tp')
# "ERROR: int_tp does not exist!"
# if '+int_tp' in spec:
# makeTools('int_tp')
if '+n2to3' in spec:
makeTools('n2to3')
if '+postnek' in spec:
@@ -138,11 +223,26 @@ def install(self, spec, prefix):
# Update the makenek to use correct compilers and
# Nek5000 source.
if self.version >= Version('17.0'):
filter_file(r'^#FC\s*=.*', 'FC="{0}"'.format(FC), 'makenek')
filter_file(r'^#CC\s*=.*', 'CC="{0}"'.format(CC), 'makenek')
filter_file(r'^#SOURCE_ROOT\s*=\"\$H.*', 'SOURCE_ROOT=\"' +
prefix.bin.Nek5000 + '\"', 'makenek')
filter_file(r'^#FC\s*=.*', 'FC="{0}"'.format(FC), 'makenek')
filter_file(r'^#CC\s*=.*', 'CC="{0}"'.format(CC), 'makenek')
filter_file(r'^#SOURCE_ROOT\s*=\"\$H.*', 'SOURCE_ROOT=\"' +
prefix.bin.Nek5000 + '\"', 'makenek')
if fflags:
filter_file(r'^#FFLAGS=.*', 'FFLAGS="{0}"'.format(fflags),
'makenek')
if cflags:
filter_file(r'^#CFLAGS=.*', 'CFLAGS="{0}"'.format(cflags),
'makenek')
with working_dir('core'):
if self.compiler.name in ['xl', 'xl_r']:
# Patch 'core/makenek.inc' and 'makefile.template' to use
# '-qextname' when checking for underscore becasue 'xl'/'xl_r'
# use this option to enable the addition of the underscore.
filter_file(r'^\$FCcomp -c ', '$FCcomp -qextname -c ',
'makenek.inc')
filter_file(r'\$\(FC\) -c \$\(L0\)',
'$(FC) -c -qextname $(L0)', 'makefile.template')
# Install Nek5000/bin in prefix/bin
install_tree(binDir, prefix.bin)