Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

better support for mpicc, mpicxx, and mpifort #558

Open
leofang opened this issue Feb 5, 2019 · 4 comments
Open

better support for mpicc, mpicxx, and mpifort #558

leofang opened this issue Feb 5, 2019 · 4 comments
Milestone

Comments

@leofang
Copy link
Collaborator

leofang commented Feb 5, 2019

Currently the MPI wrapper compilers mpicc, mpicxx, and mpifort are not guaranteed to work out of box unless the corresponding host compilers (gcc_linux-64, gxx_linux-64, and gfortran_linux-64 in Linux) are also installed in the Conda environment, see conda-forge/openmpi-feedstock#34 (comment):

The openmpi package doesn't depend on the compilers because it's most often installed as a runtime dependency, not as a compiler. To use the mpi compiler wrappers and the compilers they wrap, the conda compilers must be installed. # 35 adds openmpi-mpicc etc. as new outputs so that users have a simple package name to install to pull in both dependencies needed to compiler with openmpi (openmpi and the relevant compiler)

A solution just merged to conda-forge feedstocks yesterday (conda-forge/mpich-feedstock/pull/32
and ongoing conda-forge/openmpi-feedstock/pull/35) was to add additional outputs in the MPI recipes, including mpich-mpicc, mpich-mpicxx, mpich-mpifort, and their openmpi counterparts.

Let us wait for a while and see if it is a sustainable solution before adapting it. In the meanwhile one can always conda install the host compilers to make the MPI wrapper compilers work.

@leofang
Copy link
Collaborator Author

leofang commented Feb 5, 2019

more context: conda-forge/mpich-feedstock/issues/25

@mrakitin
Copy link
Member

mrakitin commented Feb 5, 2019

Good to know. Thanks for the links. Agree to wait a bit and see how good this solution is.

@minrk
Copy link

minrk commented Feb 6, 2019

I'm not sure which packages you are using these in, but FWIW if you have a package that requires MPI as a compiler, you can depend on both mpi and the given compiler as runtime requirements, e.g.:

requirements:
  run:
    - mpich
    - {{ compiler('c') }}

This is the ultimately the same as the new mpich-mpicc package, but more explicit if it's an actual requirement. The mpich-mpicc package and friends are meant really only for users, where the {{ compiler('c') }} template variable isn't available. I would use this pattern in recipes, regardless of the presence of the new convenience packages.

@leofang
Copy link
Collaborator Author

leofang commented Feb 8, 2019

Thanks @minrk for the comment. This is indeed better for packages requiring an MPI compiler. This issue was opened mainly to document my observation that using MPI as a compiler, as you put it, requires a bit of change. However, I suspect most of our users don't need any MPI compiler.

@mrakitin mrakitin added this to the Undefined milestone Mar 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants