-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsetup.py
executable file
·46 lines (39 loc) · 1.33 KB
/
setup.py
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
from distutils.core import setup, Extension
from distutils.sysconfig import get_python_lib, get_python_inc
import os
import subprocess
# This seems kind of arbitrary, is there a better way ?
numpy_include = get_python_lib(True) + '/numpy/core/include'
if os.name == 'nt':
extra_compile_args = ["-mnop-fun-dllimport"]
else:
extra_compile_args = []
# set fortran library depending on type of compiler
try:
if os.environ['FC'] == 'g77':
libfortran = 'g2c'
else:
libfortran = 'gfortran'
except KeyError:
libfortran = 'gfortran'
# run the Makefile
subprocess.Popen(['make','libs']).wait()
simulator = Extension('simulator_',
define_macros = [('LIBNAME', 'simulator')],
include_dirs = ['./include', numpy_include],
sources = ['./module/simulatormodule.c'],
library_dirs=['./libs'],
libraries=['simulator', 'superlu', 'lapack', 'blas', 'toms', 'cephes',
'calc', 'data', libfortran],
extra_compile_args = extra_compile_args)
setup(name = 'eispice',
version = '0.11.6',
description = 'eispice Circuit Simulator',
author = 'Charles Eidsness',
author_email = '[email protected]',
url = 'http://www.thedigitalmachine.net/eispice.html',
license = "GPL",
ext_modules = [simulator],
package_dir={'': 'module'},
packages=[''],
extra_path = 'eispice')