25 |
""" |
""" |
26 |
try: |
try: |
27 |
if platform.system()=="Windows": |
if platform.system()=="Windows": |
28 |
import _winreg |
try: |
29 |
x=_winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE) |
# one day, we'll provide a SUNDIALS installer so that people don't have to |
30 |
y= _winreg.OpenKey(x,r"SOFTWARE\SUNDIALS") |
# build their own SUNDIALS. In that case, look for the settings in the registry |
31 |
PATH,t = _winreg.QueryValueEx(y,"InstallPath") |
import _winreg |
32 |
LIB = os.path.join(PATH,"lib") |
x=_winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE) |
33 |
BIN = os.path.join(PATH,"bin") |
y= _winreg.OpenKey(x,r"SOFTWARE\SUNDIALS") |
34 |
INCLUDE = os.path.join(PATH,"include") |
PATH,t = _winreg.QueryValueEx(y,"InstallPath") |
35 |
|
LIB = os.path.join(PATH,"lib") |
36 |
|
BIN = os.path.join(PATH,"bin") |
37 |
|
INCLUDE = os.path.join(PATH,"include") |
38 |
|
env['SUNDIALS_CPPPATH'] = [munge(INCLUDE)] |
39 |
|
env['SUNDIALS_LIBPATH'] = [munge(BIN)] |
40 |
|
env['SUNDIALS_LIBS'] = ['sundials_ida','sundials_nvecserial','m'] |
41 |
|
except WindowsError: |
42 |
|
# if someone has installed sundials with ./configure --prefix=/MinGW using MSYS, then |
43 |
|
# this should work, but we would like to make this a lot more robust! |
44 |
|
cmd = ['c:\\MSYS\\1.0\\bin\\sh.exe','/MinGW/bin/sundials-config','-mida','-ts','-lc'] |
45 |
|
env1 = env.Clone() |
46 |
|
env1['CPPPATH'] = None |
47 |
|
env1['LIBPATH'] = None |
48 |
|
env1['LIBS'] = None |
49 |
|
env1.ParseConfig(cmd) |
50 |
|
env['SUNDIALS_CPPPATH'] = env1.get('CPPPATH') |
51 |
|
env['SUNDIALS_LIBPATH'] = env1.get('LIBPATH') |
52 |
|
env['SUNDIALS_LIBS'] = env1.get('LIBS') |
53 |
|
env['HAVE_SUNDIALS'] = True |
54 |
|
|
|
env['SUNDIALS_CPPPATH'] = [munge(INCLUDE)] |
|
|
env['SUNDIALS_LIBPATH'] = [munge(BIN)] |
|
|
env['SUNDIALS_LIBS'] = ['sundials_ida','sundials_nvecserial','m'] |
|
55 |
env['HAVE_SUNDIALS'] = True |
env['HAVE_SUNDIALS'] = True |
56 |
|
|
57 |
else: |
else: |
70 |
print "SUNDIALS_LIBPATH =",env.get('SUNDIALS_LIBPATH') |
print "SUNDIALS_LIBPATH =",env.get('SUNDIALS_LIBPATH') |
71 |
print "SUNDIALS_CPPPATH =",env.get('SUNDIALS_CPPPATH') |
print "SUNDIALS_CPPPATH =",env.get('SUNDIALS_CPPPATH') |
72 |
|
|
73 |
except: |
except Exception, e: |
74 |
|
print "FAILED SUNDIALS DETECTION:",e.__class__,str(e) |
75 |
env['HAVE_SUNDIALS'] = False |
env['HAVE_SUNDIALS'] = False |
76 |
|
|
77 |
def exists(env): |
def exists(env): |