Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
Merge pull request #7 from BlueBrain/enh/likwid_setgid
Browse files Browse the repository at this point in the history
Added setgid option for likwid
  • Loading branch information
pramodk authored May 3, 2018
2 parents 4358ea1 + 7f74543 commit d6a954e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions var/spack/repos/builtin/packages/likwid/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ class Likwid(Package):

depends_on('perl', type=('build', 'run'))

variant('setgid', default=False, description='enable setgid flag '
+ 'for likwid-accessD and change its group to LIWKID_GROUP. '
+ 'Note: set LIWKID_GROUP env variable')

conflicts('+setgid', when='@:4.0.1') # accessD was added in 4.1

supported_compilers = {'clang': 'CLANG', 'gcc': 'GCC', 'intel': 'ICC'}

def patch(self):
Expand Down Expand Up @@ -109,3 +115,15 @@ def install(self, spec, prefix):
env['PWD'] = os.getcwd()
make()
make('install')

@run_after('install')
def change_group(self):
accessD = join_path(self.prefix.sbin, 'likwid-accessD')
if self.spec.satisfies('+setgid'):
likwid_group = 'likwid'
if 'LIKWID_GROUP' in os.environ:
likwid_group = os.environ['LIKWID_GROUP']
chgrp = which('chgrp')
chmod = which('chmod')
chgrp(likwid_group, accessD)
chmod('g+s', accessD)

0 comments on commit d6a954e

Please sign in to comment.