Skip to content

Commit 0a0fccb

Browse files
authored
Changed order of statements in CMakeLists.txt (NOAA-EMC#1440)
Avoided 'DSO missing from command line' error during the linking step through changing the order of compilation flags
1 parent f27fe03 commit 0a0fccb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

model/src/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ if("OMPG" IN_LIST switches)
152152
target_link_libraries(ww3_lib PUBLIC OpenMP::OpenMP_Fortran)
153153
endif()
154154

155-
if("MPI" IN_LIST switches)
156-
find_package(MPI REQUIRED COMPONENTS Fortran)
157-
target_link_libraries(ww3_lib PUBLIC MPI::MPI_Fortran)
158-
endif()
159-
160155
# Handle PDLIB, SCRIP, SCRIPNC build files directly instead of through configuration file
161156
if("PDLIB" IN_LIST switches)
162157
if("SCOTCH" IN_LIST switches)
@@ -172,6 +167,11 @@ elseif("METIS" IN_LIST switches)
172167
endif()
173168
endif()
174169

170+
if("MPI" IN_LIST switches)
171+
find_package(MPI REQUIRED COMPONENTS Fortran)
172+
target_link_libraries(ww3_lib PUBLIC MPI::MPI_Fortran)
173+
endif()
174+
175175
if("SCRIP" IN_LIST switches)
176176
target_sources(ww3_lib PRIVATE ${scrip_src})
177177
endif()

0 commit comments

Comments
 (0)