Skip to content

Commit

Permalink
try to fix error without develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lrtfm committed Nov 1, 2022
1 parent 11f868c commit 11abd54
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/py-firedrake/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
from collections import namedtuple
from pathlib import Path
from spack import *
from spack.util.executable import which
from spack.pkg.firedrake.editable_install import EditablePythonPackage
import glob

fields = ["mpicc", "mpicxx", "mpif90", "mpiexec"]
MPI = namedtuple("MPI", fields)
Expand Down Expand Up @@ -203,13 +205,26 @@ def generate_config_file(self):
if "dev_path" in self.spec.variants:
config_file = string_template.format(self.spec.variants["dev_path"].value)
else:
config_file = string_template.format(self.prefix)
config_file = string_template.format(self.build_directory)

with open(config_file, "w") as fh:
from pprint import pprint

pprint(json.dumps(config))
json.dump(config, fh)

@run_after("install")
def copy_configure(self):
if "dev_path" not in self.spec.variants:
_dst_path = glob.glob(os.path.join(self.prefix, "lib", "python*", "site-packages"))
assert len(_dst_path) > 0
string_template = "{}/firedrake_configuration/configuration.json"
src_config_file = string_template.format(self.build_directory)
dst_config_file = string_template.format(_dst_path[0])
cp = which('cp')
cp(src_config_file, dst_config_file)


def setup_run_environment(self, env):
super().setup_run_environment(env)
env.set("OMP_NUM_THREADS", "1")
Expand Down

0 comments on commit 11abd54

Please sign in to comment.