示例#1
0
文件: sys_py.py 项目: gidden/fief
from fief import async
from fief.repo import ifc

interfaces = {"py": ifc()}


def realize(delivs):
    return {}


def build_a(ctx):
    yield async.Result({})
示例#2
0
文件: cmake.py 项目: gidden/fief
import os
from fief import repo
from fief import conf
from fief.repo import ifc, async, Cmd

interfaces = {'cmake': ifc(requires='cc')}

def realize(delivs):
  root = delivs['root']
  env = {'PATH': [os.path.join(root, 'bin')]}
  return env

def build_a(ctx):
  pkg = ctx['pkg']
  assert any([ctx['interface', ifc] == pkg for ifc in interfaces])
  psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
  env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

  try:
    src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
  
    to = yield async.WaitFor(ctx.outfile_a('build', pkg))
    to = os.path.abspath(to)
    os.mkdir(to)

    cmdkws = {'cwd': src, 'tag': pkg, 'env': env}
    c = Cmd(ctx, **cmdkws)
    bootstrap = ('bash', 'bootstrap') if os.name == 'nt' else './bootstrap'
    c.lit(bootstrap, '--prefix=' + to)
    yield async.WaitFor(c.exec_a())
示例#3
0
from fief import async
from fief.repo import ifc

interfaces = {'fortran': ifc()}

def realize(delivs):
    return {}

def build_a(ctx):
    yield async.Result({})
示例#4
0
文件: sys_cc.py 项目: gidden/fief
from fief import async
from fief.repo import ifc

interfaces = {'cc': ifc()}

def realize(delivs):
    return {}

def build_a(ctx):
    yield async.Result({})
示例#5
0
文件: zlib.py 项目: gidden/fief
import os
import shutil
from fief import repo
from fief import conf
from fief.repo import ifc, async, Cmd

interfaces = {'zlib': ifc(requires='cc')}

def realize(delivs):
  env = repo.c_realize(delivs)
  del env['PATH']
  return env

def build_a(ctx):
  pkg = ctx['pkg']
  assert any([ctx['interface', ifc] == pkg for ifc in interfaces])
  psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
  env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

  try:
    src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
  
    to = yield async.WaitFor(ctx.outfile_a('build', pkg))
    to = os.path.abspath(to)
    os.mkdir(to)

    cmdkws = {'cwd': src, 'tag': pkg, 'env': env}
    if os.name == 'nt':
      c = Cmd(ctx, **cmdkws)
      c.lit(conf.make, '-f', 'win32/Makefile.gcc')
      yield async.WaitFor(c.exec_a())
示例#6
0
文件: cython.py 项目: gidden/fief
from fief import repo

interfaces = {'cython': repo.ifc(requires=('cc', 'py'))}

realize = repo.py_realize

build_a = repo.python_setup_install(interfaces)
示例#7
0
文件: openmpi.py 项目: gidden/fief
from fief import repo

interfaces = {'mpi3': repo.ifc(requires='cc'),
              'mpi2': repo.ifc(requires='cc'),
              'mpi1': repo.ifc(requires='cc'),
              }

realize = repo.c_realize

build_a = repo.configure_make_make_install(interfaces, make_args='all')
示例#8
0
文件: sympy.py 项目: gidden/fief
import os
from glob import glob

from fief import conf
from fief import repo
from fief.repo import ifc, async, bake

interfaces = {'sympy': ifc(requires='py'), 
              'sympy-cython': ifc(subsumes='sympy', requires='cython')}

realize = repo.py_realize

def build_a(ctx):
    pkg = ctx['pkg']
    cythonize = (ctx['interface', 'sympy-cython'] == pkg)
    psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
    env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

    try:
        src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
        cmdkws = {'cwd': src, 'tag': pkg, 'env': env}
        to = yield async.WaitFor(ctx.outfile_a('build', pkg))
        to = os.path.abspath(to)
        os.mkdir(to)

        c = bake.Cmd(ctx, **cmdkws)
        c.lit('python', 'setup.py', 'install', '--prefix=' + to)
        yield async.WaitFor(c.exec_a())

        if cythonize:
            c = bake.Cmd(ctx, **cmdkws)
示例#9
0
文件: atlas.py 项目: gidden/fief
from fief import repo

interfaces = {'atlas': repo.ifc(requires='cc')}

realize = repo.c_realize

build_a = repo.configure_make_make_install(interfaces, libs='atlas', 
                                           configure_args='--shared')

示例#10
0
文件: hdf5.py 项目: gidden/fief
import os
import sys
from fief import repo
from fief import conf
from fief.repo import ifc, async, Cmd

interfaces = {
    "hdf5": ifc(requires=("zlib", "cmake")),
    "hdf5-cpp": ifc(subsumes="hdf5"),
    "hdf5-parallel": ifc(subsumes="hdf5", requires="mpi2"),
}

realize = repo.c_realize


def build_a(ctx):
    pkg = ctx["pkg"]
    assert any([ctx["interface", ifc] == pkg for ifc in interfaces])
    cpp = ctx["interface", "hdf5-cpp"] == pkg
    parl = ctx["interface", "hdf5-parallel"] == pkg
    psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
    env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

    try:
        src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
        cmdkws = {"cwd": src, "tag": pkg, "env": env}
        to = yield async.WaitFor(ctx.outfile_a("build", pkg))
        to = os.path.abspath(to)
        os.mkdir(to)

        if os.name == "nt":
示例#11
0
文件: numpy.py 项目: gidden/fief
import os
from fief import repo
from fief.repo import ifc, async, bake

interfaces = {'numpy': ifc(requires=('atlas', 'py')}

def build_a(ctx):
    pkg = ctx['pkg']
    env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))
    src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
  
    to = yield async.WaitFor(ctx.outfile_a('build'))
    to = os.path.abspath(to)
    os.mkdir(to)
  
    c = bake.Cmd(ctx)
    c.cwd = src
    c.env = env
    c.lit('python', 'setup.py', 'install', '--prefix=' + to)
    yield async.WaitFor(c.exec_a())
  
    cleanup()

    delivs = {'root': to, 'pkg': pkg}
    yield async.Result(delivs)  
示例#12
0
文件: lapack.py 项目: gidden/fief
import os
from fief import async
from fief import repo
from fief import conf
from fief.repo import ifc, Cmd

interfaces = {'lapack': ifc(requires=('cc', 'cmake', 'fortran'))}

def realize(delivs):
  root = delivs['root']
  return {'LD_LIBRARY_PATH': os.path.join(root, 'lib'), 
          'C_INCLUDE_PATH': os.path.join(root, 'include'),}

def build_a(ctx):
  pkg = ctx['pkg']
  assert any([ctx['interface', ifc] == pkg for ifc in interfaces])
  psrc = yield async.WaitFor(repo.fetch_nomemo_a(ctx, pkg))
  env = yield async.WaitFor(repo.realize_deps_a(ctx, interfaces))

  try:
    src, cleanup = yield async.WaitFor(repo.stage_nomemo_a(ctx, pkg))
    srcbld = os.path.join(src, 'build')
    os.mkdir(srcbld)
    cmdkws = {'cwd': srcbld, 'tag': pkg, 'env': env}
    to = yield async.WaitFor(ctx.outfile_a('build', pkg))
    to = os.path.abspath(to)
    os.mkdir(to)

    c = Cmd(ctx, **cmdkws)
    c.lit('cmake', '-DCMAKE_INSTALL_PREFIX:PATH=' + to, 
          '-DLAPACKE:BOOL=ON', '-DBUILD_SHARED_LIBS:BOOL=ON', '..')