Example #1
0
from fief import async
from fief.repo import ifc

interfaces = {"py": ifc()}


def realize(delivs):
    return {}


def build_a(ctx):
    yield async.Result({})
Example #2
0
File: cmake.py Project: 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())
Example #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({})
Example #4
0
from fief import async
from fief.repo import ifc

interfaces = {'cc': ifc()}

def realize(delivs):
    return {}

def build_a(ctx):
    yield async.Result({})
Example #5
0
File: zlib.py Project: 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())
Example #6
0
from fief import repo

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

realize = repo.py_realize

build_a = repo.python_setup_install(interfaces)
Example #7
0
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')
Example #8
0
File: sympy.py Project: 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)
Example #9
0
File: atlas.py Project: 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')

Example #10
0
File: hdf5.py Project: 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":
Example #11
0
File: numpy.py Project: 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)  
Example #12
0
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', '..')