setup.py 1.4 KB
Newer Older
Matthieu Dorier's avatar
Matthieu Dorier committed
1 2 3 4 5 6 7 8 9 10 11 12
from distutils.core import setup
from distutils.extension import Extension
from distutils.sysconfig import get_config_vars
import os
import os.path
import sys

(opt,) = get_config_vars('OPT')
os.environ['OPT'] = " ".join(
		    flag for flag in opt.split() if flag != '-Wstrict-prototypes'
		)

Matthieu Dorier's avatar
Matthieu Dorier committed
13 14 15 16 17 18 19 20 21 22 23
try:
    import numpy
    has_numpy = 1
except ImportError:
    has_numpy = 0

if has_numpy == 1:
    client_libs=['boost_python','margo','bake-client', 'boost_numpy']
else:
    client_libs=['boost_python','margo','bake-client']

Matthieu Dorier's avatar
Matthieu Dorier committed
24 25
pybake_server_module = Extension('_pybakeserver', ["pybake/src/server.cpp"],
		           libraries=['boost_python','margo','bake-server'],
26 27
                   include_dirs=['.'],
                   depends=[])
Matthieu Dorier's avatar
Matthieu Dorier committed
28 29

pybake_client_module = Extension('_pybakeclient', ["pybake/src/client.cpp"],
Matthieu Dorier's avatar
Matthieu Dorier committed
30
		           libraries=client_libs,
31
                   include_dirs=['.'],
Matthieu Dorier's avatar
Matthieu Dorier committed
32 33
                   depends=[],
                   define_macros=[('HAS_NUMPY', has_numpy)])
34 35 36 37 38 39

pybake_target_module = Extension('_pybaketarget', ["pybake/src/target.cpp"],
                    libraries=['boost_python', 'uuid' ],
                    include_dirs=['.'],
                    depends=[])

Matthieu Dorier's avatar
Matthieu Dorier committed
40 41 42 43
setup(name='pybake',
      version='0.1',
      author='Matthieu Dorier',
      description="""Python binding for BAKE""",      
44
      ext_modules=[ pybake_server_module, pybake_client_module, pybake_target_module ],
Matthieu Dorier's avatar
Matthieu Dorier committed
45 46
      packages=['pybake']
     )