Moab 5.0 and meshkit 1.5 (#4557)

* enable some of the tools

do not make zoltan default

* modify moab package

add shared, debug options to cgm, too
build some tools by default (mbsize, mbconvert)
add hdf5, netcdf dependency
add pnetcdf variant (dependency), metis, parmetis, zoltan
add shared, debug, fortran options to moab

* few kinks for moab

zoltan should be built without fortran api, otherwise moab
complains (need to fix)
also, notice that when built with cgm, shared can't find
cgm libraries for the new tools/geometry execs

install in serial for the time being (because of example makefile
duplicate?)

for example, these builds are successful:
spack install moab+mpi+hdf5+zoltan ^mpich@3.2
spack install moab+mpi+hdf5+shared ^mpich@3.2

* force hdf5+mpi if both are specified

also, something like this works:
spack install  moab+mpi+hdf5+cgm ^mpich@3.2 ^cgm+oce+mpi ^oce@0.17.2

use mpich32, and cgm built with oce 0.17.2

* forgot about irel, fbigeom, mbcoupler

* add meshkit package

simple build so far, moab and cgm deps only

also, an example of complex build for cgm
spack install  moab+mpi+hdf5+cgm+irel+fbigeom ^mpich@3.2 ^cgm+oce+mpi ^oce@0.17.2

* for meshkit, moab needs to have irel, fbigeom

* forgot to self.spec

after building moab with cgm with oce 0.17.2, we can build
meshkit with something like this
spack install meshkit ^moab/tsb75zk

cgm depencency is found out from moab

moab has to be built with irel and fbigeom

* add netgen package and review

do not support yet older versions of meshkit
(which depend on lasso, etc)
add netgen package; tested with meshkit (netgen has to be built without
occ, for meshkit)
We are not enforcing that yet, we may have to test

* use conflicts where needed, suggested by review

remove release candidates

* flake8 alignment errors

* flake8

* reviews

flake8 alignment
explicit options, even for default variants
variant for netgen should be "gui", with the default ~gui (False)
FIXME: with-occ does not work right for netgen ; maybe it should be disabled?
       also, with +gui, it should depend on a lot more, like tk, tcl?

* flake8 issues

whitespaces and a comment in netgen

* add more explicit options

--without-mpi needs fixing for cgm, moab and meshkit
add variable url for netgen (although we don''t know if other
versions will appear)

* flake8, trailing whitespace
This commit is contained in:
iulian787 2017-06-23 09:53:43 -04:00 committed by Adam J. Stewart
parent 811ea4f465
commit 75b8d728bd
4 changed files with 296 additions and 42 deletions

View File

@ -39,6 +39,8 @@ class Cgm(AutotoolsPackage):
variant("mpi", default=True, description='enable mpi support')
variant("oce", default=False, description='enable oce geometry kernel')
variant("debug", default=False, description='enable debug symbols')
variant("shared", default=False, description='enable shared builds')
depends_on('mpi', when='+mpi')
depends_on('oce+X11', when='+oce')
@ -61,4 +63,10 @@ def configure_args(self):
else:
args.append("--without-occ")
if '+debug' in spec:
args.append("--enable-debug")
if '+shared' in spec:
args.append("--enable-shared")
return args

View File

@ -0,0 +1,81 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
#
from spack import *
class Meshkit(AutotoolsPackage):
"""MeshKit is an open-source library of mesh generation functionality.
Its design philosophy is two-fold: it provides a collection of
meshing algorithms for use in real meshing problems, along with
other tools commonly needed to support mesh generation"""
homepage = "http://sigma.mcs.anl.gov/meshkit-library"
url = "http://ftp.mcs.anl.gov/pub/fathom/meshkit-1.5.0.tar.gz"
version('1.5.0', '90b52416598ef65525ce4457a50ffe68')
variant("mpi", default=True, description='enable mpi support')
variant("netgen", default=False, description='enable netgen support')
variant("debug", default=False, description='enable debug symbols')
variant("shared", default=False, description='enable shared builds')
depends_on('mpi', when='+mpi')
depends_on('netgen', when='+netgen')
depends_on('cgm')
depends_on('moab+irel+fbigeom')
def configure_args(self):
spec = self.spec
args = [
"--with-igeom={0}".format(spec['cgm'].prefix),
"--with-imesh={0}".format(spec['moab'].prefix)
]
if '+mpi' in spec:
args.extend([
"--with-mpi",
"CC={0}".format(spec['mpi'].mpicc),
"CXX={0}".format(spec['mpi'].mpicxx),
"FC={0}".format(spec['mpi'].mpifc)
])
# FIXME without-mpi is not working
# else:
# args.append("--without-mpi")
if '+netgen' in spec:
args.append("--with-netgen={0}".format(spec['netgen'].prefix))
else:
args.append("--without-netgen")
if '+debug' in spec:
args.append("--enable-debug")
else:
args.append("--disable-debug")
if '+shared' in spec:
args.append("--enable-shared")
else:
args.append("--disable-shared")
return args

View File

@ -25,7 +25,7 @@
from spack import *
class Moab(Package):
class Moab(AutotoolsPackage):
"""MOAB is a component for representing and evaluating mesh
data. MOAB can store structured and unstructured mesh, consisting
of elements in the finite element 'zoo.' The functional interface
@ -34,19 +34,43 @@ class Moab(Package):
optimized for efficiency in space and time, based on access to
mesh in chunks rather than through individual entities, while also
versatile enough to support individual entity access."""
homepage = "https://bitbucket.org/fathomteam/moab"
url = "http://ftp.mcs.anl.gov/pub/fathom/moab-4.9.1.tar.gz"
homepage = "https://bitbucket.org/fathomteam/moab"
url = "http://ftp.mcs.anl.gov/pub/fathom/moab-5.0.0.tar.gz"
version('5.0.0', '1840ca02366f4d3237d44af63e239e3b')
version('4.9.2', '540931a604c180bbd3c1bb3ee8c51dd0')
version('4.9.1', '19cc2189fa266181ad9109b18d0b2ab8')
version('4.9.0', '40695d0a159040683cfa05586ad4a7c2')
version('4.8.2', '1dddd10f162fce3cfffaedc48f6f467d')
variant('mpi', default=True, description='enable mpi support')
variant('hdf5', default=True,
description='Required to enable the hdf5 (default I/O) format')
variant('netcdf', default=False,
description='Required to enable the ExodusII reader/writer.')
variant('shared', default=True,
variant('pnetcdf', default=False,
description='Enable pnetcdf (AKA parallel-netcdf) support')
variant('netcdf', default=False,
description='Required to enable the ExodusII reader/writer.')
variant('zoltan', default=False, description='Enable zoltan support')
variant('cgm', default=False, description='Enable common geometric module')
variant('metis', default=True, description='Enable metis link')
variant('parmetis', default=True, description='Enable parmetis link')
variant('irel', default=False, description='Enable irel interface')
variant('fbigeom', default=False, description='Enable fbigeom interface')
variant('coupler', default=True, description='Enable mbcoupler tool')
variant("debug", default=False, description='enable debug symbols')
variant('shared', default=False,
description='Enables the build of shared libraries')
variant('fortran', default=True, description='Enable Fortran support')
conflicts('+irel', when='~cgm')
conflicts('+pnetcdf', when='~mpi')
conflicts('+parmetis', when='~mpi')
conflicts('+coupler', when='~mpi')
# There are many possible variants for MOAB. Here are examples for
# two of them:
#
@ -55,61 +79,119 @@ class Moab(Package):
# depends_on('cgns', when='+cgns')
# depends_on('vtk', when='+vtk')
depends_on('mpi')
depends_on('hdf5+mpi')
depends_on('mpi', when='+mpi')
depends_on('hdf5', when='+hdf5')
depends_on('hdf5+mpi', when='+hdf5+mpi')
depends_on('netcdf', when='+netcdf')
depends_on('netcdf+mpi', when='+netcdf')
depends_on('metis')
depends_on('parmetis')
depends_on('zoltan')
depends_on('zoltan~fortran', when='~fortran')
depends_on('parallel-netcdf', when='+pnetcdf')
depends_on('cgm', when='+cgm')
depends_on('metis', when='+metis')
depends_on('parmetis', when='+parmetis')
# FIXME it seems that zoltan needs to be built without fortran
depends_on('zoltan~fortran', when='+zoltan')
def install(self, spec, prefix):
def configure_args(self):
spec = self.spec
options = [
'--prefix=%s' % prefix,
'--enable-optimize',
'--disable-tools',
'--disable-mbconvert',
'--disable-hexmodops',
'--disable-vtkMOABReader',
'--disable-mbsize',
'--disable-mbskin',
'--disable-mbtagprop',
'--disable-mbmem',
'--disable-spheredecomp',
'--disable-mbsurfplot',
'--disable-mbpart',
'--disable-dagmc',
'--disable-gsets',
'--disable-mbmerge',
'--disable-mbdepth',
'--disable-mbcoupler',
'--disable-mcnpmit',
'--disable-refiner',
'--disable-h5mtools',
'--disable-mbcslam',
'--disable-mbquality',
'--disable-ahf',
'--disable-mbumr',
'--disable-imesh',
'--with-pic',
'--with-mpi=%s' % spec['mpi'].prefix,
'--with-hdf5=%s' % spec['hdf5'].prefix,
'--with-parmetis=%s' % spec['parmetis'].prefix,
'--with-zoltan=%s' % spec['zoltan'].prefix,
'--without-vtk',
'CXX=%s' % spec['mpi'].mpicxx,
'CC=%s' % spec['mpi'].mpicc,
'FC=%s' % spec['mpi'].mpifc]
'--without-vtk'
]
if '+mpi' in spec:
options.extend([
'--with-mpi=%s' % spec['mpi'].prefix,
'CXX=%s' % spec['mpi'].mpicxx,
'CC=%s' % spec['mpi'].mpicc,
'FC=%s' % spec['mpi'].mpifc
])
if '+parmetis' in spec:
options.append('--with-parmetis=%s' % spec['parmetis'].prefix)
else:
options.append('--without-parmetis')
# FIXME: --without-mpi does not configure right
# else:
# options.append('--without-mpi')
if '+hdf5' in spec:
options.append('--with-hdf5=%s' % spec['hdf5'].prefix)
else:
options.append('--without-hdf5')
if '+netcdf' in spec:
options.append('--with-netcdf=%s' % spec['netcdf'].prefix)
else:
options.append('--without-netcdf')
if '+pnetcdf' in spec:
options.append('--with-pnetcdf=%s'
% spec['parallel-netcdf'].prefix)
else:
options.append('--without-pnetcdf')
if '+cgm' in spec:
options.append('--with-cgm=%s' % spec['cgm'].prefix)
if '+irel' in spec:
options.append('--enable-irel')
else:
options.append('--disable-irel')
else:
options.append('--without-cgm')
if '+fbigeom' in spec:
options.append('--enable-fbigeom')
else:
options.append('--disable-fbigeom')
if '+coupler' in spec:
options.append('--enable-mbcoupler')
else:
options.append('--disable-mbcoupler')
if '+metis' in spec:
options.append('--with-metis=%s' % spec['metis'].prefix)
else:
options.append('--without-metis')
if '+parmetis' in spec:
options.append('--with-parmetis=%s' % spec['parmetis'].prefix)
else:
options.append('--without-parmetis')
if '+zoltan' in spec:
options.append('--with-zoltan=%s' % spec['zoltan'].prefix)
else:
options.append('--without-zoltan')
if '+debug' in spec:
options.append('--enable-debug')
else:
options.append('--disable-debug')
# FIXME it seems that with cgm and shared, we have a link
# issue in tools/geometry
if '+shared' in spec:
options.append('--enable-shared')
else:
options.append('--disable-shared')
if '~fortran' in spec:
options.append('--disable-fortran')
if '+shared' in spec:
options.append('--enable-shared')
if '+netcdf' in spec:
options.append('--with-netcdf=%s' % spec['netcdf'].prefix)
else:
options.append('--enable-fortran')
configure(*options)
make()
make('install')
return options
# FIXME Run the install phase with -j 1. There seems to be a problem with
# parallel installations of examples
def install(self, spec, prefix):
make('install', parallel=False)

View File

@ -0,0 +1,83 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class Netgen(AutotoolsPackage):
"""NETGEN is an automatic 3d tetrahedral mesh generator. It accepts
input from constructive solid geometry (CSG) or boundary
representation (BRep) from STL file format. The connection to
a geometry kernel allows the handling of IGES and STEP files.
NETGEN contains modules for mesh optimization and hierarchical
mesh refinement. """
homepage = "https://ngsolve.org/"
url = "https://gigenet.dl.sourceforge.net/project/netgen-mesher/netgen-mesher/5.3/netgen-5.3.1.tar.gz"
version('5.3.1', 'afd5a9b0b1296c242a9c554f06af6510')
variant("mpi", default=True, description='enable mpi support')
variant("oce", default=False, description='enable oce geometry kernel')
variant("gui", default=False, description='enable gui')
variant("metis", default=False, description='use metis for partitioning')
depends_on('mpi', when='+mpi')
depends_on('oce+X11', when='+oce')
depends_on('metis', when='+metis')
def url_for_version(self, version):
url = "https://gigenet.dl.sourceforge.net/project/netgen-mesher/netgen-mesher/{0}/netgen-{1}.tar.gz"
return url.format(version.up_to(2), version)
def configure_args(self):
spec = self.spec
args = []
if '+mpi' in spec:
args.extend([
"CC={0}".format(spec['mpi'].mpicc),
"CXX={0}".format(spec['mpi'].mpicxx)
])
else:
args.append("--without-mpi")
if '+oce' in spec:
args.append("--with-occ={0}".format(spec['oce'].prefix))
# FIXME
# due to a bug in netgen config, when --without-occ is specified
# or --with-occ=no, OCC flags is turned true, and build fails
# later; so do not specify anything like that
# else:
# args.append("--without-occ")
if '~gui' in spec:
args.append("--disable-gui")
else:
args.append("--enable-gui")
if '+metis' in spec:
args.append('--with-metis=%s' % spec['metis'].prefix)
else:
args.append("--without-metis")
return args