Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion GuidedTutorials/HeatEquation/Exec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ else()

# Add mpi
find_package(MPI REQUIRED)
target_link_libraries(AMReX::amrex INTERFACE ${MPI_LIBRARIES})
get_target_property(AMReX_ALIASED AMReX::amrex ALIASED_TARGET)
target_link_libraries(${AMReX_ALIASED} INTERFACE ${MPI_LIBRARIES})
Copy link
Member

@ax3l ax3l Jan 10, 2025

Choose a reason for hiding this comment

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

Do the tutorials have a specific dimensionality?

AMReX::amrex is for backwards compatibility and refers to the last-built spacedim (before, we could only build one -- keeping this target name around made transitions non-breaking/easier). But we have explicit AMReX::amrex_1d/AMReX::amrex_2d/AMReX::amrex_3d targets that we should now use.
https://github.com/AMReX-Codes/amrex/blob/041f225dc5c97a5e3baf2559046ceabffd75f002/Src/CMakeLists.txt#L8-L15


endif()

Expand Down
3 changes: 2 additions & 1 deletion GuidedTutorials/HeatEquation_Simple/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ else()

# Add mpi
find_package(MPI REQUIRED)
Copy link
Member

Choose a reason for hiding this comment

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

Funny that we need MPI here at all, because if we need MPI, AMReX has to be built with MPI, which means MPI is already linked as a public transitive dependency in the AMReX::amrex_*d targets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AMReX has to be built with MPI

Should we check for that? Or because we don't necessarily need MPI, do we just go with whatever the AMReX pkg we find already has (or has not)?

Copy link
Member

Choose a reason for hiding this comment

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

Correct. I pushed a fix :)

target_link_libraries(AMReX::amrex INTERFACE ${MPI_LIBRARIES})
get_target_property(AMReX_ALIASED AMReX::amrex ALIASED_TARGET)
target_link_libraries(${AMReX_ALIASED} INTERFACE ${MPI_LIBRARIES})

endif()

Expand Down
3 changes: 2 additions & 1 deletion GuidedTutorials/HelloWorld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ else()

# Add mpi
find_package(MPI REQUIRED)
target_link_libraries(AMReX::amrex INTERFACE ${MPI_LIBRARIES})
get_target_property(AMReX_ALIASED AMReX::amrex ALIASED_TARGET)
target_link_libraries(${AMReX_ALIASED} INTERFACE ${MPI_LIBRARIES})

endif()

Expand Down
3 changes: 2 additions & 1 deletion GuidedTutorials/MultiFab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ else()

# Add mpi
find_package(MPI REQUIRED)
target_link_libraries(AMReX::amrex INTERFACE ${MPI_LIBRARIES})
get_target_property(AMReX_ALIASED AMReX::amrex ALIASED_TARGET)
target_link_libraries(${AMReX_ALIASED} INTERFACE ${MPI_LIBRARIES})

endif()

Expand Down
Loading