New Package: ChaNGa (#17442)

* WIP: changa package

* changa cleanup

* flake8 format

* adds master branch to ChaNGa

* positional arguments

* use install instead of copy
This commit is contained in:
Julius-Plehn 2020-07-10 15:22:20 +02:00 committed by GitHub
parent e72e2568dd
commit 02dd90ebf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 2 deletions

View file

@ -0,0 +1,13 @@
diff --git a/configure b/configure
index 04f1a59..602c6cc 100755
--- a/configure
+++ b/configure
@@ -2434,7 +2434,7 @@ if test $($CHARMC -V | awk '{print $3}') -lt $MINIMUM_CHARM_VERSION; then
fi
CHARM_PATH=${CHARMC%/bin/charmc}
-CONV_CONFIG=${CHARM_PATH}/tmp/conv-config.sh
+CONV_CONFIG=${CHARM_PATH}/include/conv-config.sh
CHARMINC=${CHARM_PATH}/include
. ${CONV_CONFIG}

View file

@ -0,0 +1,46 @@
# 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 Changa(AutotoolsPackage):
"""ChaNGa (Charm N-body GrAvity solver) is a code to perform collisionless
N-body simulations. It can perform cosmological simulations with periodic
boundary conditions in comoving coordinates or simulations of isolated
stellar systems. It also can include hydrodynamics using the Smooth
Particle Hydrodynamics (SPH) technique. It uses a Barnes-Hut tree to
calculate gravity, with hexadecapole expansion of nodes and
Ewald summation for periodic forces. Timestepping is done with a leapfrog
integrator with individual timesteps for each particle."""
homepage = "http://faculty.washington.edu/trq/hpcc/tools/changa.html"
url = "https://github.com/N-BodyShop/changa/archive/v3.4.tar.gz"
git = "https://github.com/N-BodyShop/changa.git"
version('master', branch='master')
version('3.4', sha256='c2bceb6ac00025dfd704bb6960bc17c6df7c746872185845d1e75f47e6ce2a94')
patch("fix_configure_path.patch")
resource(
name="utility",
url="https://github.com/N-BodyShop/utility/archive/v3.4.tar.gz",
sha256="19f9f09023ce9d642e848a36948788fb29cd7deb8e9346cdaac4c945f1416667",
placement="utility"
)
depends_on("charmpp build-target=ChaNGa")
def configure_args(self):
args = []
args.append("STRUCT_DIR={0}/utility/structures"
.format(self.stage.source_path))
return args
def install(self, spec, prefix):
with working_dir(self.build_directory):
mkdirp(prefix.bin)
install('ChaNGa', prefix.bin)
install('charmrun', prefix.bin)

View file

@ -52,7 +52,7 @@ class Charmpp(Package):
"build-target",
default="LIBS",
# AMPI also builds charm++, LIBS also builds AMPI and charm++
values=("charm++", "AMPI", "LIBS"),
values=("charm++", "AMPI", "LIBS", "ChaNGa"),
description="Specify the target to build"
)
@ -217,7 +217,7 @@ def install(self, spec, prefix):
present on the system")
target = spec.variants["build-target"].value
builddir = prefix + "/" + str(self.charmarch)
builddir = prefix
# We assume that Spack's compiler wrappers make this work. If
# not, then we need to query the compiler vendor from Spack