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

Conversation

gthyagi
Copy link
Contributor

@gthyagi gthyagi commented Sep 5, 2024

Hi,

I've updated the setup.py file to retrieve mpicc from the system-wide installation instead of relying only on the environment installation.

@gthyagi
Copy link
Contributor Author

gthyagi commented Sep 5, 2024

#242, issue reported here.

@gthyagi
Copy link
Contributor Author

gthyagi commented Oct 2, 2024

The reason for issue #242 is that mpi4py version 4 does not provide the necessary path information when calling get_config(). For more details and potential solutions, please refer to the discussion in this GitHub issue:
mpi4py/mpi4py#532

@julesghub
Copy link
Member

@gthyagi, looking at this more it doesn't seem like we need to even use environ["CC"] anywhere. Can you confirm?

If the code is obsolete let's remove it.

@gthyagi
Copy link
Contributor Author

gthyagi commented Oct 3, 2024

@julesghub yes, we can remove these lines from the setup.py file.

underworld3/setup.py

Lines 13 to 34 in 372ecce

if os.environ.get("CC") is None:
import warnings
warnings.warn(
"CC environment variable not set. Using mpi4py's compiler configuration"
)
# Get CC from mpi4py
import mpi4py
conf = mpi4py.get_config()
# 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.")

@julesghub
Copy link
Member

ok, then I'll close this PR and I will make a new one to remove

@julesghub julesghub closed this Oct 3, 2024
gthyagi added a commit that referenced this pull request Oct 3, 2024
As a result of the previous PR 
#243
it was found `mpi4py.get_config()` has been removed in mpi4py-4+.

So removing the check now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants