summaryrefslogtreecommitdiff
path: root/dev-python/scientificpython/files/scientificpython-2.9.3-mpi-netcdf.patch
blob: c9672948f2f8bb49aeace2f769349de1d8b11ed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 71a5e881290c1cec2506a346e2740a1b821c36aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Thu, 13 Mar 2014 15:29:33 +0100
Subject: [PATCH] Include MPI cflags/ldflags for netcdf.

---
 setup.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 7f01656..71ac92a 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 
 from distutils.core import setup, Extension
 from distutils.command.install_headers import install_headers
-import os, sys, platform
+import os, sys, platform, subprocess
 from glob import glob
 
 class Dummy:
@@ -92,13 +92,16 @@ else:
         netcdf_include = os.path.join(netcdf_prefix, 'include')
         netcdf_h_file = os.path.join(netcdf_prefix, 'include', 'netcdf.h')
         netcdf_lib = os.path.join(netcdf_prefix, 'lib')
+    mpi_cflags = subprocess.Popen(["mpicc", "-showme:compile"], stdout=subprocess.PIPE).communicate()[0].rstrip().split()
+    mpi_ldflags = subprocess.Popen(["mpicc", "-showme:link"], stdout=subprocess.PIPE).communicate()[0].rstrip().split()
     ext_modules = [Extension('Scientific._netcdf',
                              ['Scientific/_netcdf.c'],
                              include_dirs=['Include', netcdf_include]
                                           + numpy_include,
                              library_dirs=[netcdf_lib],
                              libraries = ['netcdf'],
-                             extra_compile_args=extra_compile_args)]
+                             extra_compile_args=extra_compile_args + mpi_cflags,
+                             extra_link_args=mpi_ldflags)]
 
 try:
     # Add code for including documentation in Mac packages
-- 
1.9.0