Skip to content

Commit

Permalink
fix: Fix dependency ordering script
Browse files Browse the repository at this point in the history
  • Loading branch information
edeustua committed Oct 27, 2024
1 parent f4b7b79 commit 1b17386
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion devtools/f2py_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ done

echo "Finding fortan dependencies"
ORDERED_SOURCES=$(python3 $SOURCE_ROOT/devtools/order_fortran_dependencies.py ${SOURCES[@]})
echo $ORDERED_SOURCES

echo "Building PYF"
$F2PY_EXE --quiet $ORDERED_SOURCES -m _fortran -h _fortran.pyf --overwrite-signature --build-dir $BUILD_DIR
Expand Down
8 changes: 5 additions & 3 deletions devtools/order_fortran_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,15 @@ def order_dependencies(self) -> List[str]:
while True:
moved = False
for file in self.input_files:
file_pos = output_order.index(str(file))
file_str = str(file)
file_pos = output_order.index(file_str)

for need in self.needs[str(file)]:
for need in self.needs[file_str]:
need_pos = output_order.index(need)
if need_pos > file_pos:
output_order[need_pos] = str(file)
output_order[need_pos] = file_str
output_order[file_pos] = need
file_pos = need_pos
moved = True

if not moved:
Expand Down

0 comments on commit 1b17386

Please sign in to comment.