Skip to content

Commit 04721f9

Browse files
committed
Fix windows build with KLU
1 parent 07bbbb2 commit 04721f9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

sunode/build_cvodes.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@
1717

1818
headers = common + linsolve + cvodes
1919

20-
for fname in headers:
21-
with open(fname, "r") as fheader:
22-
content = fheader.read()
23-
print(fname)
24-
ffibuilder.cdef(content)
25-
2620
if sys.platform == 'win32':
2721
with open(os.path.join(base, "source_cvodes_win.c")) as fsource:
28-
content = fsource.read()
22+
source_content = fsource.read()
2923
include = [os.path.join(os.environ["CONDA_PREFIX"], "Library", "include")]
3024
library_dirs = [
3125
os.path.join(os.environ["CONDA_PREFIX"], "Library", "lib")
@@ -36,7 +30,7 @@
3630
headers = [fn for fn in headers if name not in fn]
3731
else:
3832
with open(os.path.join(base, "source_cvodes.c")) as fsource:
39-
content = fsource.read()
33+
source_content = fsource.read()
4034
include = [os.path.join(os.environ["CONDA_PREFIX"], "include")]
4135
library_dirs = [os.path.join(os.environ["CONDA_PREFIX"], "lib")]
4236
extra_libs = [
@@ -49,9 +43,16 @@
4943
"sundials_sunlinsolklu",
5044
]
5145

46+
for fname in headers:
47+
with open(fname, "r") as fheader:
48+
content = fheader.read()
49+
print(fname)
50+
ffibuilder.cdef(content)
51+
52+
5253
ffibuilder.set_source(
5354
"_sundials_cvodes",
54-
content,
55+
source_content,
5556
libraries=[
5657
"sundials_nvecserial",
5758
"sundials_sunmatrixdense",

0 commit comments

Comments
 (0)