Skip to content

Commit

Permalink
Use old method for installing libsupermesh
Browse files Browse the repository at this point in the history
Otherwise we need to make tricky changes to firedrake-install (which
will go away anyway).
  • Loading branch information
connorjward committed Dec 12, 2024
1 parent 54ca480 commit cf06d81
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
1 change: 0 additions & 1 deletion requirements-git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ git+https://github.com/dolfin-adjoint/pyadjoint.git#egg=pyadjoint-ad
git+https://github.com/firedrakeproject/loopy.git@main#egg=loopy
git+https://github.com/firedrakeproject/pytest-mpi.git@main#egg=pytest-mpi
git+https://github.com/firedrakeproject/petsc.git@firedrake#egg=petsc
git+https://github.com/firedrakeproject/libsupermesh.git@connorjward/pip-install2
40 changes: 37 additions & 3 deletions scripts/firedrake-install
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,36 @@ def build_and_install_h5py():
log.info("No need to rebuild h5py")


def build_and_install_libsupermesh(cc, cxx, f90, mpiexec):
log.info("Installing libsupermesh")
url = "git+https://github.com/firedrakeproject/libsupermesh.git@connorjward/pip-install2"
if os.path.exists("libsupermesh"):
changed = git_update("libsupermesh", url)
else:
git_clone(url)
changed = True
if changed:
with directory("libsupermesh"):
check_call(["git", "reset", "--hard"])
check_call(["git", "clean", "-f", "-x", "-d"])
check_call(["mkdir", "-p", "build"])
with directory("build"):
cmd = [
"cmake", "..", "-DBUILD_SHARED_LIBS=ON",
"-DCMAKE_INSTALL_PREFIX=" + firedrake_env,
"-DMPI_C_COMPILER=" + cc,
"-DMPI_CXX_COMPILER=" + cxx,
"-DMPI_Fortran_COMPILER=" + f90,
"-DCMAKE_Fortran_COMPILER=" + f90,
"-DMPIEXEC_EXECUTABLE=" + mpiexec,
]
check_call(cmd)
check_call(["make"])
check_call(["make", "install"])
else:
log.info("No need to rebuild libsupermesh")


def build_and_install_pythonocc():
log.info("Installing pythonocc-core")
url = "git+https://github.com/tpaviot/pythonocc-core.git@595b0a4e8e60e8d6011bea0cdb54ac878efcfcd2"
Expand Down Expand Up @@ -1409,7 +1439,7 @@ def create_compiler_env(cc, cxx, f90):
env["CXX"] = cxx
if f90:
env["MPIF90"] = f90
env["MPI_Fortran_COMPILER"] = f90
env["MPI_C_COMPILER"] = f90
env["F90"] = f90

return env
Expand Down Expand Up @@ -1658,8 +1688,6 @@ run_pip(["install", "-U", "hatch"])
run_pip(["install", "-U", "editables"])
run_pip(["install", "-U", "pip"])
run_pip(["install", "-U", "wheel"])
run_pip(["install", "-U", "scikit-build-core"])
run_pip(["install", "-U", "rtree>=1.2"])

# Extra numpy dependendencies, see
# https://github.com/numpy/numpy/blob/main/pyproject.toml
Expand Down Expand Up @@ -1849,6 +1877,9 @@ if mode == "install":
install(p+"/")
sys.path.append(os.getcwd() + "/" + p)

with environment(**compiler_env):
build_and_install_libsupermesh(cc, cxx, f90, mpiexec)

with pipargs("--no-deps"), environment(**compiler_env, **link_env):
install("firedrake/")

Expand Down Expand Up @@ -2028,6 +2059,9 @@ Please consider updating your PETSc manually.
else:
install(p+"/")

with environment(**compiler_env):
build_and_install_libsupermesh(cc, cxx, f90, mpiexec)

with pipargs("--no-deps"), environment(**compiler_env, **link_env):
install("firedrake/")

Expand Down

0 comments on commit cf06d81

Please sign in to comment.