Skip to content

Add missing MPI target in src/CMakeLists.txt#556

Closed
climbfuji wants to merge 1 commit into
NCAR:mainfrom
climbfuji:bugfix/mpi_target_src_cmakelists
Closed

Add missing MPI target in src/CMakeLists.txt#556
climbfuji wants to merge 1 commit into
NCAR:mainfrom
climbfuji:bugfix/mpi_target_src_cmakelists

Conversation

@climbfuji
Copy link
Copy Markdown
Collaborator

Add missing MPI target in src/CMakeLists.txt

Not sure why this is not causing any errors currently because it should be there! The line that gets replaced is old and should have been removed in the past (neither LIBS nor CMAKE_DL_LIBS is defined).

User interface changes?: No

Fixes: [Github issue #s] n/a

Testing:
test removed: n/a
unit tests: n/a
system tests: n/a
manual testing: on my macOS with ufs-weather-model

Copy link
Copy Markdown
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

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

Is the line needed at all? If you are using an MPI compiler (or compiler wrapper), I thought the MPI libraries were always linked in by default.
Still, I can't see how this could hurt.

@climbfuji
Copy link
Copy Markdown
Collaborator Author

Is the line needed at all? If you are using an MPI compiler (or compiler wrapper), I thought the MPI libraries were always linked in by default. Still, I can't see how this could hurt.

It is needed, because we are NOT using mpicc etc as default compilers. As I understand, the cleaner way is to use the compiler gcc etc as default and only use mpicc etc when needed. Every cmake target should define exactly what it needs, including mpi. This way you avoid overlinking.

Copy link
Copy Markdown
Member

@dustinswales dustinswales left a comment

Choose a reason for hiding this comment

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

Good catch.

@climbfuji
Copy link
Copy Markdown
Collaborator Author

climbfuji commented Apr 15, 2024

@grantfirl @dustinswales Can we add this to one of the next ufs-w-m PRs?

@dustinswales
Copy link
Copy Markdown
Member

@climbfuji I don't see any reason not to.
I will leave it to @grantfirl @Qingfu-Liu @mkavulich, who sit in on the UFS application code mgmt. meeting

@grantfirl
Copy link
Copy Markdown
Collaborator

This will get merged with NOAA-EMC/ufsatm#816.

@mkavulich
Copy link
Copy Markdown
Collaborator

Combined with #555 for testing

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.

5 participants