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

Avoid aliasing CMake import targets. #560

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Conversation

mmuetzel
Copy link
Contributor

@mmuetzel mmuetzel commented Sep 3, 2024

This fixes a configuration issue with older versions of CMake. See: #549 (comment)

CMake Error at CMakeLists.txt:217 (ADD_LIBRARY):
ADD_LIBRARY cannot create ALIAS target "Elmer::MPI_Fortran" because target
"MPI::MPI_Fortran" is imported but not globally visible.

CMake Error at CMakeLists.txt:218 (ADD_LIBRARY):
ADD_LIBRARY cannot create ALIAS target "Elmer::MPI_C" because target
"MPI::MPI_C" is imported but not globally visible.

CMake Error at CMakeLists.txt:219 (ADD_LIBRARY):
ADD_LIBRARY cannot create ALIAS target "Elmer::MPI_CXX" because target
"MPI::MPI_CXX" is imported but not globally visible.

This fixes a configuration issue with older versions of CMake.
See: ElmerCSC#549 (comment)
```
CMake Error at CMakeLists.txt:217 (ADD_LIBRARY):
ADD_LIBRARY cannot create ALIAS target "Elmer::MPI_Fortran" because target
"MPI::MPI_Fortran" is imported but not globally visible.

CMake Error at CMakeLists.txt:218 (ADD_LIBRARY):
ADD_LIBRARY cannot create ALIAS target "Elmer::MPI_C" because target
"MPI::MPI_C" is imported but not globally visible.

CMake Error at CMakeLists.txt:219 (ADD_LIBRARY):
ADD_LIBRARY cannot create ALIAS target "Elmer::MPI_CXX" because target
"MPI::MPI_CXX" is imported but not globally visible.
```
@raback
Copy link
Contributor

raback commented Sep 3, 2024

I wonder if the failing launchpad builds are related.
-- Checking whether MPI_IN_PLACE is supported with /usr/bin/mpif90 -- no
CMake Error at CMakeLists.txt:217 (ADD_LIBRARY):
ADD_LIBRARY cannot create ALIAS target "Elmer::MPI_Fortran" because target
"MPI::MPI_Fortran" is IMPORTED.

The recipes are here:
https://launchpad.net/~elmer-csc-ubuntu

@juharu juharu merged commit dfcd7d9 into ElmerCSC:devel Sep 3, 2024
8 of 10 checks passed
@juharu
Copy link
Contributor

juharu commented Sep 3, 2024

Works for me, thanks!

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.

3 participants