@when('@:0.90,0.94:')
def cmake_args(self):
    spec = self.spec
    args = self.common_config_args
    args.extend(['-DCMAKE_CXX_STANDARD=17', ('-DLBANN_WITH_CNPY=%s' % ('+numpy' in spec)), ('-DLBANN_DETERMINISTIC:BOOL=%s' % ('+deterministic' in spec)), ('-DLBANN_WITH_HWLOC=%s' % ('+hwloc' in spec)), ('-DLBANN_WITH_ALUMINUM:BOOL=%s' % ('+al' in spec)), ('-DLBANN_WITH_BOOST:BOOL=%s' % ('+boost' in spec)), ('-DLBANN_WITH_CONDUIT:BOOL=%s' % ('+conduit' in spec)), ('-DLBANN_WITH_NVSHMEM:BOOL=%s' % ('+nvshmem' in spec)), ('-DLBANN_WITH_FFT:BOOL=%s' % ('+fft' in spec)), ('-DLBANN_WITH_ONEDNN:BOOL=%s' % ('+onednn' in spec)), ('-DLBANN_WITH_EMBEDDED_PYTHON:BOOL=%s' % ('+python' in spec)), ('-DLBANN_WITH_PYTHON_FRONTEND:BOOL=%s' % ('+pfe' in spec)), '-DLBANN_WITH_TBINF=OFF', ('-DLBANN_WITH_UNIT_TESTING:BOOL=%s' % self.run_tests), ('-DLBANN_WITH_VISION:BOOL=%s' % ('+vision' in spec)), ('-DLBANN_WITH_VTUNE:BOOL=%s' % ('+vtune' in spec)), '-DLBANN_DATATYPE={0}'.format(spec.variants['dtype'].value), '-DCEREAL_DIR={0}'.format(spec['cereal'].prefix), '-DProtobuf_DIR={0}'.format(spec['protobuf'].prefix), '-Dprotobuf_MODULE_COMPATIBLE=ON'])
    if ('+cuda' in spec):
        if spec.satisfies('^cuda@11.0:'):
            args.append('-DCMAKE_CUDA_STANDARD=17')
        else:
            args.append('-DCMAKE_CUDA_STANDARD=14')
    if (spec.satisfies('@:0.90') or spec.satisfies('@0.95:')):
        args.append('-DHydrogen_DIR={0}/CMake/hydrogen'.format(spec['hydrogen'].prefix))
    elif spec.satisfies('@0.94'):
        args.append('-DElemental_DIR={0}/CMake/elemental'.format(spec['elemental'].prefix))
    if spec.satisfies('@0.94:0.98.2'):
        args.append(('-DLBANN_WITH_NCCL:BOOL=%s' % ('+cuda +nccl' in spec)))
    if ('+vtune' in spec):
        args.append('-DVTUNE_DIR={0}'.format(spec['vtune'].prefix))
    if ('+al' in spec):
        args.append('-DAluminum_DIR={0}'.format(spec['aluminum'].prefix))
    if ('+conduit' in spec):
        args.append('-DConduit_DIR={0}'.format(spec['conduit'].prefix))
    if spec.satisfies('%clang platform=darwin'):
        clang = self.compiler.cc
        clang_bin = os.path.dirname(clang)
        clang_root = os.path.dirname(clang_bin)
        args.extend(['-DOpenMP_CXX_FLAGS=-fopenmp=libomp', '-DOpenMP_CXX_LIB_NAMES=libomp', '-DOpenMP_libomp_LIBRARY={0}/lib/libomp.dylib'.format(clang_root)])
    if ('+vision' in spec):
        args.append('-DOpenCV_DIR:STRING={0}'.format(spec['opencv'].prefix))
    if ('+cuda' in spec):
        args.append('-DCUDA_TOOLKIT_ROOT_DIR={0}'.format(spec['cuda'].prefix))
        args.append('-DcuDNN_DIR={0}'.format(spec['cudnn'].prefix))
        if spec.satisfies('@0.94:0.98.2'):
            if spec.satisfies('^cuda@:10.99'):
                args.append('-DCUB_DIR={0}'.format(spec['cub'].prefix))
            if ('+nccl' in spec):
                args.append('-DNCCL_DIR={0}'.format(spec['nccl'].prefix))
        args.append(('-DLBANN_WITH_NVPROF:BOOL=%s' % ('+nvprof' in spec)))
    if (spec.satisfies('@:0.90') or spec.satisfies('@0.100:')):
        args.append(('-DLBANN_WITH_DIHYDROGEN:BOOL=%s' % ('+dihydrogen' in spec)))
    if (spec.satisfies('@:0.90') or spec.satisfies('@0.101:')):
        args.append(('-DLBANN_WITH_DISTCONV:BOOL=%s' % ('+distconv' in spec)))
    if ('+rocm' in spec):
        args.extend(['-DHIP_ROOT_DIR={0}'.format(spec['hip'].prefix), '-DHIP_CXX_COMPILER={0}'.format(self.spec['hip'].hipcc)])
        archs = self.spec.variants['amdgpu_target'].value
        if (archs != 'none'):
            arch_str = ','.join(archs)
            cxxflags_str = ' '.join(self.spec.compiler_flags['cxxflags'])
            args.append('-DHIP_HIPCC_FLAGS=--amdgpu-target={0} -g -fsized-deallocation -fPIC -std=c++17 {1}'.format(arch_str, cxxflags_str))
    return args
