Skip to content

Commit

Permalink
Merge pull request #79 from BlueBrain/fix-target-mech
Browse files Browse the repository at this point in the history
Architecture detection for mechanisms and switch to .o file checking
  • Loading branch information
ilkilic authored Nov 1, 2023
2 parents 6d41a01 + b81be1e commit 2eff3e1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion bluepyemodel/tasks/emodel_creation/optimisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,21 @@ def output(self):
targets = []
mechanisms_directory = self.access_point.get_mechanisms_directory()

architectures = ["x86_64", "i686", "powerpc", "umac"]

# Detect the first existing architecture
arch_dir = None
for arch in architectures:
dir_to_check = mechanisms_directory.parents[0] / arch
if dir_to_check.exists() and dir_to_check.is_dir():
arch_dir = dir_to_check
break

if arch_dir is None:
raise ValueError("No valid architecture directory found")

for filepath in glob.glob(f"{str(mechanisms_directory)}/*.mod"):
compile_path = mechanisms_directory.parents[0] / "x86_64" / f"{Path(filepath).stem}.c"
compile_path = mechanisms_directory.parents[0] / arch_dir / f"{Path(filepath).stem}.o"
targets.append(luigi.LocalTarget(compile_path))

return targets
Expand Down

0 comments on commit 2eff3e1

Please sign in to comment.