예제 #1
0
def compile_examples(build_dir):
    import build
    from pyutils import buildinfo

    source_dir = os.path.join(buildinfo.install_dir, 'gridtools_examples')
    build_dir = os.path.abspath(build_dir)
    os.makedirs(build_dir, exist_ok=True)

    env.set_cmake_arg('CMAKE_BUILD_TYPE', buildinfo.build_type.title())

    log.info('Configuring examples')
    build.cmake(source_dir, build_dir)
    log.info('Building examples')
    build.make(build_dir)
    log.info('Successfully built examples')
예제 #2
0
def cmake(source_dir, build_dir, install_dir=None):
    if not os.path.exists(source_dir):
        raise FileNotFoundError(f'Source directory "{source_dir}" not found')

    source_dir = os.path.abspath(source_dir)

    build_dir = os.path.abspath(build_dir)
    os.makedirs(build_dir, exist_ok=True)

    if install_dir is not None:
        install_dir = os.path.abspath(install_dir)
        os.makedirs(install_dir, exist_ok=True)
        env.set_cmake_arg('CMAKE_INSTALL_PREFIX', install_dir)
    command = ['cmake', source_dir] + env.cmake_args()
    runtools.run(command, log_output=log.info, cwd=build_dir)
예제 #3
0
def build(build_type, environment, target, source_dir, build_dir, install_dir,
          cmake_only):
    import build

    if source_dir is None:
        source_dir = os.path.abspath(os.path.join(script_dir, os.path.pardir))

    env.set_cmake_arg('CMAKE_BUILD_TYPE', build_type.title())

    if environment:
        env.load(environment)

    build.cmake(source_dir, build_dir, install_dir)
    if not cmake_only:
        build.make(build_dir, target)
예제 #4
0
def compile_and_run_examples(build_dir, verbose_ctest):
    import build

    source_dir = os.path.join(buildinfo.install_dir, 'examples')
    build_dir = os.path.abspath(build_dir)
    os.makedirs(build_dir, exist_ok=True)

    env.set_cmake_arg('CMAKE_BUILD_TYPE', buildinfo.build_type.title())

    log.info('Configuring examples')
    build.cmake(source_dir, build_dir)
    log.info('Building examples')
    build.make(build_dir)
    log.info('Successfully built examples')
    runtools.srun(_ctest(verbose=verbose_ctest),
                  log_output=log.info,
                  cwd=build_dir)
    log.info('Successfully executed examples')
예제 #5
0
def build(build_type, precision, grid, environment, target, source_dir,
          build_dir, install_dir, cmake_only):
    import build

    if source_dir is None:
        source_dir = os.path.abspath(os.path.join(script_dir, os.path.pardir))

    env.set_cmake_arg('CMAKE_BUILD_TYPE', build_type.title())
    env.set_cmake_arg('GT_SINGLE_PRECISION', precision == 'float')
    env.set_cmake_arg('GT_TESTS_ICOSAHEDRAL_GRID', grid == 'icosahedral')

    if environment:
        env.load(environment)

    build.cmake(source_dir, build_dir, install_dir)
    if not cmake_only:
        build.make(build_dir, target)
예제 #6
0
def build(build_type, environment, target, source_dir, build_dir, install_dir,
          cmake_only):
    import build

    if source_dir is None:
        source_dir = os.path.abspath(os.path.join(script_dir, os.path.pardir))

    #env.set_cmake_arg('CMAKE_BUILD_TYPE', build_type.title())
    env.set_cmake_arg('PYUTILS_HPX_WITH_FETCH_ASIO', 'ON')
    env.set_cmake_arg('PYUTILS_HPX_WITH_MALLOC', 'jemalloc')
    env.set_cmake_arg('PYUTILS_HPX_WITH_TESTS_BENCHMARKS', 'ON')
    env.set_cmake_arg('PYUTILS_HPX_WITH_MAX_CPU_COUNT', '72')
    env.set_cmake_arg('PYUTILS_CMAKE_BUILD_TYPE', 'Release')
    env.set_cmake_arg('-GNinja', '')
    # For possibly more stable/focused results
    env.set_cmake_arg('PYUTILS_HPX_WITH_TIMER_POOL', 'OFF')
    env.set_cmake_arg('PYUTILS_HPX_WITH_IO_POOL', 'OFF')

    if environment:
        env.load(environment)

    build.cmake(source_dir, build_dir, install_dir)
    if not cmake_only:
        build.make(build_dir, target)