~ubuntu-branches/ubuntu/vivid/adios/vivid-proposed

« back to all changes in this revision

Viewing changes to wrappers/numpy/setup_mpi.py

  • Committer: Package Import Robot
  • Author(s): Alastair McKinstry
  • Date: 2014-06-16 23:06:38 UTC
  • mfrom: (15.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20140616230638-cxryhot6b8ge32l6
Tags: 1.7.0-1
* New upstream release.
* Add adios.pc pkgconfig file. adios_config now uses this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# Author:  Jong Choi
 
3
# Contact: choij@ornl.gov
 
4
 
 
5
from distutils.extension import Extension
 
6
import numpy as np
 
7
 
 
8
# Use mpi4py dist utils: https://bitbucket.org/mpi4py/mpi4py
 
9
from mpidistutils import setup
 
10
#from distutils.core import setup
 
11
 
 
12
import subprocess
 
13
 
 
14
m1 = Extension('adios_mpi', 
 
15
               sources=['adios_mpi.cpp'], 
 
16
               define_macros=[],
 
17
               include_dirs = [np.get_include()],
 
18
               library_dirs = [],
 
19
               libraries = [],
 
20
               extra_objects = [])
 
21
 
 
22
p = subprocess.Popen(["adios_config", "-c"], stdout=subprocess.PIPE)
 
23
pp = p.communicate()[0].strip()
 
24
for path in str(pp).split(" "):
 
25
    if path.startswith('-I'):
 
26
        m1.include_dirs.append(path.replace('-I', '', 1))
 
27
 
 
28
p = subprocess.Popen(["adios_config", "-l"], stdout=subprocess.PIPE)
 
29
pp = p.communicate()[0].strip()
 
30
for path in str(pp).split(" "):
 
31
    if path.startswith('-L'):
 
32
        m1.library_dirs.append(path.replace('-L', '', 1))
 
33
    if path.startswith('-l'):
 
34
        m1.libraries.append(path.replace('-l', '', 1))
 
35
 
 
36
setup(name = 'Adios_MPI',
 
37
      version = '1.0',
 
38
      description = 'Python Module for Adios MPI',
 
39
      url = 'http://www.olcf.ornl.gov/center-projects/adios/',
 
40
      ext_modules = [m1])