BUG: rename MPI_PACKAGE_DIR and MPI_PREFIX_PATH vars to be prefixed with _ to prevent conflicts with known variable names in other projects.
This commit is contained in:
parent
279e4ec33b
commit
3154cde792
|
@ -72,7 +72,7 @@
|
||||||
# Microsoft HPC SDK is automatically added to the system path
|
# Microsoft HPC SDK is automatically added to the system path
|
||||||
# Argonne National Labs MPICH2 sets a registry key that we can use.
|
# Argonne National Labs MPICH2 sets a registry key that we can use.
|
||||||
|
|
||||||
set(MPI_PACKAGE_DIR
|
set(_MPI_PACKAGE_DIR
|
||||||
mpi
|
mpi
|
||||||
mpich
|
mpich
|
||||||
openmpi
|
openmpi
|
||||||
|
@ -83,15 +83,15 @@ set(MPI_PACKAGE_DIR
|
||||||
"Microsoft Compute Cluster Pack"
|
"Microsoft Compute Cluster Pack"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(MPI_PREFIX_PATH)
|
set(_MPI_PREFIX_PATH)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..")
|
list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH})
|
foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH})
|
||||||
foreach(MpiPackageDir ${MPI_PREFIX_PATH})
|
foreach(MpiPackageDir ${_MPI_PREFIX_PATH})
|
||||||
if(EXISTS ${SystemPrefixDir}/${MpiPackageDir})
|
if(EXISTS ${SystemPrefixDir}/${MpiPackageDir})
|
||||||
list(APPEND MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}")
|
list(APPEND _MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}")
|
||||||
endif()
|
endif()
|
||||||
endforeach(MpiPackageDir)
|
endforeach(MpiPackageDir)
|
||||||
endforeach(SystemPrefixDir)
|
endforeach(SystemPrefixDir)
|
||||||
|
@ -99,7 +99,7 @@ endforeach(SystemPrefixDir)
|
||||||
# Most mpi distros have some form of mpiexec which gives us something we can reliably look for.
|
# Most mpi distros have some form of mpiexec which gives us something we can reliably look for.
|
||||||
find_program(MPIEXEC
|
find_program(MPIEXEC
|
||||||
NAMES mpiexec mpirun lamexec
|
NAMES mpiexec mpirun lamexec
|
||||||
PATHS ${MPI_PREFIX_PATH}
|
PATHS ${_MPI_PREFIX_PATH}
|
||||||
PATH_SUFFIXES bin
|
PATH_SUFFIXES bin
|
||||||
DOC "Executable for running MPI programs."
|
DOC "Executable for running MPI programs."
|
||||||
)
|
)
|
||||||
|
@ -222,7 +222,7 @@ elseif (MPI_COMPILE_CMDLINE)
|
||||||
# If all else fails, just search for mpi.h in the normal include
|
# If all else fails, just search for mpi.h in the normal include
|
||||||
# paths.
|
# paths.
|
||||||
find_path(MPI_INCLUDE_PATH mpi.h
|
find_path(MPI_INCLUDE_PATH mpi.h
|
||||||
HINTS ${_MPI_BASE_DIR} ${MPI_PREFIX_PATH}
|
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||||
PATH_SUFFIXES include
|
PATH_SUFFIXES include
|
||||||
)
|
)
|
||||||
set(MPI_INCLUDE_PATH_WORK ${MPI_INCLUDE_PATH})
|
set(MPI_INCLUDE_PATH_WORK ${MPI_INCLUDE_PATH})
|
||||||
|
@ -304,7 +304,7 @@ elseif (MPI_COMPILE_CMDLINE)
|
||||||
else (MPI_COMPILE_CMDLINE)
|
else (MPI_COMPILE_CMDLINE)
|
||||||
# No MPI compiler to interogate so attempt to find everything with find functions.
|
# No MPI compiler to interogate so attempt to find everything with find functions.
|
||||||
find_path(MPI_INCLUDE_PATH mpi.h
|
find_path(MPI_INCLUDE_PATH mpi.h
|
||||||
HINTS ${_MPI_BASE_DIR} ${MPI_PREFIX_PATH}
|
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||||
PATH_SUFFIXES include
|
PATH_SUFFIXES include
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -317,13 +317,13 @@ else (MPI_COMPILE_CMDLINE)
|
||||||
|
|
||||||
find_library(MPI_LIBRARY
|
find_library(MPI_LIBRARY
|
||||||
NAMES mpi mpich msmpi
|
NAMES mpi mpich msmpi
|
||||||
HINTS ${_MPI_BASE_DIR} ${MPI_PREFIX_PATH}
|
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||||
PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}
|
PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(MPI_EXTRA_LIBRARY
|
find_library(MPI_EXTRA_LIBRARY
|
||||||
NAMES mpi++
|
NAMES mpi++
|
||||||
HINTS ${_MPI_BASE_DIR} ${MPI_PREFIX_PATH}
|
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
|
||||||
PATH_SUFFIXES lib
|
PATH_SUFFIXES lib
|
||||||
DOC "Extra MPI libraries to link against.")
|
DOC "Extra MPI libraries to link against.")
|
||||||
|
|
||||||
|
@ -358,6 +358,6 @@ mark_as_advanced(MPI_INCLUDE_PATH MPI_COMPILE_FLAGS MPI_LINK_FLAGS MPI_LIBRARY
|
||||||
MPI_EXTRA_LIBRARY)
|
MPI_EXTRA_LIBRARY)
|
||||||
|
|
||||||
# unset to cleanup namespace
|
# unset to cleanup namespace
|
||||||
unset(MPI_PACKAGE_DIR)
|
unset(_MPI_PACKAGE_DIR)
|
||||||
unset(MPI_PREFIX_PATH)
|
unset(_MPI_PREFIX_PATH)
|
||||||
unset(_MPI_BASE_DIR)
|
unset(_MPI_BASE_DIR)
|
||||||
|
|
Loading…
Reference in New Issue