Skip to content

Update BLT to apply MPI flags for the respective compilers to only the respective compiler lines#771

Open
aaroncblack wants to merge 1 commit into
developfrom
bugfix/aaroncblack/fix_mpi_flags
Open

Update BLT to apply MPI flags for the respective compilers to only the respective compiler lines#771
aaroncblack wants to merge 1 commit into
developfrom
bugfix/aaroncblack/fix_mpi_flags

Conversation

@aaroncblack

Copy link
Copy Markdown
Contributor

I encountered issues building a C++/Fortran code using a mixed vendor compiler clang/gfortran set up. The BLT mpi target added the C++ mpi paths to the general compiler flags, resulting in the gfortran compiles failing.

Description of changes:
Update BLT to apply MPI flags for the respective compilers to only the respective compiler lines.

Add test that builds a mixed language executable and confirms the respective MPI flags and include paths for C, C++, and Fortran are only added to language compile lines.

@aaroncblack

Copy link
Copy Markdown
Contributor Author

I made heavy use of codex on this, so take it with a grain of salt.

set(_mpi_includes )
set(_mpi_libraries )
set(_mpi_link_flags )
set(_mpi_fortran_includes )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@white238 I told the agent that our C++ codes make heavy use of the C MPI API, so to focus on splitting out the C/C++ vs the Fortran paths and flags.

It said in many MPI installs the MPI_C_INCLUDE_DIRS and MPI_CXX_INCLUDE_DIRS are identical, but if its a concern, another option is to have the C++ get both C and CXX mpi flags and paths, de-duplicated.

@cyrush

cyrush commented Jul 16, 2026

Copy link
Copy Markdown
Member

there are actually several issues related to this

#697

#355

llnl/axom#1853

we have discussed solutions, I dont think we have really captured those discussions well.

What I recall:
Ideally we move to use the bona fide cmake mpi per language targets, as well as we avoid having to even search for mpi fortran in cases where it is not needed (I realize that is not your case)

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