-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
53 lines (44 loc) · 1.63 KB
/
setup.py
File metadata and controls
53 lines (44 loc) · 1.63 KB
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
44
45
46
47
48
49
50
51
52
53
from __future__ import absolute_import
from __future__ import print_function
from distutils.core import setup, Extension
from distutils.sysconfig import get_python_inc, get_python_lib
import os
import sys
import numpy
###################################################################
# build the extension
#
define_macros = []
undef_macros = []
extra_compile_args = []
include_dirs = []
libraries = ["cpgplot", "pgplot", "X11", "png", "m", "z", "gfortran"]
library_dirs = ["/usr/X11R6/lib"]
include_dirs.append(numpy.get_include())
undef_macros.append('USE_NUMARRAY')
if os.name == "posix":
if "PGPLOT_DIR" in os.environ:
library_dirs.append(os.environ["PGPLOT_DIR"])
include_dirs.append(os.environ["PGPLOT_DIR"])
else:
print("Environment variable PGPLOT_DIR not defined!", file=sys.stderr)
else:
raise Exception("os not supported")
ext_pgplot = Extension('_ppgplot',
include_dirs = include_dirs,
libraries = libraries,
library_dirs = library_dirs,
runtime_library_dirs = library_dirs,
define_macros = define_macros,
sources = [os.path.join('src','_ppgplot.c')])
###################################################################
# the package
#
setup(name="ppgplot",
version="0.99",
description="Python interface to PGPLOT",
author="Tom Marsh (ppgplot from Nick Patavlis and Scott Ransom)",
author_email="t.r.marsh@warwick.ac.uk",
packages=['ppgplot'],
package_dir={'ppgplot':'src'},
ext_modules=[ext_pgplot])