Lines 3-8
Link Here
|
3 |
from distutils.core import setup, Extension |
3 |
from distutils.core import setup, Extension |
4 |
from distutils.command.install_headers import install_headers |
4 |
from distutils.command.install_headers import install_headers |
5 |
import os, sys |
5 |
import os, sys |
|
|
6 |
from subprocess import Popen, PIPE |
6 |
from glob import glob |
7 |
from glob import glob |
7 |
|
8 |
|
8 |
class Dummy: |
9 |
class Dummy: |
Lines 106-120
Link Here
|
106 |
else: |
107 |
else: |
107 |
print "Using netCDF installation in ", netcdf_prefix |
108 |
print "Using netCDF installation in ", netcdf_prefix |
108 |
netcdf_include = os.path.join(netcdf_prefix, 'include') |
109 |
netcdf_include = os.path.join(netcdf_prefix, 'include') |
|
|
110 |
mpi_ccflags = Popen(["mpicc", "-showme:compile"], stdout=PIPE).communicate()[0].rstrip().lstrip("-I").split() |
111 |
mpi_ldflags = Popen(["mpicc", "-showme:link"], stdout=PIPE).communicate()[0].rstrip().split() |
109 |
netcdf_h_file = os.path.join(netcdf_prefix, 'include', 'netcdf.h') |
112 |
netcdf_h_file = os.path.join(netcdf_prefix, 'include', 'netcdf.h') |
110 |
netcdf_lib = os.path.join(netcdf_prefix, 'lib') |
113 |
netcdf_lib = os.path.join(netcdf_prefix, 'lib') |
111 |
ext_modules = [Extension('Scientific_netcdf', |
114 |
ext_modules = [Extension('Scientific_netcdf', |
112 |
['Src/Scientific_netcdf.c'], |
115 |
['Src/Scientific_netcdf.c'], |
113 |
include_dirs=['Include', netcdf_include] |
116 |
include_dirs=['Include', netcdf_include] |
114 |
+ arrayobject_h_include, |
117 |
+ arrayobject_h_include + mpi_ccflags, |
115 |
library_dirs=[netcdf_lib], |
118 |
library_dirs=[netcdf_lib], |
116 |
libraries = ['netcdf'], |
119 |
libraries = ['netcdf'], |
117 |
extra_compile_args=extra_compile_args)] |
120 |
extra_compile_args=extra_compile_args + mpi_ldflags )] |
118 |
|
121 |
|
119 |
try: |
122 |
try: |
120 |
# Add code for including documentation in Mac packages |
123 |
# Add code for including documentation in Mac packages |