spack / spack/spack

Unable to retreive Fortran libraries from `mpi` package providers

Open
#41,341 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
5.1k
Forks
2.5k
Avg merge
3d 4h
Merged PRs (30d)
82

Description

Summary

I ran into some hard-coded library names here:

https://github.com/spack/spack/blob/4b41b11c30bd5c40cd9bcb11c1a629df50705141/var/spack/repos/builtin/packages/mfem/package.py#L754-L759

This would fail if we used any other mpi provider not listed here. It also would remove duplication across any other project that hard-codes it. A brief search showed others.

For example, neither of these packages reference the Fortran libraries at all:

https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/mvapich2/package.py
https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/openmpi/package.py

Rationale

Lower hard-coded bleed.

Description

This should be able to retrievable from the mpi providers themselves in one of the following ways:

# Specifically get just the fortran libraries
spec["mpi"].fortran_libs

# Get all libraries C/C++/Fortran
spec["mpi"].libs

This would also need to work with spec.ld_flags as well.

Additional information

No response

General information
  • I have searched the issues of this repo and believe this is not a duplicate

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with var/spack/repos/builtin/packages/mfem/package.py at the referenced lines, then compare the mvapich2 and openmpi package definitions. Trace how MPI provider specs expose libraries and how spec.ld_flags consumes them. Done means Fortran or all MPI libraries can be retrieved from the provider without hard-coded names and the linker flags work for alternate providers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.