|
| 1 | +# Copyright Spack Project Developers. See COPYRIGHT file for details. |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: (Apache-2.0 OR MIT) |
| 4 | + |
| 5 | + |
| 6 | +from spack_repo.builtin.build_systems.cmake import CMakePackage |
| 7 | + |
| 8 | +from spack.package import * |
| 9 | + |
| 10 | + |
| 11 | +class Neper(CMakePackage): |
| 12 | + """Neper is a software package for polycrystal generation and meshing. |
| 13 | + The polycrystals can be 2D or 3D.""" |
| 14 | + |
| 15 | + homepage = "https://neper.info/" |
| 16 | + url = "https://github.com/neperfepx/neper/archive/refs/tags/v4.10.1.tar.gz" |
| 17 | + |
| 18 | + maintainers("jcortial-safran") |
| 19 | + |
| 20 | + license("GPL-3.0-only", checked_by="jcortial-safran") |
| 21 | + |
| 22 | + version("4.10.1", sha256="73aeb29658a73fa5fd1deec74daacc1d43fcf0f771da4157a00fb3736dbdc37e") |
| 23 | + |
| 24 | + variant("gsl", default=True, description="Enable GNU scientific library") |
| 25 | + variant("openmp", default=True, description="Enable OpenMP") |
| 26 | + variant( |
| 27 | + "nlopt", |
| 28 | + default="external", |
| 29 | + description="Enable NlOpt, using either the vendored or an external package", |
| 30 | + values=("none", "internal", "external"), |
| 31 | + multi=False, |
| 32 | + ) |
| 33 | + variant( |
| 34 | + "scotch", |
| 35 | + default="external", |
| 36 | + description="Enable SCOTCH, using either the vendored or an external package", |
| 37 | + values=("none", "internal", "external"), |
| 38 | + multi=False, |
| 39 | + ) |
| 40 | + |
| 41 | + depends_on("c", type="build") |
| 42 | + depends_on("cxx", type="build") |
| 43 | + |
| 44 | + depends_on("gsl", when="+gsl") |
| 45 | + depends_on("nlopt", when="nlopt=external") |
| 46 | + depends_on("scotch", when="scotch=external") |
| 47 | + |
| 48 | + depends_on("cmake@3:", type="build") |
| 49 | + |
| 50 | + root_cmakelists_dir = "src" |
| 51 | + |
| 52 | + def cmake_args(self): |
| 53 | + args = [ |
| 54 | + self.define("CMAKE_INSTALL_COMPLETION_PREFIX", self.prefix), |
| 55 | + self.define_from_variant("HAVE_GSL", "gsl"), |
| 56 | + self.define_from_variant("HAVE_OPENMP", "openmp"), |
| 57 | + self.define("HAVE_NLOPT", not self.spec.satisfies("nlopt=none")), |
| 58 | + self.define("FORCE_BUILTIN_NLOPT", self.spec.satisfies("nlopt=internal")), |
| 59 | + self.define("HAVE_LIBSCOTCH", not self.spec.satisfies("scotch=none")), |
| 60 | + self.define("FORCE_BUILTIN_LIBSCOTCH", self.spec.satisfies("scotch=internal")), |
| 61 | + ] |
| 62 | + return args |
0 commit comments