warpx: only allow master branch, and fix build on darwin (#11667)
* warpx: only allow master branch, and fix build on darwin * warpx: Added CXXFLAGS=-std=c++11 for clang * warpx: further clean up of openmp and c++11 flags * warpx: Get around the problem with resources The update uses placement instead of destination
This commit is contained in:
parent
a32382e787
commit
fe8297da74
1 changed files with 24 additions and 3 deletions
|
@ -4,6 +4,7 @@
|
|||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack import *
|
||||
from spack.compiler import UnsupportedCompilerFlag
|
||||
|
||||
|
||||
class Warpx(MakefilePackage):
|
||||
|
@ -38,13 +39,27 @@ class Warpx(MakefilePackage):
|
|||
|
||||
resource(name='amrex',
|
||||
git='https://github.com/AMReX-Codes/amrex.git',
|
||||
when='@master',
|
||||
tag='master',
|
||||
placement='amrex')
|
||||
|
||||
resource(name='amrex',
|
||||
git='https://github.com/AMReX-Codes/amrex.git',
|
||||
when='@dev',
|
||||
tag='development',
|
||||
destination='.')
|
||||
placement='amrex')
|
||||
|
||||
resource(name='picsar',
|
||||
git='https://bitbucket.org/berkeleylab/picsar.git',
|
||||
tag='master',
|
||||
destination='.')
|
||||
placement='picsar')
|
||||
|
||||
@property
|
||||
def build_targets(self):
|
||||
if self.spec.satisfies('%clang'):
|
||||
return ['CXXFLAGS={0}'.format(self.compiler.cxx11_flag)]
|
||||
else:
|
||||
return []
|
||||
|
||||
def edit(self, spec, prefix):
|
||||
|
||||
|
@ -68,8 +83,14 @@ def torf(s):
|
|||
'USE_PSATD = {0}'.format(torf('+psatd')))
|
||||
makefile.filter('DO_ELECTROSTATIC .*',
|
||||
'DO_ELECTROSTATIC = %s' % torf('+do_electrostatic'))
|
||||
try:
|
||||
self.compiler.openmp_flag
|
||||
except UnsupportedCompilerFlag:
|
||||
use_omp = 'FALSE'
|
||||
else:
|
||||
use_omp = torf('+openmp')
|
||||
makefile.filter('USE_OMP .*',
|
||||
'USE_OMP = {0}'.format(torf('+openmp')))
|
||||
'USE_OMP = {0}'.format(use_omp))
|
||||
makefile.filter('DEBUG .*',
|
||||
'DEBUG = {0}'.format(torf('+debug')))
|
||||
makefile.filter('TINY_PROFILE .*',
|
||||
|
|
Loading…
Reference in a new issue