Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding mpicc system path of setup.py #243

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@
import mpi4py

conf = mpi4py.get_config()
os.environ["CC"] = conf["mpicc"]

# Check if "mpicc" is in the mpi4py configuration
if "mpicc" in conf:
os.environ["CC"] = conf["mpicc"]
else:
# Fallback: manually set CC to the path of the mpicc compiler
mpicc_path = os.popen('which mpicc').read().strip()
if mpicc_path:
os.environ["CC"] = mpicc_path
else:
raise KeyError("'mpicc' not found in mpi4py configuration, and 'mpicc' not found in system path. "
"Ensure MPI is installed and 'mpicc' is available.")

# PETSc version check - 3.16 or higher
from petsc4py import PETSc
Expand Down
Loading