Skip to content

Commit 170e309

Browse files
committed
findHDF5 always look for parallel, prioritize serial if not parallel component
1 parent 36afd53 commit 170e309

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

cmake/FindHDF5.cmake

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,9 @@ endif()
795795

796796
set(hdf5_lsuf lib hdf5/lib) # need explicit "lib" for self-built HDF5
797797
if(NOT HDF5_ROOT)
798-
if(parallel IN_LIST HDF5_FIND_COMPONENTS)
799-
list(INSERT hdf5_lsuf 0 hdf5/openmpi hdf5/mpich) # Ubuntu
800-
list(INSERT hdf5_lsuf 0 openmpi/lib mpich/lib) # CentOS
801-
else()
798+
list(INSERT hdf5_lsuf 0 hdf5/openmpi hdf5/mpich) # Ubuntu
799+
list(INSERT hdf5_lsuf 0 openmpi/lib mpich/lib) # CentOS
800+
if(NOT parallel IN_LIST HDF5_FIND_COMPONENTS)
802801
list(INSERT hdf5_lsuf 0 hdf5/serial) # Ubuntu
803802
endif()
804803
endif()
@@ -813,12 +812,14 @@ else()
813812
set(hdf5_msuf static include)
814813
endif()
815814

816-
if(parallel IN_LIST HDF5_FIND_COMPONENTS)
817-
list(APPEND hdf5_isuf hdf5/openmpi hdf5/mpich) # Ubuntu
818-
list(APPEND hdf5_msuf hdf5/openmpi hdf5/mpich) # Ubuntu
819-
else()
820-
list(APPEND hdf5_isuf hdf5/serial) # Ubuntu
821-
list(APPEND hdf5_msuf hdf5/serial) # Ubuntu
815+
# Ubuntu
816+
list(INSERT hdf5_isuf 0 hdf5/openmpi hdf5/mpich)
817+
list(INSERT hdf5_msuf 0 hdf5/openmpi hdf5/mpich)
818+
819+
if(NOT parallel IN_LIST HDF5_FIND_COMPONENTS)
820+
# Ubuntu
821+
list(INSERT hdf5_isuf 0 hdf5/serial)
822+
list(INSERT hdf5_msuf 0 hdf5/serial)
822823
endif()
823824

824825
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|AMD64)")

0 commit comments

Comments
 (0)