gridlab-d: added new package. (#16816)

This commit is contained in:
0t1s1 2020-05-29 00:37:12 -07:00 committed by GitHub
parent 38ac78489a
commit 2aca0cf565
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,59 @@
# 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 GridlabD(AutotoolsPackage):
"""
Autotools package for Gridlab-D, a new power distribution system simulation
and analysis tool that provides valuable information to users who design
and operate distribution systems, and to utilities that wish to take
advantage of the latest energy technologies. Gridlab-D is a flexible
simulation environment that can be integrated with a variety of third-party
data management and analysis tools.
"""
homepage = "https://www.gridlabd.org/"
git = "https://github.com/gridlab-d/gridlab-d"
maintainers = ['0t1s1', 'yee29', 'afisher1']
# Using only develop as other branches and releases did not build properly.
version('develop', branch='develop')
variant("mysql",
default=False,
description="Enable MySQL support for Gridlab-D.")
variant('helics',
default=False,
description='Enable Helics support for Gridlab-D.')
# Add dependencies.
depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('m4', type='build')
depends_on("xerces-c")
depends_on("superlu-mt")
depends_on('helics', when='+helics')
def configure_args(self):
args = []
if '+helics' in self.spec:
# Taken from
# https://github.com/GMLC-TDC/HELICS-Tutorial/tree/master/setup
args.append('--with-helics=' + self.spec['helics'].prefix)
args.append('CFLAGS=-g -O0 -w')
args.append('CXXFLAGS=-g -O0 -w -std=c++14')
args.append('LDFLAGS=-g -O0 -w')
return args
def setup_run_environment(self, env):
# Need to add GLPATH otherwise Gridlab-D will not run.
env.set('GLPATH', join_path(self.prefix, 'lib', 'gridlabd'))
env.prepend_path('GLPATH', join_path(self.prefix, 'share', 'gridlabd'))