@when('@:0.90,0.94:')
def cmake_args(self):
    spec = self.spec
    args = self.common_config_args
    args.extend(['-DCMAKE_CXX_STANDARD=17', ('-DLBANN_WITH_CNPY=%s' % ('+numpy' in spec)), ('-DLBANN_DETERMINISTIC:BOOL=%s' % ('+deterministic' in spec)), ('-DLBANN_WITH_HWLOC=%s' % ('+hwloc' in spec)), ('-DLBANN_WITH_ALUMINUM:BOOL=%s' % ('+al' in spec)), ('-DLBANN_WITH_BOOST:BOOL=%s' % ('+boost' in spec)), ('-DLBANN_WITH_CONDUIT:BOOL=%s' % ('+conduit' in spec)), ('-DLBANN_WITH_NVSHMEM:BOOL=%s' % ('+nvshmem' in spec)), ('-DLBANN_WITH_FFT:BOOL=%s' % ('+fft' in spec)), ('-DLBANN_WITH_ONEDNN:BOOL=%s' % ('+onednn' in spec)), ('-DLBANN_WITH_EMBEDDED_PYTHON:BOOL=%s' % ('+python' in spec)), ('-DLBANN_WITH_PYTHON_FRONTEND:BOOL=%s' % ('+pfe' in spec)), '-DLBANN_WITH_TBINF=OFF', ('-DLBANN_WITH_UNIT_TESTING:BOOL=%s' % self.run_tests), ('-DLBANN_WITH_VISION:BOOL=%s' % ('+vision' in spec)), ('-DLBANN_WITH_VTUNE:BOOL=%s' % ('+vtune' in spec)), '-DLBANN_DATATYPE={0}'.format(spec.variants['dtype'].value), '-DCEREAL_DIR={0}'.format(spec['cereal'].prefix), '-DProtobuf_DIR={0}'.format(spec['protobuf'].prefix), '-Dprotobuf_MODULE_COMPATIBLE=ON'])
    if ('+cuda' in spec):
        if spec.satisfies('^cuda@11.0:'):
            args.append('-DCMAKE_CUDA_STANDARD=17')
        else:
            args.append('-DCMAKE_CUDA_STANDARD=14')
    if (spec.satisfies('@:0.90') or spec.satisfies('@0.95:')):
        args.append('-DHydrogen_DIR={0}/CMake/hydrogen'.format(spec['hydrogen'].prefix))
    elif spec.satisfies('@0.94'):
        args.append('-DElemental_DIR={0}/CMake/elemental'.format(spec['elemental'].prefix))
    if spec.satisfies('@0.94:0.98.2'):
        args.append(('-DLBANN_WITH_NCCL:BOOL=%s' % ('+cuda +nccl' in spec)))
    if ('+vtune' in spec):
        args.append('-DVTUNE_DIR={0}'.format(spec['vtune'].prefix))
    if ('+al' in spec):
        args.append('-DAluminum_DIR={0}'.format(spec['aluminum'].prefix))
    if ('+conduit' in spec):
        args.append('-DConduit_DIR={0}'.format(spec['conduit'].prefix))
    if spec.satisfies('%clang platform=darwin'):
        clang = self.compiler.cc
        clang_bin = os.path.dirname(clang)
        clang_root = os.path.dirname(clang_bin)
        args.extend(['-DOpenMP_CXX_FLAGS=-fopenmp=libomp', '-DOpenMP_CXX_LIB_NAMES=libomp', '-DOpenMP_libomp_LIBRARY={0}/lib/libomp.dylib'.format(clang_root)])
    if ('+vision' in spec):
        args.append('-DOpenCV_DIR:STRING={0}'.format(spec['opencv'].prefix))
    if ('+cuda' in spec):
        args.append('-DCUDA_TOOLKIT_ROOT_DIR={0}'.format(spec['cuda'].prefix))
        args.append('-DcuDNN_DIR={0}'.format(spec['cudnn'].prefix))
        if spec.satisfies('@0.94:0.98.2'):
            if spec.satisfies('^cuda@:10.99'):
                args.append('-DCUB_DIR={0}'.format(spec['cub'].prefix))
            if ('+nccl' in spec):
                args.append('-DNCCL_DIR={0}'.format(spec['nccl'].prefix))
        args.append(('-DLBANN_WITH_NVPROF:BOOL=%s' % ('+nvprof' in spec)))
    if (spec.satisfies('@:0.90') or spec.satisfies('@0.100:')):
        args.append(('-DLBANN_WITH_DIHYDROGEN:BOOL=%s' % ('+dihydrogen' in spec)))
    if (spec.satisfies('@:0.90') or spec.satisfies('@0.101:')):
        args.append(('-DLBANN_WITH_DISTCONV:BOOL=%s' % ('+distconv' in spec)))
    if ('+rocm' in spec):
        args.extend(['-DHIP_ROOT_DIR={0}'.format(spec['hip'].prefix), '-DHIP_CXX_COMPILER={0}'.format(self.spec['hip'].hipcc)])
        archs = self.spec.variants['amdgpu_target'].value
        if (archs != 'none'):
            arch_str = ','.join(archs)
            cxxflags_str = ' '.join(self.spec.compiler_flags['cxxflags'])
            args.append('-DHIP_HIPCC_FLAGS=--amdgpu-target={0} -g -fsized-deallocation -fPIC -std=c++17 {1}'.format(arch_str, cxxflags_str))
    return args