1
1

A more clean solution for the 64 bit windows dependencies. MSDN says the InterlockedCompareExchange64 support is only available on 2003 and newer. However, after I tested it on Windows XP 64 bit, it seems also working, probably this has been patched via SP1. So we only need to detect the compiler bit now.

This commit was SVN r25755.
Этот коммит содержится в:
Shiqing Fan 2012-01-20 11:14:30 +00:00
родитель e114bd8a7b
Коммит 740f0650a1
3 изменённых файлов: 9 добавлений и 27 удалений

Просмотреть файл

@ -151,15 +151,7 @@ IF(NOT MICROSOFT_CHECK_DONE)
# exported by kernel32.dll. If we force the usage of TRY_RUN
# here we will check for both in same time: compilation and run.
IF(OMPI_WANT_XP_COMPATIBLE)
SET(FUNCTION_LIST Exchange ExchangeAcquire ExchangeRelease)
ELSE(OMPI_WANT_XP_COMPATIBLE)
IF(${CMAKE_SYSTEM_VERSION} GREATER 5.1)
SET(FUNCTION_LIST Exchange ExchangeAcquire ExchangeRelease Exchange64)
ELSE(${CMAKE_SYSTEM_VERSION} GREATER 5.1)
SET(FUNCTION_LIST Exchange ExchangeAcquire ExchangeRelease)
ENDIF(${CMAKE_SYSTEM_VERSION} GREATER 5.1)
ENDIF(OMPI_WANT_XP_COMPATIBLE)
SET(FUNCTION_LIST Exchange ExchangeAcquire ExchangeRelease Exchange64)
FOREACH(FUNCTION ${FUNCTION_LIST})
MESSAGE( STATUS "Checking for InterlockedCompare${FUNCTION}...")
@ -202,9 +194,9 @@ IF(NOT MICROSOFT_CHECK_DONE)
ENDIF(NOT MICROSOFT_CHECK_DONE)
OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGE "Whether we support 32 bits atomic operations on Windows" 0 0)
IF(OMPI_WANT_XP_COMPATIBLE)
IF(${OMPI_COMPILER_BIT} STREQUAL "64")
OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGE64 "Whether we support 64 bits atomic operations on Windows" 0 0)
ENDIF(OMPI_WANT_XP_COMPATIBLE)
ENDIF(${OMPI_COMPILER_BIT} STREQUAL "64")
OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGEACQUIRE "Whether we support 32 bits atomic operations on Windows" 0 0)
OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGERELEASE "Whether we support 32 bits atomic operations on Windows" 0 0)

Просмотреть файл

@ -95,15 +95,7 @@ IF(NOT MINGW_CHECK_DONE)
# exported by kernel32.dll. If we force the usage of TRY_RUN
# here we will check for both in same time: compilation and run.
IF(OMPI_WANT_XP_COMPATIBLE)
SET(FUNCTION_LIST Exchange ExchangeAcquire ExchangeRelease)
ELSE(OMPI_WANT_XP_COMPATIBLE)
IF(${CMAKE_SYSTEM_VERSION} GREATER 5.1)
SET(FUNCTION_LIST Exchange ExchangeAcquire ExchangeRelease Exchange64)
ELSE(${CMAKE_SYSTEM_VERSION} GREATER 5.1)
SET(FUNCTION_LIST Exchange ExchangeAcquire ExchangeRelease)
ENDIF(${CMAKE_SYSTEM_VERSION} GREATER 5.1)
ENDIF((OMPI_WANT_XP_COMPATIBLE))
SET(FUNCTION_LIST Exchange ExchangeAcquire ExchangeRelease Exchange64)
FOREACH(FUNCTION ${FUNCTION_LIST})
MESSAGE( STATUS "Checking for InterlockedCompare${FUNCTION}...")
@ -145,9 +137,9 @@ IF(NOT MINGW_CHECK_DONE)
ENDIF(NOT MINGW_CHECK_DONE)
OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGE "Whether we support 32 bits atomic operations on Windows" 0 0)
IF(OMPI_WANT_XP_COMPATIBLE)
IF(${OMPI_COMPILER_BIT} STREQUAL "64")
OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGE64 "Whether we support 64 bits atomic operations on Windows" 0 0)
ENDIF(OMPI_WANT_XP_COMPATIBLE)
ENDIF(${OMPI_COMPILER_BIT} STREQUAL "64")
OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGEACQUIRE "Whether we support 32 bits atomic operations on Windows" 0 0)
OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGERELEASE "Whether we support 32 bits atomic operations on Windows" 0 0)

Просмотреть файл

@ -89,13 +89,13 @@ OMPI_DEF(OMPI_BUILD_HOST $ENV{COMPUTERNAME} "Host on which the package has been
#detect the compiler bit
OMPI_CHECK_TYPES("void *" VOID_P none c)
IF(${SIZEOF_VOID_P} EQUAL 4)
SET(OMPI_COMPILER_BIT "86 bit")
SET(OMPI_COMPILER_BIT "32")
SET(IS_32_BIT TRUE CACHE INTERNAL "32 bit compiler")
ELSE(${SIZEOF_VOID_P} EQUAL 4)
SET(OMPI_COMPILER_BIT "64 bit")
SET(OMPI_COMPILER_BIT "64")
SET(IS_64_BIT TRUE CACHE INTERNAL "64 bit compiler")
ENDIF(${SIZEOF_VOID_P} EQUAL 4)
OMPI_DEF(OPAL_ARCH "${CMAKE_SYSTEM} ${OMPI_COMPILER_BIT}" "OMPI architecture string" 1 1)
OMPI_DEF(OPAL_ARCH "${CMAKE_SYSTEM} ${OMPI_COMPILER_BIT} bit" "OMPI architecture string" 1 1)
IF(WINDOWS_VS)
INCLUDE(ompi_check_Microsoft)
@ -253,8 +253,6 @@ OMPI_DEF_OPT(OPAL_EVENT_HAVE_THREAD_SUPPORT "Whether we want to enable event lib
OMPI_DEF_OPT(OMPI_RELEASE_BUILD "Whether it is a build for binary release (this will skip the path settings in mca_installdirs_config)." OFF)
OMPI_DEF_OPT(OMPI_WANT_XP_COMPATIBLE "Whether we want to build with Windows XP compatible functions (with InterlockedCompareExchange64 suooprt)." ON)
IF (NOT MSVC)
###################################################################