|
16 | 16 | cvodes.sort() |
17 | 17 |
|
18 | 18 | headers = common + linsolve + cvodes |
| 19 | +include = [] |
| 20 | +library_dirs = [] |
19 | 21 |
|
20 | 22 | if sys.platform == 'win32': |
21 | 23 | with open(os.path.join(base, "source_cvodes_win.c")) as fsource: |
22 | 24 | source_content = fsource.read() |
23 | | - include = [os.path.join(os.environ["CONDA_PREFIX"], "Library", "include")] |
24 | | - library_dirs = [ |
25 | | - os.path.join(os.environ["CONDA_PREFIX"], "Library", "lib") |
26 | | - ] |
| 25 | + include.append(os.path.join(os.environ["CONDA_PREFIX"], "Library", "include")) |
| 26 | + library_dirs.append(os.path.join(os.environ["CONDA_PREFIX"], "Library", "lib")) |
| 27 | + |
27 | 28 | extra_libs = [] |
28 | 29 | # lapackdense is not supported by the windows build of sundials |
29 | 30 | for name in ['sunlinsol_lapackdense', 'sunlinsol_klu']: |
30 | 31 | headers = [fn for fn in headers if name not in fn] |
31 | 32 | else: |
32 | 33 | with open(os.path.join(base, "source_cvodes.c")) as fsource: |
33 | 34 | source_content = fsource.read() |
34 | | - include = [os.path.join(os.environ["CONDA_PREFIX"], "include")] |
35 | | - library_dirs = [os.path.join(os.environ["CONDA_PREFIX"], "lib")] |
| 35 | + |
| 36 | + #test if we can use conda libraries |
| 37 | + if "CONDA_PREFIX" in os.environ: |
| 38 | + include.append(os.path.join(os.environ["CONDA_PREFIX"], "include")) |
| 39 | + library_dirs.append(os.path.join(os.environ["CONDA_PREFIX"], "lib")) |
| 40 | + else: |
| 41 | + include.append("/usr/include/suitesparse/") |
| 42 | + |
36 | 43 | extra_libs = [ |
37 | | - "blas", |
38 | | - "lapack", |
| 44 | + "openblas", |
39 | 45 | "pthread", |
40 | 46 | "klu", |
41 | 47 | "sundials_sunlinsollapackdense", |
|
0 commit comments