Make parmmg dependent on mmg and metis (#31838)
1. copy source of mmg to its install tree for parmmg's build 2. add cmake args for parmmg 3. add '+mmg' when '+parmmg' for petsc
This commit is contained in:
parent
8f55c3c34a
commit
ad09f7a1af
@ -3,7 +3,10 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
from spack.util.executable import which
|
||||||
|
|
||||||
|
|
||||||
class Mmg(CMakePackage):
|
class Mmg(CMakePackage):
|
||||||
@ -58,3 +61,11 @@ def cmake_args(self):
|
|||||||
args.append("-DLIBMMG_STATIC=ON")
|
args.append("-DLIBMMG_STATIC=ON")
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
# parmmg requires this for its build
|
||||||
|
@run_after("install")
|
||||||
|
def install_source(self):
|
||||||
|
prefix = self.spec.prefix
|
||||||
|
cp = which("cp")
|
||||||
|
cp("-r", os.path.join(self.stage.source_path, "src"), prefix)
|
||||||
|
cp("-r", os.path.join(self.build_directory, "src"), prefix)
|
||||||
|
@ -27,8 +27,13 @@ class Parmmg(CMakePackage):
|
|||||||
variant("pic", default=True, description="Build with position independent code")
|
variant("pic", default=True, description="Build with position independent code")
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
|
define = CMakePackage.define
|
||||||
args = [
|
args = [
|
||||||
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
|
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
|
||||||
|
define("DOWNLOAD_MMG", False),
|
||||||
|
define("MMG_DIR", self.spec["mmg"].prefix),
|
||||||
|
define("DOWNLOAD_METIS", False),
|
||||||
|
define("METIS_DIR", self.spec["metis"].prefix),
|
||||||
]
|
]
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
@ -252,6 +252,7 @@ def check_fortran_compiler(self):
|
|||||||
depends_on("parmetis~int64", when="+metis+mpi~int64")
|
depends_on("parmetis~int64", when="+metis+mpi~int64")
|
||||||
depends_on("valgrind", when="+valgrind")
|
depends_on("valgrind", when="+valgrind")
|
||||||
depends_on("mmg", when="+mmg")
|
depends_on("mmg", when="+mmg")
|
||||||
|
depends_on("mmg", when="+parmmg")
|
||||||
depends_on("parmmg", when="+parmmg")
|
depends_on("parmmg", when="+parmmg")
|
||||||
depends_on("tetgen+pic", when="+tetgen")
|
depends_on("tetgen+pic", when="+tetgen")
|
||||||
# hypre+/~fortran based on wheter fortran is enabled/disabled
|
# hypre+/~fortran based on wheter fortran is enabled/disabled
|
||||||
|
Loading…
Reference in New Issue
Block a user