v0.15.0
Loading...
Searching...
No Matches
users_modules
bone_remodelling
packages
mofem-bone-remodelling
package.py
Go to the documentation of this file.
1
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
2
# Spack Project Developers. See the top-level COPYRIGHT file for details.
3
#
4
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
5
6
7
from
spack
import
*
8
9
10
class
MofemBoneRemodelling
(
CMakePackage
):
11
"""mofem bone remodelling module"""
12
13
homepage =
"http://mofem.eng.gla.ac.uk"
14
git =
"https://bitbucket.org/likask/mofem_um_bone_remodelling.git"
15
16
maintainers = [
'karol41'
,
'likask'
]
17
18
version(
'develop'
, branch=
'develop'
)
19
version(
'lukasz'
, branch=
'lukasz/develop'
)
20
version(
'0.13.0'
, branch=
'Version0.13.0'
)
21
version(
'0.12.0'
, branch=
'Version0.12.0'
)
22
23
variant(
'copy_user_modules'
, default=
True
,
24
description=
'Copy user modules directory instead linking'
)
25
26
extends(
'mofem-cephas'
)
27
28
# The CMakeLists.txt installed with mofem - cephas package set cmake
29
# environment to install extension from extension repository.It searches
30
# for modules in user provides paths, for example in Spack source path.Also
31
# it finds all cmake exported targets installed in lib directory, which are
32
# built with dependent extensions, f.e.mofem - users - modules or others if
33
# needed.
34
@property
35
def
root_cmakelists_dir
(self):
36
"""The relative path to the directory containing CMakeLists.txt
37
38
This path is relative to the root of the extracted tarball,
39
not to the ``build_directory``. Defaults to the current directory.
40
41
:return: directory containing CMakeLists.txt
42
"""
43
spec = self.spec
44
return
spec[
'mofem-users-modules'
].prefix.users_modules
45
46
def
cmake_args
(self):
47
spec = self.spec
48
source = self.stage.source_path
49
50
options = []
51
52
# obligatory options
53
options.extend([
54
'-DWITH_SPACK=YES'
,
55
'-DWITH_METAIO=1'
,
56
'-DMPI_RUN_FLAGS=--allow-run-as-root'
,
57
'-DEXTERNAL_MODULE_SOURCE_DIRS=%s'
% source])
58
59
60
# build tests
61
options.append(
'-DMOFEM_UM_BUILD_TESTS={0}'
.format(
62
'ON'
if
self.run_tests
else
'OFF'
))
63
64
return
options
65
66
# This function is not needed to run code installed by extension, nor in
67
# the install process. However, for users like to have access to source
68
# code to play, change and make it. Having source code at hand one can
69
# compile in own build directory it in package view when the extension is
70
# activated.
71
@run_after('install')
72
def
copy_source_code
(self):
73
source = self.stage.source_path
74
prefix = self.prefix
75
install_tree(source, prefix.ext_users_modules.bone_remodelling_module)
76
77
def
check
(self):
78
"""Searches the CMake-generated Makefile for the target ``test``
79
and runs it if found.
80
"""
81
with
working_dir(self.
build_directory
):
82
ctest(
'--output-on-failure'
, parallel=
False
)
CMakePackage
package.MofemBoneRemodelling
Definition
package.py:10
package.MofemBoneRemodelling.root_cmakelists_dir
root_cmakelists_dir(self)
Definition
package.py:35
package.MofemBoneRemodelling.cmake_args
cmake_args(self)
Definition
package.py:46
package.MofemBoneRemodelling.build_directory
build_directory
Definition
package.py:81
package.MofemBoneRemodelling.check
check(self)
Definition
package.py:77
package.MofemBoneRemodelling.copy_source_code
copy_source_code(self)
Definition
package.py:72
Generated by
Doxygen
1.12.0 and hosted at