OpenMPI 4.0.3 forgets to link open-pal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openmpi (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
I am trying to compile a C++ program with CMake 3.16.3 on Ubuntu 20.04 LTS, which ships OpenMPI 4.0.3.
I realized that the
mpic++ --showme:link
flags forget to link `-lopen-pal`, which is part of the OpenMPI lib dir.
-pthread -L/usr/
Following that, a CMake CXX program compiled with clang++ that checks for `find_package(MPI REQUIRED)` will error out with:
```
-- Found MPI_C: /usr/lib/
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /usr/local/
-- Configuring incomplete, errors occurred!
Could NOT find MPI (missing: MPI_CXX_FOUND CXX) (found version "3.1")
```
The reason for that is in the compile check
```
/opt/rocm/
ld.lld: error: /usr/lib/
ld.lld: error: /usr/lib/
ld.lld: error: /usr/lib/
ld.lld: error: /usr/lib/
```
where the linker refuses the missing lib and fails the check.
The solution to this is to make sure that
mpic++ --showme:link
appends
-lopen-pal
as well.
User-side work-around until fix is applied:
export LDFLAGS=
Cross-ref GitHub: https:/ /github. com/open- mpi/ompi/ issues/ 9317