diff --git a/contrib/platform/win32/CMakeModules/check_bool.cmake b/contrib/platform/win32/CMakeModules/check_bool.cmake index 5da5129db2..a027ecc7df 100644 --- a/contrib/platform/win32/CMakeModules/check_bool.cmake +++ b/contrib/platform/win32/CMakeModules/check_bool.cmake @@ -1,56 +1,56 @@ -# -# Copyright (c) 2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# check compiler support of bool and -# possibly get its size and alignment -MACRO(OMPI_CHECK_BOOL) - - FOREACH(LANG c cxx) - - STRING(TOUPPER ${LANG} LANG_U) - - IF(NOT DEFINED SIZEOF_${LANG_U}_BOOL) - - MESSAGE( STATUS "Checking size of ${LANG} bool...") - - FILE (WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_sizeof_bool.${LANG}" - "#include - int main() {return sizeof(bool);} - ") - - TRY_RUN(SIZEOF_${LANG_U}_BOOL COMPILE_RESULT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_sizeof_bool.${LANG}") - - IF(SIZEOF_${LANG_U}_BOOL GREATER 0) - MESSAGE(STATUS "Checking size of ${LANG} bool...${SIZEOF_${LANG_U}_BOOL}") - C_GET_ALIGNMENT(bool ${LANG} BOOL) - SET(OPAL_ALIGNMENT_${LANG_U}_BOOL ${OPAL_ALIGNMENT_BOOL} CACHE INTERNAL "Sizeof ${LANG} bool.") - ELSE(SIZEOF_${LANG_U}_BOOL GREATER 0) - MESSAGE(STATUS "Checking size of ${LANG} bool...failed") - SET(SIZEOF_${LANG_U}_BOOL 1 CACHE INTERNAL "Sizeof ${LANG} bool.") - SET(OPAL_ALIGNMENT_${LANG_U}_BOOL 1 CACHE INTERNAL "Sizeof ${LANG} bool.") - SET(OPAL_NEED_${LANG_U}_BOOL 1 CACHE INTERNAL "true if compiler doesn't support bool.") - ENDIF(SIZEOF_${LANG_U}_BOOL GREATER 0) - - ENDIF(NOT DEFINED SIZEOF_${LANG_U}_BOOL) - - OMPI_DEF_VAR(OPAL_NEED_${LANG_U}_BOOL - "Define to 1 if the C compiler doesn't support bool\n without any other help (such as )." 0 0) - OMPI_DEF_VAR(SIZEOF_${LANG_U}_BOOL "The size of ${LANG} `bool'." 0 1) - OMPI_DEF_VAR(OPAL_ALIGNMENT_${LANG_U}_BOOL "Alignment of ${LANG} `bool'." 0 1) - - ENDFOREACH(LANG c cxx) - - # Opal defines these without language type.... - OMPI_DEF(SIZEOF_BOOL 1 "The size of `bool'." 0 1) - OMPI_DEF(OPAL_ALIGNMENT_BOOL 1 "Sizeof bool." 0 1) - +# +# Copyright (c) 2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# check compiler support of bool and +# possibly get its size and alignment +MACRO(OMPI_CHECK_BOOL) + + FOREACH(LANG c cxx) + + STRING(TOUPPER ${LANG} LANG_U) + + IF(NOT DEFINED SIZEOF_${LANG_U}_BOOL) + + MESSAGE( STATUS "Checking size of ${LANG} bool...") + + FILE (WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_sizeof_bool.${LANG}" + "#include + int main() {return sizeof(bool);} + ") + + TRY_RUN(SIZEOF_${LANG_U}_BOOL COMPILE_RESULT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_sizeof_bool.${LANG}") + + IF(SIZEOF_${LANG_U}_BOOL GREATER 0) + MESSAGE(STATUS "Checking size of ${LANG} bool...${SIZEOF_${LANG_U}_BOOL}") + C_GET_ALIGNMENT(bool ${LANG} BOOL) + SET(OPAL_ALIGNMENT_${LANG_U}_BOOL ${OPAL_ALIGNMENT_BOOL} CACHE INTERNAL "Sizeof ${LANG} bool.") + ELSE(SIZEOF_${LANG_U}_BOOL GREATER 0) + MESSAGE(STATUS "Checking size of ${LANG} bool...failed") + SET(SIZEOF_${LANG_U}_BOOL 1 CACHE INTERNAL "Sizeof ${LANG} bool.") + SET(OPAL_ALIGNMENT_${LANG_U}_BOOL 1 CACHE INTERNAL "Sizeof ${LANG} bool.") + SET(OPAL_NEED_${LANG_U}_BOOL 1 CACHE INTERNAL "true if compiler doesn't support bool.") + ENDIF(SIZEOF_${LANG_U}_BOOL GREATER 0) + + ENDIF(NOT DEFINED SIZEOF_${LANG_U}_BOOL) + + OMPI_DEF_VAR(OPAL_NEED_${LANG_U}_BOOL + "Define to 1 if the C compiler doesn't support bool\n without any other help (such as )." 0 0) + OMPI_DEF_VAR(SIZEOF_${LANG_U}_BOOL "The size of ${LANG} `bool'." 0 1) + OMPI_DEF_VAR(OPAL_ALIGNMENT_${LANG_U}_BOOL "Alignment of ${LANG} `bool'." 0 1) + + ENDFOREACH(LANG c cxx) + + # Opal defines these without language type.... + OMPI_DEF(SIZEOF_BOOL 1 "The size of `bool'." 0 1) + OMPI_DEF(OPAL_ALIGNMENT_BOOL 1 "Sizeof bool." 0 1) + ENDMACRO(OMPI_CHECK_BOOL) \ No newline at end of file diff --git a/contrib/platform/win32/CMakeModules/check_c_inline.cmake b/contrib/platform/win32/CMakeModules/check_c_inline.cmake index 30298aa6fc..591ac07cb6 100644 --- a/contrib/platform/win32/CMakeModules/check_c_inline.cmake +++ b/contrib/platform/win32/CMakeModules/check_c_inline.cmake @@ -1,54 +1,54 @@ -# -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -MACRO(CHECK_C_INLINE) - # - # Return the inline definition string. - # - - IF(NOT HAVE_INLINE) - - # path of foo test programs - SET (FOO_SOURCE_DIR ${OpenMPI_SOURCE_DIR}/CMakeTests) - - MESSAGE( STATUS "Check inline definition...") - - FOREACH(KEYWORD "inline" "__inline__" "__inline") - - SET(HAVE_INLINE FALSE) - FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_inline.c" - "typedef int foo_t; - static inline foo_t static_foo(){return 0;} - foo_t foo(){return 0;} - int main(int argc, char *argv[]){return 0;} - ") - - TRY_COMPILE(C_HAS_${KEYWORD} "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeTmp/" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_inline.c" - COMPILE_DEFINITIONS "-Dinline=${KEYWORD}") - - IF(C_HAS_${KEYWORD}) - SET(HAVE_INLINE TRUE CACHE INTERNAL "have 'inline' definition") - SET(INLINE_STRING ${KEYWORD} CACHE INTERNAL "'inline' definition") - MESSAGE( STATUS "Checking inline definition...${INLINE_STRING}") - BREAK() - ENDIF(C_HAS_${KEYWORD}) - ENDFOREACH(KEYWORD) - - IF(NOT HAVE_INLINE) - MESSAGE(FATAL_ERROR "Check inline definition...failed. Cannot continue.") - ENDIF(NOT HAVE_INLINE) - - ENDIF(NOT HAVE_INLINE) - - OMPI_DEF(inline ${INLINE_STRING} "Define to `__inline__' or `__inline'." 0 1) - +# +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +MACRO(CHECK_C_INLINE) + # + # Return the inline definition string. + # + + IF(NOT HAVE_INLINE) + + # path of foo test programs + SET (FOO_SOURCE_DIR ${OpenMPI_SOURCE_DIR}/CMakeTests) + + MESSAGE( STATUS "Check inline definition...") + + FOREACH(KEYWORD "inline" "__inline__" "__inline") + + SET(HAVE_INLINE FALSE) + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_inline.c" + "typedef int foo_t; + static inline foo_t static_foo(){return 0;} + foo_t foo(){return 0;} + int main(int argc, char *argv[]){return 0;} + ") + + TRY_COMPILE(C_HAS_${KEYWORD} "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeTmp/" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_inline.c" + COMPILE_DEFINITIONS "-Dinline=${KEYWORD}") + + IF(C_HAS_${KEYWORD}) + SET(HAVE_INLINE TRUE CACHE INTERNAL "have 'inline' definition") + SET(INLINE_STRING ${KEYWORD} CACHE INTERNAL "'inline' definition") + MESSAGE( STATUS "Checking inline definition...${INLINE_STRING}") + BREAK() + ENDIF(C_HAS_${KEYWORD}) + ENDFOREACH(KEYWORD) + + IF(NOT HAVE_INLINE) + MESSAGE(FATAL_ERROR "Check inline definition...failed. Cannot continue.") + ENDIF(NOT HAVE_INLINE) + + ENDIF(NOT HAVE_INLINE) + + OMPI_DEF(inline ${INLINE_STRING} "Define to `__inline__' or `__inline'." 0 1) + ENDMACRO(CHECK_C_INLINE) \ No newline at end of file diff --git a/contrib/platform/win32/CMakeModules/check_c_type_exists.cmake b/contrib/platform/win32/CMakeModules/check_c_type_exists.cmake index 1b78d42e00..6099d888cf 100644 --- a/contrib/platform/win32/CMakeModules/check_c_type_exists.cmake +++ b/contrib/platform/win32/CMakeModules/check_c_type_exists.cmake @@ -1,57 +1,57 @@ -# -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# -# Some data types are defined in SDK headers, but the SDK include path -# is only reachable from Visual Studio ENV. So try to compile and run a test -# program to check if the data types is defined in SDK headers. -# If the type is defined, also return the size of the type. -# -# TYPE: the type to check -# TYPE_NAME: the uppercase of the type, with underlines if necessary. -# INCLUDE_HEADERS: the header files defines the type. -# -# HAVE_${TYPE_NAME}: if type is found, this value is define as 1. -# SIZEOF_${TYPE_NAME}: size of the type. - -MACRO(CHECK_C_TYPE_EXISTS TYPE TYPE_NAME INCLUDE_HEADERS) - - IF(NOT ${TYPE_NAME}_CHECK_DONE) - MESSAGE( STATUS "Checking for ${TYPE}...") - - SET(INCLUDE "") - FOREACH(HEADER ${INCLUDE_HEADERS}) - SET(INCLUDE ${INCLUDE} "#include <${HEADER}>\n") - ENDFOREACH(HEADER ${INCLUDE_HEADERS}) - - STRING(REPLACE ";" "" INCLUDE ${INCLUDE}) - - FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_${TYPE_NAME}.c" - "${INCLUDE} - int main(){ ${TYPE} test; return sizeof(${TYPE});}") - - TRY_RUN(SIZEOF_${TYPE_NAME} COMPILE_RESULT "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_${TYPE_NAME}.c") - - IF(SIZEOF_${TYPE_NAME} GREATER 0) - SET(HAVE_${TYPE_NAME} 1 CACHE INTERNAL "HAVE_${TYPE_NAME}") - MESSAGE( STATUS "Checking for ${TYPE}...done") - ELSE(SIZEOF_${TYPE_NAME} GREATER 0) - SET(HAVE_${TYPE_NAME} 0 CACHE INTERNAL "HAVE_${TYPE_NAME}") - MESSAGE( STATUS "Checking for ${TYPE}...failed") - ENDIF(SIZEOF_${TYPE_NAME} GREATER 0) - - SET(${TYPE_NAME}_CHECK_DONE 1 CACHE INTERNAL "${TYPE_NAME} check finished.") - - ENDIF(NOT ${TYPE_NAME}_CHECK_DONE) - - OMPI_DEF(HAVE_${TYPE_NAME} ${HAVE_${TYPE_NAME}} "Define to 1 if you have the `${TYPE_NAME}' type in ${INCLUDE_HEADERS}" 0 0) - -ENDMACRO(CHECK_C_TYPE_EXISTS TYPE TYPE_NAME INCLUDE_HEADERS) +# +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# +# Some data types are defined in SDK headers, but the SDK include path +# is only reachable from Visual Studio ENV. So try to compile and run a test +# program to check if the data types is defined in SDK headers. +# If the type is defined, also return the size of the type. +# +# TYPE: the type to check +# TYPE_NAME: the uppercase of the type, with underlines if necessary. +# INCLUDE_HEADERS: the header files defines the type. +# +# HAVE_${TYPE_NAME}: if type is found, this value is define as 1. +# SIZEOF_${TYPE_NAME}: size of the type. + +MACRO(CHECK_C_TYPE_EXISTS TYPE TYPE_NAME INCLUDE_HEADERS) + + IF(NOT ${TYPE_NAME}_CHECK_DONE) + MESSAGE( STATUS "Checking for ${TYPE}...") + + SET(INCLUDE "") + FOREACH(HEADER ${INCLUDE_HEADERS}) + SET(INCLUDE ${INCLUDE} "#include <${HEADER}>\n") + ENDFOREACH(HEADER ${INCLUDE_HEADERS}) + + STRING(REPLACE ";" "" INCLUDE ${INCLUDE}) + + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_${TYPE_NAME}.c" + "${INCLUDE} + int main(){ ${TYPE} test; return sizeof(${TYPE});}") + + TRY_RUN(SIZEOF_${TYPE_NAME} COMPILE_RESULT "${CMAKE_BINARY_DIR}" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_${TYPE_NAME}.c") + + IF(SIZEOF_${TYPE_NAME} GREATER 0) + SET(HAVE_${TYPE_NAME} 1 CACHE INTERNAL "HAVE_${TYPE_NAME}") + MESSAGE( STATUS "Checking for ${TYPE}...done") + ELSE(SIZEOF_${TYPE_NAME} GREATER 0) + SET(HAVE_${TYPE_NAME} 0 CACHE INTERNAL "HAVE_${TYPE_NAME}") + MESSAGE( STATUS "Checking for ${TYPE}...failed") + ENDIF(SIZEOF_${TYPE_NAME} GREATER 0) + + SET(${TYPE_NAME}_CHECK_DONE 1 CACHE INTERNAL "${TYPE_NAME} check finished.") + + ENDIF(NOT ${TYPE_NAME}_CHECK_DONE) + + OMPI_DEF(HAVE_${TYPE_NAME} ${HAVE_${TYPE_NAME}} "Define to 1 if you have the `${TYPE_NAME}' type in ${INCLUDE_HEADERS}" 0 0) + +ENDMACRO(CHECK_C_TYPE_EXISTS TYPE TYPE_NAME INCLUDE_HEADERS) diff --git a/contrib/platform/win32/CMakeModules/check_mca_subdirs.cmake b/contrib/platform/win32/CMakeModules/check_mca_subdirs.cmake index 48c8a3cdd6..61d2b34d61 100644 --- a/contrib/platform/win32/CMakeModules/check_mca_subdirs.cmake +++ b/contrib/platform/win32/CMakeModules/check_mca_subdirs.cmake @@ -1,328 +1,328 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -INCLUDE(list_subdirs) - -# there are several steps and issues for checking mca components: -# -# 1. go through each framwork dir, add the top-level headers -# to the source list. -# -# 2. go through each component dir, the framwork base dir is checked -# also in this setp, and is added to the source list. -# -# 2a. if a .windows file exists in a framwork base dir, that means there -# might be properties that have to be checked for this dir, e.g. files -# need to be excluded. -# -# 2b. if a .windows file exists in a component dir, this component -# should be included in the solution. There could be properties that -# need to check for this component. If it's a static build or not a -# DSO shared build, just add necessary sources; if it is a DSO build, -# generate a proper CMakeLists.txt file for each component, so that -# this component will be compiled separately. -# -# 3. Generate static-components.h file with available mca components. -# -# -# Available properties in .windows files: -# -# exclude_list: files that need to be excluded from the solution. -# -# required_check: a CMake module has to be run to check the libraries/headers -# that needed by this component. The check might return two -# variables: RESULT_INCLUDE_PATH, RESULT_LINK_LIBRARIES and RESULT_SOURCE_FILES. -# RESULT_INCLUDE_PATH is handled in this macro, and RESULT_LINK_LIBRARIES -# is handled in upper layer. -# -# not_single_shared_lib: this component should not be built separately, it's not -# a single mca shared library. -# -# mca_link_libraries: this component has to be linked with other targets or libraries, -# e.g. Ws2_32.lib -# mca_priority: priority of the mca component. - - -SET(MCA_FRAMEWORK_LIST "") -CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}/mca" MCA_FRAMEWORK_LIST) -#MESSAGE("MCA_FRAMEWORK_LIST:${MCA_FRAMEWORK_LIST}") - - -FILE(GLOB ${PROJECT_NAME}_MCA_HEADER_FILES "mca/*.C" "mca/*.h") -SET(${PROJECT_NAME}_MCA_FILES ${${PROJECT_NAME}_MCA_FILES} ${${PROJECT_NAME}_MCA_HEADER_FILES}) -SOURCE_GROUP(mca FILES ${${PROJECT_NAME}_MCA_HEADER_FILES}) - -# clear the variables first -SET(MCA_FRAMEWORK "") -SET(MCA_FRAMEWORK_FILES "") -SET(MCA_FILES "") - -# parse each mca subdir -FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST}) - - IF(NOT ${MCA_FRAMEWORK} STREQUAL "CMakeFiles" AND NOT ${MCA_FRAMEWORK} STREQUAL "svn") - #SET(CURRENT_PATH "mca/${${PROJECT_NAME}_MCA_SUBDIR}") - FILE(GLOB MCA_FRAMEWORK_FILES "mca/${MCA_FRAMEWORK}/*.c" "mca/${MCA_FRAMEWORK}/*.h" - "mca/${MCA_FRAMEWORK}/*.cc" "mca/${MCA_FRAMEWORK}/*.cpp") - SET(MCA_FILES ${MCA_FILES} ${MCA_FRAMEWORK_FILES}) - SOURCE_GROUP(mca\\${MCA_FRAMEWORK} FILES ${MCA_FRAMEWORK_FILES}) - - SET(COMPONENT_LIST "") - CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}" COMPONENT_LIST) - - SET(CURRENT_COMPONENT_PRIORITY "") - SET(MCA_PRIORITY_LIST "") - - # parse each component subdir of current mca framework - FOREACH (MCA_COMPONENT ${COMPONENT_LIST}) - - IF(${MCA_COMPONENT} STREQUAL "base") - - SET(CURRENT_PATH "${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/base") - FILE(GLOB MCA_FRAMEWORK_BASE_FILES "${CURRENT_PATH}/*.c" "${CURRENT_PATH}/*.h" - "${CURRENT_PATH}/*.cc" "${CURRENT_PATH}/*.cpp") - - IF(EXISTS "${CURRENT_PATH}/.windows") - - #MESSAGE("MCA_FRAMEWORK_BASE_FILES:${MCA_FRAMEWORK_BASE_FILES}") - SET(EXCLUDE_LIST "") - FILE(STRINGS ${CURRENT_PATH}/.windows EXCLUDE_LIST REGEX "^exclude_list=") - - IF(NOT EXCLUDE_LIST STREQUAL "") - STRING(REPLACE "exclude_list=" "" EXCLUDE_LIST ${EXCLUDE_LIST}) - ENDIF(NOT EXCLUDE_LIST STREQUAL "") - - # remove the files in the exclude list - FOREACH(FILE ${EXCLUDE_LIST}) - LIST(REMOVE_ITEM MCA_FRAMEWORK_BASE_FILES "${CURRENT_PATH}/${FILE}") - ENDFOREACH(FILE) - - ENDIF(EXISTS "${CURRENT_PATH}/.windows") - - SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/base/static-components.h - PROPERTIES GENERATED true) - SET(MCA_FRAMEWORK_BASE_FILES ${MCA_FRAMEWORK_BASE_FILES} - ${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/base/static-components.h) - SET(MCA_FILES ${MCA_FILES} ${MCA_FRAMEWORK_BASE_FILES}) - - SOURCE_GROUP(mca\\${MCA_FRAMEWORK}\\base FILES ${MCA_FRAMEWORK_BASE_FILES}) - - # Install help files if they are here. - INSTALL(DIRECTORY ${CURRENT_PATH}/ DESTINATION share/openmpi/ - FILES_MATCHING PATTERN "*.txt" - PATTERN ".svn" EXCLUDE - PATTERN ".hg" EXCLUDE) - - ELSEIF(EXISTS "${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}/.windows") - - SET(COMPONENT_FILES "") - SET(RESULT_SOURCE_FILES "") - SET(CURRENT_PATH ${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}) - - # by default, build this component. - SET(BUILD_COMPONENT TRUE) - - # do we have to run a check module first? - SET(REQUIRED_CHECK "") - FILE(STRINGS ${CURRENT_PATH}/.windows REQUIRED_CHECK REGEX "^required_check=") - - SET(EXTRA_INCLUDE_PATH "") - IF(NOT REQUIRED_CHECK STREQUAL "") - STRING(REPLACE "required_check=" "" REQUIRED_CHECK ${REQUIRED_CHECK}) - UNSET(RESULT_INCLUDE_PATH) - UNSET(RESULT_LINK_LIBRARIES) - INCLUDE(${REQUIRED_CHECK}) - IF(RESULT) - SET(COMPONENT_FILES ${COMPONENT_FILES} ${RESULT_SOURCE_FILES}) - SET(EXTRA_INCLUDE_PATH ${RESULT_INCLUDE_PATH}) - # these extra libraries will be set up in up layer, e.g. ompi - SET(EXTRA_LINK_LIBRARIES ${EXTRA_LINK_LIBRARIES} ${RESULT_LINK_LIBRARIES}) - ELSE(RESULT) - # Required check failed, don't build this component. - SET(BUILD_COMPONENT FALSE) - ENDIF(RESULT) - ENDIF(NOT REQUIRED_CHECK STREQUAL "") - - IF(BUILD_COMPONENT) - - IF(NOT COMPONENT_FILES) - FILE(GLOB_RECURSE COMPONENT_FILES "${CURRENT_PATH}/*.C" "${CURRENT_PATH}/*.h" - "${CURRENT_PATH}/*.cc" "${CURRENT_PATH}/*.cpp") - - #check exclude list - SET(EXCLUDE_LIST "") - FILE(STRINGS ${CURRENT_PATH}/.windows EXCLUDE_LIST REGEX "^exclude_list=") - - IF(NOT EXCLUDE_LIST STREQUAL "") - STRING(REPLACE "exclude_list=" "" EXCLUDE_LIST ${EXCLUDE_LIST}) - ENDIF(NOT EXCLUDE_LIST STREQUAL "") - - # remove the files in the exclude list - FOREACH(FILE ${EXCLUDE_LIST}) - LIST(REMOVE_ITEM COMPONENT_FILES "${CURRENT_PATH}/${FILE}") - ENDFOREACH(FILE) - ENDIF(NOT COMPONENT_FILES) - - # check the library build type - FILE(STRINGS ${CURRENT_PATH}/.windows - VALUE REGEX "^not_single_shared_lib=") - IF(NOT VALUE STREQUAL "") - STRING(REPLACE "not_single_shared_lib=" "" NOT_SINGLE_SHARED_LIB ${VALUE}) - ENDIF(NOT VALUE STREQUAL "") - - IF(NOT OPAL_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1") - SET(NOT_SINGLE_SHARED_LIB "") - # add sources for static build or for the shared build when this is not a stand along library. - SET(MCA_FILES ${MCA_FILES} ${COMPONENT_FILES}) - SOURCE_GROUP(mca\\${MCA_FRAMEWORK}\\${MCA_COMPONENT} FILES ${COMPONENT_FILES}) - - INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_PATH}) - - IF(EXISTS "${CURRENT_PATH}/configure.params") - FILE(STRINGS ${CURRENT_PATH}/configure.params - CURRENT_COMPONENT_PRIORITY REGEX "PRIORITY") - ELSE(EXISTS "${CURRENT_PATH}/configure.params") - FILE(STRINGS ${CURRENT_PATH}/.windows - CURRENT_COMPONENT_PRIORITY REGEX "^mca_priority=") - ENDIF(EXISTS "${CURRENT_PATH}/configure.params") - - IF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "") - STRING(REGEX REPLACE "[A-Z_a-z]+=" "" CURRENT_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY}) - ENDIF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "") - - SET(MCA_PRIORITY_LIST ${MCA_PRIORITY_LIST} "${CURRENT_COMPONENT_PRIORITY}:${MCA_COMPONENT}") - - ELSE(NOT OPAL_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1") - - # get the libraries required for this component. - SET(MCA_LINK_LIBRARIES "") - FILE(STRINGS ${CURRENT_PATH}/.windows VALUE REGEX "^mca_link_libraries=") - IF(NOT VALUE STREQUAL "") - STRING(REPLACE "mca_link_libraries=" "" MCA_LINK_LIBRARIES ${VALUE}) - ENDIF(NOT VALUE STREQUAL "") - - # the mca_common_* libraries should be installed into bin, - # this will avoid the runtime open module failure. - IF("${MCA_FRAMEWORK}" STREQUAL "common") - SET(LIB_NAME_PREFIX "lib") - SET(INSTALL_DEST "RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib") - SET(PDB_DEST "bin") - ELSE("${MCA_FRAMEWORK}" STREQUAL "common") - SET(LIB_NAME_PREFIX "") - IF(OMPI_DEBUG_BUILD) - SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi/debug - LIBRARY DESTINATION lib/openmpi/debug - ARCHIVE DESTINATION lib/openmpi/debug") - SET(PDB_DEST "lib/openmpi/debug") - ELSE(OMPI_DEBUG_BUILD) - SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi - LIBRARY DESTINATION lib/openmpi - ARCHIVE DESTINATION lib/openmpi") - ENDIF(OMPI_DEBUG_BUILD) - ENDIF("${MCA_FRAMEWORK}" STREQUAL "common") - - - # generate CMakeLists.txt for each component for DSO build. - FILE (WRITE "${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}/CMakeLists.txt" - " -# -# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# make new project for shared build - -INCLUDE_DIRECTORIES(\${EXTRA_INCLUDE_PATH}) - -ADD_LIBRARY(${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} SHARED - \${COMPONENT_FILES}) - -SET_TARGET_PROPERTIES(${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} - PROPERTIES COMPILE_FLAGS \"-D_USRDLL -DOPAL_IMPORTS -DOMPI_IMPORTS -DORTE_IMPORTS /TP\") - -TARGET_LINK_LIBRARIES (${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} - libopen-pal ${MCA_LINK_LIBRARIES} ${EXTRA_LINK_LIBRARIES}) - -INSTALL(TARGETS ${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} ${INSTALL_DEST}) -IF (OMPI_DEBUG_BUILD) - INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}${CMAKE_DEBUG_POSTFIX}.pdb - DESTINATION ${PDB_DEST}) -ENDIF (OMPI_DEBUG_BUILD) - ") - - ADD_SUBDIRECTORY (${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT} mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}) - - # for single dll, reset these two variables for the next component. - UNSET(EXTRA_INCLUDE_PATH) - UNSET(EXTRA_LINK_LIBRARIES) - - ENDIF(NOT OPAL_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1") - - # Install help files if they are here. - INSTALL(DIRECTORY ${CURRENT_PATH}/ DESTINATION share/openmpi/ - FILES_MATCHING PATTERN "*.txt" - PATTERN ".svn" EXCLUDE - PATTERN ".hg" EXCLUDE) - - ENDIF(BUILD_COMPONENT) - ENDIF(${MCA_COMPONENT} STREQUAL "base") - - ENDFOREACH(MCA_COMPONENT) - - - # generate the correct order of the components. - LIST(SORT MCA_PRIORITY_LIST) - FOREACH(MCA_COMPONENT ${MCA_PRIORITY_LIST}) - STRING(REGEX REPLACE "[0-9]*:" "" COMPONENT_NAME ${MCA_COMPONENT}) - SET (OUTFILE_EXTERN - "extern const mca_base_component_t mca_${MCA_FRAMEWORK}_${COMPONENT_NAME}_component" - "\n${OUTFILE_EXTERN}") - SET(FRAMEWORK_STRUCT_DEF - "&mca_${MCA_FRAMEWORK}_${COMPONENT_NAME}_component,\n" - ${FRAMEWORK_STRUCT_DEF}) - SET(BEST_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY}) - ENDFOREACH(MCA_COMPONENT ${MCA_PRIORITY_LIST}) - - STRING(LENGTH "${FRAMEWORK_STRUCT_DEF}" STRUCT_STRING_LENTH) - IF(STRUCT_STRING_LENTH GREATER 0) - STRING (REPLACE ";" "" OUTFILE_STRUCT ${FRAMEWORK_STRUCT_DEF}) - ENDIF(STRUCT_STRING_LENTH GREATER 0) - # write out static-component.h for this mca. - FILE(WRITE "${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/base/static-components.h" - "/* - * $HEADER$ - */ -#if defined(c_plusplus) || defined(__cplusplus) - extern \"C\" { -#endif - -${OUTFILE_EXTERN} - -const mca_base_component_t *mca_${MCA_FRAMEWORK}_base_static_components[] = { - ${OUTFILE_STRUCT} - NULL -}; - -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - ") - - SET(OUTFILE_EXTERN "") - SET(OUTFILE_STRUCT "") - SET(FRAMEWORK_STRUCT_DEF "") - ENDIF(NOT ${MCA_FRAMEWORK} STREQUAL "CMakeFiles" AND NOT ${MCA_FRAMEWORK} STREQUAL "svn") -ENDFOREACH (MCA_FRAMEWORK) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +INCLUDE(list_subdirs) + +# there are several steps and issues for checking mca components: +# +# 1. go through each framwork dir, add the top-level headers +# to the source list. +# +# 2. go through each component dir, the framwork base dir is checked +# also in this setp, and is added to the source list. +# +# 2a. if a .windows file exists in a framwork base dir, that means there +# might be properties that have to be checked for this dir, e.g. files +# need to be excluded. +# +# 2b. if a .windows file exists in a component dir, this component +# should be included in the solution. There could be properties that +# need to check for this component. If it's a static build or not a +# DSO shared build, just add necessary sources; if it is a DSO build, +# generate a proper CMakeLists.txt file for each component, so that +# this component will be compiled separately. +# +# 3. Generate static-components.h file with available mca components. +# +# +# Available properties in .windows files: +# +# exclude_list: files that need to be excluded from the solution. +# +# required_check: a CMake module has to be run to check the libraries/headers +# that needed by this component. The check might return two +# variables: RESULT_INCLUDE_PATH, RESULT_LINK_LIBRARIES and RESULT_SOURCE_FILES. +# RESULT_INCLUDE_PATH is handled in this macro, and RESULT_LINK_LIBRARIES +# is handled in upper layer. +# +# not_single_shared_lib: this component should not be built separately, it's not +# a single mca shared library. +# +# mca_link_libraries: this component has to be linked with other targets or libraries, +# e.g. Ws2_32.lib +# mca_priority: priority of the mca component. + + +SET(MCA_FRAMEWORK_LIST "") +CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}/mca" MCA_FRAMEWORK_LIST) +#MESSAGE("MCA_FRAMEWORK_LIST:${MCA_FRAMEWORK_LIST}") + + +FILE(GLOB ${PROJECT_NAME}_MCA_HEADER_FILES "mca/*.C" "mca/*.h") +SET(${PROJECT_NAME}_MCA_FILES ${${PROJECT_NAME}_MCA_FILES} ${${PROJECT_NAME}_MCA_HEADER_FILES}) +SOURCE_GROUP(mca FILES ${${PROJECT_NAME}_MCA_HEADER_FILES}) + +# clear the variables first +SET(MCA_FRAMEWORK "") +SET(MCA_FRAMEWORK_FILES "") +SET(MCA_FILES "") + +# parse each mca subdir +FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST}) + + IF(NOT ${MCA_FRAMEWORK} STREQUAL "CMakeFiles" AND NOT ${MCA_FRAMEWORK} STREQUAL "svn") + #SET(CURRENT_PATH "mca/${${PROJECT_NAME}_MCA_SUBDIR}") + FILE(GLOB MCA_FRAMEWORK_FILES "mca/${MCA_FRAMEWORK}/*.c" "mca/${MCA_FRAMEWORK}/*.h" + "mca/${MCA_FRAMEWORK}/*.cc" "mca/${MCA_FRAMEWORK}/*.cpp") + SET(MCA_FILES ${MCA_FILES} ${MCA_FRAMEWORK_FILES}) + SOURCE_GROUP(mca\\${MCA_FRAMEWORK} FILES ${MCA_FRAMEWORK_FILES}) + + SET(COMPONENT_LIST "") + CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}" COMPONENT_LIST) + + SET(CURRENT_COMPONENT_PRIORITY "") + SET(MCA_PRIORITY_LIST "") + + # parse each component subdir of current mca framework + FOREACH (MCA_COMPONENT ${COMPONENT_LIST}) + + IF(${MCA_COMPONENT} STREQUAL "base") + + SET(CURRENT_PATH "${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/base") + FILE(GLOB MCA_FRAMEWORK_BASE_FILES "${CURRENT_PATH}/*.c" "${CURRENT_PATH}/*.h" + "${CURRENT_PATH}/*.cc" "${CURRENT_PATH}/*.cpp") + + IF(EXISTS "${CURRENT_PATH}/.windows") + + #MESSAGE("MCA_FRAMEWORK_BASE_FILES:${MCA_FRAMEWORK_BASE_FILES}") + SET(EXCLUDE_LIST "") + FILE(STRINGS ${CURRENT_PATH}/.windows EXCLUDE_LIST REGEX "^exclude_list=") + + IF(NOT EXCLUDE_LIST STREQUAL "") + STRING(REPLACE "exclude_list=" "" EXCLUDE_LIST ${EXCLUDE_LIST}) + ENDIF(NOT EXCLUDE_LIST STREQUAL "") + + # remove the files in the exclude list + FOREACH(FILE ${EXCLUDE_LIST}) + LIST(REMOVE_ITEM MCA_FRAMEWORK_BASE_FILES "${CURRENT_PATH}/${FILE}") + ENDFOREACH(FILE) + + ENDIF(EXISTS "${CURRENT_PATH}/.windows") + + SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/base/static-components.h + PROPERTIES GENERATED true) + SET(MCA_FRAMEWORK_BASE_FILES ${MCA_FRAMEWORK_BASE_FILES} + ${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/base/static-components.h) + SET(MCA_FILES ${MCA_FILES} ${MCA_FRAMEWORK_BASE_FILES}) + + SOURCE_GROUP(mca\\${MCA_FRAMEWORK}\\base FILES ${MCA_FRAMEWORK_BASE_FILES}) + + # Install help files if they are here. + INSTALL(DIRECTORY ${CURRENT_PATH}/ DESTINATION share/openmpi/ + FILES_MATCHING PATTERN "*.txt" + PATTERN ".svn" EXCLUDE + PATTERN ".hg" EXCLUDE) + + ELSEIF(EXISTS "${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}/.windows") + + SET(COMPONENT_FILES "") + SET(RESULT_SOURCE_FILES "") + SET(CURRENT_PATH ${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}) + + # by default, build this component. + SET(BUILD_COMPONENT TRUE) + + # do we have to run a check module first? + SET(REQUIRED_CHECK "") + FILE(STRINGS ${CURRENT_PATH}/.windows REQUIRED_CHECK REGEX "^required_check=") + + SET(EXTRA_INCLUDE_PATH "") + IF(NOT REQUIRED_CHECK STREQUAL "") + STRING(REPLACE "required_check=" "" REQUIRED_CHECK ${REQUIRED_CHECK}) + UNSET(RESULT_INCLUDE_PATH) + UNSET(RESULT_LINK_LIBRARIES) + INCLUDE(${REQUIRED_CHECK}) + IF(RESULT) + SET(COMPONENT_FILES ${COMPONENT_FILES} ${RESULT_SOURCE_FILES}) + SET(EXTRA_INCLUDE_PATH ${RESULT_INCLUDE_PATH}) + # these extra libraries will be set up in up layer, e.g. ompi + SET(EXTRA_LINK_LIBRARIES ${EXTRA_LINK_LIBRARIES} ${RESULT_LINK_LIBRARIES}) + ELSE(RESULT) + # Required check failed, don't build this component. + SET(BUILD_COMPONENT FALSE) + ENDIF(RESULT) + ENDIF(NOT REQUIRED_CHECK STREQUAL "") + + IF(BUILD_COMPONENT) + + IF(NOT COMPONENT_FILES) + FILE(GLOB_RECURSE COMPONENT_FILES "${CURRENT_PATH}/*.C" "${CURRENT_PATH}/*.h" + "${CURRENT_PATH}/*.cc" "${CURRENT_PATH}/*.cpp") + + #check exclude list + SET(EXCLUDE_LIST "") + FILE(STRINGS ${CURRENT_PATH}/.windows EXCLUDE_LIST REGEX "^exclude_list=") + + IF(NOT EXCLUDE_LIST STREQUAL "") + STRING(REPLACE "exclude_list=" "" EXCLUDE_LIST ${EXCLUDE_LIST}) + ENDIF(NOT EXCLUDE_LIST STREQUAL "") + + # remove the files in the exclude list + FOREACH(FILE ${EXCLUDE_LIST}) + LIST(REMOVE_ITEM COMPONENT_FILES "${CURRENT_PATH}/${FILE}") + ENDFOREACH(FILE) + ENDIF(NOT COMPONENT_FILES) + + # check the library build type + FILE(STRINGS ${CURRENT_PATH}/.windows + VALUE REGEX "^not_single_shared_lib=") + IF(NOT VALUE STREQUAL "") + STRING(REPLACE "not_single_shared_lib=" "" NOT_SINGLE_SHARED_LIB ${VALUE}) + ENDIF(NOT VALUE STREQUAL "") + + IF(NOT OPAL_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1") + SET(NOT_SINGLE_SHARED_LIB "") + # add sources for static build or for the shared build when this is not a stand along library. + SET(MCA_FILES ${MCA_FILES} ${COMPONENT_FILES}) + SOURCE_GROUP(mca\\${MCA_FRAMEWORK}\\${MCA_COMPONENT} FILES ${COMPONENT_FILES}) + + INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_PATH}) + + IF(EXISTS "${CURRENT_PATH}/configure.params") + FILE(STRINGS ${CURRENT_PATH}/configure.params + CURRENT_COMPONENT_PRIORITY REGEX "PRIORITY") + ELSE(EXISTS "${CURRENT_PATH}/configure.params") + FILE(STRINGS ${CURRENT_PATH}/.windows + CURRENT_COMPONENT_PRIORITY REGEX "^mca_priority=") + ENDIF(EXISTS "${CURRENT_PATH}/configure.params") + + IF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "") + STRING(REGEX REPLACE "[A-Z_a-z]+=" "" CURRENT_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY}) + ENDIF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "") + + SET(MCA_PRIORITY_LIST ${MCA_PRIORITY_LIST} "${CURRENT_COMPONENT_PRIORITY}:${MCA_COMPONENT}") + + ELSE(NOT OPAL_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1") + + # get the libraries required for this component. + SET(MCA_LINK_LIBRARIES "") + FILE(STRINGS ${CURRENT_PATH}/.windows VALUE REGEX "^mca_link_libraries=") + IF(NOT VALUE STREQUAL "") + STRING(REPLACE "mca_link_libraries=" "" MCA_LINK_LIBRARIES ${VALUE}) + ENDIF(NOT VALUE STREQUAL "") + + # the mca_common_* libraries should be installed into bin, + # this will avoid the runtime open module failure. + IF("${MCA_FRAMEWORK}" STREQUAL "common") + SET(LIB_NAME_PREFIX "lib") + SET(INSTALL_DEST "RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib") + SET(PDB_DEST "bin") + ELSE("${MCA_FRAMEWORK}" STREQUAL "common") + SET(LIB_NAME_PREFIX "") + IF(OMPI_DEBUG_BUILD) + SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi/debug + LIBRARY DESTINATION lib/openmpi/debug + ARCHIVE DESTINATION lib/openmpi/debug") + SET(PDB_DEST "lib/openmpi/debug") + ELSE(OMPI_DEBUG_BUILD) + SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi + LIBRARY DESTINATION lib/openmpi + ARCHIVE DESTINATION lib/openmpi") + ENDIF(OMPI_DEBUG_BUILD) + ENDIF("${MCA_FRAMEWORK}" STREQUAL "common") + + + # generate CMakeLists.txt for each component for DSO build. + FILE (WRITE "${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}/CMakeLists.txt" + " +# +# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# make new project for shared build + +INCLUDE_DIRECTORIES(\${EXTRA_INCLUDE_PATH}) + +ADD_LIBRARY(${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} SHARED + \${COMPONENT_FILES}) + +SET_TARGET_PROPERTIES(${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} + PROPERTIES COMPILE_FLAGS \"-D_USRDLL -DOPAL_IMPORTS -DOMPI_IMPORTS -DORTE_IMPORTS /TP\") + +TARGET_LINK_LIBRARIES (${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} + libopen-pal ${MCA_LINK_LIBRARIES} ${EXTRA_LINK_LIBRARIES}) + +INSTALL(TARGETS ${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} ${INSTALL_DEST}) +IF (OMPI_DEBUG_BUILD) + INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}${CMAKE_DEBUG_POSTFIX}.pdb + DESTINATION ${PDB_DEST}) +ENDIF (OMPI_DEBUG_BUILD) + ") + + ADD_SUBDIRECTORY (${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT} mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}) + + # for single dll, reset these two variables for the next component. + UNSET(EXTRA_INCLUDE_PATH) + UNSET(EXTRA_LINK_LIBRARIES) + + ENDIF(NOT OPAL_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1") + + # Install help files if they are here. + INSTALL(DIRECTORY ${CURRENT_PATH}/ DESTINATION share/openmpi/ + FILES_MATCHING PATTERN "*.txt" + PATTERN ".svn" EXCLUDE + PATTERN ".hg" EXCLUDE) + + ENDIF(BUILD_COMPONENT) + ENDIF(${MCA_COMPONENT} STREQUAL "base") + + ENDFOREACH(MCA_COMPONENT) + + + # generate the correct order of the components. + LIST(SORT MCA_PRIORITY_LIST) + FOREACH(MCA_COMPONENT ${MCA_PRIORITY_LIST}) + STRING(REGEX REPLACE "[0-9]*:" "" COMPONENT_NAME ${MCA_COMPONENT}) + SET (OUTFILE_EXTERN + "extern const mca_base_component_t mca_${MCA_FRAMEWORK}_${COMPONENT_NAME}_component" + "\n${OUTFILE_EXTERN}") + SET(FRAMEWORK_STRUCT_DEF + "&mca_${MCA_FRAMEWORK}_${COMPONENT_NAME}_component,\n" + ${FRAMEWORK_STRUCT_DEF}) + SET(BEST_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY}) + ENDFOREACH(MCA_COMPONENT ${MCA_PRIORITY_LIST}) + + STRING(LENGTH "${FRAMEWORK_STRUCT_DEF}" STRUCT_STRING_LENTH) + IF(STRUCT_STRING_LENTH GREATER 0) + STRING (REPLACE ";" "" OUTFILE_STRUCT ${FRAMEWORK_STRUCT_DEF}) + ENDIF(STRUCT_STRING_LENTH GREATER 0) + # write out static-component.h for this mca. + FILE(WRITE "${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/base/static-components.h" + "/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) + extern \"C\" { +#endif + +${OUTFILE_EXTERN} + +const mca_base_component_t *mca_${MCA_FRAMEWORK}_base_static_components[] = { + ${OUTFILE_STRUCT} + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + ") + + SET(OUTFILE_EXTERN "") + SET(OUTFILE_STRUCT "") + SET(FRAMEWORK_STRUCT_DEF "") + ENDIF(NOT ${MCA_FRAMEWORK} STREQUAL "CMakeFiles" AND NOT ${MCA_FRAMEWORK} STREQUAL "svn") +ENDFOREACH (MCA_FRAMEWORK) diff --git a/contrib/platform/win32/CMakeModules/f77_check.cmake b/contrib/platform/win32/CMakeModules/f77_check.cmake index 8a437405d7..7f27d45710 100644 --- a/contrib/platform/win32/CMakeModules/f77_check.cmake +++ b/contrib/platform/win32/CMakeModules/f77_check.cmake @@ -1,100 +1,100 @@ -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# OMPI_F77_CHECK(Fortran type, c type required, -# types to search, expected size) -#---------------------------------------------------------- -# Check Fortran type, including: -# - whether compiler supports or not -# - size of type -# - equal to expected size -# - alignment -# - associated C type -# -# types to search is a list of values - -MACRO(OMPI_F77_CHECK FORTRAN_TYPE C_TYPE TYPE_LIST EXPECTED_SIZE) - - STRING(REPLACE "*" "" TYPE_NAME ${FORTRAN_TYPE}) - STRING(REPLACE " " "_" TYPE_NAME ${TYPE_NAME}) - STRING(TOLOWER ${TYPE_NAME} TYPE_NAME_L) - - INCLUDE(F77_check_type) - INCLUDE(F77_get_alignment) - INCLUDE(F77_get_sizeof) - INCLUDE(ompi_find_type) - - SET(ofc_expected_size ${EXPECTED_SIZE}) - SET(ofc_have_type 0) - SET(ofc_type_size ${SIZEOF_INT}) - SET(ofc_type_alignment ${SIZEOF_INT}) - SET(ofc_c_type ${ompi_fortran_bogus_type_t}) - - IF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED F77_SETUP_${TYPE_NAME}_DONE) - - OMPI_F77_CHECK_TYPE(${FORTRAN_TYPE} ofc_have_type) - - IF(ofc_have_type) - # What is the size of this type? - - # NOTE: Some Fortran compilers actually will return that a - # type exists even if it doesn't support it -- the compiler - # will automatically convert the unsupported type to a type - # that it *does* support. For example, if you try to use - # INTEGER*16 and the compiler doesn't support it, it may well - # automatically convert it to INTEGER*8 for you (!). So we - # have to check the actual size of the type once we determine - # that the compiler doesn't error if we try to use it - # (i.e,. the compiler *might* support that type). If the size - # doesn't match the expected size, then the compiler doesn't - # really support it. - OMPI_F77_GET_SIZEOF(${FORTRAN_TYPE} ofc_type_size) - - IF(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}") - MESSAGE(STATUS "*** Fortran 77 ${FORTRAN_TYPE} does not have expected size!") - MESSAGE(STATUS "*** Expected ${ofc_expected_size}, got ${ofc_type_size}") - MESSAGE(STATUS "*** Disabling MPI support for Fortran 77 ${FORTRAN_TYPE}") - SET(ofc_have_type 0) - ELSE(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}") - # Look for a corresponding C type (will abort by itself if the - # type isn't found and we need it) - IF(NOT "${TYPE_LIST}" STREQUAL "") - OMPI_FIND_TYPE(${FORTRAN_TYPE} "${TYPE_LIST}" ${C_TYPE} ${ofc_type_size} ofc_c_type) - ENDIF(NOT "${TYPE_LIST}" STREQUAL "") - - OMPI_F77_GET_ALIGNMENT(${FORTRAN_TYPE} ofc_type_alignment) - - ENDIF(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}") - SET(F77_SETUP_${TYPE_NAME}_DONE TRUE CACHE INTERNAL "F77 ${TYPE_NAME} check done or not.") - ENDIF(ofc_have_type) - - ELSEIF(NOT OMPI_WANT_F77_BINDINGS) - UNSET(F77_SETUP_${TYPE_NAME}_DONE CACHE) - ENDIF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED F77_SETUP_${TYPE_NAME}_DONE) - - IF(NOT "${TYPE_LIST}" STREQUAL "") - SET(ompi_fortran_${TYPE_NAME_L}_t ${ofc_c_type} CACHE INTERNAL "ompi_fortran_${TYPE_NAME_L}_t") - ENDIF(NOT "${TYPE_LIST}" STREQUAL "") - SET(OMPI_HAVE_FORTRAN_${TYPE_NAME} ${ofc_have_type} CACHE INTERNAL "OMPI_HAVE_FORTRAN_${TYPE_NAME}") - SET(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} ${ofc_type_size} CACHE INTERNAL "OMPI_SIZEOF_FORTRAN_${TYPE_NAME}") - SET(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} ${ofc_type_alignment} CACHE INTERNAL "OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}") - - #MESSAGE("OMPI_HAVE_FORTRAN_${TYPE_NAME}:${OMPI_HAVE_FORTRAN_${TYPE_NAME}}") - #MESSAGE("OMPI_SIZEOF_FORTRAN_${TYPE_NAME}:${OMPI_SIZEOF_FORTRAN_${TYPE_NAME}}") - #MESSAGE("OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}:${OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}}") - #MESSAGE("ompi_fortran_${TYPE_NAME_L}_t:${ompi_fortran_${TYPE_NAME_L}_t}") - - OMPI_DEF_VAR(OMPI_HAVE_FORTRAN_${TYPE_NAME} "Whether we have Fortran 77 `${FORTRAN_TYPE}' or not." 0 1) - OMPI_DEF_VAR(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} "Size of Fortran 77 `${FORTRAN_TYPE}'." 0 1) - OMPI_DEF_VAR(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} "Alignment of Fortran 77 `${FORTRAN_TYPE}'." 0 1) - OMPI_DEF_VAR(ompi_fortran_${TYPE_NAME_L}_t "C type corresponding to Fortran 77 `${FORTRAN_TYPE}'." 0 0) - -ENDMACRO(OMPI_F77_CHECK FORTRAN_TYPE C_TYPE TYPE_LIST EXPECTED_SIZE) +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# OMPI_F77_CHECK(Fortran type, c type required, +# types to search, expected size) +#---------------------------------------------------------- +# Check Fortran type, including: +# - whether compiler supports or not +# - size of type +# - equal to expected size +# - alignment +# - associated C type +# +# types to search is a list of values + +MACRO(OMPI_F77_CHECK FORTRAN_TYPE C_TYPE TYPE_LIST EXPECTED_SIZE) + + STRING(REPLACE "*" "" TYPE_NAME ${FORTRAN_TYPE}) + STRING(REPLACE " " "_" TYPE_NAME ${TYPE_NAME}) + STRING(TOLOWER ${TYPE_NAME} TYPE_NAME_L) + + INCLUDE(F77_check_type) + INCLUDE(F77_get_alignment) + INCLUDE(F77_get_sizeof) + INCLUDE(ompi_find_type) + + SET(ofc_expected_size ${EXPECTED_SIZE}) + SET(ofc_have_type 0) + SET(ofc_type_size ${SIZEOF_INT}) + SET(ofc_type_alignment ${SIZEOF_INT}) + SET(ofc_c_type ${ompi_fortran_bogus_type_t}) + + IF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED F77_SETUP_${TYPE_NAME}_DONE) + + OMPI_F77_CHECK_TYPE(${FORTRAN_TYPE} ofc_have_type) + + IF(ofc_have_type) + # What is the size of this type? + + # NOTE: Some Fortran compilers actually will return that a + # type exists even if it doesn't support it -- the compiler + # will automatically convert the unsupported type to a type + # that it *does* support. For example, if you try to use + # INTEGER*16 and the compiler doesn't support it, it may well + # automatically convert it to INTEGER*8 for you (!). So we + # have to check the actual size of the type once we determine + # that the compiler doesn't error if we try to use it + # (i.e,. the compiler *might* support that type). If the size + # doesn't match the expected size, then the compiler doesn't + # really support it. + OMPI_F77_GET_SIZEOF(${FORTRAN_TYPE} ofc_type_size) + + IF(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}") + MESSAGE(STATUS "*** Fortran 77 ${FORTRAN_TYPE} does not have expected size!") + MESSAGE(STATUS "*** Expected ${ofc_expected_size}, got ${ofc_type_size}") + MESSAGE(STATUS "*** Disabling MPI support for Fortran 77 ${FORTRAN_TYPE}") + SET(ofc_have_type 0) + ELSE(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}") + # Look for a corresponding C type (will abort by itself if the + # type isn't found and we need it) + IF(NOT "${TYPE_LIST}" STREQUAL "") + OMPI_FIND_TYPE(${FORTRAN_TYPE} "${TYPE_LIST}" ${C_TYPE} ${ofc_type_size} ofc_c_type) + ENDIF(NOT "${TYPE_LIST}" STREQUAL "") + + OMPI_F77_GET_ALIGNMENT(${FORTRAN_TYPE} ofc_type_alignment) + + ENDIF(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}") + SET(F77_SETUP_${TYPE_NAME}_DONE TRUE CACHE INTERNAL "F77 ${TYPE_NAME} check done or not.") + ENDIF(ofc_have_type) + + ELSEIF(NOT OMPI_WANT_F77_BINDINGS) + UNSET(F77_SETUP_${TYPE_NAME}_DONE CACHE) + ENDIF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED F77_SETUP_${TYPE_NAME}_DONE) + + IF(NOT "${TYPE_LIST}" STREQUAL "") + SET(ompi_fortran_${TYPE_NAME_L}_t ${ofc_c_type} CACHE INTERNAL "ompi_fortran_${TYPE_NAME_L}_t") + ENDIF(NOT "${TYPE_LIST}" STREQUAL "") + SET(OMPI_HAVE_FORTRAN_${TYPE_NAME} ${ofc_have_type} CACHE INTERNAL "OMPI_HAVE_FORTRAN_${TYPE_NAME}") + SET(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} ${ofc_type_size} CACHE INTERNAL "OMPI_SIZEOF_FORTRAN_${TYPE_NAME}") + SET(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} ${ofc_type_alignment} CACHE INTERNAL "OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}") + + #MESSAGE("OMPI_HAVE_FORTRAN_${TYPE_NAME}:${OMPI_HAVE_FORTRAN_${TYPE_NAME}}") + #MESSAGE("OMPI_SIZEOF_FORTRAN_${TYPE_NAME}:${OMPI_SIZEOF_FORTRAN_${TYPE_NAME}}") + #MESSAGE("OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}:${OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}}") + #MESSAGE("ompi_fortran_${TYPE_NAME_L}_t:${ompi_fortran_${TYPE_NAME_L}_t}") + + OMPI_DEF_VAR(OMPI_HAVE_FORTRAN_${TYPE_NAME} "Whether we have Fortran 77 `${FORTRAN_TYPE}' or not." 0 1) + OMPI_DEF_VAR(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} "Size of Fortran 77 `${FORTRAN_TYPE}'." 0 1) + OMPI_DEF_VAR(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} "Alignment of Fortran 77 `${FORTRAN_TYPE}'." 0 1) + OMPI_DEF_VAR(ompi_fortran_${TYPE_NAME_L}_t "C type corresponding to Fortran 77 `${FORTRAN_TYPE}'." 0 0) + +ENDMACRO(OMPI_F77_CHECK FORTRAN_TYPE C_TYPE TYPE_LIST EXPECTED_SIZE) diff --git a/contrib/platform/win32/CMakeModules/f77_check_real16_c_equiv.cmake b/contrib/platform/win32/CMakeModules/f77_check_real16_c_equiv.cmake index ac1e7ad0f0..89a13bca6b 100644 --- a/contrib/platform/win32/CMakeModules/f77_check_real16_c_equiv.cmake +++ b/contrib/platform/win32/CMakeModules/f77_check_real16_c_equiv.cmake @@ -1,97 +1,97 @@ -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# OMPI_F77_CHECK_REAL16_C_EQUIV -# ---------------------------------------------------- -MACRO(OMPI_F77_CHECK_REAL16_C_EQUIV) - SET(OMPI_REAL16_MATCHES_C 0) - - IF(OMPI_WANT_F77_BINDINGS AND OMPI_HAVE_FORTRAN_REAL16 AND NOT DEFINED REAL16_MATCHES_CHECK_DONE) - IF(NOT ${ompi_fortran_real16_t} STREQUAL "") - STRING(TOUPPER ${ompi_fortran_real16_t} REAL16_C_TYPE) - - IF(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE}) - OMPI_F77_MAKE_C_FUNCTION(ompi_ac_c_fn c) - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c - "#include \n" - "#include \n" - "\n" - "#ifdef __cplusplus\n" - "extern \"C\" {\n" - "#endif\n" - "void ${ompi_ac_c_fn}(${ompi_fortran_real16_t} *a) {\n" - " FILE *fp = fopen(\"conftestval\", \"w\");\n" - " if (NULL == fp) exit(1);\n" - " fprintf(fp, \"%s\n\", (1.1L == *a) ? \"yes\" : \"no\");\n" - " fclose(fp);\n" - "}\n" - "#ifdef __cplusplus\n" - "}\n" - "#endif\n") - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_f.f - "\tprogram bogus\n" - "\tREAL*16 :: foo\n" - "\tfoo = 1.1\n" - "\tcall c(foo)\n" - "\tend program bogus\n") - - EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest_c.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - EXECUTE_PROCESS(COMMAND ${F77} conftest_f.f conftest_c.obj ${F77_OUTPUT_OBJ}conftest - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - EXECUTE_PROCESS(COMMAND conftest.exe - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(RESULT) - UNSET(REAL16_MATCHES_CHECK_DONE CACHE) - MESSAGE(FATAL_ERROR "Can not determine if REAL*16 bit-matches C.") - ELSE(RESULT) - IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - # read out type size value from the file, and write back to the output variable - FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE}) - MESSAGE(STATUS "Check if REAL*16 bit-matches C...${OUTPUT_VARIABLE}") - SET(OMPI_REAL16_MATCHES_C 1) - SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.") - ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - UNSET(REAL16_MATCHES_CHECK_DONE CACHE) - MESSAGE(STATUS "Check if REAL*16 bit-matches C...failed") - ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - ENDIF(RESULT) - - ELSE(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE}) - SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.") - MESSAGE(STATUS "Check if REAL*16 bit-matches C...skipped. (no corresponding C type)") - ENDIF(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE}) - - ELSE(NOT ${ompi_fortran_real16_t} STREQUAL "") - SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.") - MESSAGE(STATUS "Check if REAL*16 bit-matches C...skipped. (no REAL*16)") - ENDIF(NOT ${ompi_fortran_real16_t} STREQUAL "") - - ELSEIF(NOT OMPI_WANT_F77_BINDINGS) - UNSET(REAL16_MATCHES_CHECK_DONE CACHE) - ENDIF(OMPI_WANT_F77_BINDINGS AND OMPI_HAVE_FORTRAN_REAL16 AND NOT DEFINED REAL16_MATCHES_CHECK_DONE) - - OMPI_DEF_VAR(OMPI_REAL16_MATCHES_C "if REAL*16 bit-matches C." 0 1) - -ENDMACRO(OMPI_F77_CHECK_REAL16_C_EQUIV) +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# OMPI_F77_CHECK_REAL16_C_EQUIV +# ---------------------------------------------------- +MACRO(OMPI_F77_CHECK_REAL16_C_EQUIV) + SET(OMPI_REAL16_MATCHES_C 0) + + IF(OMPI_WANT_F77_BINDINGS AND OMPI_HAVE_FORTRAN_REAL16 AND NOT DEFINED REAL16_MATCHES_CHECK_DONE) + IF(NOT ${ompi_fortran_real16_t} STREQUAL "") + STRING(TOUPPER ${ompi_fortran_real16_t} REAL16_C_TYPE) + + IF(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE}) + OMPI_F77_MAKE_C_FUNCTION(ompi_ac_c_fn c) + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c + "#include \n" + "#include \n" + "\n" + "#ifdef __cplusplus\n" + "extern \"C\" {\n" + "#endif\n" + "void ${ompi_ac_c_fn}(${ompi_fortran_real16_t} *a) {\n" + " FILE *fp = fopen(\"conftestval\", \"w\");\n" + " if (NULL == fp) exit(1);\n" + " fprintf(fp, \"%s\n\", (1.1L == *a) ? \"yes\" : \"no\");\n" + " fclose(fp);\n" + "}\n" + "#ifdef __cplusplus\n" + "}\n" + "#endif\n") + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_f.f + "\tprogram bogus\n" + "\tREAL*16 :: foo\n" + "\tfoo = 1.1\n" + "\tcall c(foo)\n" + "\tend program bogus\n") + + EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest_c.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + EXECUTE_PROCESS(COMMAND ${F77} conftest_f.f conftest_c.obj ${F77_OUTPUT_OBJ}conftest + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + EXECUTE_PROCESS(COMMAND conftest.exe + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(RESULT) + UNSET(REAL16_MATCHES_CHECK_DONE CACHE) + MESSAGE(FATAL_ERROR "Can not determine if REAL*16 bit-matches C.") + ELSE(RESULT) + IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + # read out type size value from the file, and write back to the output variable + FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE}) + MESSAGE(STATUS "Check if REAL*16 bit-matches C...${OUTPUT_VARIABLE}") + SET(OMPI_REAL16_MATCHES_C 1) + SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.") + ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + UNSET(REAL16_MATCHES_CHECK_DONE CACHE) + MESSAGE(STATUS "Check if REAL*16 bit-matches C...failed") + ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + ENDIF(RESULT) + + ELSE(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE}) + SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.") + MESSAGE(STATUS "Check if REAL*16 bit-matches C...skipped. (no corresponding C type)") + ENDIF(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE}) + + ELSE(NOT ${ompi_fortran_real16_t} STREQUAL "") + SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.") + MESSAGE(STATUS "Check if REAL*16 bit-matches C...skipped. (no REAL*16)") + ENDIF(NOT ${ompi_fortran_real16_t} STREQUAL "") + + ELSEIF(NOT OMPI_WANT_F77_BINDINGS) + UNSET(REAL16_MATCHES_CHECK_DONE CACHE) + ENDIF(OMPI_WANT_F77_BINDINGS AND OMPI_HAVE_FORTRAN_REAL16 AND NOT DEFINED REAL16_MATCHES_CHECK_DONE) + + OMPI_DEF_VAR(OMPI_REAL16_MATCHES_C "if REAL*16 bit-matches C." 0 1) + +ENDMACRO(OMPI_F77_CHECK_REAL16_C_EQUIV) diff --git a/contrib/platform/win32/CMakeModules/f77_check_type.cmake b/contrib/platform/win32/CMakeModules/f77_check_type.cmake index 82e27de107..52d8717802 100644 --- a/contrib/platform/win32/CMakeModules/f77_check_type.cmake +++ b/contrib/platform/win32/CMakeModules/f77_check_type.cmake @@ -1,45 +1,45 @@ -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# OMPI_F77_CHECK_TYPE -# in: TYPE - fortran type to check. -# out: HAVE_TYPE - 0/1 whether we have that type. -# ----------------------------------------------------------------- - -MACRO(OMPI_F77_CHECK_TYPE TYPE HAVE_TYPE) - - IF(NOT DEFINED ${TYPE_NAME}_CHECK_DONE) - - MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...") - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_fortran_type.f - "\t program main \n" - "\t ${TYPE} bogus_variable \n" - "\t END \n") - - EXECUTE_PROCESS(COMMAND ${F77} check_fortran_type.f - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(RESULT) - SET(${HAVE_TYPE} 0 CACHE INTERNAL "have Fortran ${TYPE}") - MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...no") - ELSE(RESULT) - SET(${HAVE_TYPE} 1 CACHE INTERNAL "have Fortran ${TYPE}") - MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...yes") - ENDIF(RESULT) - - SET(${TYPE_NAME}_CHECK_DONE TRUE CACHE INTERNAL "${TYPE_NAME} check done") - - ENDIF(NOT DEFINED ${TYPE_NAME}_CHECK_DONE) - +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# OMPI_F77_CHECK_TYPE +# in: TYPE - fortran type to check. +# out: HAVE_TYPE - 0/1 whether we have that type. +# ----------------------------------------------------------------- + +MACRO(OMPI_F77_CHECK_TYPE TYPE HAVE_TYPE) + + IF(NOT DEFINED ${TYPE_NAME}_CHECK_DONE) + + MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...") + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_fortran_type.f + "\t program main \n" + "\t ${TYPE} bogus_variable \n" + "\t END \n") + + EXECUTE_PROCESS(COMMAND ${F77} check_fortran_type.f + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(RESULT) + SET(${HAVE_TYPE} 0 CACHE INTERNAL "have Fortran ${TYPE}") + MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...no") + ELSE(RESULT) + SET(${HAVE_TYPE} 1 CACHE INTERNAL "have Fortran ${TYPE}") + MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...yes") + ENDIF(RESULT) + + SET(${TYPE_NAME}_CHECK_DONE TRUE CACHE INTERNAL "${TYPE_NAME} check done") + + ENDIF(NOT DEFINED ${TYPE_NAME}_CHECK_DONE) + ENDMACRO(OMPI_F77_CHECK_TYPE TYPE HAVE_TYPE) \ No newline at end of file diff --git a/contrib/platform/win32/CMakeModules/f77_find_ext_symbol_convention.cmake b/contrib/platform/win32/CMakeModules/f77_find_ext_symbol_convention.cmake index ec86775d7c..8afa9e6ead 100644 --- a/contrib/platform/win32/CMakeModules/f77_find_ext_symbol_convention.cmake +++ b/contrib/platform/win32/CMakeModules/f77_find_ext_symbol_convention.cmake @@ -1,163 +1,163 @@ -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -MACRO(OMPI_F77_FIND_EXT_SYMBOL_CONVENTION) - IF(NOT SYMBOL_CONVENTION_CHECK_DONE) - SET(OMPI_F77_DOUBLE_UNDERSCORE 0 - CACHE INTERNAL "external symbol convention - double underscore") - SET(OMPI_F77_SINGLE_UNDERSCORE 0 - CACHE INTERNAL "external symbol convention - single underscore") - SET(OMPI_F77_CAPS 0 - CACHE INTERNAL "external symbol convention - captital") - SET(OMPI_F77_PLAIN 0 - CACHE INTERNAL "external symbol convention - plain") - - # make sure we know our linking convention... - MESSAGE(STATUS "Check ${F77} external symbol convention...") - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f - "\t subroutine FOO_bar(a) \n" - "\t integer a \n" - "\t a = 1 \n" - "\t return \n" - "\t end \n") - - EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest.f ${F77_OUTPUT_OBJ}conftest.lib - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - SET(OUTPUT_OBJ_FILE "conftest.lib") - - # now run dumpbin to generate an output file - EXECUTE_PROCESS(COMMAND ${DUMP_UTIL} ${OUTPUT_OBJ_FILE} /symbols /out:conftest_out - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - - # find out the external symbol convention - FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out - DOUBLE_UNDERSCORE REGEX "foo_bar__$") - FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out - SINGLE_UNDERSCORE REGEX "foo_bar_$") - FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out - MIXED_CASE REGEX "FOO_bar$") - FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out - NO_UNDERSCORE REGEX "foo_bar$") - FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out - UPPER_CASE REGEX "FOO_BAR$") - - # set up the corresponding values - IF(NOT DOUBLE_UNDERSCORE STREQUAL "") - SET(OMPI_F77_DOUBLE_UNDERSCORE 1 - CACHE INTERNAL "external symbol convention - double underscore") - SET(FUNC_NAME "foo_bar__") - SET(ompi_cv_f77_external_symbol "double underscore" - CACHE INTERNAL "F77 external symbol convention") - ELSEIF(NOT SINGLE_UNDERSCORE STREQUAL "") - SET(OMPI_F77_SINGLE_UNDERSCORE 1 - CACHE INTERNAL "external symbol convention - single underscore") - SET(FUNC_NAME "foo_bar_") - SET(ompi_cv_f77_external_symbol "single underscore" - CACHE INTERNAL "F77 external symbol convention") - ELSEIF(NOT MIXED_CASE STREQUAL "") - SET(OMPI_F77_CAPS 1 - CACHE INTERNAL "external symbol convention - captital") - SET(FUNC_NAME "FOO_bar") - SET(ompi_cv_f77_external_symbol "mixed case" - CACHE INTERNAL "F77 external symbol convention") - ELSEIF(NOT NO_UNDERSCORE STREQUAL "") - SET(OMPI_F77_PLAIN 1 - CACHE INTERNAL "external symbol convention - plain") - SET(FUNC_NAME "foo_bar") - SET(ompi_cv_f77_external_symbol "no underscore" - CACHE INTERNAL "F77 external symbol convention") - ELSEIF(NOT UPPER_CASE STREQUAL "") - SET(OMPI_F77_CAPS 1 - CACHE INTERNAL "external symbol convention - captital") - SET(FUNC_NAME "FOO_BAR") - SET(ompi_cv_f77_external_symbol "upper case" - CACHE INTERNAL "F77 external symbol convention") - ELSE(NOT UPPER_CASE STREQUAL "") - MESSAGE(FATAL_ERROR "unknow Fortran naming convertion.") - SET(ompi_cv_f77_external_symbol "unknow") - ENDIF(NOT DOUBLE_UNDERSCORE STREQUAL "") - - MESSAGE(STATUS "Check ${F77} external symbol convention...${ompi_cv_f77_external_symbol}") - - # now test if we can link the library with c program - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c - "int main(){${FUNC_NAME}();return(0);}") - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)\n" - "PROJECT(conftest_c C)\n" - "IF(NOT \"${F77_LIB_PATH}\" STREQUAL \"\")\n" - " LINK_DIRECTORIES(\"${F77_LIB_PATH}\")\n" - "ENDIF(NOT \"${F77_LIB_PATH}\" STREQUAL \"\")\n" - "ADD_EXECUTABLE(conftest_c conftest_c.c)\n" - "TARGET_LINK_LIBRARIES(conftest_c ${OUTPUT_OBJ_FILE})\n") - - TRY_COMPILE( - TEST_OK - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - conftest_c - OUTPUT_VARIABLE MY_OUTPUT) - - #MESSAGE("MY_OUTPUT:${MY_OUTPUT}") - - SET(SYMBOL_CONVENTION_CHECK_DONE TRUE CACHE INTERNAL "Symbol convention check done.") - - IF(NOT TEST_OK) - UNSET(SYMBOL_CONVENTION_CHECK_DONE CACHE) - MESSAGE(STATUS "${MY_OUTPUT}") - MESSAGE(STATUS "*** Probably you have to setup the library path of the Fortran compiler.") - MESSAGE(FATAL_ERROR "C and Fortran 77 compilers are not link compatible. Cannot continue.") - ENDIF(NOT TEST_OK) - - ENDIF(NOT SYMBOL_CONVENTION_CHECK_DONE) - -ENDMACRO(OMPI_F77_FIND_EXT_SYMBOL_CONVENTION) - - -# return the corresponding C function name -# OMPI_F77_MAKE_C_FUNCTION -# in: FUNCTION_NAME -Fortran function name -# out: OUTPUT_VARIABLE -C function name -MACRO(OMPI_F77_MAKE_C_FUNCTION OUTPUT_VARIABLE FUNCTION_NAME) - IF("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore") - # so the general rule is that if there is an _ in the function - # name, then there are two trailing underscores. Otherwise, - # there is only one trailing underscore. - STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE}) - STRING(REGEX MATCH "_" RESULT ${FUNCTION_NAME}) - IF("${RESULT}" STREQUAL "") - SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}_") - ELSE("${RESULT}" STREQUAL "") - SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}__") - ENDIF("${RESULT}" STREQUAL "") - ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "single underscore") - STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE}) - SET(${OUTPUT_VARIABLE} "${OUTPUT_VARIABLE}_") - ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "mixed case") - SET(${OUTPUT_VARIABLE} ${FUNCTION_NAME}) - ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "no underscore") - STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE}) - ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "upper case") - STRING(TOUPPER ${FUNCTION_NAME} ${OUTPUT_VARIABLE}) - ELSE("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore") - MESSAGE(FATAL_ERROR "unknown naming convention: ${ompi_cv_f77_external_symbol}") - ENDIF("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore") - +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +MACRO(OMPI_F77_FIND_EXT_SYMBOL_CONVENTION) + IF(NOT SYMBOL_CONVENTION_CHECK_DONE) + SET(OMPI_F77_DOUBLE_UNDERSCORE 0 + CACHE INTERNAL "external symbol convention - double underscore") + SET(OMPI_F77_SINGLE_UNDERSCORE 0 + CACHE INTERNAL "external symbol convention - single underscore") + SET(OMPI_F77_CAPS 0 + CACHE INTERNAL "external symbol convention - captital") + SET(OMPI_F77_PLAIN 0 + CACHE INTERNAL "external symbol convention - plain") + + # make sure we know our linking convention... + MESSAGE(STATUS "Check ${F77} external symbol convention...") + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f + "\t subroutine FOO_bar(a) \n" + "\t integer a \n" + "\t a = 1 \n" + "\t return \n" + "\t end \n") + + EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest.f ${F77_OUTPUT_OBJ}conftest.lib + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + SET(OUTPUT_OBJ_FILE "conftest.lib") + + # now run dumpbin to generate an output file + EXECUTE_PROCESS(COMMAND ${DUMP_UTIL} ${OUTPUT_OBJ_FILE} /symbols /out:conftest_out + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + + # find out the external symbol convention + FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out + DOUBLE_UNDERSCORE REGEX "foo_bar__$") + FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out + SINGLE_UNDERSCORE REGEX "foo_bar_$") + FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out + MIXED_CASE REGEX "FOO_bar$") + FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out + NO_UNDERSCORE REGEX "foo_bar$") + FILE(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_out + UPPER_CASE REGEX "FOO_BAR$") + + # set up the corresponding values + IF(NOT DOUBLE_UNDERSCORE STREQUAL "") + SET(OMPI_F77_DOUBLE_UNDERSCORE 1 + CACHE INTERNAL "external symbol convention - double underscore") + SET(FUNC_NAME "foo_bar__") + SET(ompi_cv_f77_external_symbol "double underscore" + CACHE INTERNAL "F77 external symbol convention") + ELSEIF(NOT SINGLE_UNDERSCORE STREQUAL "") + SET(OMPI_F77_SINGLE_UNDERSCORE 1 + CACHE INTERNAL "external symbol convention - single underscore") + SET(FUNC_NAME "foo_bar_") + SET(ompi_cv_f77_external_symbol "single underscore" + CACHE INTERNAL "F77 external symbol convention") + ELSEIF(NOT MIXED_CASE STREQUAL "") + SET(OMPI_F77_CAPS 1 + CACHE INTERNAL "external symbol convention - captital") + SET(FUNC_NAME "FOO_bar") + SET(ompi_cv_f77_external_symbol "mixed case" + CACHE INTERNAL "F77 external symbol convention") + ELSEIF(NOT NO_UNDERSCORE STREQUAL "") + SET(OMPI_F77_PLAIN 1 + CACHE INTERNAL "external symbol convention - plain") + SET(FUNC_NAME "foo_bar") + SET(ompi_cv_f77_external_symbol "no underscore" + CACHE INTERNAL "F77 external symbol convention") + ELSEIF(NOT UPPER_CASE STREQUAL "") + SET(OMPI_F77_CAPS 1 + CACHE INTERNAL "external symbol convention - captital") + SET(FUNC_NAME "FOO_BAR") + SET(ompi_cv_f77_external_symbol "upper case" + CACHE INTERNAL "F77 external symbol convention") + ELSE(NOT UPPER_CASE STREQUAL "") + MESSAGE(FATAL_ERROR "unknow Fortran naming convertion.") + SET(ompi_cv_f77_external_symbol "unknow") + ENDIF(NOT DOUBLE_UNDERSCORE STREQUAL "") + + MESSAGE(STATUS "Check ${F77} external symbol convention...${ompi_cv_f77_external_symbol}") + + # now test if we can link the library with c program + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c + "int main(){${FUNC_NAME}();return(0);}") + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeLists.txt + "CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)\n" + "PROJECT(conftest_c C)\n" + "IF(NOT \"${F77_LIB_PATH}\" STREQUAL \"\")\n" + " LINK_DIRECTORIES(\"${F77_LIB_PATH}\")\n" + "ENDIF(NOT \"${F77_LIB_PATH}\" STREQUAL \"\")\n" + "ADD_EXECUTABLE(conftest_c conftest_c.c)\n" + "TARGET_LINK_LIBRARIES(conftest_c ${OUTPUT_OBJ_FILE})\n") + + TRY_COMPILE( + TEST_OK + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + conftest_c + OUTPUT_VARIABLE MY_OUTPUT) + + #MESSAGE("MY_OUTPUT:${MY_OUTPUT}") + + SET(SYMBOL_CONVENTION_CHECK_DONE TRUE CACHE INTERNAL "Symbol convention check done.") + + IF(NOT TEST_OK) + UNSET(SYMBOL_CONVENTION_CHECK_DONE CACHE) + MESSAGE(STATUS "${MY_OUTPUT}") + MESSAGE(STATUS "*** Probably you have to setup the library path of the Fortran compiler.") + MESSAGE(FATAL_ERROR "C and Fortran 77 compilers are not link compatible. Cannot continue.") + ENDIF(NOT TEST_OK) + + ENDIF(NOT SYMBOL_CONVENTION_CHECK_DONE) + +ENDMACRO(OMPI_F77_FIND_EXT_SYMBOL_CONVENTION) + + +# return the corresponding C function name +# OMPI_F77_MAKE_C_FUNCTION +# in: FUNCTION_NAME -Fortran function name +# out: OUTPUT_VARIABLE -C function name +MACRO(OMPI_F77_MAKE_C_FUNCTION OUTPUT_VARIABLE FUNCTION_NAME) + IF("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore") + # so the general rule is that if there is an _ in the function + # name, then there are two trailing underscores. Otherwise, + # there is only one trailing underscore. + STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE}) + STRING(REGEX MATCH "_" RESULT ${FUNCTION_NAME}) + IF("${RESULT}" STREQUAL "") + SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}_") + ELSE("${RESULT}" STREQUAL "") + SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}__") + ENDIF("${RESULT}" STREQUAL "") + ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "single underscore") + STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE}) + SET(${OUTPUT_VARIABLE} "${OUTPUT_VARIABLE}_") + ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "mixed case") + SET(${OUTPUT_VARIABLE} ${FUNCTION_NAME}) + ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "no underscore") + STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE}) + ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "upper case") + STRING(TOUPPER ${FUNCTION_NAME} ${OUTPUT_VARIABLE}) + ELSE("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore") + MESSAGE(FATAL_ERROR "unknown naming convention: ${ompi_cv_f77_external_symbol}") + ENDIF("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore") + ENDMACRO(OMPI_F77_MAKE_C_FUNCTION OUTPUT_VARIABLE FUNCTION_NAME) \ No newline at end of file diff --git a/contrib/platform/win32/CMakeModules/f77_get_alignment.cmake b/contrib/platform/win32/CMakeModules/f77_get_alignment.cmake index 9589713e35..ab9a6895ae 100644 --- a/contrib/platform/win32/CMakeModules/f77_get_alignment.cmake +++ b/contrib/platform/win32/CMakeModules/f77_get_alignment.cmake @@ -1,99 +1,99 @@ -# Copyright (c) 2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# OMPI_F77_GET_ALIGNMENT -# in: TYPE - fortran type to check -# out: ALIGNMENT - alignment to return -# ---------------------------------------------------- - -INCLUDE(F77_find_ext_symbol_convention) - -MACRO(OMPI_F77_GET_ALIGNMENT TYPE OUTPUT_VARIABLE) - MESSAGE(STATUS "Check alignment of Fortran ${TYPE}...") - - OMPI_F77_MAKE_C_FUNCTION(ompi_ac_align_fn align) - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f - "\t program falign\n" - "\t external align\n" - "\t $1 w,x,y,z\n" - "\t CHARACTER a,b,c\n" - "\t common /foo/a,w,b,x,y,c,z\n" - "\t call align(w,x,y,z)\n" - "\t end \n") - - IF(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h") - SET(ompi_conftest_h "#include \"conftest.h\"") - ELSE(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h") - SET(ompi_conftest_h "") - ENDIF(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h") - - FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c" - "\t #include \n" - "\t #include \n" - "\t $conftest \n" - "\t \n" - "\t #ifdef __cplusplus \n" - "\t extern \"C\" { \n" - "\t #endif \n" - "\t void ${ompi_ac_align_fn}(char *w, char *x, char *y, char *z) \n" - "\t { unsigned long aw, ax, ay, az; \n" - "\t FILE *f=fopen(\"conftestval\", \"w\"); \n" - "\t if (!f) exit(1); \n" - "\t aw = (unsigned long) w; \n" - "\t ax = (unsigned long) x; \n" - "\t ay = (unsigned long) y; \n" - "\t az = (unsigned long) z; \n" - "\t if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, \"%d\n\", 16); \n" - "\t else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, \"%d\n\", 12); \n" - "\t else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, \"%d\n\", 8); \n" - "\t else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, \"%d\n\", 4); \n" - "\t else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, \"%d\n\", 2); \n" - "\t else fprintf(f, \"%d\n\", 1); \n" - "\t fclose(f); \n" - "\t } \n" - "\t #ifdef __cplusplus \n" - "\t } \n" - "\t #endif \n" - ) - - EXECUTE_PROCESS(COMMAND ${CL_EXE} /c conftest.c /I${VC_INCLUDE_PATH} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - EXECUTE_PROCESS(COMMAND ${F77} conftest.f conftest.obj -o conftest - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - EXECUTE_PROCESS(COMMAND conftest.exe - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - #MESSAGE("RESULT:${RESULT}") - - IF(RESULT) - MESSAGE(FATAL_ERROR "Could not determine alignment of ${TYPE}.") - ELSE(RESULT) - IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - # read out type size value from the file, and write back to the output variable - FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE}) - MESSAGE(STATUS "Check alignment of Fortran ${TYPE}...${${OUTPUT_VARIABLE}}") - ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - MESSAGE(FATAL_ERROR "Could not determine alignment of ${TYPE}.") - ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - ENDIF(RESULT) - -ENDMACRO(OMPI_F77_GET_ALIGNMENT TYPE OUTPUT_VARIABLE) +# Copyright (c) 2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# OMPI_F77_GET_ALIGNMENT +# in: TYPE - fortran type to check +# out: ALIGNMENT - alignment to return +# ---------------------------------------------------- + +INCLUDE(F77_find_ext_symbol_convention) + +MACRO(OMPI_F77_GET_ALIGNMENT TYPE OUTPUT_VARIABLE) + MESSAGE(STATUS "Check alignment of Fortran ${TYPE}...") + + OMPI_F77_MAKE_C_FUNCTION(ompi_ac_align_fn align) + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f + "\t program falign\n" + "\t external align\n" + "\t $1 w,x,y,z\n" + "\t CHARACTER a,b,c\n" + "\t common /foo/a,w,b,x,y,c,z\n" + "\t call align(w,x,y,z)\n" + "\t end \n") + + IF(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h") + SET(ompi_conftest_h "#include \"conftest.h\"") + ELSE(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h") + SET(ompi_conftest_h "") + ENDIF(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h") + + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c" + "\t #include \n" + "\t #include \n" + "\t $conftest \n" + "\t \n" + "\t #ifdef __cplusplus \n" + "\t extern \"C\" { \n" + "\t #endif \n" + "\t void ${ompi_ac_align_fn}(char *w, char *x, char *y, char *z) \n" + "\t { unsigned long aw, ax, ay, az; \n" + "\t FILE *f=fopen(\"conftestval\", \"w\"); \n" + "\t if (!f) exit(1); \n" + "\t aw = (unsigned long) w; \n" + "\t ax = (unsigned long) x; \n" + "\t ay = (unsigned long) y; \n" + "\t az = (unsigned long) z; \n" + "\t if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, \"%d\n\", 16); \n" + "\t else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, \"%d\n\", 12); \n" + "\t else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, \"%d\n\", 8); \n" + "\t else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, \"%d\n\", 4); \n" + "\t else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, \"%d\n\", 2); \n" + "\t else fprintf(f, \"%d\n\", 1); \n" + "\t fclose(f); \n" + "\t } \n" + "\t #ifdef __cplusplus \n" + "\t } \n" + "\t #endif \n" + ) + + EXECUTE_PROCESS(COMMAND ${CL_EXE} /c conftest.c /I${VC_INCLUDE_PATH} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + EXECUTE_PROCESS(COMMAND ${F77} conftest.f conftest.obj -o conftest + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + EXECUTE_PROCESS(COMMAND conftest.exe + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + #MESSAGE("RESULT:${RESULT}") + + IF(RESULT) + MESSAGE(FATAL_ERROR "Could not determine alignment of ${TYPE}.") + ELSE(RESULT) + IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + # read out type size value from the file, and write back to the output variable + FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE}) + MESSAGE(STATUS "Check alignment of Fortran ${TYPE}...${${OUTPUT_VARIABLE}}") + ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + MESSAGE(FATAL_ERROR "Could not determine alignment of ${TYPE}.") + ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + ENDIF(RESULT) + +ENDMACRO(OMPI_F77_GET_ALIGNMENT TYPE OUTPUT_VARIABLE) diff --git a/contrib/platform/win32/CMakeModules/f77_get_fortran_handle_max.cmake b/contrib/platform/win32/CMakeModules/f77_get_fortran_handle_max.cmake index 4aab3b631a..bd9bd1ae77 100644 --- a/contrib/platform/win32/CMakeModules/f77_get_fortran_handle_max.cmake +++ b/contrib/platform/win32/CMakeModules/f77_get_fortran_handle_max.cmake @@ -1,106 +1,106 @@ -# Copyright (c) 2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# OMPI_F77_GET_FORTRAN_HANDLE_MAX() -# ------------------------------------------------------- -# Find the maximum value of fortran integers, then calculate -# min(INT_MAX, max fortran INTEGER). This represents the maximum -# number of fortran MPI handle index. -MACRO(OMPI_F77_GET_FORTRAN_HANDLE_MAX) - - #store previous value for later use. - IF(DEFINED OMPI_FINT_MAX) - SET(OMPI_FINT_MAX_OLD ${OMPI_FINT_MAX}) - ENDIF(DEFINED OMPI_FINT_MAX) - - IF(NOT OMPI_WANT_F77_BINDINGS) - SET(OMPI_FINT_MAX 0 CACHE INTERNAL "fortran int max") - ELSE(NOT OMPI_WANT_F77_BINDINGS) - # Calculate the number of f's that we need to append to the hex - # value. Do one less than we really need becaue we assume the - # top nybble is 0x7 to avoid sign issues. - MATH(EXPR OMPI_NUMF ${OMPI_SIZEOF_FORTRAN_INTEGER}*2-1) - SET(OMPI_FINT_MAX 0x7) - - WHILE(${OMPI_NUMF} GREATER 0) - SET(OMPI_FINT_MAX ${OMPI_FINT_MAX}f CACHE INTERNAL "fortran int max") - MATH(EXPR OMPI_NUMF ${OMPI_NUMF}-1) - ENDWHILE(${OMPI_NUMF} GREATER 0) - ENDIF(NOT OMPI_WANT_F77_BINDINGS) - - #OMPI_CINT_MAX doesn't change, check only once and cache the result. - IF(NOT DEFINED CINT_MAX_CHECK_DONE) - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max.c - "#include \n" - "#include \n" - "\n" - "#ifdef __cplusplus\n" - "extern \"C\" {\n" - "#endif\n" - "\n" - "void main()\n" - "{\n" - " FILE *fp = fopen(\"fortran_handle_max\", \"w\");\n" - " long cint = INT_MAX;\n" - " fprintf(fp, \"%ld\", cint);\n" - " fclose(fp);\n" - "}\n" - ) - - EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} fortran_handle_max.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - EXECUTE_PROCESS(COMMAND fortran_handle_max.exe - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max) - FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max OUTPUT_VALUE) - SET(OMPI_CINT_MAX ${OUTPUT_VALUE} CACHE INTERNAL "c int max") - ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max) - SET(OMPI_CINT_MAX 0) - ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max) - - ENDIF(NOT DEFINED CINT_MAX_CHECK_DONE) - - #whenever OMPI_FINT_MAX changes, recalculate OMPI_FORTRAN_HANDLE_MAX - IF(NOT DEFINED OMPI_FINT_MAX OR NOT "${OMPI_FINT_MAX}" STREQUAL "${OMPI_FINT_MAX_OLD}") - - MESSAGE(STATUS "Check Max handle value for Fortran MPI handles...") - - IF(${OMPI_CINT_MAX} EQUAL 0) - # wow - something went really wrong. Be conservative - SET(OMPI_FORTRAN_HANDLE_MAX 32767 CACHE INTERNAL "Fortran handle max") - ELSEIF(${OMPI_FINT_MAX} EQUAL 0) - # we aren't compiling Fortran - just set it to C INT_MAX - SET(OMPI_FORTRAN_HANDLE_MAX ${OMPI_CINT_MAX} CACHE INTERNAL "Fortran handle max") - ELSE(${OMPI_FINT_MAX} EQUAL 0) - # take the lesser of C INT_MAX and Fortran INTEGER - # max. The resulting value will then be storable in - # either type. There's no easy way to do this in - # the shell, so make the preprocessor do it. - SET(OMPI_FORTRAN_HANDLE_MAX "( ${OMPI_FINT_MAX} < ${OMPI_CINT_MAX} ? ${OMPI_FINT_MAX} : ${OMPI_CINT_MAX} )" CACHE INTERNAL "Fortran handle max") - ENDIF(${OMPI_CINT_MAX} EQUAL 0) - - MESSAGE(STATUS "Check Max handle value for Fortran MPI handles...${OMPI_FORTRAN_HANDLE_MAX}") - SET(FORTRAN_MAX_HANDLE_CHECK_DONE TRUE CACHE INTERNAL "Fortran handle max check done") - - ENDIF(NOT DEFINED OMPI_FINT_MAX OR NOT "${OMPI_FINT_MAX}" STREQUAL "${OMPI_FINT_MAX_OLD}") - - OMPI_DEF_VAR(OMPI_FORTRAN_HANDLE_MAX "Max handle value for fortran MPI handles, effectively min(INT_MAX, max fortran INTEGER value)." 0 1) - -ENDMACRO(OMPI_F77_GET_FORTRAN_HANDLE_MAX) +# Copyright (c) 2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# OMPI_F77_GET_FORTRAN_HANDLE_MAX() +# ------------------------------------------------------- +# Find the maximum value of fortran integers, then calculate +# min(INT_MAX, max fortran INTEGER). This represents the maximum +# number of fortran MPI handle index. +MACRO(OMPI_F77_GET_FORTRAN_HANDLE_MAX) + + #store previous value for later use. + IF(DEFINED OMPI_FINT_MAX) + SET(OMPI_FINT_MAX_OLD ${OMPI_FINT_MAX}) + ENDIF(DEFINED OMPI_FINT_MAX) + + IF(NOT OMPI_WANT_F77_BINDINGS) + SET(OMPI_FINT_MAX 0 CACHE INTERNAL "fortran int max") + ELSE(NOT OMPI_WANT_F77_BINDINGS) + # Calculate the number of f's that we need to append to the hex + # value. Do one less than we really need becaue we assume the + # top nybble is 0x7 to avoid sign issues. + MATH(EXPR OMPI_NUMF ${OMPI_SIZEOF_FORTRAN_INTEGER}*2-1) + SET(OMPI_FINT_MAX 0x7) + + WHILE(${OMPI_NUMF} GREATER 0) + SET(OMPI_FINT_MAX ${OMPI_FINT_MAX}f CACHE INTERNAL "fortran int max") + MATH(EXPR OMPI_NUMF ${OMPI_NUMF}-1) + ENDWHILE(${OMPI_NUMF} GREATER 0) + ENDIF(NOT OMPI_WANT_F77_BINDINGS) + + #OMPI_CINT_MAX doesn't change, check only once and cache the result. + IF(NOT DEFINED CINT_MAX_CHECK_DONE) + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max.c + "#include \n" + "#include \n" + "\n" + "#ifdef __cplusplus\n" + "extern \"C\" {\n" + "#endif\n" + "\n" + "void main()\n" + "{\n" + " FILE *fp = fopen(\"fortran_handle_max\", \"w\");\n" + " long cint = INT_MAX;\n" + " fprintf(fp, \"%ld\", cint);\n" + " fclose(fp);\n" + "}\n" + ) + + EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} fortran_handle_max.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + EXECUTE_PROCESS(COMMAND fortran_handle_max.exe + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max) + FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max OUTPUT_VALUE) + SET(OMPI_CINT_MAX ${OUTPUT_VALUE} CACHE INTERNAL "c int max") + ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max) + SET(OMPI_CINT_MAX 0) + ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max) + + ENDIF(NOT DEFINED CINT_MAX_CHECK_DONE) + + #whenever OMPI_FINT_MAX changes, recalculate OMPI_FORTRAN_HANDLE_MAX + IF(NOT DEFINED OMPI_FINT_MAX OR NOT "${OMPI_FINT_MAX}" STREQUAL "${OMPI_FINT_MAX_OLD}") + + MESSAGE(STATUS "Check Max handle value for Fortran MPI handles...") + + IF(${OMPI_CINT_MAX} EQUAL 0) + # wow - something went really wrong. Be conservative + SET(OMPI_FORTRAN_HANDLE_MAX 32767 CACHE INTERNAL "Fortran handle max") + ELSEIF(${OMPI_FINT_MAX} EQUAL 0) + # we aren't compiling Fortran - just set it to C INT_MAX + SET(OMPI_FORTRAN_HANDLE_MAX ${OMPI_CINT_MAX} CACHE INTERNAL "Fortran handle max") + ELSE(${OMPI_FINT_MAX} EQUAL 0) + # take the lesser of C INT_MAX and Fortran INTEGER + # max. The resulting value will then be storable in + # either type. There's no easy way to do this in + # the shell, so make the preprocessor do it. + SET(OMPI_FORTRAN_HANDLE_MAX "( ${OMPI_FINT_MAX} < ${OMPI_CINT_MAX} ? ${OMPI_FINT_MAX} : ${OMPI_CINT_MAX} )" CACHE INTERNAL "Fortran handle max") + ENDIF(${OMPI_CINT_MAX} EQUAL 0) + + MESSAGE(STATUS "Check Max handle value for Fortran MPI handles...${OMPI_FORTRAN_HANDLE_MAX}") + SET(FORTRAN_MAX_HANDLE_CHECK_DONE TRUE CACHE INTERNAL "Fortran handle max check done") + + ENDIF(NOT DEFINED OMPI_FINT_MAX OR NOT "${OMPI_FINT_MAX}" STREQUAL "${OMPI_FINT_MAX_OLD}") + + OMPI_DEF_VAR(OMPI_FORTRAN_HANDLE_MAX "Max handle value for fortran MPI handles, effectively min(INT_MAX, max fortran INTEGER value)." 0 1) + +ENDMACRO(OMPI_F77_GET_FORTRAN_HANDLE_MAX) diff --git a/contrib/platform/win32/CMakeModules/f77_get_sizeof.cmake b/contrib/platform/win32/CMakeModules/f77_get_sizeof.cmake index a459bc4a71..da58da9fbe 100644 --- a/contrib/platform/win32/CMakeModules/f77_get_sizeof.cmake +++ b/contrib/platform/win32/CMakeModules/f77_get_sizeof.cmake @@ -1,98 +1,98 @@ -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# OMPI_F77_GET_SIZEOF(type, variable to set) -# ------------------------------------------ - -INCLUDE(F77_find_ext_symbol_convention) - -MACRO(OMPI_F77_GET_SIZEOF TYPE OUTPUT_VARIABLE) - MESSAGE(STATUS "Check size of Fortran 77 ${TYPE}...") - - OMPI_F77_MAKE_C_FUNCTION(ompi_ac_size_fn size) - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f - "\t program fsize \n" - "\t external size \n " - "\t ${TYPE} x(2) \n" - "\t call size(x(1),x(2)) \n" - "\t end \n") - - IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h) - SET(ompi_conftest_h "#include \"conftest.h\"") - ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h) - SET(ompi_conftest_h "") - ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h) - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c - "#include \n" - "#include \n" - "${ompi_conftest_h} \n" - "#ifdef __cplusplus \n" - "extern \"C\" { \n" - "#endif \n" - "" - "void ${ompi_ac_size_fn}(char *a, char *b) \n" - "{ \n" - " int diff = (int) (b - a); \n" - " FILE *f=fopen(\"conftestval\", \"w\"); \n" - " if (!f) exit(1); \n" - " fprintf(f, \"%d\\n\", diff); \n" - " fclose(f); \n" - "} \n" - "#ifdef __cplusplus \n" - "} \n" - "#endif \n") - - # generate the C object file - EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest.c ${OMPI_C_OUTPUT_OBJ}conftest_c.obj - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - # generate the Fortran object file - # some Fortran compilers don't allow to compile and link in one step. :-( - EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest.f ${F77_OUTPUT_OBJ}conftest.obj - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - # link the C and Fortran object files. - EXECUTE_PROCESS(COMMAND ${F77} conftest.obj conftest_c.obj ${F77_OUTPUT_EXE}conftest.exe - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - EXECUTE_PROCESS(COMMAND conftest.exe - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - -# MESSAGE("RESULT:${RESULT}") - - IF(RESULT) - MESSAGE(FATAL_ERROR "Could not determine size of ${TYPE}.") - ELSE(RESULT) - IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - # read out type size value from the file, and write back to the output variable - FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE}) - STRING(REPLACE "\n" "" ${OUTPUT_VARIABLE} ${${OUTPUT_VARIABLE}}) - MESSAGE(STATUS "Check size of Fortran 77 ${TYPE}...${${OUTPUT_VARIABLE}}") - ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - MESSAGE(FATAL_ERROR "Could not determine size of ${TYPE}.") - ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) - ENDIF(RESULT) - +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# OMPI_F77_GET_SIZEOF(type, variable to set) +# ------------------------------------------ + +INCLUDE(F77_find_ext_symbol_convention) + +MACRO(OMPI_F77_GET_SIZEOF TYPE OUTPUT_VARIABLE) + MESSAGE(STATUS "Check size of Fortran 77 ${TYPE}...") + + OMPI_F77_MAKE_C_FUNCTION(ompi_ac_size_fn size) + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f + "\t program fsize \n" + "\t external size \n " + "\t ${TYPE} x(2) \n" + "\t call size(x(1),x(2)) \n" + "\t end \n") + + IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h) + SET(ompi_conftest_h "#include \"conftest.h\"") + ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h) + SET(ompi_conftest_h "") + ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h) + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c + "#include \n" + "#include \n" + "${ompi_conftest_h} \n" + "#ifdef __cplusplus \n" + "extern \"C\" { \n" + "#endif \n" + "" + "void ${ompi_ac_size_fn}(char *a, char *b) \n" + "{ \n" + " int diff = (int) (b - a); \n" + " FILE *f=fopen(\"conftestval\", \"w\"); \n" + " if (!f) exit(1); \n" + " fprintf(f, \"%d\\n\", diff); \n" + " fclose(f); \n" + "} \n" + "#ifdef __cplusplus \n" + "} \n" + "#endif \n") + + # generate the C object file + EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest.c ${OMPI_C_OUTPUT_OBJ}conftest_c.obj + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + # generate the Fortran object file + # some Fortran compilers don't allow to compile and link in one step. :-( + EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest.f ${F77_OUTPUT_OBJ}conftest.obj + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + # link the C and Fortran object files. + EXECUTE_PROCESS(COMMAND ${F77} conftest.obj conftest_c.obj ${F77_OUTPUT_EXE}conftest.exe + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + EXECUTE_PROCESS(COMMAND conftest.exe + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + +# MESSAGE("RESULT:${RESULT}") + + IF(RESULT) + MESSAGE(FATAL_ERROR "Could not determine size of ${TYPE}.") + ELSE(RESULT) + IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + # read out type size value from the file, and write back to the output variable + FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE}) + STRING(REPLACE "\n" "" ${OUTPUT_VARIABLE} ${${OUTPUT_VARIABLE}}) + MESSAGE(STATUS "Check size of Fortran 77 ${TYPE}...${${OUTPUT_VARIABLE}}") + ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + MESSAGE(FATAL_ERROR "Could not determine size of ${TYPE}.") + ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval) + ENDIF(RESULT) + ENDMACRO(OMPI_F77_GET_SIZEOF TYPE OUTPUT_VARIABLE) \ No newline at end of file diff --git a/contrib/platform/win32/CMakeModules/f77_get_value_true.cmake b/contrib/platform/win32/CMakeModules/f77_get_value_true.cmake index fe3bb83de7..8001696862 100644 --- a/contrib/platform/win32/CMakeModules/f77_get_value_true.cmake +++ b/contrib/platform/win32/CMakeModules/f77_get_value_true.cmake @@ -1,124 +1,124 @@ -# Copyright (c) 2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# OMPI_F77_GET_VALUE_TRUE() -# ------------------------------------------------------- -# Determine the value of .TRUE. of this Fortran compiler. -MACRO(OMPI_F77_GET_VALUE_TRUE) - - IF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED FORTRAN_VALUE_CHECK_DONE) - - MESSAGE(STATUS "Check Fortran value for .TRUE. logical type...") - - OMPI_F77_MAKE_C_FUNCTION(ompi_print_logical_fn print) - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c - "#include \n" - "#include \n" - "\n" - "#ifdef __cplusplus\n" - "extern \"C\" {\n" - "#endif\n" - "\n" - "void ${ompi_print_logical_fn}(${ompi_fortran_logical_t} * logical);\n" - "\n" - "void ${ompi_print_logical_fn}(${ompi_fortran_logical_t} * logical)\n" - "{\n" - " FILE *f=fopen(\"fortran_true_value\", \"w\");\n" - " if (!f) exit(1);\n" - "\n" - " if( ${SIZEOF_INT} >= sizeof(${ompi_fortran_logical_t}) ) {\n" - " fprintf(f, \"%d\\n\", (int)*logical);\n" - " } else if (${SIZEOF_LONG} >= sizeof(${ompi_fortran_logical_t}) ) {\n" - " fprintf(f, \"%ld\\n\", (long) *logical);\n" - "#ifdef HAVE_LONG_LONG\n" - " } else if (${SIZEOF_LONG_LONG} >= sizeof(${ompi_fortran_logical_t}) ) {\n" - " fprintf(f, \"%lld\\n\", (long long) *logical);\n" - "#endif\n" - " } else {\n" - " exit(1);\n" - " }\n" - "}\n" - "\n" - "#ifdef __cplusplus\n" - "}\n" - "#endif\n") - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_f.f - "\tprogram main\n" - "\tlogical value\n" - "\tvalue=.TRUE.\n" - "\tCALL print(value)\n" - "\tend\n") - - EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest_c.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(RESULT) - MESSAGE(STATUS "${OUTPUT}\n${ERROR}") - MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") - ENDIF(RESULT) - - EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest_f.f - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(RESULT) - MESSAGE(STATUS "${OUTPUT}\n${ERROR}") - MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") - ENDIF(RESULT) - - EXECUTE_PROCESS(COMMAND ${F77} conftest_f.obj conftest_c.obj ${F77_OUTPUT_EXE}conftest - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(RESULT) - MESSAGE(STATUS "${OUTPUT}\n${ERROR}") - MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") - ENDIF(RESULT) - - EXECUTE_PROCESS(COMMAND conftest.exe - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(RESULT) - UNSET(FORTRAN_VALUE_CHECK_DONE CACHE) - MESSAGE(STATUS "${OUTPUT}\n${ERROR}") - MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") - ELSE(RESULT) - IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value) - FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value OUTPUT_VALUE) - MESSAGE(STATUS "Check Fortran value for .TRUE. logical type...${OUTPUT_VALUE}") - SET(OMPI_FORTRAN_VALUE_TRUE ${OUTPUT_VALUE} CACHE INTERNAL "Fortran value true") - SET(FORTRAN_VALUE_CHECK_DONE TRUE CACHE INTERNAL "Fortran value true check done") - ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value) - UNSET(FORTRAN_VALUE_CHECK_DONE CACHE) - MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") - ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value) - ENDIF(RESULT) - - ELSEIF(NOT OMPI_WANT_F77_BINDINGS) - SET(OMPI_FORTRAN_VALUE_TRUE 0) - UNSET(FORTRAN_VALUE_CHECK_DONE CACHE) - ENDIF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED FORTRAN_VALUE_CHECK_DONE) - - OMPI_DEF_VAR(OMPI_FORTRAN_VALUE_TRUE "Fortran value for .TRUE. logical type" 0 1) - -ENDMACRO(OMPI_F77_GET_VALUE_TRUE) +# Copyright (c) 2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# OMPI_F77_GET_VALUE_TRUE() +# ------------------------------------------------------- +# Determine the value of .TRUE. of this Fortran compiler. +MACRO(OMPI_F77_GET_VALUE_TRUE) + + IF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED FORTRAN_VALUE_CHECK_DONE) + + MESSAGE(STATUS "Check Fortran value for .TRUE. logical type...") + + OMPI_F77_MAKE_C_FUNCTION(ompi_print_logical_fn print) + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c + "#include \n" + "#include \n" + "\n" + "#ifdef __cplusplus\n" + "extern \"C\" {\n" + "#endif\n" + "\n" + "void ${ompi_print_logical_fn}(${ompi_fortran_logical_t} * logical);\n" + "\n" + "void ${ompi_print_logical_fn}(${ompi_fortran_logical_t} * logical)\n" + "{\n" + " FILE *f=fopen(\"fortran_true_value\", \"w\");\n" + " if (!f) exit(1);\n" + "\n" + " if( ${SIZEOF_INT} >= sizeof(${ompi_fortran_logical_t}) ) {\n" + " fprintf(f, \"%d\\n\", (int)*logical);\n" + " } else if (${SIZEOF_LONG} >= sizeof(${ompi_fortran_logical_t}) ) {\n" + " fprintf(f, \"%ld\\n\", (long) *logical);\n" + "#ifdef HAVE_LONG_LONG\n" + " } else if (${SIZEOF_LONG_LONG} >= sizeof(${ompi_fortran_logical_t}) ) {\n" + " fprintf(f, \"%lld\\n\", (long long) *logical);\n" + "#endif\n" + " } else {\n" + " exit(1);\n" + " }\n" + "}\n" + "\n" + "#ifdef __cplusplus\n" + "}\n" + "#endif\n") + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_f.f + "\tprogram main\n" + "\tlogical value\n" + "\tvalue=.TRUE.\n" + "\tCALL print(value)\n" + "\tend\n") + + EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest_c.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(RESULT) + MESSAGE(STATUS "${OUTPUT}\n${ERROR}") + MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") + ENDIF(RESULT) + + EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest_f.f + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(RESULT) + MESSAGE(STATUS "${OUTPUT}\n${ERROR}") + MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") + ENDIF(RESULT) + + EXECUTE_PROCESS(COMMAND ${F77} conftest_f.obj conftest_c.obj ${F77_OUTPUT_EXE}conftest + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(RESULT) + MESSAGE(STATUS "${OUTPUT}\n${ERROR}") + MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") + ENDIF(RESULT) + + EXECUTE_PROCESS(COMMAND conftest.exe + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(RESULT) + UNSET(FORTRAN_VALUE_CHECK_DONE CACHE) + MESSAGE(STATUS "${OUTPUT}\n${ERROR}") + MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") + ELSE(RESULT) + IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value) + FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value OUTPUT_VALUE) + MESSAGE(STATUS "Check Fortran value for .TRUE. logical type...${OUTPUT_VALUE}") + SET(OMPI_FORTRAN_VALUE_TRUE ${OUTPUT_VALUE} CACHE INTERNAL "Fortran value true") + SET(FORTRAN_VALUE_CHECK_DONE TRUE CACHE INTERNAL "Fortran value true check done") + ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value) + UNSET(FORTRAN_VALUE_CHECK_DONE CACHE) + MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE.. Aborting.") + ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value) + ENDIF(RESULT) + + ELSEIF(NOT OMPI_WANT_F77_BINDINGS) + SET(OMPI_FORTRAN_VALUE_TRUE 0) + UNSET(FORTRAN_VALUE_CHECK_DONE CACHE) + ENDIF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED FORTRAN_VALUE_CHECK_DONE) + + OMPI_DEF_VAR(OMPI_FORTRAN_VALUE_TRUE "Fortran value for .TRUE. logical type" 0 1) + +ENDMACRO(OMPI_F77_GET_VALUE_TRUE) diff --git a/contrib/platform/win32/CMakeModules/find_ccp.cmake b/contrib/platform/win32/CMakeModules/find_ccp.cmake index b6ddd985fe..e3b3b64fe7 100644 --- a/contrib/platform/win32/CMakeModules/find_ccp.cmake +++ b/contrib/platform/win32/CMakeModules/find_ccp.cmake @@ -1,42 +1,42 @@ -# Copyright (c) 2009 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# The CCP components need to import the type library ccpapi.tlb, -# if it's not installed, the CCP components won't be built. - -# This module is included in a .windows file, it must return two variables: -# RESULT : find result -# RESULT_INCLUDE_PATH : the path need to include if RESULT is true - -IF(NOT ORTE_WANT_CCP) - SET(RESULT FALSE) -ELSEIF(NOT CCP_FOUND) - MESSAGE(STATUS "looking for ccp...") - - IF(CMAKE_CL_64) - FIND_PATH(CCP_LIB_PATH ccpapi.tlb PATHS $ENV{CCP_LIB64} ) - ELSE(CMAKE_CL_64) - FIND_PATH(CCP_LIB_PATH ccpapi.tlb PATHS $ENV{CCP_LIB32} ) - ENDIF(CMAKE_CL_64) - - IF(CCP_LIB_PATH) - SET(CCP_FOUND TRUE CACHE INTERNAL "find result of CCP.") - SET(RESULT TRUE) - SET(RESULT_INCLUDE_PATH ${CCP_LIB_PATH}) - MESSAGE(STATUS "looking for ccp...found.") - ELSE(CCP_LIB_PATH) - SET(CCP_FOUND FALSE CACHE INTERNAL "find result of CCP.") - SET(RESULT FALSE) - MESSAGE(STATUS "looking for ccp...failed.") - ENDIF(CCP_LIB_PATH) - -ELSE(NOT CCP_FOUND) - SET(RESULT_INCLUDE_PATH ${CCP_LIB_PATH}) - SET(RESULT TRUE) -ENDIF(NOT ORTE_WANT_CCP) +# Copyright (c) 2009 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# The CCP components need to import the type library ccpapi.tlb, +# if it's not installed, the CCP components won't be built. + +# This module is included in a .windows file, it must return two variables: +# RESULT : find result +# RESULT_INCLUDE_PATH : the path need to include if RESULT is true + +IF(NOT ORTE_WANT_CCP) + SET(RESULT FALSE) +ELSEIF(NOT CCP_FOUND) + MESSAGE(STATUS "looking for ccp...") + + IF(CMAKE_CL_64) + FIND_PATH(CCP_LIB_PATH ccpapi.tlb PATHS $ENV{CCP_LIB64} ) + ELSE(CMAKE_CL_64) + FIND_PATH(CCP_LIB_PATH ccpapi.tlb PATHS $ENV{CCP_LIB32} ) + ENDIF(CMAKE_CL_64) + + IF(CCP_LIB_PATH) + SET(CCP_FOUND TRUE CACHE INTERNAL "find result of CCP.") + SET(RESULT TRUE) + SET(RESULT_INCLUDE_PATH ${CCP_LIB_PATH}) + MESSAGE(STATUS "looking for ccp...found.") + ELSE(CCP_LIB_PATH) + SET(CCP_FOUND FALSE CACHE INTERNAL "find result of CCP.") + SET(RESULT FALSE) + MESSAGE(STATUS "looking for ccp...failed.") + ENDIF(CCP_LIB_PATH) + +ELSE(NOT CCP_FOUND) + SET(RESULT_INCLUDE_PATH ${CCP_LIB_PATH}) + SET(RESULT TRUE) +ENDIF(NOT ORTE_WANT_CCP) diff --git a/contrib/platform/win32/CMakeModules/find_flex.cmake b/contrib/platform/win32/CMakeModules/find_flex.cmake index c3dd1328f3..4dab6d44df 100644 --- a/contrib/platform/win32/CMakeModules/find_flex.cmake +++ b/contrib/platform/win32/CMakeModules/find_flex.cmake @@ -1,106 +1,106 @@ -# -# Copyright (c) 2007-2009 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# -# FLEX_FOUND - system has Flex -# FLEX_EXECUTABLE - path of the flex executable -# FLEX_VERSION - the version string, like "2.5.31" -# - -MACRO(FIND_FLEX) - - IF(NOT FLEX_FOUND) - MESSAGE(STATUS "Check for working flex...") - - # first find out if it's already installed somewhere - FIND_PROGRAM(FLEX_EXECUTABLE_SYS NAMES flex) - - IF (WIN32) - IF(FLEX_EXECUTABLE_SYS) - SET(FLEX_EXECUTABLE ${FLEX_EXECUTABLE_SYS} CACHE FILEPATH "Flex") - ELSE(FLEX_EXECUTABLE_SYS) - IF(EXISTS ${CMAKE_SOURCE_DIR}/contrib/platform/win32/bin/flex.exe) - # in case that no flex is installed, use our own version - SET(FLEX_EXECUTABLE "${CMAKE_SOURCE_DIR}/contrib/platform/win32/bin/flex.exe" CACHE FILEPATH "Flex") - ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/contrib/platform/win32/bin/flex.exe) - ENDIF(FLEX_EXECUTABLE_SYS) - ELSE(WIN32) - # nothing to do here at moment. - ENDIF(WIN32) - - IF(FLEX_EXECUTABLE) - SET(FLEX_FOUND TRUE CACHE INTERNAL "found flex") - - EXECUTE_PROCESS(COMMAND ${FLEX_EXECUTABLE} --version - OUTPUT_VARIABLE _FLEX_VERSION - ) - STRING (REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" FLEX_VERSION "${_FLEX_VERSION}") - ENDIF(FLEX_EXECUTABLE) - - IF(FLEX_FOUND) - IF(NOT Flex_FIND_QUIETLY) - MESSAGE(STATUS "Check for working flex...done") - ENDIF(NOT Flex_FIND_QUIETLY) - ELSE(FLEX_FOUND) - IF(Flex_FIND_REQUIRED) - MESSAGE(STATUS "Check for working flex...failed") - ENDIF(Flex_FIND_REQUIRED) - ENDIF(FLEX_FOUND) - ENDIF(NOT FLEX_FOUND) -ENDMACRO(FIND_FLEX) - -# -# Generate the corresponding C file from the lex file, -# and add it in to the source list for the target. -# - -MACRO(ADD_FLEX_FILE _sourcelist _source _prefix _output_dir) - - GET_FILENAME_COMPONENT(_in ${_source} ABSOLUTE) - GET_FILENAME_COMPONENT(_basename ${_source} NAME_WE) - - - STRING(LENGTH "${_prefix}" _prefix_length) - IF(NOT _prefix_length EQUAL 0) - SET(_out ${_output_dir}/${_basename}.c) - SET(_args -P${_prefix}) - ELSE(NOT _prefix_length EQUAL 0) - SET(_out ${_output_dir}/${_basename}.c) - ENDIF(NOT _prefix_length EQUAL 0) - - #MESSAGE("${FLEX_EXECUTABLE} -o${_out} ${_args} ${_in}") - - IF(NOT DEFINED ${_basename}_DONE) - - MESSAGE(STATUS "parse ${_basename} with flex...") - - FILE(MAKE_DIRECTORY ${_output_dir}) - EXECUTE_PROCESS( - COMMAND ${FLEX_EXECUTABLE} -o${_out} ${_args} ${_in} - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR - ) - - IF (NOT ${RESULT} STREQUAL "1") - MESSAGE(STATUS "${ERROR}parse ${_basename} with flex...done") - ELSE (NOT ${RESULT} STREQUAL "1") - MESSAGE(FATAL_ERROR "${ERROR}parse ${_basename} with flex...failed") - ENDIF (NOT ${RESULT} STREQUAL "1") - - SET(${_basename}_DONE TRUE CACHE INTERNAL "${_basename} flex parse done") - - ENDIF(NOT DEFINED ${_basename}_DONE) - - SET(${_sourcelist} ${${_sourcelist}} ${_out} ) - SET_SOURCE_FILES_PROPERTIES(${_out} PROPERTIES COMPILE_DEFINITIONS YY_NO_UNISTD_H) - -ENDMACRO(ADD_FLEX_FILE) +# +# Copyright (c) 2007-2009 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# +# FLEX_FOUND - system has Flex +# FLEX_EXECUTABLE - path of the flex executable +# FLEX_VERSION - the version string, like "2.5.31" +# + +MACRO(FIND_FLEX) + + IF(NOT FLEX_FOUND) + MESSAGE(STATUS "Check for working flex...") + + # first find out if it's already installed somewhere + FIND_PROGRAM(FLEX_EXECUTABLE_SYS NAMES flex) + + IF (WIN32) + IF(FLEX_EXECUTABLE_SYS) + SET(FLEX_EXECUTABLE ${FLEX_EXECUTABLE_SYS} CACHE FILEPATH "Flex") + ELSE(FLEX_EXECUTABLE_SYS) + IF(EXISTS ${CMAKE_SOURCE_DIR}/contrib/platform/win32/bin/flex.exe) + # in case that no flex is installed, use our own version + SET(FLEX_EXECUTABLE "${CMAKE_SOURCE_DIR}/contrib/platform/win32/bin/flex.exe" CACHE FILEPATH "Flex") + ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/contrib/platform/win32/bin/flex.exe) + ENDIF(FLEX_EXECUTABLE_SYS) + ELSE(WIN32) + # nothing to do here at moment. + ENDIF(WIN32) + + IF(FLEX_EXECUTABLE) + SET(FLEX_FOUND TRUE CACHE INTERNAL "found flex") + + EXECUTE_PROCESS(COMMAND ${FLEX_EXECUTABLE} --version + OUTPUT_VARIABLE _FLEX_VERSION + ) + STRING (REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" FLEX_VERSION "${_FLEX_VERSION}") + ENDIF(FLEX_EXECUTABLE) + + IF(FLEX_FOUND) + IF(NOT Flex_FIND_QUIETLY) + MESSAGE(STATUS "Check for working flex...done") + ENDIF(NOT Flex_FIND_QUIETLY) + ELSE(FLEX_FOUND) + IF(Flex_FIND_REQUIRED) + MESSAGE(STATUS "Check for working flex...failed") + ENDIF(Flex_FIND_REQUIRED) + ENDIF(FLEX_FOUND) + ENDIF(NOT FLEX_FOUND) +ENDMACRO(FIND_FLEX) + +# +# Generate the corresponding C file from the lex file, +# and add it in to the source list for the target. +# + +MACRO(ADD_FLEX_FILE _sourcelist _source _prefix _output_dir) + + GET_FILENAME_COMPONENT(_in ${_source} ABSOLUTE) + GET_FILENAME_COMPONENT(_basename ${_source} NAME_WE) + + + STRING(LENGTH "${_prefix}" _prefix_length) + IF(NOT _prefix_length EQUAL 0) + SET(_out ${_output_dir}/${_basename}.c) + SET(_args -P${_prefix}) + ELSE(NOT _prefix_length EQUAL 0) + SET(_out ${_output_dir}/${_basename}.c) + ENDIF(NOT _prefix_length EQUAL 0) + + #MESSAGE("${FLEX_EXECUTABLE} -o${_out} ${_args} ${_in}") + + IF(NOT DEFINED ${_basename}_DONE) + + MESSAGE(STATUS "parse ${_basename} with flex...") + + FILE(MAKE_DIRECTORY ${_output_dir}) + EXECUTE_PROCESS( + COMMAND ${FLEX_EXECUTABLE} -o${_out} ${_args} ${_in} + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR + ) + + IF (NOT ${RESULT} STREQUAL "1") + MESSAGE(STATUS "${ERROR}parse ${_basename} with flex...done") + ELSE (NOT ${RESULT} STREQUAL "1") + MESSAGE(FATAL_ERROR "${ERROR}parse ${_basename} with flex...failed") + ENDIF (NOT ${RESULT} STREQUAL "1") + + SET(${_basename}_DONE TRUE CACHE INTERNAL "${_basename} flex parse done") + + ENDIF(NOT DEFINED ${_basename}_DONE) + + SET(${_sourcelist} ${${_sourcelist}} ${_out} ) + SET_SOURCE_FILES_PROPERTIES(${_out} PROPERTIES COMPILE_DEFINITIONS YY_NO_UNISTD_H) + +ENDMACRO(ADD_FLEX_FILE) diff --git a/contrib/platform/win32/CMakeModules/find_libltdl.cmake b/contrib/platform/win32/CMakeModules/find_libltdl.cmake index 967e46c297..3a7e35e916 100644 --- a/contrib/platform/win32/CMakeModules/find_libltdl.cmake +++ b/contrib/platform/win32/CMakeModules/find_libltdl.cmake @@ -1,53 +1,53 @@ -# -# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# -# LIBLTDL_PATH - path to libltdl dir -# LIBLTDL_LIB_PATH - path to ltdl.lib -# LIBLTDL_INCLUDE_PATH - path to ltdl.h -# LIBLTDL_FOUND - system has Libltdl -# - -SET(LIBLTDL_PATH "" CACHE PATH "Path to libltdl root directory.") - -IF(NOT OPAL_WANT_LIBLTDL) - SET(LIBLTDL_FOUND FALSE CACHE INTERNAL "find result of libltdl.") -ELSE(NOT OPAL_WANT_LIBLTDL) - - IF(NOT LIBLTDL_FOUND OR NOT "${LIBLTDL_PATH}" STREQUAL "${LIBLTDL_OLD_PATH}") - MESSAGE(STATUS "looking for libltdl...") - - # set the default search path - IF("${LIBLTDL_PATH}" STREQUAL "") - SET(CHECK_PATH "$ENV{ProgramFiles}/GnuWin32") - ELSE("${LIBLTDL_PATH}" STREQUAL "") - SET(CHECK_PATH ${LIBLTDL_PATH}) - ENDIF("${LIBLTDL_PATH}" STREQUAL "") - - # clear the old find results and start a new search - UNSET(LIBLTDL_INCLUDE_PATH CACHE) - UNSET(LIBLTDL_LIB_PATH CACHE) - - FIND_FILE(LIBLTDL_LIB ltdl.lib PATHS ${CHECK_PATH}/lib) - FIND_PATH(LIBLTDL_INCLUDE_PATH ltdl.h PATHS ${CHECK_PATH}/include) - - IF(LIBLTDL_LIB AND LIBLTDL_INCLUDE_PATH) - SET(LIBLTDL_FOUND TRUE CACHE INTERNAL "find result of libltdl.") - SET(LIBLTDL_OLD_PATH ${LIBLTDL_PATH} CACHE INTERNAL "Store the old libltdl path.") - MESSAGE(STATUS "looking for libltdl...found.") - ELSE(LIBLTDL_LIB AND LIBLTDL_INCLUDE_PATH) - SET(LIBLTDL_FOUND FALSE CACHE INTERNAL "find result of libltdl.") - MESSAGE(STATUS "looking for libltdl...failed.") - ENDIF(LIBLTDL_LIB AND LIBLTDL_INCLUDE_PATH) - - ENDIF(NOT LIBLTDL_FOUND OR NOT "${LIBLTDL_PATH}" STREQUAL "${LIBLTDL_OLD_PATH}") - -ENDIF(NOT OPAL_WANT_LIBLTDL) +# +# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# +# LIBLTDL_PATH - path to libltdl dir +# LIBLTDL_LIB_PATH - path to ltdl.lib +# LIBLTDL_INCLUDE_PATH - path to ltdl.h +# LIBLTDL_FOUND - system has Libltdl +# + +SET(LIBLTDL_PATH "" CACHE PATH "Path to libltdl root directory.") + +IF(NOT OPAL_WANT_LIBLTDL) + SET(LIBLTDL_FOUND FALSE CACHE INTERNAL "find result of libltdl.") +ELSE(NOT OPAL_WANT_LIBLTDL) + + IF(NOT LIBLTDL_FOUND OR NOT "${LIBLTDL_PATH}" STREQUAL "${LIBLTDL_OLD_PATH}") + MESSAGE(STATUS "looking for libltdl...") + + # set the default search path + IF("${LIBLTDL_PATH}" STREQUAL "") + SET(CHECK_PATH "$ENV{ProgramFiles}/GnuWin32") + ELSE("${LIBLTDL_PATH}" STREQUAL "") + SET(CHECK_PATH ${LIBLTDL_PATH}) + ENDIF("${LIBLTDL_PATH}" STREQUAL "") + + # clear the old find results and start a new search + UNSET(LIBLTDL_INCLUDE_PATH CACHE) + UNSET(LIBLTDL_LIB_PATH CACHE) + + FIND_FILE(LIBLTDL_LIB ltdl.lib PATHS ${CHECK_PATH}/lib) + FIND_PATH(LIBLTDL_INCLUDE_PATH ltdl.h PATHS ${CHECK_PATH}/include) + + IF(LIBLTDL_LIB AND LIBLTDL_INCLUDE_PATH) + SET(LIBLTDL_FOUND TRUE CACHE INTERNAL "find result of libltdl.") + SET(LIBLTDL_OLD_PATH ${LIBLTDL_PATH} CACHE INTERNAL "Store the old libltdl path.") + MESSAGE(STATUS "looking for libltdl...found.") + ELSE(LIBLTDL_LIB AND LIBLTDL_INCLUDE_PATH) + SET(LIBLTDL_FOUND FALSE CACHE INTERNAL "find result of libltdl.") + MESSAGE(STATUS "looking for libltdl...failed.") + ENDIF(LIBLTDL_LIB AND LIBLTDL_INCLUDE_PATH) + + ENDIF(NOT LIBLTDL_FOUND OR NOT "${LIBLTDL_PATH}" STREQUAL "${LIBLTDL_OLD_PATH}") + +ENDIF(NOT OPAL_WANT_LIBLTDL) diff --git a/contrib/platform/win32/CMakeModules/find_ofed_sdk.cmake b/contrib/platform/win32/CMakeModules/find_ofed_sdk.cmake index 5ec818d9ff..420294cddf 100644 --- a/contrib/platform/win32/CMakeModules/find_ofed_sdk.cmake +++ b/contrib/platform/win32/CMakeModules/find_ofed_sdk.cmake @@ -1,93 +1,93 @@ -# Copyright (c) 2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Find OFED SDK headers and libraries. - -# -# OFED_SDK_PATH - path to OFED SDK dir -# OFED_SDK_INCLUDE_PATH - path to verbs.h -# OFED_SDK_FOUND - system has OFED SDK -# - -# This module is included in a .windows file, it must return two variables: -# RESULT : find result -# RESULT_INCLUDE_PATH : the path need to include if RESULT is true -# RESULT_LINK_LIBRARIES : libraries need to be linked - -IF(NOT OMPI_WANT_OFED) - SET(RESULT FALSE) -ELSE(NOT OMPI_WANT_OFED) - - SET(OFED_SDK_PATH "" CACHE PATH - "Path to OFED SDK root directory, if not in system path, has to be set manually by user.") - - #generate the lex file, if it's not there - IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/mca/btl/openib/btl_openib_lex.c) - ADD_FLEX_FILE(OPAL_SOURCE_FILES ./mca/btl/openib/btl_openib_lex.l - btl_openib_ini_yy "${PROJECT_BINARY_DIR}/mca/btl/openib/") - SET(RESULT_SOURCE_FILES ${PROJECT_BINARY_DIR}/mca/btl/openib/btl_openib_lex.c) - ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/mca/btl/openib/btl_openib_lex.c) - - IF(NOT OFED_SDK_FOUND) - - MESSAGE(STATUS "looking for OFED SDK...") - - # set the default search path - IF("${OFED_SDK_PATH}" STREQUAL "") - SET(OFED_SDK_PATH "$ENV{SystemDrive}/OFED_SDK") - ENDIF("${OFED_SDK_PATH}" STREQUAL "") - - # clear the old find results and start a new search - UNSET(OFED_SDK_INCLUDE_PATH) - UNSET(OFED_SDK_LIBIBVERBS) - - FIND_PATH(OFED_SDK_INCLUDE_PATH NAMES verbs.h PATHS ${OFED_SDK_PATH}/Inc/infiniband - DOC "Path to OFED SDK include directory, will be detected automatically.") - - FIND_LIBRARY(OFED_SDK_LIBIBVERBS libibverbs PATHS ${OFED_SDK_PATH}/Lib - DOC "Path to OFED SDK libraries directory, will be detected automatically.") - - FIND_LIBRARY(OFED_SDK_LIBRDMACM librdmacm PATHS ${OFED_SDK_PATH}/Lib - DOC "Path to OFED SDK libraries directory, will be detected automatically.") - - IF(OFED_SDK_INCLUDE_PATH AND OFED_SDK_LIBIBVERBS) - SET(OFED_SDK_FOUND TRUE CACHE INTERNAL "find result of OFED SDK.") - SET(RESULT_INCLUDE_PATH ${OFED_SDK_INCLUDE_PATH}/..;${PROJECT_SOURCE_DIR}/mca/btl/openib) - SET(RESULT_LINK_LIBRARIES ${OFED_SDK_LIBIBVERBS} ${OFED_SDK_LIBRDMACM}) - SET(RESULT TRUE) - MESSAGE(STATUS "looking for OFED SDK...found.") - - UNSET(CMAKE_REQUIRED_INCLUDES) - UNSET(CMAKE_REQUIRED_LIBRARIES) - - SET(CMAKE_REQUIRED_INCLUDES ${OFED_SDK_PATH}/Inc/infiniband/verbs.h ${OFED_SDK_PATH}/Inc/infiniband/sa.h) - SET(CMAKE_REQUIRED_LIBRARIES ${OFED_SDK_PATH}/Lib/libibverbs.lib ${OFED_SDK_PATH}/Lib/librdmacm.lib) - - OMPI_CHECK_FUNCTION_EXISTS(ibv_fork_init HAVE_IBV_FORK_INIT) - OMPI_CHECK_FUNCTION_EXISTS(ibv_get_device_list HAVE_IBV_GET_DEVICE_LIST) - OMPI_CHECK_FUNCTION_EXISTS(ibv_resize_cq HAVE_IBV_RESIZE_CQ) - OMPI_CHECK_SYMBOL_EXISTS(IBV_EVENT_CLIENT_REREGISTER "" HAVE_DECL_IBV_EVENT_CLIENT_REREGISTER) - - INSTALL(FILES ${PROJECT_SOURCE_DIR}/mca/btl/openib/mca-btl-openib-device-params.ini - ${PROJECT_SOURCE_DIR}/mca/btl/openib/help-mpi-btl-openib.txt - DESTINATION share/openmpi) - - ELSE(OFED_SDK_INCLUDE_PATH AND OFED_SDK_LIBIBVERBS) - SET(OFED_SDK_FOUND FALSE CACHE INTERNAL "find result of OFED SDK.") - SET(RESULT FALSE) - MESSAGE(STATUS "looking for OFED SDK...failed.") - ENDIF(OFED_SDK_INCLUDE_PATH AND OFED_SDK_LIBIBVERBS) - - ELSE(NOT OFED_SDK_FOUND) - SET(RESULT_INCLUDE_PATH ${OFED_SDK_INCLUDE_PATH}/..;${OpenMPI_SOURCE_DIR}/ompi/mca/btl/openib) - SET(RESULT_LINK_LIBRARIES ${OFED_SDK_LIBIBVERBS} ${OFED_SDK_LIBRDMACM}) - SET(RESULT TRUE) - ENDIF(NOT OFED_SDK_FOUND) - -ENDIF(NOT OMPI_WANT_OFED) +# Copyright (c) 2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Find OFED SDK headers and libraries. + +# +# OFED_SDK_PATH - path to OFED SDK dir +# OFED_SDK_INCLUDE_PATH - path to verbs.h +# OFED_SDK_FOUND - system has OFED SDK +# + +# This module is included in a .windows file, it must return two variables: +# RESULT : find result +# RESULT_INCLUDE_PATH : the path need to include if RESULT is true +# RESULT_LINK_LIBRARIES : libraries need to be linked + +IF(NOT OMPI_WANT_OFED) + SET(RESULT FALSE) +ELSE(NOT OMPI_WANT_OFED) + + SET(OFED_SDK_PATH "" CACHE PATH + "Path to OFED SDK root directory, if not in system path, has to be set manually by user.") + + #generate the lex file, if it's not there + IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/mca/btl/openib/btl_openib_lex.c) + ADD_FLEX_FILE(OPAL_SOURCE_FILES ./mca/btl/openib/btl_openib_lex.l + btl_openib_ini_yy "${PROJECT_BINARY_DIR}/mca/btl/openib/") + SET(RESULT_SOURCE_FILES ${PROJECT_BINARY_DIR}/mca/btl/openib/btl_openib_lex.c) + ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/mca/btl/openib/btl_openib_lex.c) + + IF(NOT OFED_SDK_FOUND) + + MESSAGE(STATUS "looking for OFED SDK...") + + # set the default search path + IF("${OFED_SDK_PATH}" STREQUAL "") + SET(OFED_SDK_PATH "$ENV{SystemDrive}/OFED_SDK") + ENDIF("${OFED_SDK_PATH}" STREQUAL "") + + # clear the old find results and start a new search + UNSET(OFED_SDK_INCLUDE_PATH) + UNSET(OFED_SDK_LIBIBVERBS) + + FIND_PATH(OFED_SDK_INCLUDE_PATH NAMES verbs.h PATHS ${OFED_SDK_PATH}/Inc/infiniband + DOC "Path to OFED SDK include directory, will be detected automatically.") + + FIND_LIBRARY(OFED_SDK_LIBIBVERBS libibverbs PATHS ${OFED_SDK_PATH}/Lib + DOC "Path to OFED SDK libraries directory, will be detected automatically.") + + FIND_LIBRARY(OFED_SDK_LIBRDMACM librdmacm PATHS ${OFED_SDK_PATH}/Lib + DOC "Path to OFED SDK libraries directory, will be detected automatically.") + + IF(OFED_SDK_INCLUDE_PATH AND OFED_SDK_LIBIBVERBS) + SET(OFED_SDK_FOUND TRUE CACHE INTERNAL "find result of OFED SDK.") + SET(RESULT_INCLUDE_PATH ${OFED_SDK_INCLUDE_PATH}/..;${PROJECT_SOURCE_DIR}/mca/btl/openib) + SET(RESULT_LINK_LIBRARIES ${OFED_SDK_LIBIBVERBS} ${OFED_SDK_LIBRDMACM}) + SET(RESULT TRUE) + MESSAGE(STATUS "looking for OFED SDK...found.") + + UNSET(CMAKE_REQUIRED_INCLUDES) + UNSET(CMAKE_REQUIRED_LIBRARIES) + + SET(CMAKE_REQUIRED_INCLUDES ${OFED_SDK_PATH}/Inc/infiniband/verbs.h ${OFED_SDK_PATH}/Inc/infiniband/sa.h) + SET(CMAKE_REQUIRED_LIBRARIES ${OFED_SDK_PATH}/Lib/libibverbs.lib ${OFED_SDK_PATH}/Lib/librdmacm.lib) + + OMPI_CHECK_FUNCTION_EXISTS(ibv_fork_init HAVE_IBV_FORK_INIT) + OMPI_CHECK_FUNCTION_EXISTS(ibv_get_device_list HAVE_IBV_GET_DEVICE_LIST) + OMPI_CHECK_FUNCTION_EXISTS(ibv_resize_cq HAVE_IBV_RESIZE_CQ) + OMPI_CHECK_SYMBOL_EXISTS(IBV_EVENT_CLIENT_REREGISTER "" HAVE_DECL_IBV_EVENT_CLIENT_REREGISTER) + + INSTALL(FILES ${PROJECT_SOURCE_DIR}/mca/btl/openib/mca-btl-openib-device-params.ini + ${PROJECT_SOURCE_DIR}/mca/btl/openib/help-mpi-btl-openib.txt + DESTINATION share/openmpi) + + ELSE(OFED_SDK_INCLUDE_PATH AND OFED_SDK_LIBIBVERBS) + SET(OFED_SDK_FOUND FALSE CACHE INTERNAL "find result of OFED SDK.") + SET(RESULT FALSE) + MESSAGE(STATUS "looking for OFED SDK...failed.") + ENDIF(OFED_SDK_INCLUDE_PATH AND OFED_SDK_LIBIBVERBS) + + ELSE(NOT OFED_SDK_FOUND) + SET(RESULT_INCLUDE_PATH ${OFED_SDK_INCLUDE_PATH}/..;${OpenMPI_SOURCE_DIR}/ompi/mca/btl/openib) + SET(RESULT_LINK_LIBRARIES ${OFED_SDK_LIBIBVERBS} ${OFED_SDK_LIBRDMACM}) + SET(RESULT TRUE) + ENDIF(NOT OFED_SDK_FOUND) + +ENDIF(NOT OMPI_WANT_OFED) diff --git a/contrib/platform/win32/CMakeModules/get_c_alignment.cmake b/contrib/platform/win32/CMakeModules/get_c_alignment.cmake index 64db5511bd..62ccb78754 100644 --- a/contrib/platform/win32/CMakeModules/get_c_alignment.cmake +++ b/contrib/platform/win32/CMakeModules/get_c_alignment.cmake @@ -1,48 +1,48 @@ -# -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -MACRO(C_GET_ALIGNMENT TYPE LANG NAME) - - IF(NOT OPAL_ALIGNMENT_${NAME}) - - # - # Try to compile and run a foo grogram. - # The alignment result will be stored in ${CHECK_TYPE}_ALIGNMENT - # - - MESSAGE( STATUS "Check alignment of ${TYPE} in ${LANG}...") - - SET(INCLUDE_HEADERS "#include - #include - #include ") - - IF(HAVE_STDINT_H) - SET(INCLUDE_HEADERS "${INCLUDE_HEADERS}\n#include \n") - ENDIF(HAVE_STDINT_H) - - FILE (WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/c_get_${NAME}_alignment.${LANG}" - "${INCLUDE_HEADERS} - int main(){ - char diff; - struct foo {char a; ${TYPE} b;}; - struct foo *p = (struct foo *) malloc(sizeof(struct foo)); - diff = ((char *)&p->b) - ((char *)&p->a); - return diff;} - ") - - TRY_RUN(OPAL_ALIGNMENT_${NAME} COMPILE_RESULT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/c_get_${NAME}_alignment.${LANG}") - - MESSAGE( STATUS "Check alignment of ${TYPE} in ${LANG}...${OPAL_ALIGNMENT_${NAME}}") - - ENDIF(NOT OPAL_ALIGNMENT_${NAME}) - +# +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +MACRO(C_GET_ALIGNMENT TYPE LANG NAME) + + IF(NOT OPAL_ALIGNMENT_${NAME}) + + # + # Try to compile and run a foo grogram. + # The alignment result will be stored in ${CHECK_TYPE}_ALIGNMENT + # + + MESSAGE( STATUS "Check alignment of ${TYPE} in ${LANG}...") + + SET(INCLUDE_HEADERS "#include + #include + #include ") + + IF(HAVE_STDINT_H) + SET(INCLUDE_HEADERS "${INCLUDE_HEADERS}\n#include \n") + ENDIF(HAVE_STDINT_H) + + FILE (WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/c_get_${NAME}_alignment.${LANG}" + "${INCLUDE_HEADERS} + int main(){ + char diff; + struct foo {char a; ${TYPE} b;}; + struct foo *p = (struct foo *) malloc(sizeof(struct foo)); + diff = ((char *)&p->b) - ((char *)&p->a); + return diff;} + ") + + TRY_RUN(OPAL_ALIGNMENT_${NAME} COMPILE_RESULT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/c_get_${NAME}_alignment.${LANG}") + + MESSAGE( STATUS "Check alignment of ${TYPE} in ${LANG}...${OPAL_ALIGNMENT_${NAME}}") + + ENDIF(NOT OPAL_ALIGNMENT_${NAME}) + ENDMACRO(C_GET_ALIGNMENT TYPE TYPE_ALIGNMENT LANG ) \ No newline at end of file diff --git a/contrib/platform/win32/CMakeModules/list_subdirs.cmake b/contrib/platform/win32/CMakeModules/list_subdirs.cmake index 39220352e9..52e46abbea 100644 --- a/contrib/platform/win32/CMakeModules/list_subdirs.cmake +++ b/contrib/platform/win32/CMakeModules/list_subdirs.cmake @@ -1,30 +1,30 @@ -# -# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# list the sub directories of current directories -# save the list of subdirs in OUTPUT_VARIABLE - -MACRO(CHECK_SUBDIRS CURRENT_DIR OUTPUT_VARIABLE) - - # change the path into standard Windows format, - # so that we can support UNC paths too. - STRING(REPLACE "/" "\\" DIR_FORMATTED ${CURRENT_DIR}) - - EXECUTE_PROCESS (COMMAND cmd /C dir /AD /B ${DIR_FORMATTED} - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(NOT "${OUTPUT}" STREQUAL "") - STRING (REGEX MATCHALL "[a-zA-Z0-9_]+" ${OUTPUT_VARIABLE} ${OUTPUT}) - ENDIF(NOT "${OUTPUT}" STREQUAL "") - -ENDMACRO(CHECK_SUBDIRS CURRENT_DIR OUTPUT_VARIABLE) +# +# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# list the sub directories of current directories +# save the list of subdirs in OUTPUT_VARIABLE + +MACRO(CHECK_SUBDIRS CURRENT_DIR OUTPUT_VARIABLE) + + # change the path into standard Windows format, + # so that we can support UNC paths too. + STRING(REPLACE "/" "\\" DIR_FORMATTED ${CURRENT_DIR}) + + EXECUTE_PROCESS (COMMAND cmd /C dir /AD /B ${DIR_FORMATTED} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(NOT "${OUTPUT}" STREQUAL "") + STRING (REGEX MATCHALL "[a-zA-Z0-9_]+" ${OUTPUT_VARIABLE} ${OUTPUT}) + ENDIF(NOT "${OUTPUT}" STREQUAL "") + +ENDMACRO(CHECK_SUBDIRS CURRENT_DIR OUTPUT_VARIABLE) diff --git a/contrib/platform/win32/CMakeModules/ompi_base_checks.cmake b/contrib/platform/win32/CMakeModules/ompi_base_checks.cmake index 65920ee1cd..992d74c335 100644 --- a/contrib/platform/win32/CMakeModules/ompi_base_checks.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_base_checks.cmake @@ -1,98 +1,98 @@ -# -# Copyright (c) 2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# this file contains -# 1. several wrappers for CMake macros, so that they will -# do the job and write the configure temeplate file too. -# 2. a macro that checks the data types - -# check include file -MACRO(OMPI_CHECK_INCLUDE_FILE FILE_NAME VAR_NAME) - - CHECK_INCLUDE_FILE(${FILE_NAME} ${VAR_NAME}) - OMPI_DEF_VAR(${VAR_NAME} "Define to 1 if you have <${FILE_NAME}> header file." 0 0) - -ENDMACRO(OMPI_CHECK_INCLUDE_FILE FILE_NAME VAR_NAME) - - -# check if function exists -MACRO(OMPI_CHECK_FUNCTION_EXISTS FUNCTION_NAME VAR_NAME) - - CHECK_FUNCTION_EXISTS(${FUNCTION_NAME} ${VAR_NAME}) - OMPI_DEF_VAR(${VAR_NAME} "Define to 1 if you have the `${FUNCTION_NAME}' function." 0 0) - -ENDMACRO(OMPI_CHECK_FUNCTION_EXISTS FUNCTION_NAME VAR_NAME) - - -# check if symbol exists -MACRO(OMPI_CHECK_SYMBOL_EXISTS SYMBOL_NAME FILE_NAMES VAR_NAME) - - CHECK_SYMBOL_EXISTS(${SYMBOL_NAME} "${FILE_NAMES}" ${VAR_NAME}) - OMPI_DEF_VAR(${VAR_NAME} "Define to 1 if you have the `${SYMBOL_NAME}' function." 0 0) - -ENDMACRO(OMPI_CHECK_SYMBOL_EXISTS SYMBOL_NAME FILE_NAMES VAR_NAME) - - -# check if structure has member -MACRO(OMPI_CHECK_STRUCT_HAS_MEMBER STRUC_NAME MEMBER_NAME FILE_NAMES VAR_NAME) - - CHECK_SYMBOL_EXISTS(${STRUC_NAME} ${MEMBER_NAME} "${FILE_NAMES}" ${VAR_NAME}) - OMPI_DEF_VAR(${VAR_NAME} "Define to 1 if `${MEMBER_NAME}' is member of ${STRUC_NAME}." 0 0) - -ENDMACRO(OMPI_CHECK_STRUCT_HAS_MEMBER STRUC_NAME MEMBER_NAME FILE_NAMES VAR_NAME) - - -# check type size and alignment -MACRO(OMPI_CHECK_TYPES TYPE_NAME VAR_NAME DEFAULT_TYPE LAN) - - CHECK_TYPE_SIZE(${TYPE_NAME} ${VAR_NAME}) - - IF(NOT ${VAR_NAME}_CHECK_DONE) - - IF (HAVE_${VAR_NAME}) - SET(SIZEOF_${VAR_NAME} ${${VAR_NAME}} CACHE INTERNAL "Size of `${TYPE_NAME}'") - C_GET_ALIGNMENT(${TYPE_NAME} ${LAN} ${VAR_NAME}) - ELSE(HAVE_${VAR_NAME}) - IF(NOT ${DEFAULT_TYPE} STREQUAL "" AND NOT ${DEFAULT_TYPE} STREQUAL "none") - - #Get the variable name of the default type size. - STRING(TOUPPER "${DEFAULT_TYPE}" DEFAULT_TYPE_VAR) - STRING(REPLACE " " "_" DEFAULT_TYPE_VAR ${DEFAULT_TYPE_VAR}) - - IF(${SIZEOF_${DEFAULT_TYPE_VAR}} GREATER 0) - MESSAGE(STATUS "Define it as '${DEFAULT_TYPE}'.") - - SET(${TYPE_NAME} ${DEFAULT_TYPE} CACHE INTERNAL "System support type for `${TYPE_NAME}'") - SET(SIZEOF_${VAR_NAME} ${SIZEOF_${DEFAULT_TYPE_VAR}} CACHE INTERNAL "Size of `${TYPE_NAME}'") - SET(OPAL_ALIGNMENT_${VAR_NAME} ${OPAL_ALIGNMENT_${DEFAULT_TYPE_VAR}}) - ENDIF(${SIZEOF_${DEFAULT_TYPE_VAR}} GREATER 0) - - ENDIF(NOT ${DEFAULT_TYPE} STREQUAL "" AND NOT ${DEFAULT_TYPE} STREQUAL "none") - ENDIF (HAVE_${VAR_NAME}) - - SET(${VAR_NAME}_CHECK_DONE 1 CACHE INTERNAL "check for `${VAR_NAME}' is done.") - - ENDIF(NOT ${VAR_NAME}_CHECK_DONE) - - IF(NOT ${DEFAULT_TYPE} STREQUAL "" AND NOT ${DEFAULT_TYPE} STREQUAL "none") - OMPI_DEF_VAR(${TYPE_NAME} "Define to `${DEFAULT_TYPE}' if system types does not define." 0 0) - ENDIF(NOT ${DEFAULT_TYPE} STREQUAL "" AND NOT ${DEFAULT_TYPE} STREQUAL "none") - - #CMake automatically sets the HAVE_type to TURE or FALSE, - #but we need a number. - IF(HAVE_${VAR_NAME}) - SET(HAVE_${VAR_NAME} 1) - ENDIF(HAVE_${VAR_NAME}) - - OMPI_DEF_VAR(SIZEOF_${VAR_NAME} "The size of `${TYPE_NAME}'" 0 0) - OMPI_DEF_VAR(HAVE_${VAR_NAME} "Define to 1 if the system has the type `${TYPE_NAME}'" 0 0) - OMPI_DEF_VAR(OPAL_ALIGNMENT_${VAR_NAME} "Alignment of type `${TYPE_NAME}'." 0 0) - -ENDMACRO(OMPI_CHECK_TYPES TYPE VAR_NAME DEFAULT_TYPE LAN) +# +# Copyright (c) 2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# this file contains +# 1. several wrappers for CMake macros, so that they will +# do the job and write the configure temeplate file too. +# 2. a macro that checks the data types + +# check include file +MACRO(OMPI_CHECK_INCLUDE_FILE FILE_NAME VAR_NAME) + + CHECK_INCLUDE_FILE(${FILE_NAME} ${VAR_NAME}) + OMPI_DEF_VAR(${VAR_NAME} "Define to 1 if you have <${FILE_NAME}> header file." 0 0) + +ENDMACRO(OMPI_CHECK_INCLUDE_FILE FILE_NAME VAR_NAME) + + +# check if function exists +MACRO(OMPI_CHECK_FUNCTION_EXISTS FUNCTION_NAME VAR_NAME) + + CHECK_FUNCTION_EXISTS(${FUNCTION_NAME} ${VAR_NAME}) + OMPI_DEF_VAR(${VAR_NAME} "Define to 1 if you have the `${FUNCTION_NAME}' function." 0 0) + +ENDMACRO(OMPI_CHECK_FUNCTION_EXISTS FUNCTION_NAME VAR_NAME) + + +# check if symbol exists +MACRO(OMPI_CHECK_SYMBOL_EXISTS SYMBOL_NAME FILE_NAMES VAR_NAME) + + CHECK_SYMBOL_EXISTS(${SYMBOL_NAME} "${FILE_NAMES}" ${VAR_NAME}) + OMPI_DEF_VAR(${VAR_NAME} "Define to 1 if you have the `${SYMBOL_NAME}' function." 0 0) + +ENDMACRO(OMPI_CHECK_SYMBOL_EXISTS SYMBOL_NAME FILE_NAMES VAR_NAME) + + +# check if structure has member +MACRO(OMPI_CHECK_STRUCT_HAS_MEMBER STRUC_NAME MEMBER_NAME FILE_NAMES VAR_NAME) + + CHECK_SYMBOL_EXISTS(${STRUC_NAME} ${MEMBER_NAME} "${FILE_NAMES}" ${VAR_NAME}) + OMPI_DEF_VAR(${VAR_NAME} "Define to 1 if `${MEMBER_NAME}' is member of ${STRUC_NAME}." 0 0) + +ENDMACRO(OMPI_CHECK_STRUCT_HAS_MEMBER STRUC_NAME MEMBER_NAME FILE_NAMES VAR_NAME) + + +# check type size and alignment +MACRO(OMPI_CHECK_TYPES TYPE_NAME VAR_NAME DEFAULT_TYPE LAN) + + CHECK_TYPE_SIZE(${TYPE_NAME} ${VAR_NAME}) + + IF(NOT ${VAR_NAME}_CHECK_DONE) + + IF (HAVE_${VAR_NAME}) + SET(SIZEOF_${VAR_NAME} ${${VAR_NAME}} CACHE INTERNAL "Size of `${TYPE_NAME}'") + C_GET_ALIGNMENT(${TYPE_NAME} ${LAN} ${VAR_NAME}) + ELSE(HAVE_${VAR_NAME}) + IF(NOT ${DEFAULT_TYPE} STREQUAL "" AND NOT ${DEFAULT_TYPE} STREQUAL "none") + + #Get the variable name of the default type size. + STRING(TOUPPER "${DEFAULT_TYPE}" DEFAULT_TYPE_VAR) + STRING(REPLACE " " "_" DEFAULT_TYPE_VAR ${DEFAULT_TYPE_VAR}) + + IF(${SIZEOF_${DEFAULT_TYPE_VAR}} GREATER 0) + MESSAGE(STATUS "Define it as '${DEFAULT_TYPE}'.") + + SET(${TYPE_NAME} ${DEFAULT_TYPE} CACHE INTERNAL "System support type for `${TYPE_NAME}'") + SET(SIZEOF_${VAR_NAME} ${SIZEOF_${DEFAULT_TYPE_VAR}} CACHE INTERNAL "Size of `${TYPE_NAME}'") + SET(OPAL_ALIGNMENT_${VAR_NAME} ${OPAL_ALIGNMENT_${DEFAULT_TYPE_VAR}}) + ENDIF(${SIZEOF_${DEFAULT_TYPE_VAR}} GREATER 0) + + ENDIF(NOT ${DEFAULT_TYPE} STREQUAL "" AND NOT ${DEFAULT_TYPE} STREQUAL "none") + ENDIF (HAVE_${VAR_NAME}) + + SET(${VAR_NAME}_CHECK_DONE 1 CACHE INTERNAL "check for `${VAR_NAME}' is done.") + + ENDIF(NOT ${VAR_NAME}_CHECK_DONE) + + IF(NOT ${DEFAULT_TYPE} STREQUAL "" AND NOT ${DEFAULT_TYPE} STREQUAL "none") + OMPI_DEF_VAR(${TYPE_NAME} "Define to `${DEFAULT_TYPE}' if system types does not define." 0 0) + ENDIF(NOT ${DEFAULT_TYPE} STREQUAL "" AND NOT ${DEFAULT_TYPE} STREQUAL "none") + + #CMake automatically sets the HAVE_type to TURE or FALSE, + #but we need a number. + IF(HAVE_${VAR_NAME}) + SET(HAVE_${VAR_NAME} 1) + ENDIF(HAVE_${VAR_NAME}) + + OMPI_DEF_VAR(SIZEOF_${VAR_NAME} "The size of `${TYPE_NAME}'" 0 0) + OMPI_DEF_VAR(HAVE_${VAR_NAME} "Define to 1 if the system has the type `${TYPE_NAME}'" 0 0) + OMPI_DEF_VAR(OPAL_ALIGNMENT_${VAR_NAME} "Alignment of type `${TYPE_NAME}'." 0 0) + +ENDMACRO(OMPI_CHECK_TYPES TYPE VAR_NAME DEFAULT_TYPE LAN) diff --git a/contrib/platform/win32/CMakeModules/ompi_check_Microsoft.cmake b/contrib/platform/win32/CMakeModules/ompi_check_Microsoft.cmake index 628afc23e6..fd0e3b26c4 100644 --- a/contrib/platform/win32/CMakeModules/ompi_check_Microsoft.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_check_Microsoft.cmake @@ -1,240 +1,240 @@ -# -*- cmake-script -*- -# -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -###################################################################### -# -# OMPI_MICROSOFT_COMPILER -# -# Keep all the Windows checks in one place. -# -# USAGE: -# OMPI_MICROSOFT_COMPILER() -# -###################################################################### - -IF(NOT MICROSOFT_CHECK_DONE) - - MESSAGE( STATUS "Start Microsoft specific detection....") - - # search for Microsoft VC tools - IF(CMAKE_CL_64) - SET(CHECK_PATHS ${CHECK_PATHS} - "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin/amd64" - "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/amd64" - "C:/Program Files/Microsoft Visual Studio 8/VC/bin/amd64" - "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin/amd64" - "C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/bin/amd64" - "C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/bin/amd64" - "C:/Program Files/Microsoft Visual Studio 10.0/VC/bin/amd64" - "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64" - "$ENV{VS80COMNTOOLS}../../VC/bin/ia64" - "$ENV{VS80COMNTOOLS}../../VC/bin/amd64" - "$ENV{VS90COMNTOOLS}../../VC/bin/ia64" - "$ENV{VS90COMNTOOLS}../../VC/bin/amd64" - "$ENV{VS100COMNTOOLS}../../VC/bin/ia64" - "$ENV{VS100COMNTOOLS}../../VC/bin/amd64") - ELSE(CMAKE_CL_64) - SET(CHECK_PATHS ${CHECK_PATHS} - "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin" - "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin" - "C:/Program Files/Microsoft Visual Studio 8/VC/bin" - "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin" - "C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/bin" - "C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/bin" - "C:/Program Files/Microsoft Visual Studio 10.0/VC/bin" - "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin" - "$ENV{VS90COMNTOOLS}../../VC/bin" - "$ENV{VS80COMNTOOLS}../../VC/bin" - "$ENV{VS100COMNTOOLS}../../VC/bin/") - ENDIF(CMAKE_CL_64) - - FIND_PROGRAM(CL_EXE cl PATHS ${CHECK_PATHS}) - - # Set up VS environments. - GET_FILENAME_COMPONENT(VC_BIN_PATH ${CL_EXE} PATH) - GET_FILENAME_COMPONENT(COMPILER_NAME ${CL_EXE} NAME) - SET(CC ${COMPILER_NAME} CACHE INTERNAL "C compiler executable") - SET(CXX ${COMPILER_NAME} CACHE INTERNAL "CXX compiler executable") - GET_FILENAME_COMPONENT(SDK_ROOT_PATH - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE) - IF(CMAKE_CL_64) - SET(VS_ROOT_DIR ${VC_BIN_PATH}/../../..) - SET(VC_LIB_DIR ${VS_ROOT_DIR}/VC/lib/amd64) - SET(SDK_LIB_DIR ${SDK_ROOT_PATH}/lib/x64) - ELSE(CMAKE_CL_64) - SET(VS_ROOT_DIR ${VC_BIN_PATH}/../..) - SET(VC_LIB_DIR ${VS_ROOT_DIR}/VC/lib) - SET(SDK_LIB_DIR ${SDK_ROOT_PATH}/lib) - ENDIF(CMAKE_CL_64) - SET(VS_COMMON_TOOLS_DIR ${VS_ROOT_DIR}/Common7/Tools) - SET(VS_IDE_DIR ${VS_ROOT_DIR}/Common7/IDE) - SET(VC_INCLUDE_DIR ${VS_ROOT_DIR}/VC/include) - - - # Cache the compilers paths that could be used later. - SET(C_COMPILER_PATH ${VC_BIN_PATH} ${SDK_ROOT_PATH}/bin ${VS_IDE_DIR} CACHE INTERNAL "Compiler binary paths.") - SET(C_COMPILER_INCLUDE ${VC_INCLUDE_DIR} CACHE INTERNAL "Compiler include paths.") - SET(C_COMPILER_LIB ${VC_LIB_DIR} ${SDK_LIB_DIR} CACHE INTERNAL "Compiler libraries.") - SET(C_COMPILER_LIBPATH ${VC_LIB_DIR} ${SDK_LIB_DIR} CACHE INTERNAL "Compiler libraries path.") - - SET(ENV{PATH} "${C_COMPILER_PATH};$ENV{PATH}") - SET(ENV{INCLUDE} "${C_COMPILER_INCLUDE};$ENV{INCLUDE}") - SET(ENV{LIB} "${C_COMPILER_LIB};$ENV{LIB}") - SET(ENV{LIBPATH} "${C_COMPILER_LIBPATH};$ENV{LIBPATH}") - - # Default compiler settings. - SET(OMPI_C_OPTION_COMPILE "/c" CACHE INTERNAL - "C compiler option for compiling without linking.") - SET(OMPI_C_OUTPUT_OBJ "/Fo" CACHE INTERNAL - "C compiler option for setting object file name.") - SET(OMPI_C_OUTPUT_EXE "/Fe" CACHE INTERNAL - "C compiler option for setting executable file name.") - SET(OMPI_C_LAN_FLAG "/TC" CACHE INTERNAL - "C compiler option for compiling source as C.") - SET(OMPI_CXX_LAN_FLAG "/TP" CACHE INTERNAL - "C compiler option for compiling source as C++.") - SET(OMPI_C_DEF_PRE "/D" CACHE INTERNAL - "C compiler option for preprocessor definition.") - SET(OMPI_C_MD_DEBUG "/MDd" CACHE INTERNAL - "C compiler option for Multi-thread Debug DLL.") - SET(OMPI_C_MD "/MD" CACHE INTERNAL - "C compiler option for Multi-thread DLL.") - SET(OMPI_CXX_EXCEPTION "/EHsc" CACHE INTERNAL - "C compiler option for C++ exceptions.") - SET(OMPI_C_INCLUDE_DIR "/I" CACHE INTERNAL - "C compiler option for including directory.") - SET(OMPI_LIB_CMD "lib" CACHE INTERNAL - "command line for making static libraries.") - SET(OMPI_LIB_CMD_OUTPUT "-OUT:" CACHE INTERNAL - "Output option for making static libraries.") - - SET(DUMP_UTIL "${VC_BIN_PATH}/dumpbin.exe" CACHE INTERNAL "the dumpbin application.") - - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cl_test.c - "int main() {return 0;}") - - TRY_COMPILE(CL_EXE_OK ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/ - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cl_test.c) - - IF(CL_EXE_OK) - - # The atomic functions are defined in a very unuasual manner. - # Some of them are intrinsic defined in windows.h others are - # 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(${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) - - FOREACH(FUNCTION ${FUNCTION_LIST}) - MESSAGE( STATUS "Checking for InterlockedCompare${FUNCTION}...") - - IF(FUNCTION STREQUAL "Exchange64") - SET(64BITS_TYPE "LONGLONG" CACHE INTERNAL "64bits type longlong") - ELSE(FUNCTION STREQUAL "Exchange64") - SET(64BITS_TYPE "LONG" CACHE INTERNAL "64bits type long") - ENDIF(FUNCTION STREQUAL "Exchange64") - - STRING(TOUPPER ${FUNCTION} FUNCTION_NAME) - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/InterlockedCompare${FUNCTION}_test.c - "#include \n" - "int main() {\n" - " ${64BITS_TYPE} dest = 0, exchange = 1, comperand = 0;\n" - " SetErrorMode(SEM_FAILCRITICALERRORS);\n" - " InterlockedCompare${FUNCTION}( &dest, exchange, comperand );\n" - " return (int)dest;\n" - " }\n") - - TRY_RUN (HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} COMPILE_RESULT - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/InterlockedCompare${FUNCTION}_test.c") - - IF(HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} STREQUAL "FAILED_TO_RUN" OR COMPILE_RESULT EQUAL FALSE) - SET (HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} 0 CACHE INTERNAL "HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME}") - MESSAGE( STATUS "Checking for InterlockedCompare${FUNCTION}...failed") - ELSE(HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} STREQUAL "FAILED_TO_RUN" OR COMPILE_RESULT EQUAL FALSE) - MESSAGE( STATUS "Checking for InterlockedCompare${FUNCTION}...done") - ENDIF(HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} STREQUAL "FAILED_TO_RUN" OR COMPILE_RESULT EQUAL FALSE) - - ENDFOREACH(FUNCTION) - - ELSE(CL_EXE_OK) - MESSAGE(FATAL_ERROR "No working Microsoft compiler found. Please check if Visual Studio VC is correctly installed.") - ENDIF(CL_EXE_OK) - - SET(MICROSOFT_CHECK_DONE TRUE CACHE INTERNAL "Microsoft check finished.") - -ENDIF(NOT MICROSOFT_CHECK_DONE) - -OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGE "Whether we support 32 bits atomic operations on Windows" 0 0) -OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGE64 "Whether we support 64 bits atomic operations on Windows" 0 0) -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) - -# a few definitions for shared memory support -OMPI_DEF(MCA_COMMON_SM_WINDOWS 1 "Whether we have shared memory support for Windows or not." 0 1) -OMPI_DEF(MCA_COMMON_SM_SYSV 0 "Whether we have shared memory support for SYSV or not." 0 1) -OMPI_DEF(MCA_COMMON_SM_POSIX 0 "Whether we have shared memory support for POSIX or not." 0 1) - -OMPI_CHECK_INCLUDE_FILE (windows.h HAVE_WINDOWS_H) - -OMPI_CHECK_INCLUDE_FILE (winsock2.h HAVE_WINSOCK2_H) - -OMPI_CHECK_INCLUDE_FILE (wdm.h HAVE_WDM_H) - -OMPI_CHECK_INCLUDE_FILE (malloc.h HAVE_MALLOC_H) - -OMPI_CHECK_INCLUDE_FILE (memory.h HAVE_MEMORY_H) - -OMPI_CHECK_INCLUDE_FILE (signal.h HAVE_SIGNAL_H) - -OMPI_CHECK_INCLUDE_FILE (stdarg.h HAVE_STDARG_H) - -OMPI_CHECK_INCLUDE_FILE (stdint.h HAVE_STDINT_H) - -OMPI_CHECK_INCLUDE_FILE (stdlib.h HAVE_STDLIB_H) - -OMPI_CHECK_INCLUDE_FILE (string.h HAVE_STRING_H) - -OMPI_CHECK_INCLUDE_FILE (sys/stat.h HAVE_SYS_STAT_H) - -OMPI_CHECK_INCLUDE_FILE (sys/types.h HAVE_SYS_TYPES_H) - -OMPI_CHECK_INCLUDE_FILE (time.h HAVE_TIME_H) - -OMPI_CHECK_INCLUDE_FILE(stddef.h OPAL_STDC_HEADERS) - -OMPI_CHECK_FUNCTION_EXISTS (ceil HAVE_CEIL) - -OMPI_CHECK_FUNCTION_EXISTS (execve HAVE_EXECVE) - -OMPI_CHECK_FUNCTION_EXISTS (isatty HAVE_ISATTY) - -OMPI_CHECK_FUNCTION_EXISTS (vsnprintf HAVE_VSNPRINTF) - -CHECK_C_TYPE_EXISTS(socklen_t SOCKLEN_T "winsock2.h;ws2tcpip.h") - -CHECK_C_TYPE_EXISTS("struct sockaddr_in" STRUCT_SOCKADDR_IN "winsock2.h") - -CHECK_C_TYPE_EXISTS("struct sockaddr_in6" STRUCT_SOCKADDR_IN6 "ws2tcpip.h") - -CHECK_C_TYPE_EXISTS("struct sockaddr_storage" STRUCT_SOCKADDR_STORAGE "winsock2.h;ws2tcpip.h") - -OMPI_CHECK_SYMBOL_EXISTS (AF_UNSPEC winsock2.h HAVE_DECL_AF_UNSPEC) - -OMPI_CHECK_SYMBOL_EXISTS (PF_UNSPEC winsock2.h HAVE_DECL_PF_UNSPEC) - -OMPI_CHECK_SYMBOL_EXISTS (AF_INET6 winsock2.h HAVE_DECL_AF_INET6) - -OMPI_CHECK_SYMBOL_EXISTS (PF_INET6 winsock2.h HAVE_DECL_PF_INET6) +# -*- cmake-script -*- +# +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +###################################################################### +# +# OMPI_MICROSOFT_COMPILER +# +# Keep all the Windows checks in one place. +# +# USAGE: +# OMPI_MICROSOFT_COMPILER() +# +###################################################################### + +IF(NOT MICROSOFT_CHECK_DONE) + + MESSAGE( STATUS "Start Microsoft specific detection....") + + # search for Microsoft VC tools + IF(CMAKE_CL_64) + SET(CHECK_PATHS ${CHECK_PATHS} + "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin/amd64" + "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/amd64" + "C:/Program Files/Microsoft Visual Studio 8/VC/bin/amd64" + "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin/amd64" + "C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/bin/amd64" + "C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/bin/amd64" + "C:/Program Files/Microsoft Visual Studio 10.0/VC/bin/amd64" + "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64" + "$ENV{VS80COMNTOOLS}../../VC/bin/ia64" + "$ENV{VS80COMNTOOLS}../../VC/bin/amd64" + "$ENV{VS90COMNTOOLS}../../VC/bin/ia64" + "$ENV{VS90COMNTOOLS}../../VC/bin/amd64" + "$ENV{VS100COMNTOOLS}../../VC/bin/ia64" + "$ENV{VS100COMNTOOLS}../../VC/bin/amd64") + ELSE(CMAKE_CL_64) + SET(CHECK_PATHS ${CHECK_PATHS} + "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin" + "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin" + "C:/Program Files/Microsoft Visual Studio 8/VC/bin" + "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin" + "C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/bin" + "C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/bin" + "C:/Program Files/Microsoft Visual Studio 10.0/VC/bin" + "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin" + "$ENV{VS90COMNTOOLS}../../VC/bin" + "$ENV{VS80COMNTOOLS}../../VC/bin" + "$ENV{VS100COMNTOOLS}../../VC/bin/") + ENDIF(CMAKE_CL_64) + + FIND_PROGRAM(CL_EXE cl PATHS ${CHECK_PATHS}) + + # Set up VS environments. + GET_FILENAME_COMPONENT(VC_BIN_PATH ${CL_EXE} PATH) + GET_FILENAME_COMPONENT(COMPILER_NAME ${CL_EXE} NAME) + SET(CC ${COMPILER_NAME} CACHE INTERNAL "C compiler executable") + SET(CXX ${COMPILER_NAME} CACHE INTERNAL "CXX compiler executable") + GET_FILENAME_COMPONENT(SDK_ROOT_PATH + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE) + IF(CMAKE_CL_64) + SET(VS_ROOT_DIR ${VC_BIN_PATH}/../../..) + SET(VC_LIB_DIR ${VS_ROOT_DIR}/VC/lib/amd64) + SET(SDK_LIB_DIR ${SDK_ROOT_PATH}/lib/x64) + ELSE(CMAKE_CL_64) + SET(VS_ROOT_DIR ${VC_BIN_PATH}/../..) + SET(VC_LIB_DIR ${VS_ROOT_DIR}/VC/lib) + SET(SDK_LIB_DIR ${SDK_ROOT_PATH}/lib) + ENDIF(CMAKE_CL_64) + SET(VS_COMMON_TOOLS_DIR ${VS_ROOT_DIR}/Common7/Tools) + SET(VS_IDE_DIR ${VS_ROOT_DIR}/Common7/IDE) + SET(VC_INCLUDE_DIR ${VS_ROOT_DIR}/VC/include) + + + # Cache the compilers paths that could be used later. + SET(C_COMPILER_PATH ${VC_BIN_PATH} ${SDK_ROOT_PATH}/bin ${VS_IDE_DIR} CACHE INTERNAL "Compiler binary paths.") + SET(C_COMPILER_INCLUDE ${VC_INCLUDE_DIR} CACHE INTERNAL "Compiler include paths.") + SET(C_COMPILER_LIB ${VC_LIB_DIR} ${SDK_LIB_DIR} CACHE INTERNAL "Compiler libraries.") + SET(C_COMPILER_LIBPATH ${VC_LIB_DIR} ${SDK_LIB_DIR} CACHE INTERNAL "Compiler libraries path.") + + SET(ENV{PATH} "${C_COMPILER_PATH};$ENV{PATH}") + SET(ENV{INCLUDE} "${C_COMPILER_INCLUDE};$ENV{INCLUDE}") + SET(ENV{LIB} "${C_COMPILER_LIB};$ENV{LIB}") + SET(ENV{LIBPATH} "${C_COMPILER_LIBPATH};$ENV{LIBPATH}") + + # Default compiler settings. + SET(OMPI_C_OPTION_COMPILE "/c" CACHE INTERNAL + "C compiler option for compiling without linking.") + SET(OMPI_C_OUTPUT_OBJ "/Fo" CACHE INTERNAL + "C compiler option for setting object file name.") + SET(OMPI_C_OUTPUT_EXE "/Fe" CACHE INTERNAL + "C compiler option for setting executable file name.") + SET(OMPI_C_LAN_FLAG "/TC" CACHE INTERNAL + "C compiler option for compiling source as C.") + SET(OMPI_CXX_LAN_FLAG "/TP" CACHE INTERNAL + "C compiler option for compiling source as C++.") + SET(OMPI_C_DEF_PRE "/D" CACHE INTERNAL + "C compiler option for preprocessor definition.") + SET(OMPI_C_MD_DEBUG "/MDd" CACHE INTERNAL + "C compiler option for Multi-thread Debug DLL.") + SET(OMPI_C_MD "/MD" CACHE INTERNAL + "C compiler option for Multi-thread DLL.") + SET(OMPI_CXX_EXCEPTION "/EHsc" CACHE INTERNAL + "C compiler option for C++ exceptions.") + SET(OMPI_C_INCLUDE_DIR "/I" CACHE INTERNAL + "C compiler option for including directory.") + SET(OMPI_LIB_CMD "lib" CACHE INTERNAL + "command line for making static libraries.") + SET(OMPI_LIB_CMD_OUTPUT "-OUT:" CACHE INTERNAL + "Output option for making static libraries.") + + SET(DUMP_UTIL "${VC_BIN_PATH}/dumpbin.exe" CACHE INTERNAL "the dumpbin application.") + + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cl_test.c + "int main() {return 0;}") + + TRY_COMPILE(CL_EXE_OK ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/ + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cl_test.c) + + IF(CL_EXE_OK) + + # The atomic functions are defined in a very unuasual manner. + # Some of them are intrinsic defined in windows.h others are + # 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(${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) + + FOREACH(FUNCTION ${FUNCTION_LIST}) + MESSAGE( STATUS "Checking for InterlockedCompare${FUNCTION}...") + + IF(FUNCTION STREQUAL "Exchange64") + SET(64BITS_TYPE "LONGLONG" CACHE INTERNAL "64bits type longlong") + ELSE(FUNCTION STREQUAL "Exchange64") + SET(64BITS_TYPE "LONG" CACHE INTERNAL "64bits type long") + ENDIF(FUNCTION STREQUAL "Exchange64") + + STRING(TOUPPER ${FUNCTION} FUNCTION_NAME) + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/InterlockedCompare${FUNCTION}_test.c + "#include \n" + "int main() {\n" + " ${64BITS_TYPE} dest = 0, exchange = 1, comperand = 0;\n" + " SetErrorMode(SEM_FAILCRITICALERRORS);\n" + " InterlockedCompare${FUNCTION}( &dest, exchange, comperand );\n" + " return (int)dest;\n" + " }\n") + + TRY_RUN (HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} COMPILE_RESULT + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/InterlockedCompare${FUNCTION}_test.c") + + IF(HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} STREQUAL "FAILED_TO_RUN" OR COMPILE_RESULT EQUAL FALSE) + SET (HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} 0 CACHE INTERNAL "HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME}") + MESSAGE( STATUS "Checking for InterlockedCompare${FUNCTION}...failed") + ELSE(HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} STREQUAL "FAILED_TO_RUN" OR COMPILE_RESULT EQUAL FALSE) + MESSAGE( STATUS "Checking for InterlockedCompare${FUNCTION}...done") + ENDIF(HAVE_INTERLOCKEDCOMPARE${FUNCTION_NAME} STREQUAL "FAILED_TO_RUN" OR COMPILE_RESULT EQUAL FALSE) + + ENDFOREACH(FUNCTION) + + ELSE(CL_EXE_OK) + MESSAGE(FATAL_ERROR "No working Microsoft compiler found. Please check if Visual Studio VC is correctly installed.") + ENDIF(CL_EXE_OK) + + SET(MICROSOFT_CHECK_DONE TRUE CACHE INTERNAL "Microsoft check finished.") + +ENDIF(NOT MICROSOFT_CHECK_DONE) + +OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGE "Whether we support 32 bits atomic operations on Windows" 0 0) +OMPI_DEF_VAR(HAVE_INTERLOCKEDCOMPAREEXCHANGE64 "Whether we support 64 bits atomic operations on Windows" 0 0) +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) + +# a few definitions for shared memory support +OMPI_DEF(MCA_COMMON_SM_WINDOWS 1 "Whether we have shared memory support for Windows or not." 0 1) +OMPI_DEF(MCA_COMMON_SM_SYSV 0 "Whether we have shared memory support for SYSV or not." 0 1) +OMPI_DEF(MCA_COMMON_SM_POSIX 0 "Whether we have shared memory support for POSIX or not." 0 1) + +OMPI_CHECK_INCLUDE_FILE (windows.h HAVE_WINDOWS_H) + +OMPI_CHECK_INCLUDE_FILE (winsock2.h HAVE_WINSOCK2_H) + +OMPI_CHECK_INCLUDE_FILE (wdm.h HAVE_WDM_H) + +OMPI_CHECK_INCLUDE_FILE (malloc.h HAVE_MALLOC_H) + +OMPI_CHECK_INCLUDE_FILE (memory.h HAVE_MEMORY_H) + +OMPI_CHECK_INCLUDE_FILE (signal.h HAVE_SIGNAL_H) + +OMPI_CHECK_INCLUDE_FILE (stdarg.h HAVE_STDARG_H) + +OMPI_CHECK_INCLUDE_FILE (stdint.h HAVE_STDINT_H) + +OMPI_CHECK_INCLUDE_FILE (stdlib.h HAVE_STDLIB_H) + +OMPI_CHECK_INCLUDE_FILE (string.h HAVE_STRING_H) + +OMPI_CHECK_INCLUDE_FILE (sys/stat.h HAVE_SYS_STAT_H) + +OMPI_CHECK_INCLUDE_FILE (sys/types.h HAVE_SYS_TYPES_H) + +OMPI_CHECK_INCLUDE_FILE (time.h HAVE_TIME_H) + +OMPI_CHECK_INCLUDE_FILE(stddef.h OPAL_STDC_HEADERS) + +OMPI_CHECK_FUNCTION_EXISTS (ceil HAVE_CEIL) + +OMPI_CHECK_FUNCTION_EXISTS (execve HAVE_EXECVE) + +OMPI_CHECK_FUNCTION_EXISTS (isatty HAVE_ISATTY) + +OMPI_CHECK_FUNCTION_EXISTS (vsnprintf HAVE_VSNPRINTF) + +CHECK_C_TYPE_EXISTS(socklen_t SOCKLEN_T "winsock2.h;ws2tcpip.h") + +CHECK_C_TYPE_EXISTS("struct sockaddr_in" STRUCT_SOCKADDR_IN "winsock2.h") + +CHECK_C_TYPE_EXISTS("struct sockaddr_in6" STRUCT_SOCKADDR_IN6 "ws2tcpip.h") + +CHECK_C_TYPE_EXISTS("struct sockaddr_storage" STRUCT_SOCKADDR_STORAGE "winsock2.h;ws2tcpip.h") + +OMPI_CHECK_SYMBOL_EXISTS (AF_UNSPEC winsock2.h HAVE_DECL_AF_UNSPEC) + +OMPI_CHECK_SYMBOL_EXISTS (PF_UNSPEC winsock2.h HAVE_DECL_PF_UNSPEC) + +OMPI_CHECK_SYMBOL_EXISTS (AF_INET6 winsock2.h HAVE_DECL_AF_INET6) + +OMPI_CHECK_SYMBOL_EXISTS (PF_INET6 winsock2.h HAVE_DECL_PF_INET6) diff --git a/contrib/platform/win32/CMakeModules/ompi_configure.cmake b/contrib/platform/win32/CMakeModules/ompi_configure.cmake index 1df28fa6ef..e4306861c8 100644 --- a/contrib/platform/win32/CMakeModules/ompi_configure.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_configure.cmake @@ -1,914 +1,914 @@ -# -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2008 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - - -MACRO(BEGIN_CONFIGURE) - -INCLUDE (CheckIncludeFileCXX) -INCLUDE (CheckIncludeFile) -INCLUDE (CheckFunctionExists) -INCLUDE (CheckSymbolExists) -INCLUDE (CheckLibraryExists) -INCLUDE (CheckTypeSize) -INCLUDE (CheckStructHasMember) -INCLUDE (CheckCXXSourceCompiles) -INCLUDE (CheckCSourceCompiles) -INCLUDE (ompi_define) -INCLUDE (ompi_base_checks) -INCLUDE (opal_functions) -INCLUDE (get_c_alignment) -INCLUDE (check_c_type_exists) -INCLUDE (check_c_inline) -INCLUDE (check_bool) - -OPTION(OPAL_CONFIG_REGEN "Whether we want to regenerate the configure template file." OFF) - -IF(${OPAL_CONFIG_REGEN} STREQUAL "ON") - SET(WRITE_CONFIG_DONE FALSE CACHE INTERNAL "Whether to regenerate configure template.") -ENDIF(${OPAL_CONFIG_REGEN} STREQUAL "ON") - -IF(NOT WRITE_CONFIG_DONE) - FILE(REMOVE ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake) - FILE(APPEND ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake - "/* opal/include/opal_config.h.cmake. Generated by CMake. */ - -/* -*- c -*- - * - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - * - * Function: - OS, CPU and compiler dependent configuration - */ - -#ifndef OPAL_CONFIG_H -#define OPAL_CONFIG_H -\n\n -") -ENDIF(NOT WRITE_CONFIG_DONE) - - -OMPI_DEF(PACKAGE_NAME "Open MPI" "Define to the full name of this package." 1 1) - -OMPI_DEF(PACKAGE_TARNAME "openmpi" "Define to the one symbol short name of this package." 1 1) - -OMPI_DEF(OPAL_PACKAGE_STRING "Open MPI $ENV{USERNAME}@$ENV{COMPUTERNAME} Distribution" "Package/branding string for Open MPI" 1 1) - -OMPI_DEF(PACKAGE_BUGREPORT "http://www.open-mpi.org/community/help/" "Define to the address where bug reports for this package should be sent." 1 1) - -OMPI_DEF(OPAL_CONFIGURE_HOST $ENV{COMPUTERNAME} "Host on which configuration has been done." 1 1) - -OMPI_DEF(OPAL_CONFIGURE_USER $ENV{USERNAME} "User who has done the configuration." 1 1) - -OMPI_DEF(OMPI_BUILD_USER $ENV{USERNAME} "User who has built the package." 1 1) - -OMPI_DEF(OMPI_BUILD_HOST $ENV{COMPUTERNAME} "Host on which the package has been built." 1 1) - -OMPI_DEF(OPAL_ARCH "${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_SYSTEM}" "OMPI architecture string" 1 1) - - -INCLUDE(opal_get_version) - -OMPI_DEF(OMPI_RELEASE_DATE ${RELEASE_DATE} "Release date of the package" 1 1) - -OMPI_DEF(OPAL_RELEASE_DATE ${RELEASE_DATE} "Release date of the package" 1 1) - -OMPI_DEF(ORTE_RELEASE_DATE ${RELEASE_DATE} "Release date of the package" 1 1) - -OMPI_DEF(PACKAGE_VERSION ${OPAL_VERSION} "Define to the version of this package." 1 1) - -OMPI_DEF(PACKAGE_STRING "Open MPI ${PACKAGE_VERSION}" "Define to the full name and version of this package." 1 1) - - -# Get current time and date. -EXECUTE_PROCESS(COMMAND cmd /C time /t - OUTPUT_VARIABLE CURRENT_TIME) - -EXECUTE_PROCESS(COMMAND cmd /C date /t - OUTPUT_VARIABLE CURRENT_DATE) - -STRING (REPLACE "\n" "" CURRENT_TIME ${CURRENT_TIME}) -STRING (REPLACE "\n" "" CURRENT_DATE ${CURRENT_DATE}) -STRING (REGEX MATCH [.-/\0-9]+ CURRENT_DATE ${CURRENT_DATE}) -SET (OPAL_CONFIGURE_DATE "${CURRENT_TIME} ${CURRENT_DATE}" CACHE INTERNAL "OPAL_CONFIGURE_DATE") -SET (OMPI_BUILD_DATE "${CURRENT_TIME} ${CURRENT_DATE}" CACHE INTERNAL "OMPI_BUILD_DATE") - -OMPI_DEF(OPAL_CONFIGURE_DATE "${CURRENT_TIME} ${CURRENT_DATE}" "Configuration date." 1 1) -OMPI_DEF(OMPI_BUILD_DATE "${CURRENT_TIME} ${CURRENT_DATE}" "Build date." 1 1) - -OMPI_DEF(OMPI_BUILD_CFLAGS "/Od /Gm /EHsc /RTC1 /MDd" "C flags" 1 1) - - -SET(OMPI_BUILD_CPPFLAGS "\"-I${OpenMPI_SOURCE_DIR}/ - -I${OpenMPI_SOURCE_DIR}/opal - -I${OpenMPI_SOURCE_DIR}/opal/include - -I${OpenMPI_SOURCE_DIR}/ompi - -I${OpenMPI_SOURCE_DIR}/ompi/include - -I${OpenMPI_SOURCE_DIR}/orte - -I${OpenMPI_SOURCE_DIR}/orte/include - -I${OpenMPI_BINARY_DIR}/ - -I${OpenMPI_BINARY_DIR}/opal - -I${OpenMPI_BINARY_DIR}/opal/include - -I${OpenMPI_BINARY_DIR}/ompi - -I${OpenMPI_BINARY_DIR}/ompi/include - -I${OpenMPI_BINARY_DIR}/orte - -I${OpenMPI_BINARY_DIR}/orte/include - -I${OpenMPI_SOURCE_DIR}/contrib/platform/win32\"") - - -OMPI_DEF(OMPI_BUILD_CXXFLAGS "/Od /Gm /EHsc /RTC1 /MDd" "C++ flags" 1 1) - -SET(OMPI_BUILD_CXXCPPFLAGS ${OMPI_BUILD_CPPFLAGS}) - -OMPI_DEF(OMPI_BUILD_FFLAGS " " "F77 flags." 1 1) - -OMPI_DEF(OMPI_BUILD_FCFLAGS " " "F90 flags." 1 1) - -OMPI_DEF(OMPI_BUILD_LDFLAGS " " "LD flags." 1 1) - -OMPI_DEF(OMPI_BUILD_LIBS " " "Link libraries." 1 1) - -OMPI_DEF(OMPI_F90_BUILD_SIZE "small" "F90 build size." 1 1) - -OMPI_DEF(OMPI_BTL_SM_HAVE_KNEM 0 "If btl sm has knem." 0 1) - -IF(WIN32 AND MSVC) - INCLUDE(ompi_check_Microsoft) - OMPI_DEF(COMPILER_FAMILYNAME MICROSOFT "Compiler family name" 1 1) - OMPI_DEF(COMPILER_VERSION ${MSVC_VERSION} "Compiler version" 0 1) - OMPI_DEF(OPAL_BUILD_PLATFORM_COMPILER_FAMILYID 14 "Compiler family ID" 0 1) - OMPI_DEF(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME ${COMPILER_FAMILYNAME} "Compiler family name" 0 1) - OMPI_DEF(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR ${MSVC_VERSION} "Compiler version" 0 1) -ENDIF(WIN32 AND MSVC) - - -################################################################### -# Options # -################################################################### - -OPAL_WITH_OPTION_MIN_MAX_VALUE(processor_name 256 16 1024) - -OPAL_WITH_OPTION_MIN_MAX_VALUE(error_string 256 64 1024) - -OPAL_WITH_OPTION_MIN_MAX_VALUE(object_name 64 64 256) - -OPAL_WITH_OPTION_MIN_MAX_VALUE(info_key 36 34 255) - -OPAL_WITH_OPTION_MIN_MAX_VALUE(info_val 256 32 1024) - -OPAL_WITH_OPTION_MIN_MAX_VALUE(port_name 1024 255 2048) - -OPAL_WITH_OPTION_MIN_MAX_VALUE(datarep_string 128 64 256) - -OMPI_DEF_CACHE_VAR(OMPI_MPIEXT_COMPONENTS none STRING "Specify user defined MPI Extended Interface Components." 1 1) - -OMPI_DEF_OPT(MCA_ompi_mtl_DIRECT_CALL "Whether mtl should use direct calls instead of components." OFF) - -OMPI_DEF_OPT(MCA_ompi_pml_DIRECT_CALL "Whether pml should use direct calls instead of components." OFF) - -OMPI_DEF_OPT(MPI_PARAM_CHECK "Whether we want to check MPI parameters always, never, or decide at run-time." OFF) - -OMPI_DEF_OPT(OPAL_ENABLE_DEBUG "Whether we want developer-level debugging code or not." OFF) - -OMPI_DEF_OPT(OPAL_ENABLE_HETEROGENEOUS_SUPPORT "Enable features required for heterogeneous support." OFF) - -OMPI_DEF_OPT(OPAL_ENABLE_MEM_DEBUG "Whether we want the memory debug or not." OFF) - -OMPI_DEF_OPT(OPAL_ENABLE_MEM_PROFILE "Whether we want the memory profiling or not." OFF) - -OMPI_DEF_OPT(OMPI_ENABLE_MPI_PROFILING "Whether we want MPI profiling or not." ON) - -OMPI_DEF_OPT(OMPI_ENABLE_THREAD_MULTIPLE "Enable MPI Thread Multiple." OFF) - -OMPI_DEF(OMPI_ENABLE_PROGRESS_THREADS 0 "Hardcode the OMPI progress thread to be off." 0 1) - -OMPI_DEF(ORTE_ENABLE_PROGRESS_THREADS 0 "Hardcode the ORTE progress thread to be off." 0 1) - -OMPI_DEF_OPT(OPAL_ENABLE_MULTI_THREADS "Whether we should enable support for multiple user threads" OFF) - -OMPI_DEF_OPT(OPAL_ENABLE_PTY_SUPPORT "Whether we should use progress threads rather than polling." OFF) - -OMPI_DEF_OPT ( OMPI_GROUP_SPARSE "Wether we want sparse process groups." OFF) - -OMPI_DEF_OPT (OMPI_PROVIDE_MPI_FILE_INTERFACE "Whether OMPI should provide MPI File interface" ON) - -OMPI_DEF_OPT(OMPI_WANT_CXX_BINDINGS "Whether we want MPI cxx support or not." ON) - -OMPI_DEF_OPT(OMPI_WANT_F77_BINDINGS "Whether we want MPI F77 support or not." OFF) - -OMPI_DEF_OPT(OMPI_WANT_F90_BINDINGS "Whether we want MPI F90 support or not." OFF) - -OMPI_DEF_OPT(OMPI_WANT_MPI_CXX_SEEK "Do we want to try to work around C++ bindings SEEK_* issue?" OFF) - -OMPI_DEF_OPT(OMPI_WANT_PERUSE "Whether the peruse interface should be enabled." OFF) - -OMPI_DEF_OPT( OPAL_WANT_PRETTY_PRINT_STACKTRACE "Whether we want pretty-print stack trace feature." ON) - -OMPI_DEF_OPT( OPAL_WANT_SMP_LOCKS "Whether we want to have smp locks in atomic ops or not." ON) - -OMPI_DEF_OPT( OPAL_ENABLE_FT "Enable fault tolerance general components and logic." ON) - -OMPI_DEF_OPT( OPAL_ENABLE_FT_CR "Enable fault tolerance checkpoint/restart components and logic." OFF) - -OMPI_DEF_OPT( OPAL_ENABLE_FT_THREAD "Enable fault tolerance thread in Open PAL." OFF) - -OMPI_DEF_OPT( OPAL_ENABLE_IPV6 "Enable IPv6 support, but only if the underlying system supports it." ON) - -OMPI_DEF_OPT( OPAL_ENABLE_TRACE "Enable run-time tracing of internal functions." OFF) - -OMPI_DEF_OPT( ORTE_DISABLE_FULL_SUPPORT "Enable full RTE support (Default OFF)." OFF) - -OMPI_DEF_OPT( ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT "Whether we want orterun to effect \"--prefix $prefix\" by default." ON) - -OMPI_DEF_OPT( OMPI_WANT_MPI_INTERFACE_WARNING "enable warnings in wrong (e.g. deprecated) usage in user-level code (default: disabled)." OFF) - -OMPI_DEF_OPT(ORTE_WANT_CCP "Whether we want to have the CCP remote process launch support." ON) - -OMPI_DEF_OPT(OPAL_WANT_LIBLTDL "Whether we want to enable DSO build for Windows." OFF) - -OMPI_DEF_OPT(OMPI_WANT_NETWORK_DIRECT "Whether we want to enable Network Direct support." ON) - -OMPI_DEF_OPT(ORTE_WANT_NOTIFIER_LOG_EVENT "if the notifier_log_event should be enabled" OFF) - -OMPI_DEF_OPT(OMPI_WANT_OFED "Whether we want to enable OFED support." ON) - -OMPI_DEF_OPT(OMPI_WANT_WINVERBS "Whether we want to enable Winverbs support." ON) - -OMPI_DEF_OPT(OPAL_ENABLE_CRDEBUG "Whether we want checkpoint/restart enabled debugging functionality or not." OFF) - -OMPI_DEF_OPT(OPAL_EVENT_HAVE_THREAD_SUPPORT "Whether we want to enable event library internal thread support." OFF) - -IF (NOT MSVC) - -################################################################### -# Check headers # -################################################################### - - -OMPI_CHECK_INCLUDE_FILE (alloca.h HAVE_ALLOCA_H) - -OMPI_CHECK_INCLUDE_FILE (arpa/inet.h HAVE_ARPA_INET_H) - -OMPI_CHECK_INCLUDE_FILE (crt_externs.h HAVE_CRT_EXTERNS_H) - -OMPI_CHECK_INCLUDE_FILE (dirent.h HAVE_DIRENT_H) - -OMPI_CHECK_INCLUDE_FILE (dlfcn.h HAVE_DLFCN_H) - -OMPI_CHECK_INCLUDE_FILE (err.h HAVE_ERR_H) - -OMPI_CHECK_INCLUDE_FILE (execinfo.h HAVE_EXECINFO_H) - -OMPI_CHECK_INCLUDE_FILE (fcntl.h HAVE_FCNTL_H) - -OMPI_CHECK_INCLUDE_FILE (grp.h HAVE_GRP_H) - -OMPI_CHECK_INCLUDE_FILE (ifaddrs.h HAVE_IFADDRS_H) - -OMPI_CHECK_INCLUDE_FILE (inttypes.h HAVE_INTTYPES_H) - -OMPI_CHECK_INCLUDE_FILE (libcr.h HAVE_LIBCR_H) - -OMPI_CHECK_INCLUDE_FILE (libgen.h HAVE_LIBGEN_H) - -OMPI_CHECK_INCLUDE_FILE (libutil.h HAVE_LIBUTIL_H) - -OMPI_CHECK_INCLUDE_FILE (libxcpu.h HAVE_LIBXCPU_H) - -OMPI_CHECK_INCLUDE_FILE (mach/mach_time.h HAVE_MACH_MACH_TIME_H) - -OMPI_CHECK_INCLUDE_FILE (mach/mach_vm.h HAVE_MACH_MACH_VM_H) - -OMPI_CHECK_INCLUDE_FILE (netdb.h HAVE_NETDB_H) - -OMPI_CHECK_INCLUDE_FILE (netinet/in.h HAVE_NETINET_IN_H) - -OMPI_CHECK_INCLUDE_FILE (netinet/tcp.h HAVE_NETINET_TCP_H) - -OMPI_CHECK_INCLUDE_FILE (net/if.h HAVE_NET_IF_H) - -OMPI_CHECK_INCLUDE_FILE (pmapi.h HAVE_PMAPI_H) - -OMPI_CHECK_INCLUDE_FILE (poll.h HAVE_POLL_H) - -OMPI_CHECK_INCLUDE_FILE (pthread.h HAVE_PTHREAD_H) - -OMPI_CHECK_INCLUDE_FILE (pty.h HAVE_PTY_H) - -OMPI_CHECK_INCLUDE_FILE (pwd.h HAVE_PWD_H) - -OMPI_CHECK_INCLUDE_FILE (regex.h HAVE_REGEX_H) - -OMPI_CHECK_INCLUDE_FILE (sched.h HAVE_SCHED_H) - -OMPI_CHECK_INCLUDE_FILE (stdbool.h HAVE_STDBOOL_H) - -OMPI_CHECK_INCLUDE_FILE (stdint.h HAVE_STDINT_H) - -OMPI_CHECK_INCLUDE_FILE (strings.h HAVE_STRINGS_H) - -OMPI_CHECK_INCLUDE_FILE (stropts.h HAVE_STROPTS_H) - -OMPI_CHECK_INCLUDE_FILE (syslog.h HAVE_SYSLOG_H) - -OMPI_CHECK_INCLUDE_FILE (sys/bproc_common.h HAVE_SYS_BPROC_COMMON_H) - -OMPI_CHECK_INCLUDE_FILE (sys/bproc.h HAVE_SYS_BPROC_H) - -OMPI_CHECK_INCLUDE_FILE (sys/devpoll.h HAVE_SYS_DEVPOLL_H) - -OMPI_CHECK_INCLUDE_FILE (sys/epoll.h HAVE_SYS_EPOLL_H) - -OMPI_CHECK_INCLUDE_FILE (sys/event.h HAVE_SYS_EVENT_H) - -OMPI_CHECK_INCLUDE_FILE (sys/fcntl.h HAVE_SYS_FCNTL_H) - -OMPI_CHECK_INCLUDE_FILE (sys/ioctl.h HAVE_SYS_IOCTL_H) - -OMPI_CHECK_INCLUDE_FILE (sys/ipc.h HAVE_SYS_IPC_H) - -OMPI_CHECK_INCLUDE_FILE (sys/mman.h HAVE_SYS_MMAN_H) - -OMPI_CHECK_INCLUDE_FILE (sys/param.h HAVE_SYS_PARAM_H) - -OMPI_CHECK_INCLUDE_FILE (sys/queue.h HAVE_SYS_QUEUE_H) - -OMPI_CHECK_INCLUDE_FILE (sys/resource.h HAVE_SYS_RESOURCE_H) - -OMPI_CHECK_INCLUDE_FILE (sys/select.h HAVE_SYS_SELECT_H) - -OMPI_CHECK_INCLUDE_FILE (sys/socket.h HAVE_SYS_SOCKET_H) - -OMPI_CHECK_INCLUDE_FILE (sys/sockio.h HAVE_SYS_SOCKIO_H) - -OMPI_CHECK_INCLUDE_FILE (sys/statvfs.h HAVE_SYS_STATVFS_H) - -OMPI_CHECK_INCLUDE_FILE (sys/sysctl.h HAVE_SYS_SYSCTL_H) - -OMPI_CHECK_INCLUDE_FILE (sys/time.h HAVE_SYS_TIME_H) - -OMPI_CHECK_INCLUDE_FILE (sys/tree.h HAVE_SYS_TREE_H) - -OMPI_CHECK_INCLUDE_FILE (sys/uio.h HAVE_SYS_UIO_H) - -OMPI_CHECK_INCLUDE_FILE (sys/utsname.h HAVE_SYS_UTSNAME_H) - -OMPI_CHECK_INCLUDE_FILE (sys/wait.h HAVE_SYS_WAIT_H) - -OMPI_CHECK_INCLUDE_FILE (termios.h HAVE_TERMIOS_H) - -OMPI_CHECK_INCLUDE_FILE (sys/time.h HAVE_TIMERADD) - - -OMPI_CHECK_INCLUDE_FILE (ucontext.h HAVE_UCONTEXT_H) - -OMPI_CHECK_INCLUDE_FILE (ulimit.h HAVE_ULIMIT_H) - -OMPI_CHECK_INCLUDE_FILE (unistd.h HAVE_UNISTD_H) - -OMPI_CHECK_INCLUDE_FILE (util.h HAVE_UTIL_H) - -OMPI_CHECK_INCLUDE_FILE (utmp.h HAVE_UTMP_H) - -OMPI_CHECK_INCLUDE_FILE (mx_extension.h MX_HAVE_EXTENSIONS_H) - - -################################################################### -# Check functions # -################################################################### - -OMPI_CHECK_FUNCTION_EXISTS (asprintf HAVE_ASPRINTF) - -OMPI_CHECK_FUNCTION_EXISTS (backtrace HAVE_BACKTRACE) - -OMPI_CHECK_FUNCTION_EXISTS (cnos_pm_barrier HAVE_CNOS_PM_BARRIER) - -OMPI_CHECK_FUNCTION_EXISTS (dirname HAVE_DIRNAME) - -OMPI_CHECK_FUNCTION_EXISTS (dlsym HAVE_DLSYM) - -OMPI_CHECK_FUNCTION_EXISTS (epoll HAVE_EPOLL) - -OMPI_CHECK_FUNCTION_EXISTS (epoll_ctl HAVE_EPOLL_CTL) - -OMPI_CHECK_FUNCTION_EXISTS (fcntl HAVE_FCNTL) - -OMPI_CHECK_FUNCTION_EXISTS (fork HAVE_FORK) - -OMPI_CHECK_FUNCTION_EXISTS (getpwuid HAVE_GETPWUID) - -OMPI_CHECK_FUNCTION_EXISTS (gettimeofday HAVE_GETTIMEOFDAY) - -OMPI_CHECK_FUNCTION_EXISTS (htonl HAVE_HTONL) - -OMPI_CHECK_FUNCTION_EXISTS (htons HAVE_HTONS) - -OMPI_CHECK_FUNCTION_EXISTS (ibv_fork_init HAVE_IBV_FORK_INIT) - -OMPI_CHECK_FUNCTION_EXISTS (ibv_get_device_list HAVE_IBV_GET_DEVICE_LIST) - -OMPI_CHECK_FUNCTION_EXISTS (ibv_resize_cq HAVE_IBV_RESIZE_CQ) - -OMPI_CHECK_FUNCTION_EXISTS (killrank HAVE_KILLRANK) - -OMPI_CHECK_FUNCTION_EXISTS (kqueue KQUEUE) - -OMPI_CHECK_FUNCTION_EXISTS (mach_vm_read HAVE_MACH_MACH_VM_READ) - -OMPI_CHECK_FUNCTION_EXISTS (mach_vm_region HAVE_MACH_VM_REGION) - -OMPI_CHECK_FUNCTION_EXISTS (mallopt HAVE_MALLOPT) - -OMPI_CHECK_FUNCTION_EXISTS (mmap HAVE_MMAP) - -OMPI_CHECK_FUNCTION_EXISTS (ntohl HAVE_NTOHL) - -OMPI_CHECK_FUNCTION_EXISTS (ntohs HAVE_NTOHS) - -OMPI_CHECK_FUNCTION_EXISTS (openpty HAVE_OPENPTY) - -OMPI_CHECK_FUNCTION_EXISTS (pipe HAVE_PIPE) - -OMPI_CHECK_FUNCTION_EXISTS (pm_cycles HAVE_PM_CYCLES) - -OMPI_CHECK_FUNCTION_EXISTS (poll HAVE_POLL) - -OMPI_CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN) - -OMPI_CHECK_FUNCTION_EXISTS (printstack HAVE_PRINTSTACK) - -OMPI_CHECK_FUNCTION_EXISTS (ptsname HAVE_PTSNAME) - -OMPI_CHECK_FUNCTION_EXISTS (regcmp HAVE_REGCMP) - -OMPI_CHECK_FUNCTION_EXISTS (regexec HAVE_REGEXEC) - -OMPI_CHECK_FUNCTION_EXISTS (regfree HAVE_REGFREE) - -OMPI_CHECK_FUNCTION_EXISTS (sched_yield HAVE_SCHED_YIELD) - -OMPI_CHECK_FUNCTION_EXISTS (select HAVE_SELECT) - -OMPI_CHECK_FUNCTION_EXISTS (setsid HAVE_SETSID) - -OMPI_CHECK_FUNCTION_EXISTS (sigtimedwait HAVE_SIGTIMEDWAIT) - -OMPI_CHECK_FUNCTION_EXISTS (snprintf HAVE_SNPRINTF) - -OMPI_CHECK_FUNCTION_EXISTS (strsignal HAVE_STRSIGNAL) - -OMPI_CHECK_FUNCTION_EXISTS (syscall HAVE_SYSCALL) - -OMPI_CHECK_FUNCTION_EXISTS (sysconf HAVE_SYSCONF) - -OMPI_CHECK_FUNCTION_EXISTS (syslog HAVE_SYSLOG) - -OMPI_CHECK_FUNCTION_EXISTS (tcgetpgrp HAVE_TCGETPGRP) - -OMPI_CHECK_FUNCTION_EXISTS (vasprintf HAVE_VASPRINTF) - -OMPI_CHECK_FUNCTION_EXISTS (vm_read_overwrite HAVE_VM_READ_OVERWRITE) - -OMPI_CHECK_FUNCTION_EXISTS (waitpid HAVE_WAITPIN) - -OMPI_CHECK_FUNCTION_EXISTS (_NSGetEnviron HAVE__NSGETENVIRON) - -OMPI_CHECK_FUNCTION_EXISTS (__mmap HAVE___MMAP) - -OMPI_CHECK_FUNCTION_EXISTS (__munmap HAVE___MUNMAP) - -OMPI_CHECK_SYMBOL_EXISTS (F_SETFD fcntl.h HAVE_SETFD) - -OMPI_CHECK_SYMBOL_EXISTS (TAILQ_FOREACH "sys/queue.h" HAVE_TAILQFOREACH) - -OMPI_CHECK_SYMBOL_EXISTS (IBV_EVENT_CLIENT_REREGISTER "" HAVE_DECL_IBV_EVENT_CLIENT_REREGISTER) - -OMPI_CHECK_SYMBOL_EXISTS (RLIMIT_NPROC "" HAVE_DECL_RLIMIT_NPROC) - -OMPI_CHECK_SYMBOL_EXISTS (sbrk "" HAVE_DECL_SBRK) - -OMPI_CHECK_SYMBOL_EXISTS (__func__ "" HAVE_DECL___FUNC__) - -OMPI_CHECK_STRUCT_HAS_MEMBER(ppc_thread_state_t srr0 mach/ppc/thread_status.h HAVE_PPC_THREAD_STATE_T_SRR0) - -OMPI_CHECK_STRUCT_HAS_MEMBER(siginfo_t si_band sys/siginfo.h HAVE_SIGINFO_T_SI_BAND) - -OMPI_CHECK_STRUCT_HAS_MEMBER(siginfo_t si_fd sys/siginfo.h HAVE_SIGINFO_T_SI_FD) - -OMPI_CHECK_STRUCT_HAS_MEMBER("struct dirent" d_type dirent.h HAVE_STRUCT_DIRENT_D_TYPE) - -ENDIF (NOT MSVC) - -################################################################### -# Check data type # -################################################################### - - -OMPI_CHECK_TYPES(char CHAR none c) - -OMPI_CHECK_TYPES(wchar WCHAR none c) - -OMPI_CHECK_TYPES(double DOUBLE none c) - -OMPI_CHECK_TYPES(float FLOAT none c) - -OMPI_CHECK_TYPES(int INT none c) - -OMPI_CHECK_BOOL() - -OMPI_CHECK_TYPES(short SHORT none c) - -OMPI_CHECK_TYPES(long LONG none c) - -OMPI_CHECK_TYPES("long double" LONG_DOUBLE none c) - -OMPI_CHECK_TYPES("long long" LONG_LONG none c) - -OMPI_CHECK_TYPES ("unsigned int" UNSIGNED_INT none c) - -OMPI_CHECK_TYPES ("unsigned short" UNSIGNED_SHORT none c) - -OMPI_CHECK_TYPES ("unsigned long long" UNSIGNED_LONG_LONG none c) - -OMPI_CHECK_TYPES("unsigned long double" UNSIGNED_LONG_DOUBLE none c) - -OMPI_CHECK_TYPES ("unsigned char" UNSIGNED_CHAR none c) - -OMPI_CHECK_TYPES("float _Complex" FLOAT_COMPLEX none c) - -OMPI_CHECK_TYPES("double _Complex" DOUBLE_COMPLEX none c) - -OMPI_CHECK_TYPES("long double _Complex" LONG_DOUBLE_COMPLEX none c) - -OMPI_CHECK_TYPES(size_t SIZE_T none c) - -OMPI_CHECK_TYPES(ssize_t SSIZE_T none c) - -OMPI_CHECK_TYPES("void *" VOID_P none c) - -OMPI_CHECK_TYPES(pid_t PID_T "int" c) - -OMPI_CHECK_TYPES(ptrdiff_t PTRDIFF_T "int" c) - -OMPI_CHECK_TYPES (mode_t MODE_T none c) - -OMPI_CHECK_TYPES (int8_t INT8_T none c) - -OMPI_CHECK_TYPES (int16_t INT16_T none c) - -OMPI_CHECK_TYPES (int32_t INT32_T none c) - -OMPI_CHECK_TYPES (int64_t INT64_T none c) - -OMPI_CHECK_TYPES (int128_t INT128_T none c) - -OMPI_CHECK_TYPES (intptr_t INTPTR_T none c) - -OMPI_CHECK_TYPES (uint8_t UINT8_T none c) - -OMPI_CHECK_TYPES (uint16_t UINT16_T none c) - -OMPI_CHECK_TYPES (uint32_t UINT32_T none c) - -OMPI_CHECK_TYPES (uint64_t UINT64_T none c) - -OMPI_CHECK_TYPES (uint128_t UINT128_T none c) - -OMPI_CHECK_TYPES (uintptr_t UINTPTR_T none c) - - -################################################################### -# Check Fortran 77 types # -################################################################### -INCLUDE(setup_F77) -INCLUDE(f77_check) -INCLUDE(f77_check_real16_c_equiv) -INCLUDE(f77_get_value_true) -INCLUDE(f77_get_fortran_handle_max) - -IF(WIN32) - OMPI_DEF(ompi_fortran_bogus_type_t "int" "A bogus type that allows us to have sentinel type values that are still valid." 0 1) -ENDIF(WIN32) - -# We want to set the #define's for all of these, so invoke the macros -# regardless of whether we have F77 support or not. -OMPI_F77_CHECK("CHARACTER" "yes" "char;int32_t;int;int64_t;long long;long" "-1") -OMPI_F77_CHECK("LOGICAL" "yes" "char;int;long long;long" "-1") -OMPI_F77_CHECK("LOGICAL*1" "yes" "char;short;int;long long;long" "1") -OMPI_F77_CHECK("LOGICAL*2" "yes" "short;int;long long;long" "2") -OMPI_F77_CHECK("LOGICAL*4" "yes" "int;long long;long" "4") -OMPI_F77_CHECK("LOGICAL*8" "yes" "int;long long;long" "8") -OMPI_F77_CHECK("INTEGER" "yes" "int;long long;long" "-1") -OMPI_F77_CHECK("INTEGER*1" "no" "char;short;int;long long;long" "1") -OMPI_F77_CHECK("INTEGER*2" "no" "short;int;long long;long" "2") -OMPI_F77_CHECK("INTEGER*4" "no" "int;long long;long" "4") -OMPI_F77_CHECK("INTEGER*8" "no" "int;long long;long" "8") -OMPI_F77_CHECK("INTEGER*16" "no" "int;long long;long" "16") - -OMPI_F77_CHECK("REAL" "yes" "float;double;long double" "-1") -OMPI_F77_CHECK("REAL*2" "no" "float;double;long double" "2") -OMPI_F77_CHECK("REAL*4" "no" "float;double;long double" "4") -OMPI_F77_CHECK("REAL*8" "no" "float;double;long double" "8") -OMPI_F77_CHECK("REAL*16" "no" "float;double;long double" "16") -OMPI_F77_CHECK("DOUBLE PRECISION" "yes" "float;double;long double" "-1") - -OMPI_F77_CHECK("COMPLEX" "yes" "" "-1") -OMPI_F77_CHECK("DOUBLE COMPLEX" "yes" "" "-1") - -# The complex*N tests are a bit different (note: the complex tests are -# the same as all the rest, because complex is a composite of two -# reals, which we *have* to have. It's only the complex*N tests that -# are different). The fortran complex types are composites of the -# real*(N/2) types. So for us to support complex*N, two conditions -# must be true: -# -# a) we must support real*(N/2) (i.e., compiler supports it and we -# have a back-end C type for it) -# b) compiler supports complex*N - -OMPI_F77_CHECK("COMPLEX*8" "no" "" "8") -OMPI_F77_CHECK("COMPLEX*16" "no" "" "16") -OMPI_F77_CHECK("COMPLEX*32" "no" "" "32") - -OMPI_F77_CHECK_REAL16_C_EQUIV() - -# Regardless of whether we have fortran bindings, or even a fortran -# compiler, get the max value for a fortran MPI handle (this macro -# handles the case where we don't have a fortran compiler). - -OMPI_F77_GET_FORTRAN_HANDLE_MAX() - -# -# Check for Fortran compilers value of TRUE and for the correct assumption -# on LOGICAL for conversion into what C considers to be a true value -# -OMPI_F77_GET_VALUE_TRUE() -#OMPI_F77_CHECK_LOGICAL_ARRAY - -# -# There are 2 layers to the MPI f77 layer. The only extra thing that -# determine f77 bindings is that fortran can be disabled by user. In -# such cases, we need to not build the target at all. One layer -# generates MPI_f77* bindings. The other layer generates PMPI_f77* -# bindings. The following conditions determine whether each (or both) -# these layers are built. -# -# Superceeding clause: -# - fortran77 bindings should be enabled, else everything is -# disabled -# 1. MPI_f77* bindings are needed if: -# - Profiling is not required -# - Profiling is required but weak symbols are not -# supported -# 2. PMPI_* bindings are needed if profiling is required. Hence we -# define 2 conditionals which tell us whether each of these layers -# need to be built or NOT -# - -IF(NOT WANT_MPI_PROFILING OR OMPI_PROFILING_COMPILE_SEPARATELY AND OMPI_WANT_F77_BINDINGS) - SET(WANT_MPI_F77_BINDINGS_LAYER 1) -ELSE(NOT WANT_MPI_PROFILING OR OMPI_PROFILING_COMPILE_SEPARATELY AND OMPI_WANT_F77_BINDINGS) - SET(WANT_MPI_F77_BINDINGS_LAYER 0) -ENDIF(NOT WANT_MPI_PROFILING OR OMPI_PROFILING_COMPILE_SEPARATELY AND OMPI_WANT_F77_BINDINGS) - -IF(WANT_MPI_PROFILING AND OMPI_WANT_F77_BINDINGS) - SET(WANT_MPI_F77_BINDINGS_LAYER 1) -ELSE(WANT_MPI_PROFILING AND OMPI_WANT_F77_BINDINGS) - SET(WANT_MPI_F77_BINDINGS_LAYER 0) -ENDIF(WANT_MPI_PROFILING AND OMPI_WANT_F77_BINDINGS) - - -IF(WIN32) - - OMPI_DEF(OMPI_HAVE_CXX_EXCEPTION_SUPPORT 0 "Whether or not we have compiled with C++ exceptions support" 0 1) - - OMPI_DEF(OPAL_C_HAVE_VISIBILITY 1 "Whether C compiler supports -fvisibility." 0 1) - - OMPI_DEF(restrict " " "Define to equivalent of C99 restrict keyword, or to nothing if this is not supported.\n Do not define if restrict is supported directly." 0 1) - - OMPI_DEF(MCA_timer_IMPLEMENTATION_HEADER "opal/mca/timer/windows/timer_windows.h" "Header to include for timer implementation." 1 1) - - OMPI_DEF(MCA_memory_IMPLEMENTATION_HEADER "opal/mca/memory/base/empty.h" "Header to include for memory implementation." 1 1) - - OMPI_DEF(OPAL_ASSEMBLY_ARCH "OMPI_WINDOWS" "Architecture type of assembly to use for atomic operations." 0 1) - - OMPI_DEF(OPAL_HAVE_POSIX_THREADS 0 "Do we have POSIX threads." 0 1) - - OMPI_DEF(OPAL_HAVE_WEAK_SYMBOLS 0 "Whether we have weak symbols or not" 0 1) - - OMPI_DEF(OPAL_HAVE_SOLARIS_THREADS 0 "Do we have native Solaris threads." 0 1) - - OMPI_DEF(MCA_memcpy_IMPLEMENTATION_HEADER "opal/mca/memcpy/base/memcpy_base_default.h" "Header to include for memcpy implementation." 1 1) - - OMPI_DEF(OMPI_MPI_OFFSET_TYPE "long long" "Type of MPI_Offset." 0 1) - - OMPI_DEF(HAVE_DECL___FUNC__ 0 "Define to 1 if you have the declaration of `__func__', and to 0 if you don't." 0 1) - - OMPI_DEF_CACHE(MCA_mtl_DIRECT_CALL_COMPONENT " " STRING "Name of component to use for direct calls, if MCA_mtl_DIRECT_CALL is 1." 1 1) - - OMPI_DEF_CACHE(MCA_mtl_DIRECT_CALL_HEADER " " STRING "Header mtl includes to be direct called." 1 1) - - OMPI_DEF_CACHE(MCA_pml_DIRECT_CALL_COMPONENT " " STRING "Name of component to use for direct calls, if MCA_pml_DIRECT_CALL is 1." 1 1) - - OMPI_DEF_CACHE(MCA_pml_DIRECT_CALL_HEADER " " STRING "Header pml includes to be direct called." 1 1) - - OMPI_DEF_CACHE(OMPI_MPI_CONTRIBS none STRING "List of contributed package names that will be built." 1 1) - - CHECK_C_INLINE() - -ENDIF(WIN32) - - -GET_FILENAME_COMPONENT(C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME_WE) - -OMPI_DEF(OPAL_CC ${C_COMPILER_NAME} "OMPI underlying C compiler name." 1 1) - -OMPI_DEF(OPAL_CC_ABSOLUTE ${CMAKE_C_COMPILER} "OMPI underlying C compiler absolute path." 1 1) - -OMPI_DEF(WRAPPER_EXTRA_CFLAGS " " "Additional CFLAGS to pass through the wrapper compilers." 1 1) - -OMPI_DEF(WRAPPER_EXTRA_CXXFLAGS " " "Additional CXXFLAGS to pass through the wrapper compilers." 1 1) - -OMPI_DEF(WRAPPER_EXTRA_FCFLAGS " " "Additional FCFLAGS to pass through the wrapper compilers." 1 1) - -OMPI_DEF(WRAPPER_EXTRA_FFLAGS " " "Additional FFLAGS to pass through the wrapper compilers." 1 1) - -OMPI_DEF(WRAPPER_EXTRA_LDFLAGS " " "Additional LDFLAGS to pass through the wrapper compilers." 1 1) - -OMPI_DEF(WRAPPER_EXTRA_LIBS " " "Additional LIBS to pass through the wrapper compilers." 1 1) - - -GET_FILENAME_COMPONENT(CXX_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME_WE) -OMPI_DEF(OMPI_CXX ${CXX_COMPILER_NAME} "OMPI underlying C++ compiler name." 1 1) - -OMPI_DEF(OMPI_CXX_ABSOLUTE ${CMAKE_CXX_COMPILER} "OMPI underlying C++ compiler absolute path." 1 1) - -IF(OMPI_WANT_F77_BINDINGS) - GET_FILENAME_COMPONENT(F77_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME_WE) - OMPI_DEF(OMPI_F77 ${F77_COMPILER_NAME} "OMPI underlying Fortran 77 compiler name." 1 1) - OMPI_DEF(OMPI_F77_ABSOLUTE ${CMAKE_Fortran_COMPILER} "OMPI underlying Fortran 77 compiler absolute path" 1 1) -ELSE(OMPI_WANT_F77_BINDINGS) - OMPI_DEF(OMPI_F77 "none" "OMPI underlying Fortran 77 compiler name." 1 1) - OMPI_DEF(OMPI_F77_ABSOLUTE "none" "OMPI underlying Fortran 77 compiler absolute path" 1 1) -ENDIF(OMPI_WANT_F77_BINDINGS) - -IF(OMPI_WANT_F90_BINDINGS) - GET_FILENAME_COMPONENT(F90_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME_WE) - OMPI_DEF(OMPI_F90 ${F90_COMPILER_NAME} "OMPI underlying Fortran 90 compiler name." 1 1) - OMPI_DEF(OMPI_F90_ABSOLUTE ${CMAKE_Fortran_COMPILER} "OMPI underlying Fortran 90 compiler absolute path" 1 1) -ELSE(OMPI_WANT_F90_BINDINGS) - OMPI_DEF(OMPI_F90 "none" "OMPI underlying Fortran 90 compiler name." 1 1) - OMPI_DEF(OMPI_F90_ABSOLUTE "none" "OMPI underlying Fortran 90 compiler absolute path" 1 1) -ENDIF(OMPI_WANT_F90_BINDINGS) - -IF(HAVE_LONG_LONG) - OMPI_DEF(OPAL_HAVE_LONG_LONG 1 "Do not use outside of mpi.h.\n Define to 1 if the system has the type 'long long'." 0 1) -ENDIF(HAVE_LONG_LONG) - -IF(HAVE_PTRDIFF_T) - OMPI_DEF(OPAL_PTRDIFF_TYPE "ptrdiff_t" "Type to use for ptrdiff_t." 0 0) -ENDIF(HAVE_PTRDIFF_T) - -#The same logic as in opal_stdint.h -#8-bit -IF(SIZEOF_CHAR EQUAL 1) - IF(NOT HAVE_INT8_T) - OMPI_DEF(OPAL_ALIGNMENT_INT8 ${OPAL_ALIGNMENT_CHAR} "Alignment of `int8_t'." 0 1) - ELSE(NOT HAVE_INT8_T) - OMPI_DEF(OPAL_ALIGNMENT_INT8 ${OPAL_ALIGNMENT_INT8_T} "Alignment of `int8_t'." 0 1) - ENDIF(NOT HAVE_INT8_T) - - IF(NOT HAVE_UINT8_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT8 ${OPAL_ALIGNMENT_CHAR} "Alignment of `uint8_t'." 0 1) - ELSE(NOT HAVE_UINT8_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT8 ${OPAL_ALIGNMENT_UINT8_T} "Alignment of `uint8_t'." 0 1) - ENDIF(NOT HAVE_UINT8_T) -ELSE(SIZEOF_CHAR EQUAL 1) - MESSAGE(FATAL_ERROR "Failed to define 8-bit types.") -ENDIF(SIZEOF_CHAR EQUAL 1) - -#16-bit -IF(SIZEOF_SHORT EQUAL 2) - IF(NOT HAVE_INT16_T) - OMPI_DEF(OPAL_ALIGNMENT_INT16 ${OPAL_ALIGNMENT_SHORT} "Alignment of `int16_t'." 0 1) - ELSE(NOT HAVE_INT16_T) - OMPI_DEF(OPAL_ALIGNMENT_INT16 ${OPAL_ALIGNMENT_INT16_T} "Alignment of `int16_t'." 0 1) - ENDIF(NOT HAVE_INT16_T) - - IF(NOT HAVE_UINT16_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT16 ${OPAL_ALIGNMENT_SHORT} "Alignment of `uint16_t'." 0 1) - ELSE(NOT HAVE_UINT16_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT16 ${OPAL_ALIGNMENT_UINT16_T} "Alignment of `uint16_t'." 0 1) - ENDIF(NOT HAVE_UINT16_T) -ELSE(SIZEOF_SHORT EQUAL 2) - MESSAGE(FATAL_ERROR "Failed to define 16-bit types.") -ENDIF(SIZEOF_SHORT EQUAL 2) - -#32-bit -IF(SIZEOF_INT EQUAL 4) - IF(NOT HAVE_INT32_T) - OMPI_DEF(OPAL_ALIGNMENT_INT32 ${OPAL_ALIGNMENT_INT} "Alignment of `int32_t'." 0 1) - ELSE(NOT HAVE_INT32_T) - OMPI_DEF(OPAL_ALIGNMENT_INT32 ${OPAL_ALIGNMENT_INT32_T} "Alignment of `int32_t'." 0 1) - ENDIF(NOT HAVE_INT32_T) - - IF(NOT HAVE_UINT32_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT32 ${OPAL_ALIGNMENT_INT} "Alignment of `uint32_t'." 0 1) - ELSE(NOT HAVE_UINT32_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT32 ${OPAL_ALIGNMENT_UINT32_T} "Alignment of `uint32_t'." 0 1) - ENDIF(NOT HAVE_UINT32_T) -ELSEIF(SIZEOF_LONG EQUAL 4) - IF(NOT HAVE_INT32_T) - OMPI_DEF(OPAL_ALIGNMENT_INT32 ${OPAL_ALIGNMENT_LONG} "Alignment of `int32_t'." 0 1) - ELSE(NOT HAVE_INT32_T) - OMPI_DEF(OPAL_ALIGNMENT_INT32 ${OPAL_ALIGNMENT_INT32_T} "Alignment of `int32_t'." 0 1) - ENDIF(NOT HAVE_INT32_T) - - IF(NOT HAVE_UINT32_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT32 ${OPAL_ALIGNMENT_LONG} "Alignment of `uint32_t'." 0 1) - ELSE(NOT HAVE_UINT32_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT32 ${OPAL_ALIGNMENT_UINT32_T} "Alignment of `uint32_t'." 0 1) - ENDIF(NOT HAVE_UINT32_T) -ELSE(SIZEOF_INT EQUAL 4) - MESSAGE(FATAL_ERROR "Failed to define 8-bit types.") -ENDIF(SIZEOF_INT EQUAL 4) - -#64-bit -IF(SIZEOF_INT EQUAL 8) - IF(NOT HAVE_INT64_T) - OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_INT} "Alignment of `int64_t'." 0 1) - ELSE(NOT HAVE_INT64_T) - OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_INT64_T} "Alignment of `int64_t'." 0 1) - ENDIF(NOT HAVE_INT64_T) - - IF(NOT HAVE_UINT64_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_INT} "Alignment of `uint64_t'." 0 1) - ELSE(NOT HAVE_UINT64_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_UINT64_T} "Alignment of `uint64_t'." 0 1) - ENDIF(NOT HAVE_UINT64_T) -ELSEIF(SIZEOF_LONG EQUAL 8) - IF(NOT HAVE_INT64_T) - OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_LONG} "Alignment of `int64_t'." 0 1) - ELSE(NOT HAVE_INT64_T) - OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_INT64_T} "Alignment of `int64_t'." 0 1) - ENDIF(NOT HAVE_INT64_T) - - IF(NOT HAVE_UINT64_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_LONG} "Alignment of `uint64_t'." 0 1) - ELSE(NOT HAVE_UINT64_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_UINT64_T} "Alignment of `uint64_t'." 0 1) - ENDIF(NOT HAVE_UINT64_T) -ELSEIF(HAVE_LONG_LONG AND SIZEOF_LONG_LONG EQUAL 8) - IF(NOT HAVE_INT64_T) - OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_LONG_LONG} "Alignment of `int64_t'." 0 1) - ELSE(NOT HAVE_INT64_T) - OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_INT64_T} "Alignment of `int64_t'." 0 1) - ENDIF(NOT HAVE_INT64_T) - - IF(NOT HAVE_UINT64_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_LONG_LONG} "Alignment of `uint64_t'." 0 1) - ELSE(NOT HAVE_UINT64_T) - OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_UINT64_T} "Alignment of `uint64_t'." 0 1) - ENDIF(NOT HAVE_UINT64_T) -ELSE(SIZEOF_INT EQUAL 8) - MESSAGE(FATAL_ERROR "Failed to define 8-bit types.") -ENDIF(SIZEOF_INT EQUAL 8) - - -ENDMACRO(BEGIN_CONFIGURE) - - - -MACRO(END_CONFIGURE) - -IF(NOT WRITE_CONFIG_DONE) - FILE(APPEND ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake - "#include \"opal_config_bottom.h\"\n#endif /* OPAL_CONFIG_H */\n") - SET(WRITE_CONFIG_DONE TRUE CACHE INTERNAL "Whether to regenerate configure template.") -ENDIF(NOT WRITE_CONFIG_DONE) - -CONFIGURE_FILE(${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h) - -ENDMACRO(END_CONFIGURE) +# +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2008 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + + +MACRO(BEGIN_CONFIGURE) + +INCLUDE (CheckIncludeFileCXX) +INCLUDE (CheckIncludeFile) +INCLUDE (CheckFunctionExists) +INCLUDE (CheckSymbolExists) +INCLUDE (CheckLibraryExists) +INCLUDE (CheckTypeSize) +INCLUDE (CheckStructHasMember) +INCLUDE (CheckCXXSourceCompiles) +INCLUDE (CheckCSourceCompiles) +INCLUDE (ompi_define) +INCLUDE (ompi_base_checks) +INCLUDE (opal_functions) +INCLUDE (get_c_alignment) +INCLUDE (check_c_type_exists) +INCLUDE (check_c_inline) +INCLUDE (check_bool) + +OPTION(OPAL_CONFIG_REGEN "Whether we want to regenerate the configure template file." OFF) + +IF(${OPAL_CONFIG_REGEN} STREQUAL "ON") + SET(WRITE_CONFIG_DONE FALSE CACHE INTERNAL "Whether to regenerate configure template.") +ENDIF(${OPAL_CONFIG_REGEN} STREQUAL "ON") + +IF(NOT WRITE_CONFIG_DONE) + FILE(REMOVE ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake) + FILE(APPEND ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake + "/* opal/include/opal_config.h.cmake. Generated by CMake. */ + +/* -*- c -*- + * + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * Function: - OS, CPU and compiler dependent configuration + */ + +#ifndef OPAL_CONFIG_H +#define OPAL_CONFIG_H +\n\n +") +ENDIF(NOT WRITE_CONFIG_DONE) + + +OMPI_DEF(PACKAGE_NAME "Open MPI" "Define to the full name of this package." 1 1) + +OMPI_DEF(PACKAGE_TARNAME "openmpi" "Define to the one symbol short name of this package." 1 1) + +OMPI_DEF(OPAL_PACKAGE_STRING "Open MPI $ENV{USERNAME}@$ENV{COMPUTERNAME} Distribution" "Package/branding string for Open MPI" 1 1) + +OMPI_DEF(PACKAGE_BUGREPORT "http://www.open-mpi.org/community/help/" "Define to the address where bug reports for this package should be sent." 1 1) + +OMPI_DEF(OPAL_CONFIGURE_HOST $ENV{COMPUTERNAME} "Host on which configuration has been done." 1 1) + +OMPI_DEF(OPAL_CONFIGURE_USER $ENV{USERNAME} "User who has done the configuration." 1 1) + +OMPI_DEF(OMPI_BUILD_USER $ENV{USERNAME} "User who has built the package." 1 1) + +OMPI_DEF(OMPI_BUILD_HOST $ENV{COMPUTERNAME} "Host on which the package has been built." 1 1) + +OMPI_DEF(OPAL_ARCH "${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_SYSTEM}" "OMPI architecture string" 1 1) + + +INCLUDE(opal_get_version) + +OMPI_DEF(OMPI_RELEASE_DATE ${RELEASE_DATE} "Release date of the package" 1 1) + +OMPI_DEF(OPAL_RELEASE_DATE ${RELEASE_DATE} "Release date of the package" 1 1) + +OMPI_DEF(ORTE_RELEASE_DATE ${RELEASE_DATE} "Release date of the package" 1 1) + +OMPI_DEF(PACKAGE_VERSION ${OPAL_VERSION} "Define to the version of this package." 1 1) + +OMPI_DEF(PACKAGE_STRING "Open MPI ${PACKAGE_VERSION}" "Define to the full name and version of this package." 1 1) + + +# Get current time and date. +EXECUTE_PROCESS(COMMAND cmd /C time /t + OUTPUT_VARIABLE CURRENT_TIME) + +EXECUTE_PROCESS(COMMAND cmd /C date /t + OUTPUT_VARIABLE CURRENT_DATE) + +STRING (REPLACE "\n" "" CURRENT_TIME ${CURRENT_TIME}) +STRING (REPLACE "\n" "" CURRENT_DATE ${CURRENT_DATE}) +STRING (REGEX MATCH [.-/\0-9]+ CURRENT_DATE ${CURRENT_DATE}) +SET (OPAL_CONFIGURE_DATE "${CURRENT_TIME} ${CURRENT_DATE}" CACHE INTERNAL "OPAL_CONFIGURE_DATE") +SET (OMPI_BUILD_DATE "${CURRENT_TIME} ${CURRENT_DATE}" CACHE INTERNAL "OMPI_BUILD_DATE") + +OMPI_DEF(OPAL_CONFIGURE_DATE "${CURRENT_TIME} ${CURRENT_DATE}" "Configuration date." 1 1) +OMPI_DEF(OMPI_BUILD_DATE "${CURRENT_TIME} ${CURRENT_DATE}" "Build date." 1 1) + +OMPI_DEF(OMPI_BUILD_CFLAGS "/Od /Gm /EHsc /RTC1 /MDd" "C flags" 1 1) + + +SET(OMPI_BUILD_CPPFLAGS "\"-I${OpenMPI_SOURCE_DIR}/ + -I${OpenMPI_SOURCE_DIR}/opal + -I${OpenMPI_SOURCE_DIR}/opal/include + -I${OpenMPI_SOURCE_DIR}/ompi + -I${OpenMPI_SOURCE_DIR}/ompi/include + -I${OpenMPI_SOURCE_DIR}/orte + -I${OpenMPI_SOURCE_DIR}/orte/include + -I${OpenMPI_BINARY_DIR}/ + -I${OpenMPI_BINARY_DIR}/opal + -I${OpenMPI_BINARY_DIR}/opal/include + -I${OpenMPI_BINARY_DIR}/ompi + -I${OpenMPI_BINARY_DIR}/ompi/include + -I${OpenMPI_BINARY_DIR}/orte + -I${OpenMPI_BINARY_DIR}/orte/include + -I${OpenMPI_SOURCE_DIR}/contrib/platform/win32\"") + + +OMPI_DEF(OMPI_BUILD_CXXFLAGS "/Od /Gm /EHsc /RTC1 /MDd" "C++ flags" 1 1) + +SET(OMPI_BUILD_CXXCPPFLAGS ${OMPI_BUILD_CPPFLAGS}) + +OMPI_DEF(OMPI_BUILD_FFLAGS " " "F77 flags." 1 1) + +OMPI_DEF(OMPI_BUILD_FCFLAGS " " "F90 flags." 1 1) + +OMPI_DEF(OMPI_BUILD_LDFLAGS " " "LD flags." 1 1) + +OMPI_DEF(OMPI_BUILD_LIBS " " "Link libraries." 1 1) + +OMPI_DEF(OMPI_F90_BUILD_SIZE "small" "F90 build size." 1 1) + +OMPI_DEF(OMPI_BTL_SM_HAVE_KNEM 0 "If btl sm has knem." 0 1) + +IF(WIN32 AND MSVC) + INCLUDE(ompi_check_Microsoft) + OMPI_DEF(COMPILER_FAMILYNAME MICROSOFT "Compiler family name" 1 1) + OMPI_DEF(COMPILER_VERSION ${MSVC_VERSION} "Compiler version" 0 1) + OMPI_DEF(OPAL_BUILD_PLATFORM_COMPILER_FAMILYID 14 "Compiler family ID" 0 1) + OMPI_DEF(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME ${COMPILER_FAMILYNAME} "Compiler family name" 0 1) + OMPI_DEF(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR ${MSVC_VERSION} "Compiler version" 0 1) +ENDIF(WIN32 AND MSVC) + + +################################################################### +# Options # +################################################################### + +OPAL_WITH_OPTION_MIN_MAX_VALUE(processor_name 256 16 1024) + +OPAL_WITH_OPTION_MIN_MAX_VALUE(error_string 256 64 1024) + +OPAL_WITH_OPTION_MIN_MAX_VALUE(object_name 64 64 256) + +OPAL_WITH_OPTION_MIN_MAX_VALUE(info_key 36 34 255) + +OPAL_WITH_OPTION_MIN_MAX_VALUE(info_val 256 32 1024) + +OPAL_WITH_OPTION_MIN_MAX_VALUE(port_name 1024 255 2048) + +OPAL_WITH_OPTION_MIN_MAX_VALUE(datarep_string 128 64 256) + +OMPI_DEF_CACHE_VAR(OMPI_MPIEXT_COMPONENTS none STRING "Specify user defined MPI Extended Interface Components." 1 1) + +OMPI_DEF_OPT(MCA_ompi_mtl_DIRECT_CALL "Whether mtl should use direct calls instead of components." OFF) + +OMPI_DEF_OPT(MCA_ompi_pml_DIRECT_CALL "Whether pml should use direct calls instead of components." OFF) + +OMPI_DEF_OPT(MPI_PARAM_CHECK "Whether we want to check MPI parameters always, never, or decide at run-time." OFF) + +OMPI_DEF_OPT(OPAL_ENABLE_DEBUG "Whether we want developer-level debugging code or not." OFF) + +OMPI_DEF_OPT(OPAL_ENABLE_HETEROGENEOUS_SUPPORT "Enable features required for heterogeneous support." OFF) + +OMPI_DEF_OPT(OPAL_ENABLE_MEM_DEBUG "Whether we want the memory debug or not." OFF) + +OMPI_DEF_OPT(OPAL_ENABLE_MEM_PROFILE "Whether we want the memory profiling or not." OFF) + +OMPI_DEF_OPT(OMPI_ENABLE_MPI_PROFILING "Whether we want MPI profiling or not." ON) + +OMPI_DEF_OPT(OMPI_ENABLE_THREAD_MULTIPLE "Enable MPI Thread Multiple." OFF) + +OMPI_DEF(OMPI_ENABLE_PROGRESS_THREADS 0 "Hardcode the OMPI progress thread to be off." 0 1) + +OMPI_DEF(ORTE_ENABLE_PROGRESS_THREADS 0 "Hardcode the ORTE progress thread to be off." 0 1) + +OMPI_DEF_OPT(OPAL_ENABLE_MULTI_THREADS "Whether we should enable support for multiple user threads" OFF) + +OMPI_DEF_OPT(OPAL_ENABLE_PTY_SUPPORT "Whether we should use progress threads rather than polling." OFF) + +OMPI_DEF_OPT ( OMPI_GROUP_SPARSE "Wether we want sparse process groups." OFF) + +OMPI_DEF_OPT (OMPI_PROVIDE_MPI_FILE_INTERFACE "Whether OMPI should provide MPI File interface" ON) + +OMPI_DEF_OPT(OMPI_WANT_CXX_BINDINGS "Whether we want MPI cxx support or not." ON) + +OMPI_DEF_OPT(OMPI_WANT_F77_BINDINGS "Whether we want MPI F77 support or not." OFF) + +OMPI_DEF_OPT(OMPI_WANT_F90_BINDINGS "Whether we want MPI F90 support or not." OFF) + +OMPI_DEF_OPT(OMPI_WANT_MPI_CXX_SEEK "Do we want to try to work around C++ bindings SEEK_* issue?" OFF) + +OMPI_DEF_OPT(OMPI_WANT_PERUSE "Whether the peruse interface should be enabled." OFF) + +OMPI_DEF_OPT( OPAL_WANT_PRETTY_PRINT_STACKTRACE "Whether we want pretty-print stack trace feature." ON) + +OMPI_DEF_OPT( OPAL_WANT_SMP_LOCKS "Whether we want to have smp locks in atomic ops or not." ON) + +OMPI_DEF_OPT( OPAL_ENABLE_FT "Enable fault tolerance general components and logic." ON) + +OMPI_DEF_OPT( OPAL_ENABLE_FT_CR "Enable fault tolerance checkpoint/restart components and logic." OFF) + +OMPI_DEF_OPT( OPAL_ENABLE_FT_THREAD "Enable fault tolerance thread in Open PAL." OFF) + +OMPI_DEF_OPT( OPAL_ENABLE_IPV6 "Enable IPv6 support, but only if the underlying system supports it." ON) + +OMPI_DEF_OPT( OPAL_ENABLE_TRACE "Enable run-time tracing of internal functions." OFF) + +OMPI_DEF_OPT( ORTE_DISABLE_FULL_SUPPORT "Enable full RTE support (Default OFF)." OFF) + +OMPI_DEF_OPT( ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT "Whether we want orterun to effect \"--prefix $prefix\" by default." ON) + +OMPI_DEF_OPT( OMPI_WANT_MPI_INTERFACE_WARNING "enable warnings in wrong (e.g. deprecated) usage in user-level code (default: disabled)." OFF) + +OMPI_DEF_OPT(ORTE_WANT_CCP "Whether we want to have the CCP remote process launch support." ON) + +OMPI_DEF_OPT(OPAL_WANT_LIBLTDL "Whether we want to enable DSO build for Windows." OFF) + +OMPI_DEF_OPT(OMPI_WANT_NETWORK_DIRECT "Whether we want to enable Network Direct support." ON) + +OMPI_DEF_OPT(ORTE_WANT_NOTIFIER_LOG_EVENT "if the notifier_log_event should be enabled" OFF) + +OMPI_DEF_OPT(OMPI_WANT_OFED "Whether we want to enable OFED support." ON) + +OMPI_DEF_OPT(OMPI_WANT_WINVERBS "Whether we want to enable Winverbs support." ON) + +OMPI_DEF_OPT(OPAL_ENABLE_CRDEBUG "Whether we want checkpoint/restart enabled debugging functionality or not." OFF) + +OMPI_DEF_OPT(OPAL_EVENT_HAVE_THREAD_SUPPORT "Whether we want to enable event library internal thread support." OFF) + +IF (NOT MSVC) + +################################################################### +# Check headers # +################################################################### + + +OMPI_CHECK_INCLUDE_FILE (alloca.h HAVE_ALLOCA_H) + +OMPI_CHECK_INCLUDE_FILE (arpa/inet.h HAVE_ARPA_INET_H) + +OMPI_CHECK_INCLUDE_FILE (crt_externs.h HAVE_CRT_EXTERNS_H) + +OMPI_CHECK_INCLUDE_FILE (dirent.h HAVE_DIRENT_H) + +OMPI_CHECK_INCLUDE_FILE (dlfcn.h HAVE_DLFCN_H) + +OMPI_CHECK_INCLUDE_FILE (err.h HAVE_ERR_H) + +OMPI_CHECK_INCLUDE_FILE (execinfo.h HAVE_EXECINFO_H) + +OMPI_CHECK_INCLUDE_FILE (fcntl.h HAVE_FCNTL_H) + +OMPI_CHECK_INCLUDE_FILE (grp.h HAVE_GRP_H) + +OMPI_CHECK_INCLUDE_FILE (ifaddrs.h HAVE_IFADDRS_H) + +OMPI_CHECK_INCLUDE_FILE (inttypes.h HAVE_INTTYPES_H) + +OMPI_CHECK_INCLUDE_FILE (libcr.h HAVE_LIBCR_H) + +OMPI_CHECK_INCLUDE_FILE (libgen.h HAVE_LIBGEN_H) + +OMPI_CHECK_INCLUDE_FILE (libutil.h HAVE_LIBUTIL_H) + +OMPI_CHECK_INCLUDE_FILE (libxcpu.h HAVE_LIBXCPU_H) + +OMPI_CHECK_INCLUDE_FILE (mach/mach_time.h HAVE_MACH_MACH_TIME_H) + +OMPI_CHECK_INCLUDE_FILE (mach/mach_vm.h HAVE_MACH_MACH_VM_H) + +OMPI_CHECK_INCLUDE_FILE (netdb.h HAVE_NETDB_H) + +OMPI_CHECK_INCLUDE_FILE (netinet/in.h HAVE_NETINET_IN_H) + +OMPI_CHECK_INCLUDE_FILE (netinet/tcp.h HAVE_NETINET_TCP_H) + +OMPI_CHECK_INCLUDE_FILE (net/if.h HAVE_NET_IF_H) + +OMPI_CHECK_INCLUDE_FILE (pmapi.h HAVE_PMAPI_H) + +OMPI_CHECK_INCLUDE_FILE (poll.h HAVE_POLL_H) + +OMPI_CHECK_INCLUDE_FILE (pthread.h HAVE_PTHREAD_H) + +OMPI_CHECK_INCLUDE_FILE (pty.h HAVE_PTY_H) + +OMPI_CHECK_INCLUDE_FILE (pwd.h HAVE_PWD_H) + +OMPI_CHECK_INCLUDE_FILE (regex.h HAVE_REGEX_H) + +OMPI_CHECK_INCLUDE_FILE (sched.h HAVE_SCHED_H) + +OMPI_CHECK_INCLUDE_FILE (stdbool.h HAVE_STDBOOL_H) + +OMPI_CHECK_INCLUDE_FILE (stdint.h HAVE_STDINT_H) + +OMPI_CHECK_INCLUDE_FILE (strings.h HAVE_STRINGS_H) + +OMPI_CHECK_INCLUDE_FILE (stropts.h HAVE_STROPTS_H) + +OMPI_CHECK_INCLUDE_FILE (syslog.h HAVE_SYSLOG_H) + +OMPI_CHECK_INCLUDE_FILE (sys/bproc_common.h HAVE_SYS_BPROC_COMMON_H) + +OMPI_CHECK_INCLUDE_FILE (sys/bproc.h HAVE_SYS_BPROC_H) + +OMPI_CHECK_INCLUDE_FILE (sys/devpoll.h HAVE_SYS_DEVPOLL_H) + +OMPI_CHECK_INCLUDE_FILE (sys/epoll.h HAVE_SYS_EPOLL_H) + +OMPI_CHECK_INCLUDE_FILE (sys/event.h HAVE_SYS_EVENT_H) + +OMPI_CHECK_INCLUDE_FILE (sys/fcntl.h HAVE_SYS_FCNTL_H) + +OMPI_CHECK_INCLUDE_FILE (sys/ioctl.h HAVE_SYS_IOCTL_H) + +OMPI_CHECK_INCLUDE_FILE (sys/ipc.h HAVE_SYS_IPC_H) + +OMPI_CHECK_INCLUDE_FILE (sys/mman.h HAVE_SYS_MMAN_H) + +OMPI_CHECK_INCLUDE_FILE (sys/param.h HAVE_SYS_PARAM_H) + +OMPI_CHECK_INCLUDE_FILE (sys/queue.h HAVE_SYS_QUEUE_H) + +OMPI_CHECK_INCLUDE_FILE (sys/resource.h HAVE_SYS_RESOURCE_H) + +OMPI_CHECK_INCLUDE_FILE (sys/select.h HAVE_SYS_SELECT_H) + +OMPI_CHECK_INCLUDE_FILE (sys/socket.h HAVE_SYS_SOCKET_H) + +OMPI_CHECK_INCLUDE_FILE (sys/sockio.h HAVE_SYS_SOCKIO_H) + +OMPI_CHECK_INCLUDE_FILE (sys/statvfs.h HAVE_SYS_STATVFS_H) + +OMPI_CHECK_INCLUDE_FILE (sys/sysctl.h HAVE_SYS_SYSCTL_H) + +OMPI_CHECK_INCLUDE_FILE (sys/time.h HAVE_SYS_TIME_H) + +OMPI_CHECK_INCLUDE_FILE (sys/tree.h HAVE_SYS_TREE_H) + +OMPI_CHECK_INCLUDE_FILE (sys/uio.h HAVE_SYS_UIO_H) + +OMPI_CHECK_INCLUDE_FILE (sys/utsname.h HAVE_SYS_UTSNAME_H) + +OMPI_CHECK_INCLUDE_FILE (sys/wait.h HAVE_SYS_WAIT_H) + +OMPI_CHECK_INCLUDE_FILE (termios.h HAVE_TERMIOS_H) + +OMPI_CHECK_INCLUDE_FILE (sys/time.h HAVE_TIMERADD) + + +OMPI_CHECK_INCLUDE_FILE (ucontext.h HAVE_UCONTEXT_H) + +OMPI_CHECK_INCLUDE_FILE (ulimit.h HAVE_ULIMIT_H) + +OMPI_CHECK_INCLUDE_FILE (unistd.h HAVE_UNISTD_H) + +OMPI_CHECK_INCLUDE_FILE (util.h HAVE_UTIL_H) + +OMPI_CHECK_INCLUDE_FILE (utmp.h HAVE_UTMP_H) + +OMPI_CHECK_INCLUDE_FILE (mx_extension.h MX_HAVE_EXTENSIONS_H) + + +################################################################### +# Check functions # +################################################################### + +OMPI_CHECK_FUNCTION_EXISTS (asprintf HAVE_ASPRINTF) + +OMPI_CHECK_FUNCTION_EXISTS (backtrace HAVE_BACKTRACE) + +OMPI_CHECK_FUNCTION_EXISTS (cnos_pm_barrier HAVE_CNOS_PM_BARRIER) + +OMPI_CHECK_FUNCTION_EXISTS (dirname HAVE_DIRNAME) + +OMPI_CHECK_FUNCTION_EXISTS (dlsym HAVE_DLSYM) + +OMPI_CHECK_FUNCTION_EXISTS (epoll HAVE_EPOLL) + +OMPI_CHECK_FUNCTION_EXISTS (epoll_ctl HAVE_EPOLL_CTL) + +OMPI_CHECK_FUNCTION_EXISTS (fcntl HAVE_FCNTL) + +OMPI_CHECK_FUNCTION_EXISTS (fork HAVE_FORK) + +OMPI_CHECK_FUNCTION_EXISTS (getpwuid HAVE_GETPWUID) + +OMPI_CHECK_FUNCTION_EXISTS (gettimeofday HAVE_GETTIMEOFDAY) + +OMPI_CHECK_FUNCTION_EXISTS (htonl HAVE_HTONL) + +OMPI_CHECK_FUNCTION_EXISTS (htons HAVE_HTONS) + +OMPI_CHECK_FUNCTION_EXISTS (ibv_fork_init HAVE_IBV_FORK_INIT) + +OMPI_CHECK_FUNCTION_EXISTS (ibv_get_device_list HAVE_IBV_GET_DEVICE_LIST) + +OMPI_CHECK_FUNCTION_EXISTS (ibv_resize_cq HAVE_IBV_RESIZE_CQ) + +OMPI_CHECK_FUNCTION_EXISTS (killrank HAVE_KILLRANK) + +OMPI_CHECK_FUNCTION_EXISTS (kqueue KQUEUE) + +OMPI_CHECK_FUNCTION_EXISTS (mach_vm_read HAVE_MACH_MACH_VM_READ) + +OMPI_CHECK_FUNCTION_EXISTS (mach_vm_region HAVE_MACH_VM_REGION) + +OMPI_CHECK_FUNCTION_EXISTS (mallopt HAVE_MALLOPT) + +OMPI_CHECK_FUNCTION_EXISTS (mmap HAVE_MMAP) + +OMPI_CHECK_FUNCTION_EXISTS (ntohl HAVE_NTOHL) + +OMPI_CHECK_FUNCTION_EXISTS (ntohs HAVE_NTOHS) + +OMPI_CHECK_FUNCTION_EXISTS (openpty HAVE_OPENPTY) + +OMPI_CHECK_FUNCTION_EXISTS (pipe HAVE_PIPE) + +OMPI_CHECK_FUNCTION_EXISTS (pm_cycles HAVE_PM_CYCLES) + +OMPI_CHECK_FUNCTION_EXISTS (poll HAVE_POLL) + +OMPI_CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN) + +OMPI_CHECK_FUNCTION_EXISTS (printstack HAVE_PRINTSTACK) + +OMPI_CHECK_FUNCTION_EXISTS (ptsname HAVE_PTSNAME) + +OMPI_CHECK_FUNCTION_EXISTS (regcmp HAVE_REGCMP) + +OMPI_CHECK_FUNCTION_EXISTS (regexec HAVE_REGEXEC) + +OMPI_CHECK_FUNCTION_EXISTS (regfree HAVE_REGFREE) + +OMPI_CHECK_FUNCTION_EXISTS (sched_yield HAVE_SCHED_YIELD) + +OMPI_CHECK_FUNCTION_EXISTS (select HAVE_SELECT) + +OMPI_CHECK_FUNCTION_EXISTS (setsid HAVE_SETSID) + +OMPI_CHECK_FUNCTION_EXISTS (sigtimedwait HAVE_SIGTIMEDWAIT) + +OMPI_CHECK_FUNCTION_EXISTS (snprintf HAVE_SNPRINTF) + +OMPI_CHECK_FUNCTION_EXISTS (strsignal HAVE_STRSIGNAL) + +OMPI_CHECK_FUNCTION_EXISTS (syscall HAVE_SYSCALL) + +OMPI_CHECK_FUNCTION_EXISTS (sysconf HAVE_SYSCONF) + +OMPI_CHECK_FUNCTION_EXISTS (syslog HAVE_SYSLOG) + +OMPI_CHECK_FUNCTION_EXISTS (tcgetpgrp HAVE_TCGETPGRP) + +OMPI_CHECK_FUNCTION_EXISTS (vasprintf HAVE_VASPRINTF) + +OMPI_CHECK_FUNCTION_EXISTS (vm_read_overwrite HAVE_VM_READ_OVERWRITE) + +OMPI_CHECK_FUNCTION_EXISTS (waitpid HAVE_WAITPIN) + +OMPI_CHECK_FUNCTION_EXISTS (_NSGetEnviron HAVE__NSGETENVIRON) + +OMPI_CHECK_FUNCTION_EXISTS (__mmap HAVE___MMAP) + +OMPI_CHECK_FUNCTION_EXISTS (__munmap HAVE___MUNMAP) + +OMPI_CHECK_SYMBOL_EXISTS (F_SETFD fcntl.h HAVE_SETFD) + +OMPI_CHECK_SYMBOL_EXISTS (TAILQ_FOREACH "sys/queue.h" HAVE_TAILQFOREACH) + +OMPI_CHECK_SYMBOL_EXISTS (IBV_EVENT_CLIENT_REREGISTER "" HAVE_DECL_IBV_EVENT_CLIENT_REREGISTER) + +OMPI_CHECK_SYMBOL_EXISTS (RLIMIT_NPROC "" HAVE_DECL_RLIMIT_NPROC) + +OMPI_CHECK_SYMBOL_EXISTS (sbrk "" HAVE_DECL_SBRK) + +OMPI_CHECK_SYMBOL_EXISTS (__func__ "" HAVE_DECL___FUNC__) + +OMPI_CHECK_STRUCT_HAS_MEMBER(ppc_thread_state_t srr0 mach/ppc/thread_status.h HAVE_PPC_THREAD_STATE_T_SRR0) + +OMPI_CHECK_STRUCT_HAS_MEMBER(siginfo_t si_band sys/siginfo.h HAVE_SIGINFO_T_SI_BAND) + +OMPI_CHECK_STRUCT_HAS_MEMBER(siginfo_t si_fd sys/siginfo.h HAVE_SIGINFO_T_SI_FD) + +OMPI_CHECK_STRUCT_HAS_MEMBER("struct dirent" d_type dirent.h HAVE_STRUCT_DIRENT_D_TYPE) + +ENDIF (NOT MSVC) + +################################################################### +# Check data type # +################################################################### + + +OMPI_CHECK_TYPES(char CHAR none c) + +OMPI_CHECK_TYPES(wchar WCHAR none c) + +OMPI_CHECK_TYPES(double DOUBLE none c) + +OMPI_CHECK_TYPES(float FLOAT none c) + +OMPI_CHECK_TYPES(int INT none c) + +OMPI_CHECK_BOOL() + +OMPI_CHECK_TYPES(short SHORT none c) + +OMPI_CHECK_TYPES(long LONG none c) + +OMPI_CHECK_TYPES("long double" LONG_DOUBLE none c) + +OMPI_CHECK_TYPES("long long" LONG_LONG none c) + +OMPI_CHECK_TYPES ("unsigned int" UNSIGNED_INT none c) + +OMPI_CHECK_TYPES ("unsigned short" UNSIGNED_SHORT none c) + +OMPI_CHECK_TYPES ("unsigned long long" UNSIGNED_LONG_LONG none c) + +OMPI_CHECK_TYPES("unsigned long double" UNSIGNED_LONG_DOUBLE none c) + +OMPI_CHECK_TYPES ("unsigned char" UNSIGNED_CHAR none c) + +OMPI_CHECK_TYPES("float _Complex" FLOAT_COMPLEX none c) + +OMPI_CHECK_TYPES("double _Complex" DOUBLE_COMPLEX none c) + +OMPI_CHECK_TYPES("long double _Complex" LONG_DOUBLE_COMPLEX none c) + +OMPI_CHECK_TYPES(size_t SIZE_T none c) + +OMPI_CHECK_TYPES(ssize_t SSIZE_T none c) + +OMPI_CHECK_TYPES("void *" VOID_P none c) + +OMPI_CHECK_TYPES(pid_t PID_T "int" c) + +OMPI_CHECK_TYPES(ptrdiff_t PTRDIFF_T "int" c) + +OMPI_CHECK_TYPES (mode_t MODE_T none c) + +OMPI_CHECK_TYPES (int8_t INT8_T none c) + +OMPI_CHECK_TYPES (int16_t INT16_T none c) + +OMPI_CHECK_TYPES (int32_t INT32_T none c) + +OMPI_CHECK_TYPES (int64_t INT64_T none c) + +OMPI_CHECK_TYPES (int128_t INT128_T none c) + +OMPI_CHECK_TYPES (intptr_t INTPTR_T none c) + +OMPI_CHECK_TYPES (uint8_t UINT8_T none c) + +OMPI_CHECK_TYPES (uint16_t UINT16_T none c) + +OMPI_CHECK_TYPES (uint32_t UINT32_T none c) + +OMPI_CHECK_TYPES (uint64_t UINT64_T none c) + +OMPI_CHECK_TYPES (uint128_t UINT128_T none c) + +OMPI_CHECK_TYPES (uintptr_t UINTPTR_T none c) + + +################################################################### +# Check Fortran 77 types # +################################################################### +INCLUDE(setup_F77) +INCLUDE(f77_check) +INCLUDE(f77_check_real16_c_equiv) +INCLUDE(f77_get_value_true) +INCLUDE(f77_get_fortran_handle_max) + +IF(WIN32) + OMPI_DEF(ompi_fortran_bogus_type_t "int" "A bogus type that allows us to have sentinel type values that are still valid." 0 1) +ENDIF(WIN32) + +# We want to set the #define's for all of these, so invoke the macros +# regardless of whether we have F77 support or not. +OMPI_F77_CHECK("CHARACTER" "yes" "char;int32_t;int;int64_t;long long;long" "-1") +OMPI_F77_CHECK("LOGICAL" "yes" "char;int;long long;long" "-1") +OMPI_F77_CHECK("LOGICAL*1" "yes" "char;short;int;long long;long" "1") +OMPI_F77_CHECK("LOGICAL*2" "yes" "short;int;long long;long" "2") +OMPI_F77_CHECK("LOGICAL*4" "yes" "int;long long;long" "4") +OMPI_F77_CHECK("LOGICAL*8" "yes" "int;long long;long" "8") +OMPI_F77_CHECK("INTEGER" "yes" "int;long long;long" "-1") +OMPI_F77_CHECK("INTEGER*1" "no" "char;short;int;long long;long" "1") +OMPI_F77_CHECK("INTEGER*2" "no" "short;int;long long;long" "2") +OMPI_F77_CHECK("INTEGER*4" "no" "int;long long;long" "4") +OMPI_F77_CHECK("INTEGER*8" "no" "int;long long;long" "8") +OMPI_F77_CHECK("INTEGER*16" "no" "int;long long;long" "16") + +OMPI_F77_CHECK("REAL" "yes" "float;double;long double" "-1") +OMPI_F77_CHECK("REAL*2" "no" "float;double;long double" "2") +OMPI_F77_CHECK("REAL*4" "no" "float;double;long double" "4") +OMPI_F77_CHECK("REAL*8" "no" "float;double;long double" "8") +OMPI_F77_CHECK("REAL*16" "no" "float;double;long double" "16") +OMPI_F77_CHECK("DOUBLE PRECISION" "yes" "float;double;long double" "-1") + +OMPI_F77_CHECK("COMPLEX" "yes" "" "-1") +OMPI_F77_CHECK("DOUBLE COMPLEX" "yes" "" "-1") + +# The complex*N tests are a bit different (note: the complex tests are +# the same as all the rest, because complex is a composite of two +# reals, which we *have* to have. It's only the complex*N tests that +# are different). The fortran complex types are composites of the +# real*(N/2) types. So for us to support complex*N, two conditions +# must be true: +# +# a) we must support real*(N/2) (i.e., compiler supports it and we +# have a back-end C type for it) +# b) compiler supports complex*N + +OMPI_F77_CHECK("COMPLEX*8" "no" "" "8") +OMPI_F77_CHECK("COMPLEX*16" "no" "" "16") +OMPI_F77_CHECK("COMPLEX*32" "no" "" "32") + +OMPI_F77_CHECK_REAL16_C_EQUIV() + +# Regardless of whether we have fortran bindings, or even a fortran +# compiler, get the max value for a fortran MPI handle (this macro +# handles the case where we don't have a fortran compiler). + +OMPI_F77_GET_FORTRAN_HANDLE_MAX() + +# +# Check for Fortran compilers value of TRUE and for the correct assumption +# on LOGICAL for conversion into what C considers to be a true value +# +OMPI_F77_GET_VALUE_TRUE() +#OMPI_F77_CHECK_LOGICAL_ARRAY + +# +# There are 2 layers to the MPI f77 layer. The only extra thing that +# determine f77 bindings is that fortran can be disabled by user. In +# such cases, we need to not build the target at all. One layer +# generates MPI_f77* bindings. The other layer generates PMPI_f77* +# bindings. The following conditions determine whether each (or both) +# these layers are built. +# +# Superceeding clause: +# - fortran77 bindings should be enabled, else everything is +# disabled +# 1. MPI_f77* bindings are needed if: +# - Profiling is not required +# - Profiling is required but weak symbols are not +# supported +# 2. PMPI_* bindings are needed if profiling is required. Hence we +# define 2 conditionals which tell us whether each of these layers +# need to be built or NOT +# + +IF(NOT WANT_MPI_PROFILING OR OMPI_PROFILING_COMPILE_SEPARATELY AND OMPI_WANT_F77_BINDINGS) + SET(WANT_MPI_F77_BINDINGS_LAYER 1) +ELSE(NOT WANT_MPI_PROFILING OR OMPI_PROFILING_COMPILE_SEPARATELY AND OMPI_WANT_F77_BINDINGS) + SET(WANT_MPI_F77_BINDINGS_LAYER 0) +ENDIF(NOT WANT_MPI_PROFILING OR OMPI_PROFILING_COMPILE_SEPARATELY AND OMPI_WANT_F77_BINDINGS) + +IF(WANT_MPI_PROFILING AND OMPI_WANT_F77_BINDINGS) + SET(WANT_MPI_F77_BINDINGS_LAYER 1) +ELSE(WANT_MPI_PROFILING AND OMPI_WANT_F77_BINDINGS) + SET(WANT_MPI_F77_BINDINGS_LAYER 0) +ENDIF(WANT_MPI_PROFILING AND OMPI_WANT_F77_BINDINGS) + + +IF(WIN32) + + OMPI_DEF(OMPI_HAVE_CXX_EXCEPTION_SUPPORT 0 "Whether or not we have compiled with C++ exceptions support" 0 1) + + OMPI_DEF(OPAL_C_HAVE_VISIBILITY 1 "Whether C compiler supports -fvisibility." 0 1) + + OMPI_DEF(restrict " " "Define to equivalent of C99 restrict keyword, or to nothing if this is not supported.\n Do not define if restrict is supported directly." 0 1) + + OMPI_DEF(MCA_timer_IMPLEMENTATION_HEADER "opal/mca/timer/windows/timer_windows.h" "Header to include for timer implementation." 1 1) + + OMPI_DEF(MCA_memory_IMPLEMENTATION_HEADER "opal/mca/memory/base/empty.h" "Header to include for memory implementation." 1 1) + + OMPI_DEF(OPAL_ASSEMBLY_ARCH "OMPI_WINDOWS" "Architecture type of assembly to use for atomic operations." 0 1) + + OMPI_DEF(OPAL_HAVE_POSIX_THREADS 0 "Do we have POSIX threads." 0 1) + + OMPI_DEF(OPAL_HAVE_WEAK_SYMBOLS 0 "Whether we have weak symbols or not" 0 1) + + OMPI_DEF(OPAL_HAVE_SOLARIS_THREADS 0 "Do we have native Solaris threads." 0 1) + + OMPI_DEF(MCA_memcpy_IMPLEMENTATION_HEADER "opal/mca/memcpy/base/memcpy_base_default.h" "Header to include for memcpy implementation." 1 1) + + OMPI_DEF(OMPI_MPI_OFFSET_TYPE "long long" "Type of MPI_Offset." 0 1) + + OMPI_DEF(HAVE_DECL___FUNC__ 0 "Define to 1 if you have the declaration of `__func__', and to 0 if you don't." 0 1) + + OMPI_DEF_CACHE(MCA_mtl_DIRECT_CALL_COMPONENT " " STRING "Name of component to use for direct calls, if MCA_mtl_DIRECT_CALL is 1." 1 1) + + OMPI_DEF_CACHE(MCA_mtl_DIRECT_CALL_HEADER " " STRING "Header mtl includes to be direct called." 1 1) + + OMPI_DEF_CACHE(MCA_pml_DIRECT_CALL_COMPONENT " " STRING "Name of component to use for direct calls, if MCA_pml_DIRECT_CALL is 1." 1 1) + + OMPI_DEF_CACHE(MCA_pml_DIRECT_CALL_HEADER " " STRING "Header pml includes to be direct called." 1 1) + + OMPI_DEF_CACHE(OMPI_MPI_CONTRIBS none STRING "List of contributed package names that will be built." 1 1) + + CHECK_C_INLINE() + +ENDIF(WIN32) + + +GET_FILENAME_COMPONENT(C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME_WE) + +OMPI_DEF(OPAL_CC ${C_COMPILER_NAME} "OMPI underlying C compiler name." 1 1) + +OMPI_DEF(OPAL_CC_ABSOLUTE ${CMAKE_C_COMPILER} "OMPI underlying C compiler absolute path." 1 1) + +OMPI_DEF(WRAPPER_EXTRA_CFLAGS " " "Additional CFLAGS to pass through the wrapper compilers." 1 1) + +OMPI_DEF(WRAPPER_EXTRA_CXXFLAGS " " "Additional CXXFLAGS to pass through the wrapper compilers." 1 1) + +OMPI_DEF(WRAPPER_EXTRA_FCFLAGS " " "Additional FCFLAGS to pass through the wrapper compilers." 1 1) + +OMPI_DEF(WRAPPER_EXTRA_FFLAGS " " "Additional FFLAGS to pass through the wrapper compilers." 1 1) + +OMPI_DEF(WRAPPER_EXTRA_LDFLAGS " " "Additional LDFLAGS to pass through the wrapper compilers." 1 1) + +OMPI_DEF(WRAPPER_EXTRA_LIBS " " "Additional LIBS to pass through the wrapper compilers." 1 1) + + +GET_FILENAME_COMPONENT(CXX_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME_WE) +OMPI_DEF(OMPI_CXX ${CXX_COMPILER_NAME} "OMPI underlying C++ compiler name." 1 1) + +OMPI_DEF(OMPI_CXX_ABSOLUTE ${CMAKE_CXX_COMPILER} "OMPI underlying C++ compiler absolute path." 1 1) + +IF(OMPI_WANT_F77_BINDINGS) + GET_FILENAME_COMPONENT(F77_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME_WE) + OMPI_DEF(OMPI_F77 ${F77_COMPILER_NAME} "OMPI underlying Fortran 77 compiler name." 1 1) + OMPI_DEF(OMPI_F77_ABSOLUTE ${CMAKE_Fortran_COMPILER} "OMPI underlying Fortran 77 compiler absolute path" 1 1) +ELSE(OMPI_WANT_F77_BINDINGS) + OMPI_DEF(OMPI_F77 "none" "OMPI underlying Fortran 77 compiler name." 1 1) + OMPI_DEF(OMPI_F77_ABSOLUTE "none" "OMPI underlying Fortran 77 compiler absolute path" 1 1) +ENDIF(OMPI_WANT_F77_BINDINGS) + +IF(OMPI_WANT_F90_BINDINGS) + GET_FILENAME_COMPONENT(F90_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME_WE) + OMPI_DEF(OMPI_F90 ${F90_COMPILER_NAME} "OMPI underlying Fortran 90 compiler name." 1 1) + OMPI_DEF(OMPI_F90_ABSOLUTE ${CMAKE_Fortran_COMPILER} "OMPI underlying Fortran 90 compiler absolute path" 1 1) +ELSE(OMPI_WANT_F90_BINDINGS) + OMPI_DEF(OMPI_F90 "none" "OMPI underlying Fortran 90 compiler name." 1 1) + OMPI_DEF(OMPI_F90_ABSOLUTE "none" "OMPI underlying Fortran 90 compiler absolute path" 1 1) +ENDIF(OMPI_WANT_F90_BINDINGS) + +IF(HAVE_LONG_LONG) + OMPI_DEF(OPAL_HAVE_LONG_LONG 1 "Do not use outside of mpi.h.\n Define to 1 if the system has the type 'long long'." 0 1) +ENDIF(HAVE_LONG_LONG) + +IF(HAVE_PTRDIFF_T) + OMPI_DEF(OPAL_PTRDIFF_TYPE "ptrdiff_t" "Type to use for ptrdiff_t." 0 0) +ENDIF(HAVE_PTRDIFF_T) + +#The same logic as in opal_stdint.h +#8-bit +IF(SIZEOF_CHAR EQUAL 1) + IF(NOT HAVE_INT8_T) + OMPI_DEF(OPAL_ALIGNMENT_INT8 ${OPAL_ALIGNMENT_CHAR} "Alignment of `int8_t'." 0 1) + ELSE(NOT HAVE_INT8_T) + OMPI_DEF(OPAL_ALIGNMENT_INT8 ${OPAL_ALIGNMENT_INT8_T} "Alignment of `int8_t'." 0 1) + ENDIF(NOT HAVE_INT8_T) + + IF(NOT HAVE_UINT8_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT8 ${OPAL_ALIGNMENT_CHAR} "Alignment of `uint8_t'." 0 1) + ELSE(NOT HAVE_UINT8_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT8 ${OPAL_ALIGNMENT_UINT8_T} "Alignment of `uint8_t'." 0 1) + ENDIF(NOT HAVE_UINT8_T) +ELSE(SIZEOF_CHAR EQUAL 1) + MESSAGE(FATAL_ERROR "Failed to define 8-bit types.") +ENDIF(SIZEOF_CHAR EQUAL 1) + +#16-bit +IF(SIZEOF_SHORT EQUAL 2) + IF(NOT HAVE_INT16_T) + OMPI_DEF(OPAL_ALIGNMENT_INT16 ${OPAL_ALIGNMENT_SHORT} "Alignment of `int16_t'." 0 1) + ELSE(NOT HAVE_INT16_T) + OMPI_DEF(OPAL_ALIGNMENT_INT16 ${OPAL_ALIGNMENT_INT16_T} "Alignment of `int16_t'." 0 1) + ENDIF(NOT HAVE_INT16_T) + + IF(NOT HAVE_UINT16_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT16 ${OPAL_ALIGNMENT_SHORT} "Alignment of `uint16_t'." 0 1) + ELSE(NOT HAVE_UINT16_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT16 ${OPAL_ALIGNMENT_UINT16_T} "Alignment of `uint16_t'." 0 1) + ENDIF(NOT HAVE_UINT16_T) +ELSE(SIZEOF_SHORT EQUAL 2) + MESSAGE(FATAL_ERROR "Failed to define 16-bit types.") +ENDIF(SIZEOF_SHORT EQUAL 2) + +#32-bit +IF(SIZEOF_INT EQUAL 4) + IF(NOT HAVE_INT32_T) + OMPI_DEF(OPAL_ALIGNMENT_INT32 ${OPAL_ALIGNMENT_INT} "Alignment of `int32_t'." 0 1) + ELSE(NOT HAVE_INT32_T) + OMPI_DEF(OPAL_ALIGNMENT_INT32 ${OPAL_ALIGNMENT_INT32_T} "Alignment of `int32_t'." 0 1) + ENDIF(NOT HAVE_INT32_T) + + IF(NOT HAVE_UINT32_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT32 ${OPAL_ALIGNMENT_INT} "Alignment of `uint32_t'." 0 1) + ELSE(NOT HAVE_UINT32_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT32 ${OPAL_ALIGNMENT_UINT32_T} "Alignment of `uint32_t'." 0 1) + ENDIF(NOT HAVE_UINT32_T) +ELSEIF(SIZEOF_LONG EQUAL 4) + IF(NOT HAVE_INT32_T) + OMPI_DEF(OPAL_ALIGNMENT_INT32 ${OPAL_ALIGNMENT_LONG} "Alignment of `int32_t'." 0 1) + ELSE(NOT HAVE_INT32_T) + OMPI_DEF(OPAL_ALIGNMENT_INT32 ${OPAL_ALIGNMENT_INT32_T} "Alignment of `int32_t'." 0 1) + ENDIF(NOT HAVE_INT32_T) + + IF(NOT HAVE_UINT32_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT32 ${OPAL_ALIGNMENT_LONG} "Alignment of `uint32_t'." 0 1) + ELSE(NOT HAVE_UINT32_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT32 ${OPAL_ALIGNMENT_UINT32_T} "Alignment of `uint32_t'." 0 1) + ENDIF(NOT HAVE_UINT32_T) +ELSE(SIZEOF_INT EQUAL 4) + MESSAGE(FATAL_ERROR "Failed to define 8-bit types.") +ENDIF(SIZEOF_INT EQUAL 4) + +#64-bit +IF(SIZEOF_INT EQUAL 8) + IF(NOT HAVE_INT64_T) + OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_INT} "Alignment of `int64_t'." 0 1) + ELSE(NOT HAVE_INT64_T) + OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_INT64_T} "Alignment of `int64_t'." 0 1) + ENDIF(NOT HAVE_INT64_T) + + IF(NOT HAVE_UINT64_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_INT} "Alignment of `uint64_t'." 0 1) + ELSE(NOT HAVE_UINT64_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_UINT64_T} "Alignment of `uint64_t'." 0 1) + ENDIF(NOT HAVE_UINT64_T) +ELSEIF(SIZEOF_LONG EQUAL 8) + IF(NOT HAVE_INT64_T) + OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_LONG} "Alignment of `int64_t'." 0 1) + ELSE(NOT HAVE_INT64_T) + OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_INT64_T} "Alignment of `int64_t'." 0 1) + ENDIF(NOT HAVE_INT64_T) + + IF(NOT HAVE_UINT64_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_LONG} "Alignment of `uint64_t'." 0 1) + ELSE(NOT HAVE_UINT64_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_UINT64_T} "Alignment of `uint64_t'." 0 1) + ENDIF(NOT HAVE_UINT64_T) +ELSEIF(HAVE_LONG_LONG AND SIZEOF_LONG_LONG EQUAL 8) + IF(NOT HAVE_INT64_T) + OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_LONG_LONG} "Alignment of `int64_t'." 0 1) + ELSE(NOT HAVE_INT64_T) + OMPI_DEF(OPAL_ALIGNMENT_INT64 ${OPAL_ALIGNMENT_INT64_T} "Alignment of `int64_t'." 0 1) + ENDIF(NOT HAVE_INT64_T) + + IF(NOT HAVE_UINT64_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_LONG_LONG} "Alignment of `uint64_t'." 0 1) + ELSE(NOT HAVE_UINT64_T) + OMPI_DEF(OPAL_ALIGNMENT_UINT64 ${OPAL_ALIGNMENT_UINT64_T} "Alignment of `uint64_t'." 0 1) + ENDIF(NOT HAVE_UINT64_T) +ELSE(SIZEOF_INT EQUAL 8) + MESSAGE(FATAL_ERROR "Failed to define 8-bit types.") +ENDIF(SIZEOF_INT EQUAL 8) + + +ENDMACRO(BEGIN_CONFIGURE) + + + +MACRO(END_CONFIGURE) + +IF(NOT WRITE_CONFIG_DONE) + FILE(APPEND ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake + "#include \"opal_config_bottom.h\"\n#endif /* OPAL_CONFIG_H */\n") + SET(WRITE_CONFIG_DONE TRUE CACHE INTERNAL "Whether to regenerate configure template.") +ENDIF(NOT WRITE_CONFIG_DONE) + +CONFIGURE_FILE(${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h) + +ENDMACRO(END_CONFIGURE) diff --git a/contrib/platform/win32/CMakeModules/ompi_define.cmake b/contrib/platform/win32/CMakeModules/ompi_define.cmake index 80e9d3ffd2..377a1470c2 100644 --- a/contrib/platform/win32/CMakeModules/ompi_define.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_define.cmake @@ -1,123 +1,123 @@ -# -# Copyright (c) 2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -#Generate content for opal_config.h.cmake -# -# NAME: name of the variable to be defined in configure file -# VALUE: value to be defined for the variable -# DESC: description of the definition -# IS_STR: whether this variable should be defined with quotation marks -# FORCE_DEF: whether use "#cmakedefiine" or just "#define" in the line -# VAR_FORMAT: whether we should use the variable name instead of the value -# in the template file. - -MACRO(APPEND_CONFIG_FILE NAME VAR_NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT) - - #We don't want to always generate the template file, but only when required. - IF(NOT WRITE_CONFIG_DONE) - - UNSET(APPEND_STRING) - - IF(${VAR_FORMAT}) - IF(${IS_STR}) - IF(${FORCE_DEF}) - SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \"\${${VAR_NAME}}\"\n\n") - ELSE(${FORCE_DEF}) - SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \"\${${VAR_NAME}}\"\n\n") - ENDIF(${FORCE_DEF}) - ELSE(${IS_STR}) - IF(${FORCE_DEF}) - SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \${${VAR_NAME}}\n\n") - ELSE(${FORCE_DEF}) - SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \${${VAR_NAME}}\n\n") - ENDIF(${FORCE_DEF}) - ENDIF(${IS_STR}) - ELSE(${VAR_FORMAT}) - IF(${IS_STR}) - IF(${FORCE_DEF}) - SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \"${VALUE}\"\n\n") - ELSE(${FORCE_DEF}) - SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \"${VALUE}\"\n\n") - ENDIF(${FORCE_DEF}) - ELSE(${IS_STR}) - IF(${FORCE_DEF}) - SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} ${VALUE}\n\n") - ELSE(${FORCE_DEF}) - SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} ${VALUE}\n\n") - ENDIF(${FORCE_DEF}) - ENDIF(${IS_STR}) - ENDIF(${VAR_FORMAT}) - - FILE(APPEND ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake - ${APPEND_STRING}) - ENDIF(NOT WRITE_CONFIG_DONE) - -ENDMACRO(APPEND_CONFIG_FILE NAME VAR_NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT) - - -#define a name with value and -#write the line in template file. -MACRO(OMPI_DEF NAME VALUE DESC IS_STR FORCE_DEF) - - SET(${NAME} ${VALUE}) - - APPEND_CONFIG_FILE(${NAME} ${NAME} "${VALUE}" ${DESC} ${IS_STR} ${FORCE_DEF} 0) - -ENDMACRO(OMPI_DEF NAME VALUE DESC IS_STR FORCE_DEF) - - -#define a name with variable and -#write the line in template file. -MACRO(OMPI_DEF_VAR NAME DESC IS_STR FORCE_DEF) - - APPEND_CONFIG_FILE(${NAME} ${NAME} "" ${DESC} ${IS_STR} ${FORCE_DEF} 1) - -ENDMACRO(OMPI_DEF_VAR NAME DESC IS_STR FORCE_DEF) - - -#define/cache a name with value and -#write the line in template file. -MACRO(OMPI_DEF_CACHE NAME VALUE CACHE_TYPE DESC IS_STR FORCE_DEF) - - SET(${NAME} ${VALUE} CACHE ${CACHE_TYPE} "${DESC}") - - APPEND_CONFIG_FILE(${NAME} ${NAME} ${VALUE} ${DESC} ${IS_STR} ${FORCE_DEF} 0) - -ENDMACRO(OMPI_DEF_CACHE NAME VALUE OPT DESC IS_STR FORCE_DEF) - - -#define/cache a name with variable and -#write the line in template file. -MACRO(OMPI_DEF_CACHE_VAR NAME VALUE CACHE_TYPE DESC IS_STR FORCE_DEF) - - SET(${NAME} ${VALUE} CACHE ${CACHE_TYPE} "${DESC}") - - APPEND_CONFIG_FILE(${NAME} ${NAME} "" ${DESC} ${IS_STR} ${FORCE_DEF} 1) - -ENDMACRO(OMPI_DEF_CACHE_VAR NAME VALUE OPT DESC IS_STR FORCE_DEF) - - -#add an configure option and -#write the line in template file. -MACRO(OMPI_DEF_OPT NAME DESC DEFAULT_VAL) - - UNSET(APPEND_STRING) - - OPTION(${NAME} "${DESC}" ${DEFAULT_VAL}) - - IF(${${NAME}} STREQUAL "OFF") - SET(${NAME}_VAL 0) - ELSE(${${NAME}} STREQUAL "OFF") - SET(${NAME}_VAL 1) - ENDIF(${${NAME}} STREQUAL "OFF") - - APPEND_CONFIG_FILE(${NAME} ${NAME}_VAL "" ${DESC} 0 1 1) - -ENDMACRO(OMPI_DEF_OPT NAME DESC DEFAULT_VAL) +# +# Copyright (c) 2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +#Generate content for opal_config.h.cmake +# +# NAME: name of the variable to be defined in configure file +# VALUE: value to be defined for the variable +# DESC: description of the definition +# IS_STR: whether this variable should be defined with quotation marks +# FORCE_DEF: whether use "#cmakedefiine" or just "#define" in the line +# VAR_FORMAT: whether we should use the variable name instead of the value +# in the template file. + +MACRO(APPEND_CONFIG_FILE NAME VAR_NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT) + + #We don't want to always generate the template file, but only when required. + IF(NOT WRITE_CONFIG_DONE) + + UNSET(APPEND_STRING) + + IF(${VAR_FORMAT}) + IF(${IS_STR}) + IF(${FORCE_DEF}) + SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \"\${${VAR_NAME}}\"\n\n") + ELSE(${FORCE_DEF}) + SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \"\${${VAR_NAME}}\"\n\n") + ENDIF(${FORCE_DEF}) + ELSE(${IS_STR}) + IF(${FORCE_DEF}) + SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \${${VAR_NAME}}\n\n") + ELSE(${FORCE_DEF}) + SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \${${VAR_NAME}}\n\n") + ENDIF(${FORCE_DEF}) + ENDIF(${IS_STR}) + ELSE(${VAR_FORMAT}) + IF(${IS_STR}) + IF(${FORCE_DEF}) + SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} \"${VALUE}\"\n\n") + ELSE(${FORCE_DEF}) + SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} \"${VALUE}\"\n\n") + ENDIF(${FORCE_DEF}) + ELSE(${IS_STR}) + IF(${FORCE_DEF}) + SET(APPEND_STRING "/* ${DESC} */\n#define ${NAME} ${VALUE}\n\n") + ELSE(${FORCE_DEF}) + SET(APPEND_STRING "/* ${DESC} */\n#cmakedefine ${NAME} ${VALUE}\n\n") + ENDIF(${FORCE_DEF}) + ENDIF(${IS_STR}) + ENDIF(${VAR_FORMAT}) + + FILE(APPEND ${OpenMPI_BINARY_DIR}/opal/include/opal_config.h.cmake + ${APPEND_STRING}) + ENDIF(NOT WRITE_CONFIG_DONE) + +ENDMACRO(APPEND_CONFIG_FILE NAME VAR_NAME VALUE DESC IS_STR FORCE_DEF VAR_FORMAT) + + +#define a name with value and +#write the line in template file. +MACRO(OMPI_DEF NAME VALUE DESC IS_STR FORCE_DEF) + + SET(${NAME} ${VALUE}) + + APPEND_CONFIG_FILE(${NAME} ${NAME} "${VALUE}" ${DESC} ${IS_STR} ${FORCE_DEF} 0) + +ENDMACRO(OMPI_DEF NAME VALUE DESC IS_STR FORCE_DEF) + + +#define a name with variable and +#write the line in template file. +MACRO(OMPI_DEF_VAR NAME DESC IS_STR FORCE_DEF) + + APPEND_CONFIG_FILE(${NAME} ${NAME} "" ${DESC} ${IS_STR} ${FORCE_DEF} 1) + +ENDMACRO(OMPI_DEF_VAR NAME DESC IS_STR FORCE_DEF) + + +#define/cache a name with value and +#write the line in template file. +MACRO(OMPI_DEF_CACHE NAME VALUE CACHE_TYPE DESC IS_STR FORCE_DEF) + + SET(${NAME} ${VALUE} CACHE ${CACHE_TYPE} "${DESC}") + + APPEND_CONFIG_FILE(${NAME} ${NAME} ${VALUE} ${DESC} ${IS_STR} ${FORCE_DEF} 0) + +ENDMACRO(OMPI_DEF_CACHE NAME VALUE OPT DESC IS_STR FORCE_DEF) + + +#define/cache a name with variable and +#write the line in template file. +MACRO(OMPI_DEF_CACHE_VAR NAME VALUE CACHE_TYPE DESC IS_STR FORCE_DEF) + + SET(${NAME} ${VALUE} CACHE ${CACHE_TYPE} "${DESC}") + + APPEND_CONFIG_FILE(${NAME} ${NAME} "" ${DESC} ${IS_STR} ${FORCE_DEF} 1) + +ENDMACRO(OMPI_DEF_CACHE_VAR NAME VALUE OPT DESC IS_STR FORCE_DEF) + + +#add an configure option and +#write the line in template file. +MACRO(OMPI_DEF_OPT NAME DESC DEFAULT_VAL) + + UNSET(APPEND_STRING) + + OPTION(${NAME} "${DESC}" ${DEFAULT_VAL}) + + IF(${${NAME}} STREQUAL "OFF") + SET(${NAME}_VAL 0) + ELSE(${${NAME}} STREQUAL "OFF") + SET(${NAME}_VAL 1) + ENDIF(${${NAME}} STREQUAL "OFF") + + APPEND_CONFIG_FILE(${NAME} ${NAME}_VAL "" ${DESC} 0 1 1) + +ENDMACRO(OMPI_DEF_OPT NAME DESC DEFAULT_VAL) diff --git a/contrib/platform/win32/CMakeModules/ompi_ext_config.cmake b/contrib/platform/win32/CMakeModules/ompi_ext_config.cmake index a92fbe5246..54e6e03da9 100644 --- a/contrib/platform/win32/CMakeModules/ompi_ext_config.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_ext_config.cmake @@ -1,53 +1,53 @@ -# Copyright (c) 2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB OMPI_EXT_BASE_FILES ${PROJECT_SOURCE_DIR}/mpiext/*.h ${PROJECT_SOURCE_DIR}/mpiext/*.c) -SOURCE_GROUP(mpiext FILES ${OMPI_EXT_BASE_FILES}) - -SET(OMPI_EXT_FILES ${OMPI_EXT_FILES} ${OMPI_EXT_BASE_FILES}) - -CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}/mpiext" OMPI_EXT_SUBDIRS) - -FOREACH(OMPI_MPIEXT_COMPONENT ${OMPI_MPIEXT_COMPONENTS}) - LIST(FIND OMPI_EXT_SUBDIRS ${OMPI_MPIEXT_COMPONENT} VALID_COMPONENT) - - IF(NOT VALID_COMPONENT EQUAL -1) - FILE(GLOB ${OMPI_MPIEXT_COMPONENT}_FILES - ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/*.h ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/*.c) - SOURCE_GROUP(mpiext\\${OMPI_MPIEXT_COMPONENT} FILES ${${OMPI_MPIEXT_COMPONENT}_FILES}) - - FILE(GLOB ${OMPI_MPIEXT_COMPONENT}_C_FILES - ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/c/*.h ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/c/*.c) - SOURCE_GROUP(mpiext\\${OMPI_MPIEXT_COMPONENT}\\c FILES ${${OMPI_MPIEXT_COMPONENT}_C_FILES}) - - SET(OMPI_EXT_FILES ${OMPI_EXT_FILES} ${${OMPI_MPIEXT_COMPONENT}_FILES} ${${OMPI_MPIEXT_COMPONENT}_C_FILES}) - ENDIF(NOT VALID_COMPONENT EQUAL -1) -ENDFOREACH(OMPI_MPIEXT_COMPONENT ${OMPI_MPIEXT_COMPONENTS}) - - -# write out static-component.h for this mca. -FILE(WRITE "${PROJECT_BINARY_DIR}/mpiext/static-components.h" - "/* - * $HEADER$ - */ -#if defined(c_plusplus) || defined(__cplusplus) -extern \"C\" { -#endif - - - -const ompi_mpiext_component_t *ompi_mpiext_components[] = { - - NULL -}; - -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - ") +# Copyright (c) 2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB OMPI_EXT_BASE_FILES ${PROJECT_SOURCE_DIR}/mpiext/*.h ${PROJECT_SOURCE_DIR}/mpiext/*.c) +SOURCE_GROUP(mpiext FILES ${OMPI_EXT_BASE_FILES}) + +SET(OMPI_EXT_FILES ${OMPI_EXT_FILES} ${OMPI_EXT_BASE_FILES}) + +CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}/mpiext" OMPI_EXT_SUBDIRS) + +FOREACH(OMPI_MPIEXT_COMPONENT ${OMPI_MPIEXT_COMPONENTS}) + LIST(FIND OMPI_EXT_SUBDIRS ${OMPI_MPIEXT_COMPONENT} VALID_COMPONENT) + + IF(NOT VALID_COMPONENT EQUAL -1) + FILE(GLOB ${OMPI_MPIEXT_COMPONENT}_FILES + ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/*.h ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/*.c) + SOURCE_GROUP(mpiext\\${OMPI_MPIEXT_COMPONENT} FILES ${${OMPI_MPIEXT_COMPONENT}_FILES}) + + FILE(GLOB ${OMPI_MPIEXT_COMPONENT}_C_FILES + ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/c/*.h ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/c/*.c) + SOURCE_GROUP(mpiext\\${OMPI_MPIEXT_COMPONENT}\\c FILES ${${OMPI_MPIEXT_COMPONENT}_C_FILES}) + + SET(OMPI_EXT_FILES ${OMPI_EXT_FILES} ${${OMPI_MPIEXT_COMPONENT}_FILES} ${${OMPI_MPIEXT_COMPONENT}_C_FILES}) + ENDIF(NOT VALID_COMPONENT EQUAL -1) +ENDFOREACH(OMPI_MPIEXT_COMPONENT ${OMPI_MPIEXT_COMPONENTS}) + + +# write out static-component.h for this mca. +FILE(WRITE "${PROJECT_BINARY_DIR}/mpiext/static-components.h" + "/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern \"C\" { +#endif + + + +const ompi_mpiext_component_t *ompi_mpiext_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + ") diff --git a/contrib/platform/win32/CMakeModules/ompi_find_type.cmake b/contrib/platform/win32/CMakeModules/ompi_find_type.cmake index 87dfe3c6d3..7226f0857a 100644 --- a/contrib/platform/win32/CMakeModules/ompi_find_type.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_find_type.cmake @@ -1,48 +1,48 @@ -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -# OMPI_FIND_TYPE(type, [list of c types], abort if not found, -# target size, variable to set) -# ----------------------------------------------------------- - -MACRO(OMPI_FIND_TYPE TYPE TYPE_LIST ABORT TARGET_SIZE OUTPUT_VARIABLE) - SET(oft_abort_on_fail "${ABORT}") - SET(oft_target_size ${TARGET_SIZE}) - - - MESSAGE(STATUS "Check corresponding C type of ${TYPE}...") - SET(oft_real_type "") - - IF(NOT "${oft_target_size}" STREQUAL "") - - FOREACH(oft_type ${TYPE_LIST}) - STRING(REGEX REPLACE " " "_" oft_type_name ${oft_type}) - STRING(TOUPPER ${oft_type_name} oft_type_name) - IF(SIZEOF_${oft_type_name} EQUAL oft_target_size) - SET(oft_real_type ${oft_type}) - BREAK() - ENDIF(SIZEOF_${oft_type_name} EQUAL oft_target_size) - ENDFOREACH(oft_type ${TYPE_LIST}) - - ENDIF(NOT "${oft_target_size}" STREQUAL "") - - IF("${oft_real_type}" STREQUAL "") - SET(OUTPUT_VARIABLE "") - MESSAGE(STATUS "*** Did not find corresponding C type of ${TYPE}") - IF("${oft_abort_on_fail}" STREQUAL "yes") - MESSAGE(FATAL_ERROR "Cannot continue.") - ENDIF("${oft_abort_on_fail}" STREQUAL "yes") - ELSE("${oft_real_type}" STREQUAL "") - SET(${OUTPUT_VARIABLE} "${oft_real_type}") - MESSAGE(STATUS "Check corresponding C type of ${TYPE}... ${oft_real_type}") - ENDIF("${oft_real_type}" STREQUAL "") - -ENDMACRO(OMPI_FIND_TYPE TYPE TYPE_LIST ABORT TARGET_SIZE OUTPUT_VARIABLE) +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +# OMPI_FIND_TYPE(type, [list of c types], abort if not found, +# target size, variable to set) +# ----------------------------------------------------------- + +MACRO(OMPI_FIND_TYPE TYPE TYPE_LIST ABORT TARGET_SIZE OUTPUT_VARIABLE) + SET(oft_abort_on_fail "${ABORT}") + SET(oft_target_size ${TARGET_SIZE}) + + + MESSAGE(STATUS "Check corresponding C type of ${TYPE}...") + SET(oft_real_type "") + + IF(NOT "${oft_target_size}" STREQUAL "") + + FOREACH(oft_type ${TYPE_LIST}) + STRING(REGEX REPLACE " " "_" oft_type_name ${oft_type}) + STRING(TOUPPER ${oft_type_name} oft_type_name) + IF(SIZEOF_${oft_type_name} EQUAL oft_target_size) + SET(oft_real_type ${oft_type}) + BREAK() + ENDIF(SIZEOF_${oft_type_name} EQUAL oft_target_size) + ENDFOREACH(oft_type ${TYPE_LIST}) + + ENDIF(NOT "${oft_target_size}" STREQUAL "") + + IF("${oft_real_type}" STREQUAL "") + SET(OUTPUT_VARIABLE "") + MESSAGE(STATUS "*** Did not find corresponding C type of ${TYPE}") + IF("${oft_abort_on_fail}" STREQUAL "yes") + MESSAGE(FATAL_ERROR "Cannot continue.") + ENDIF("${oft_abort_on_fail}" STREQUAL "yes") + ELSE("${oft_real_type}" STREQUAL "") + SET(${OUTPUT_VARIABLE} "${oft_real_type}") + MESSAGE(STATUS "Check corresponding C type of ${TYPE}... ${oft_real_type}") + ENDIF("${oft_real_type}" STREQUAL "") + +ENDMACRO(OMPI_FIND_TYPE TYPE TYPE_LIST ABORT TARGET_SIZE OUTPUT_VARIABLE) diff --git a/contrib/platform/win32/CMakeModules/opal_functions.cmake b/contrib/platform/win32/CMakeModules/opal_functions.cmake index ac7d8495c7..85f218ad1a 100644 --- a/contrib/platform/win32/CMakeModules/opal_functions.cmake +++ b/contrib/platform/win32/CMakeModules/opal_functions.cmake @@ -1,55 +1,55 @@ -# -# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# -# Functions that are re-written from config/opal_functions.m4, and to be continued... -# - - -# OPAL_WITH_OPTION_MIN_MAX_VALUE(NAME,DEFAULT_VALUE,LOWER_BOUND,UPPER_BOUND) -# Defines a variable OPAL_MAX_xxx, with "xxx" being specified as the first parameter. -# If not set at configure-time, the default-value is assumed. -# If set, value is checked against lower and upper bound -# -MACRO(OPAL_WITH_OPTION_MIN_MAX_VALUE NAME DEFAULT_VALUE LOWER_BOUND UPPER_BOUND) - - STRING(REPLACE "_" " " NAME_HELPER ${NAME}) - STRING(TOUPPER "OPAL_MAX_${NAME}" OPTION_VALUE_VAR) - - IF(NOT ${OPTION_VALUE_VAR}) - MESSAGE(STATUS "Checking maximum length of ${NAME_HELPER}...") - MESSAGE(STATUS "Use default value ${DEFAULT_VALUE}.") - - SET(${NAME}_OLD_VALUE ${DEFAULT_VALUE} CACHE INTERNAL "the value from the last configure.") - ENDIF(NOT ${OPTION_VALUE_VAR}) - - # check if the value is changed. - IF(NOT ${${OPTION_VALUE_VAR}} EQUAL ${NAME}_OLD_VALUE) - MESSAGE(STATUS "Checking maximum length of ${NAME_HELPER}...") - - # check if the value is in the range. - IF(NOT ${${OPTION_VALUE_VAR}} EQUAL 0 AND NOT ${${OPTION_VALUE_VAR}} EQUAL no AND NOT ${${OPTION_VALUE_VAR}} EQUAL NO) - - IF(${${OPTION_VALUE_VAR}} LESS ${LOWER_BOUND} OR ${${OPTION_VALUE_VAR}} GREATER ${UPPER_BOUND}) - MESSAGE(FATAL_ERROR "${OPTION_VALUE_VAR} is out of range(${LOWER_BOUND}-${UPPER_BOUND}). Cannot continue.") - ENDIF(${${OPTION_VALUE_VAR}} LESS ${LOWER_BOUND} OR ${${OPTION_VALUE_VAR}} GREATER ${UPPER_BOUND}) - - ELSE(NOT ${${OPTION_VALUE_VAR}} EQUAL 0 AND NOT ${${OPTION_VALUE_VAR}} EQUAL no AND NOT ${${OPTION_VALUE_VAR}} EQUAL NO) - MESSAGE(FATAL_ERROR "Bad value for ${OPTION_VALUE_VAR}. Cannot continue.") - ENDIF(NOT ${${OPTION_VALUE_VAR}} EQUAL 0 AND NOT ${${OPTION_VALUE_VAR}} EQUAL no AND NOT ${${OPTION_VALUE_VAR}} EQUAL NO) - - SET(${NAME}_OLD_VALUE ${${OPTION_VALUE_VAR}} CACHE INTERNAL "the value from the last configure.") - - ENDIF(NOT ${${OPTION_VALUE_VAR}} EQUAL ${NAME}_OLD_VALUE) - - OMPI_DEF_CACHE_VAR(${OPTION_VALUE_VAR} ${DEFAULT_VALUE} STRING - "maximum length of ${NAME} (${LOWER_BOUND}-${UPPER_BOUND}). (Default: ${DEFAULT_VALUE}.)." 0 1) - -ENDMACRO(OPAL_WITH_OPTION_MIN_MAX_VALUE NAME DEFAULT_VALUE LOWER_BOUND UPPER_BOUND) +# +# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# +# Functions that are re-written from config/opal_functions.m4, and to be continued... +# + + +# OPAL_WITH_OPTION_MIN_MAX_VALUE(NAME,DEFAULT_VALUE,LOWER_BOUND,UPPER_BOUND) +# Defines a variable OPAL_MAX_xxx, with "xxx" being specified as the first parameter. +# If not set at configure-time, the default-value is assumed. +# If set, value is checked against lower and upper bound +# +MACRO(OPAL_WITH_OPTION_MIN_MAX_VALUE NAME DEFAULT_VALUE LOWER_BOUND UPPER_BOUND) + + STRING(REPLACE "_" " " NAME_HELPER ${NAME}) + STRING(TOUPPER "OPAL_MAX_${NAME}" OPTION_VALUE_VAR) + + IF(NOT ${OPTION_VALUE_VAR}) + MESSAGE(STATUS "Checking maximum length of ${NAME_HELPER}...") + MESSAGE(STATUS "Use default value ${DEFAULT_VALUE}.") + + SET(${NAME}_OLD_VALUE ${DEFAULT_VALUE} CACHE INTERNAL "the value from the last configure.") + ENDIF(NOT ${OPTION_VALUE_VAR}) + + # check if the value is changed. + IF(NOT ${${OPTION_VALUE_VAR}} EQUAL ${NAME}_OLD_VALUE) + MESSAGE(STATUS "Checking maximum length of ${NAME_HELPER}...") + + # check if the value is in the range. + IF(NOT ${${OPTION_VALUE_VAR}} EQUAL 0 AND NOT ${${OPTION_VALUE_VAR}} EQUAL no AND NOT ${${OPTION_VALUE_VAR}} EQUAL NO) + + IF(${${OPTION_VALUE_VAR}} LESS ${LOWER_BOUND} OR ${${OPTION_VALUE_VAR}} GREATER ${UPPER_BOUND}) + MESSAGE(FATAL_ERROR "${OPTION_VALUE_VAR} is out of range(${LOWER_BOUND}-${UPPER_BOUND}). Cannot continue.") + ENDIF(${${OPTION_VALUE_VAR}} LESS ${LOWER_BOUND} OR ${${OPTION_VALUE_VAR}} GREATER ${UPPER_BOUND}) + + ELSE(NOT ${${OPTION_VALUE_VAR}} EQUAL 0 AND NOT ${${OPTION_VALUE_VAR}} EQUAL no AND NOT ${${OPTION_VALUE_VAR}} EQUAL NO) + MESSAGE(FATAL_ERROR "Bad value for ${OPTION_VALUE_VAR}. Cannot continue.") + ENDIF(NOT ${${OPTION_VALUE_VAR}} EQUAL 0 AND NOT ${${OPTION_VALUE_VAR}} EQUAL no AND NOT ${${OPTION_VALUE_VAR}} EQUAL NO) + + SET(${NAME}_OLD_VALUE ${${OPTION_VALUE_VAR}} CACHE INTERNAL "the value from the last configure.") + + ENDIF(NOT ${${OPTION_VALUE_VAR}} EQUAL ${NAME}_OLD_VALUE) + + OMPI_DEF_CACHE_VAR(${OPTION_VALUE_VAR} ${DEFAULT_VALUE} STRING + "maximum length of ${NAME} (${LOWER_BOUND}-${UPPER_BOUND}). (Default: ${DEFAULT_VALUE}.)." 0 1) + +ENDMACRO(OPAL_WITH_OPTION_MIN_MAX_VALUE NAME DEFAULT_VALUE LOWER_BOUND UPPER_BOUND) diff --git a/contrib/platform/win32/CMakeModules/opal_get_version.cmake b/contrib/platform/win32/CMakeModules/opal_get_version.cmake index 0dab5e1cb1..2a95a9955d 100644 --- a/contrib/platform/win32/CMakeModules/opal_get_version.cmake +++ b/contrib/platform/win32/CMakeModules/opal_get_version.cmake @@ -1,117 +1,117 @@ -# -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^major=") -STRING(REPLACE "major=" "" MAJOR_VERSION ${VALUE}) - -FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^minor=") -STRING(REPLACE "minor=" "" MINOR_VERSION ${VALUE}) - -FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^release=") -STRING(REPLACE "release=" "" RELEASE_VERSION ${VALUE}) - -FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^greek=") -STRING(REPLACE "greek=" "" GREEK_VERSION ${VALUE}) - -FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^want_svn=") -STRING(REPLACE "want_svn=" "" WANT_SVN ${VALUE}) - -FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^svn_r=") -STRING(REPLACE "svn_r=" "" SVN_R ${VALUE}) - -FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^date=") -STRING(REPLACE "date=" "" RELEASE_DATE ${VALUE}) -STRING(REPLACE "\"" "" RELEASE_DATE ${RELEASE_DATE}) - -IF(${RELEASE_VERSION} EQUAL 0) - SET(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}${GREEK_VERSION}) -ELSE(${RELEASE_VERSION} EQUAL 0) - SET(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}.${RELEASE_VERSION}${GREEK_VERSION}) -ENDIF(${RELEASE_VERSION} EQUAL 0) - -# Get the svn version -IF("${WANT_SVN}" STREQUAL "1") - - IF("${SVN_R}" STREQUAL "-1") - # for VS.NET2003 users working with web projects, we should also check "_svn" - IF(EXISTS ${OpenMPI_SOURCE_DIR}/.svn OR EXISTS ${OpenMPI_SOURCE_DIR}/_svn) - EXECUTE_PROCESS (COMMAND svnversion -n - WORKING_DIRECTORY ${OpenMPI_SOURCE_DIR} - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - IF(NOT RESULT STREQUAL "0") - # subversion might be not installed, let's try TortoiseSVN. - EXECUTE_PROCESS (COMMAND SubWCRev - . contrib/platform/win32/ConfigFiles/revision.in - ${OpenMPI_BINARY_DIR}/revision - WORKING_DIRECTORY ${OpenMPI_SOURCE_DIR} - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - IF(RESULT STREQUAL "0") - FILE(STRINGS ${OpenMPI_BINARY_DIR}/revision OUTPUT REGEX "[0-9]*") - ENDIF(RESULT STREQUAL "0") - ENDIF(NOT RESULT STREQUAL "0") - ELSEIF(EXISTS ${OpenMPI_SOURCE_DIR}/.hg) - EXECUTE_PROCESS (COMMAND hg -v -R . tip - WORKING_DIRECTORY ${OpenMPI_SOURCE_DIR} - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - STRING(REGEX REPLACE "changeset:[^:]*:" "" OUTPUT ${OUTPUT}) - STRING(REGEX REPLACE "tag.*" "" OUTPUT ${OUTPUT}) - STRING(REPLACE "\n" "" OUTPUT ${OUTPUT}) - ENDIF(EXISTS ${OpenMPI_SOURCE_DIR}/.svn OR EXISTS ${OpenMPI_SOURCE_DIR}/_svn) - - IF(NOT RESULT STREQUAL "0") - MESSAGE(STATUS "SVN ERROR:${RESULT} ${ERROR}") - ELSE(NOT RESULT STREQUAL "0") - IF(${RESULT} EQUAL 0 AND NOT "${OUTPUT}" STREQUAL "exported" ) - SET(SVN_VERSION "r${OUTPUT}") - ENDIF(${RESULT} EQUAL 0 AND NOT "${OUTPUT}" STREQUAL "exported") - ENDIF(NOT RESULT STREQUAL "0") - - ENDIF("${SVN_R}" STREQUAL "-1") - - SET(VERSION_STRING ${VERSION_STRING}${SVN_VERSION}) - -ELSE("${WANT_SVN}" STREQUAL "1") - SET(SVN_VERSION ${SVN_R}) -ENDIF("${WANT_SVN}" STREQUAL "1") - -# Set opal versions -SET(OPAL_WANT_SVN ${WANT_SVN}) -SET(OPAL_SVN_R ${SVN_R}) -OMPI_DEF(OPAL_GREEK_VERSION "${GREEK_VERSION}" "Greek - alpha, beta, etc - release number of Open Portable Access Layer." 1 1) -OMPI_DEF(OPAL_MAJOR_VERSION ${MAJOR_VERSION} "Major release number of Open Portable Access Layer." 0 1) -OMPI_DEF(OPAL_MINOR_VERSION ${MINOR_VERSION} "Minor release number of Open Portable Access Layer." 0 1) -OMPI_DEF(OPAL_RELEASE_VERSION ${RELEASE_VERSION} "Release number of Open Portable Access Layer." 0 1) -OMPI_DEF(OPAL_VERSION ${VERSION_STRING} "Complete release number of Open Portable Access Layer." 1 1) -OMPI_DEF(OPAL_IDENT_STRING ${VERSION_STRING} "ident string for Open MPI." 1 1) - -# Set OMPI versions -SET(OMPI_WANT_SVN ${WANT_SVN}) -SET(OMPI_SVN_R ${SVN_R}) -OMPI_DEF(OMPI_GREEK_VERSION "${GREEK_VERSION}" "Greek - alpha, beta, etc - release number of Open Portable Access Layer." 1 1) -OMPI_DEF(OMPI_MAJOR_VERSION ${MAJOR_VERSION} "Major release number of Open MPI." 0 1) -OMPI_DEF(OMPI_MINOR_VERSION ${MINOR_VERSION} "Minor release number of Open MPI." 0 1) -OMPI_DEF(OMPI_RELEASE_VERSION ${RELEASE_VERSION} "Release number of Open MPI." 0 1) -OMPI_DEF(OMPI_VERSION ${VERSION_STRING} "Complete release number of Open MPI." 1 1) - -# Set ORTE versions -SET(ORTE_WANT_SVN ${WANT_SVN}) -SET(ORTE_SVN_R ${SVN_R}) -OMPI_DEF(ORTE_GREEK_VERSION "${GREEK_VERSION}" "Greek - alpha, beta, etc - release number of Open Run-Time Environment." 1 1) -OMPI_DEF(ORTE_MAJOR_VERSION ${MAJOR_VERSION} "Major release number of Open Run-Time Environment." 0 1) -OMPI_DEF(ORTE_MINOR_VERSION ${MINOR_VERSION} "Minor release number of Open Run-Time Environment." 0 1) -OMPI_DEF(ORTE_RELEASE_VERSION ${RELEASE_VERSION} "Release number of Open Run-Time Environment." 0 1) -OMPI_DEF(ORTE_VERSION ${VERSION_STRING} "Complete release number of Open Run-Time Environment." 1 1) +# +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^major=") +STRING(REPLACE "major=" "" MAJOR_VERSION ${VALUE}) + +FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^minor=") +STRING(REPLACE "minor=" "" MINOR_VERSION ${VALUE}) + +FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^release=") +STRING(REPLACE "release=" "" RELEASE_VERSION ${VALUE}) + +FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^greek=") +STRING(REPLACE "greek=" "" GREEK_VERSION ${VALUE}) + +FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^want_svn=") +STRING(REPLACE "want_svn=" "" WANT_SVN ${VALUE}) + +FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^svn_r=") +STRING(REPLACE "svn_r=" "" SVN_R ${VALUE}) + +FILE(STRINGS ${OpenMPI_SOURCE_DIR}/VERSION VALUE REGEX "^date=") +STRING(REPLACE "date=" "" RELEASE_DATE ${VALUE}) +STRING(REPLACE "\"" "" RELEASE_DATE ${RELEASE_DATE}) + +IF(${RELEASE_VERSION} EQUAL 0) + SET(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}${GREEK_VERSION}) +ELSE(${RELEASE_VERSION} EQUAL 0) + SET(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}.${RELEASE_VERSION}${GREEK_VERSION}) +ENDIF(${RELEASE_VERSION} EQUAL 0) + +# Get the svn version +IF("${WANT_SVN}" STREQUAL "1") + + IF("${SVN_R}" STREQUAL "-1") + # for VS.NET2003 users working with web projects, we should also check "_svn" + IF(EXISTS ${OpenMPI_SOURCE_DIR}/.svn OR EXISTS ${OpenMPI_SOURCE_DIR}/_svn) + EXECUTE_PROCESS (COMMAND svnversion -n + WORKING_DIRECTORY ${OpenMPI_SOURCE_DIR} + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + IF(NOT RESULT STREQUAL "0") + # subversion might be not installed, let's try TortoiseSVN. + EXECUTE_PROCESS (COMMAND SubWCRev + . contrib/platform/win32/ConfigFiles/revision.in + ${OpenMPI_BINARY_DIR}/revision + WORKING_DIRECTORY ${OpenMPI_SOURCE_DIR} + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + IF(RESULT STREQUAL "0") + FILE(STRINGS ${OpenMPI_BINARY_DIR}/revision OUTPUT REGEX "[0-9]*") + ENDIF(RESULT STREQUAL "0") + ENDIF(NOT RESULT STREQUAL "0") + ELSEIF(EXISTS ${OpenMPI_SOURCE_DIR}/.hg) + EXECUTE_PROCESS (COMMAND hg -v -R . tip + WORKING_DIRECTORY ${OpenMPI_SOURCE_DIR} + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + STRING(REGEX REPLACE "changeset:[^:]*:" "" OUTPUT ${OUTPUT}) + STRING(REGEX REPLACE "tag.*" "" OUTPUT ${OUTPUT}) + STRING(REPLACE "\n" "" OUTPUT ${OUTPUT}) + ENDIF(EXISTS ${OpenMPI_SOURCE_DIR}/.svn OR EXISTS ${OpenMPI_SOURCE_DIR}/_svn) + + IF(NOT RESULT STREQUAL "0") + MESSAGE(STATUS "SVN ERROR:${RESULT} ${ERROR}") + ELSE(NOT RESULT STREQUAL "0") + IF(${RESULT} EQUAL 0 AND NOT "${OUTPUT}" STREQUAL "exported" ) + SET(SVN_VERSION "r${OUTPUT}") + ENDIF(${RESULT} EQUAL 0 AND NOT "${OUTPUT}" STREQUAL "exported") + ENDIF(NOT RESULT STREQUAL "0") + + ENDIF("${SVN_R}" STREQUAL "-1") + + SET(VERSION_STRING ${VERSION_STRING}${SVN_VERSION}) + +ELSE("${WANT_SVN}" STREQUAL "1") + SET(SVN_VERSION ${SVN_R}) +ENDIF("${WANT_SVN}" STREQUAL "1") + +# Set opal versions +SET(OPAL_WANT_SVN ${WANT_SVN}) +SET(OPAL_SVN_R ${SVN_R}) +OMPI_DEF(OPAL_GREEK_VERSION "${GREEK_VERSION}" "Greek - alpha, beta, etc - release number of Open Portable Access Layer." 1 1) +OMPI_DEF(OPAL_MAJOR_VERSION ${MAJOR_VERSION} "Major release number of Open Portable Access Layer." 0 1) +OMPI_DEF(OPAL_MINOR_VERSION ${MINOR_VERSION} "Minor release number of Open Portable Access Layer." 0 1) +OMPI_DEF(OPAL_RELEASE_VERSION ${RELEASE_VERSION} "Release number of Open Portable Access Layer." 0 1) +OMPI_DEF(OPAL_VERSION ${VERSION_STRING} "Complete release number of Open Portable Access Layer." 1 1) +OMPI_DEF(OPAL_IDENT_STRING ${VERSION_STRING} "ident string for Open MPI." 1 1) + +# Set OMPI versions +SET(OMPI_WANT_SVN ${WANT_SVN}) +SET(OMPI_SVN_R ${SVN_R}) +OMPI_DEF(OMPI_GREEK_VERSION "${GREEK_VERSION}" "Greek - alpha, beta, etc - release number of Open Portable Access Layer." 1 1) +OMPI_DEF(OMPI_MAJOR_VERSION ${MAJOR_VERSION} "Major release number of Open MPI." 0 1) +OMPI_DEF(OMPI_MINOR_VERSION ${MINOR_VERSION} "Minor release number of Open MPI." 0 1) +OMPI_DEF(OMPI_RELEASE_VERSION ${RELEASE_VERSION} "Release number of Open MPI." 0 1) +OMPI_DEF(OMPI_VERSION ${VERSION_STRING} "Complete release number of Open MPI." 1 1) + +# Set ORTE versions +SET(ORTE_WANT_SVN ${WANT_SVN}) +SET(ORTE_SVN_R ${SVN_R}) +OMPI_DEF(ORTE_GREEK_VERSION "${GREEK_VERSION}" "Greek - alpha, beta, etc - release number of Open Run-Time Environment." 1 1) +OMPI_DEF(ORTE_MAJOR_VERSION ${MAJOR_VERSION} "Major release number of Open Run-Time Environment." 0 1) +OMPI_DEF(ORTE_MINOR_VERSION ${MINOR_VERSION} "Minor release number of Open Run-Time Environment." 0 1) +OMPI_DEF(ORTE_RELEASE_VERSION ${RELEASE_VERSION} "Release number of Open Run-Time Environment." 0 1) +OMPI_DEF(ORTE_VERSION ${VERSION_STRING} "Complete release number of Open Run-Time Environment." 1 1) diff --git a/contrib/platform/win32/CMakeModules/setup_f77.cmake b/contrib/platform/win32/CMakeModules/setup_f77.cmake index d67273f40d..76eebd433d 100644 --- a/contrib/platform/win32/CMakeModules/setup_f77.cmake +++ b/contrib/platform/win32/CMakeModules/setup_f77.cmake @@ -1,145 +1,145 @@ -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# first try to find a f77 compiler, will be checked when f77 support is enabled. - -# There might be a bug in CMake, the CMAKE_GENERATOR_FC is set to "ifort" by default, -# which causes CMake can't find the correct Fortran compiler. -# We have to set CMAKE_GENERATOR_FC empty. -SET(CMAKE_GENERATOR_FC "") -include(CMakeDetermineFortranCompiler) -include(CMakeFortranInformation) - -IF(OMPI_WANT_F77_BINDINGS AND NOT F77_SETUP_DONE) - - SET(OMPI_MPI_INTEGER_KIND 0 CACHE INTERNAL "MPI_INTEGER_KIND") - SET(OMPI_MPI_ADDRESS_KIND 0 CACHE INTERNAL "MPI_ADDRESS_KIND") - SET(OMPI_MPI_OFFSET_KIND 0 CACHE INTERNAL "MPI_OFFSET_KIND") - - GET_FILENAME_COMPONENT(F77_NAME ${CMAKE_Fortran_COMPILER} NAME) - GET_FILENAME_COMPONENT(F77_PATH ${CMAKE_Fortran_COMPILER} PATH) - - SET(F77 ${F77_NAME} CACHE INTERNAL "Name of the fortran compiler.") - - # Default compiler settings. - IF(${F77} STREQUAL "ifort.exe") - #settings for Intel Fortran - SET(F77_OPTION_COMPILE "/c" CACHE INTERNAL - "Fortran compiler option for compiling without linking.") - SET(F77_OUTPUT_OBJ "/Fo" CACHE INTERNAL - "Fortran compiler option for setting object file name.") - SET(F77_OUTPUT_EXE "/Fe" CACHE INTERNAL - "Fortran compiler option for setting executable file name.") - SET(F77_DYNAMIC_FLAG_DEBUG "/MDd" CACHE INTERNAL - "Compile flag for using dynamically-loaded, multithread C runtime (Debug).") - SET(F77_DYNAMIC_FLAG "/MD" CACHE INTERNAL - "Compile flag for using dynamically-loaded, multithread C runtime.") - - IF(CMAKE_CL_64) - SET(F77_LIB_PATH "$ENV{IFORT_COMPILER11}/lib/intel64") - ELSE(CMAKE_CL_64) - SET(F77_LIB_PATH "$ENV{IFORT_COMPILER11}/lib/ia32") - ENDIF(CMAKE_CL_64) - - IF(NOT F77_LIB_PATH) - IF(CMAKE_CL_64) - FIND_LIBRARY(F77_IFCONSOL_LIB ifconsol.lib PATHS ${F77_PATH}/../../intel64) - ELSE(CMAKE_CL_64) - FIND_LIBRARY(F77_IFCONSOL_LIB ifconsol.lib PATHS ${F77_PATH}/../../ia32) - ENDIF(CMAKE_CL_64) - GET_FILENAME_COMPONENT(F77_LIB_PATH ${F77_IFCONSOL_LIB} PATH) - UNSET(F77_IFCONSOL_LIB CACHE) - ELSE(NOT F77_LIB_PATH) - STRING(REPLACE "\\" "/" F77_LIB_PATH ${F77_LIB_PATH}) - ENDIF(NOT F77_LIB_PATH) - ELSEIF(${F77} STREQUAL "g95.exe") - #settings for G95 - SET(F77_OPTION_COMPILE "-c" CACHE INTERNAL - "Fortran compiler option for compiling without linking.") - SET(F77_OUTPUT_OBJ "-o" CACHE INTERNAL - "Fortran compiler option for setting object file name.") - SET(F77_OUTPUT_EXE "-o" CACHE INTERNAL - "Fortran compiler option for setting executable file name.") - ELSE(${F77} STREQUAL "ifort.exe") - # in other case, let user specify their fortran configrations. - SET(F77_OPTION_COMPILE "-c" CACHE STRING - "Fortran compiler option for compiling without linking.") - SET(F77_OUTPUT_OBJ "-o" CACHE STRING - "Fortran compiler option for setting object file name.") - SET(F77_OUTPUT_EXE "-o" CACHE STRING - "Fortran compiler option for setting executable file name.") - SET(F77_LIB_PATH "" CACHE PATH - "Library path for the fortran compiler") - SET(F77_INCLUDE_PATH "" CACHE PATH - "Include path for the fortran compiler") - ENDIF(${F77} STREQUAL "ifort.exe") - - # Export env variables for fortran compiler. - SET(ENV{PATH} "${C_COMPILER_PATH};${F77_PATH};$ENV{PATH}") - SET(ENV{LIB} "${C_COMPILER_LIB};${F77_LIB_PATH};$ENV{LIB}") - SET(ENV{INCLUDE} "${C_COMPILER_INCLUDE};${F77_INCLUDE_PATH};$ENV{INCLUDE}") - SET(ENV{LIBPATH} "${C_COMPILER_LIBPATH};$ENV{LIBPATH}") - - # make sure the compiler actually works, if not cross-compiling - MESSAGE(STATUS "Checking for working Fortran compiler...") - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f - "\t PROGRAM TESTFortran \n" - "\t PRINT *, 'Hello' \n" - "\t END \n") - - # lets use execute_process to run the compile test - EXECUTE_PROCESS(COMMAND ${F77} testFortranCompiler.f - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp - OUTPUT_VARIABLE OUTPUT - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR) - - - IF(RESULT) - SET(F77_SETUP_DONE FALSE CACHE INTERNAL "f77 setup done.") - MESSAGE(STATUS "${OUTPUT}\n${ERROR}") - MESSAGE(STATUS "Fortran compiler ${F77} can't compile a simple fortran program.") - MESSAGE(FATAL_ERROR "Cannot continue. Please check Fortran compiler installation, or disable Fortran 77 support.") - ELSE(RESULT) - MESSAGE(STATUS "Checking for working Fortran compiler...${F77}") - SET(F77_SETUP_DONE TRUE CACHE INTERNAL "f77 setup done.") - ENDIF(RESULT) - - INCLUDE(F77_find_ext_symbol_convention) - # make sure we know the linking convention - # this macro will also test linking with C code - OMPI_F77_FIND_EXT_SYMBOL_CONVENTION() - -ELSEIF(NOT OMPI_WANT_F77_BINDINGS) - SET(OMPI_F77_DOUBLE_UNDERSCORE 0 - CACHE INTERNAL "external symbol convention - double underscore") - SET(OMPI_F77_SINGLE_UNDERSCORE 0 - CACHE INTERNAL "external symbol convention - single underscore") - SET(OMPI_F77_CAPS 0 - CACHE INTERNAL "external symbol convention - captital") - SET(OMPI_F77_PLAIN 0 - CACHE INTERNAL "external symbol convention - plain") - - UNSET(SYMBOL_CONVENTION_CHECK_DONE CACHE) - UNSET(F77_OPTION_COMPILE CACHE) - UNSET(F77_OUTPUT_OBJ CACHE) - UNSET(F77_OUTPUT_EXE CACHE) - UNSET(F77_LIB_PATH CACHE) - UNSET(F77_INCLUDE_PATH CACHE) - UNSET(F77_IFCONSOL_LIB CACHE) - UNSET(F77_SETUP_DONE CACHE) -ENDIF(OMPI_WANT_F77_BINDINGS AND NOT F77_SETUP_DONE) - -# a few definitions needed by OMPI_F77_FIND_EXT_SYMBOL_CONVENTION check. -OMPI_DEF_VAR(OMPI_F77_DOUBLE_UNDERSCORE "Whether fortran symbols have a trailing double underscore or not." 0 1) -OMPI_DEF_VAR(OMPI_F77_SINGLE_UNDERSCORE "Whether fortran symbols have a trailing single underscore or not." 0 1) -OMPI_DEF_VAR(OMPI_F77_CAPS "Whether fortran symbols are all caps or not." 0 1) -OMPI_DEF_VAR(OMPI_F77_PLAIN "Whether fortran symbols have no trailing underscore or not." 0 1) - +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# first try to find a f77 compiler, will be checked when f77 support is enabled. + +# There might be a bug in CMake, the CMAKE_GENERATOR_FC is set to "ifort" by default, +# which causes CMake can't find the correct Fortran compiler. +# We have to set CMAKE_GENERATOR_FC empty. +SET(CMAKE_GENERATOR_FC "") +include(CMakeDetermineFortranCompiler) +include(CMakeFortranInformation) + +IF(OMPI_WANT_F77_BINDINGS AND NOT F77_SETUP_DONE) + + SET(OMPI_MPI_INTEGER_KIND 0 CACHE INTERNAL "MPI_INTEGER_KIND") + SET(OMPI_MPI_ADDRESS_KIND 0 CACHE INTERNAL "MPI_ADDRESS_KIND") + SET(OMPI_MPI_OFFSET_KIND 0 CACHE INTERNAL "MPI_OFFSET_KIND") + + GET_FILENAME_COMPONENT(F77_NAME ${CMAKE_Fortran_COMPILER} NAME) + GET_FILENAME_COMPONENT(F77_PATH ${CMAKE_Fortran_COMPILER} PATH) + + SET(F77 ${F77_NAME} CACHE INTERNAL "Name of the fortran compiler.") + + # Default compiler settings. + IF(${F77} STREQUAL "ifort.exe") + #settings for Intel Fortran + SET(F77_OPTION_COMPILE "/c" CACHE INTERNAL + "Fortran compiler option for compiling without linking.") + SET(F77_OUTPUT_OBJ "/Fo" CACHE INTERNAL + "Fortran compiler option for setting object file name.") + SET(F77_OUTPUT_EXE "/Fe" CACHE INTERNAL + "Fortran compiler option for setting executable file name.") + SET(F77_DYNAMIC_FLAG_DEBUG "/MDd" CACHE INTERNAL + "Compile flag for using dynamically-loaded, multithread C runtime (Debug).") + SET(F77_DYNAMIC_FLAG "/MD" CACHE INTERNAL + "Compile flag for using dynamically-loaded, multithread C runtime.") + + IF(CMAKE_CL_64) + SET(F77_LIB_PATH "$ENV{IFORT_COMPILER11}/lib/intel64") + ELSE(CMAKE_CL_64) + SET(F77_LIB_PATH "$ENV{IFORT_COMPILER11}/lib/ia32") + ENDIF(CMAKE_CL_64) + + IF(NOT F77_LIB_PATH) + IF(CMAKE_CL_64) + FIND_LIBRARY(F77_IFCONSOL_LIB ifconsol.lib PATHS ${F77_PATH}/../../intel64) + ELSE(CMAKE_CL_64) + FIND_LIBRARY(F77_IFCONSOL_LIB ifconsol.lib PATHS ${F77_PATH}/../../ia32) + ENDIF(CMAKE_CL_64) + GET_FILENAME_COMPONENT(F77_LIB_PATH ${F77_IFCONSOL_LIB} PATH) + UNSET(F77_IFCONSOL_LIB CACHE) + ELSE(NOT F77_LIB_PATH) + STRING(REPLACE "\\" "/" F77_LIB_PATH ${F77_LIB_PATH}) + ENDIF(NOT F77_LIB_PATH) + ELSEIF(${F77} STREQUAL "g95.exe") + #settings for G95 + SET(F77_OPTION_COMPILE "-c" CACHE INTERNAL + "Fortran compiler option for compiling without linking.") + SET(F77_OUTPUT_OBJ "-o" CACHE INTERNAL + "Fortran compiler option for setting object file name.") + SET(F77_OUTPUT_EXE "-o" CACHE INTERNAL + "Fortran compiler option for setting executable file name.") + ELSE(${F77} STREQUAL "ifort.exe") + # in other case, let user specify their fortran configrations. + SET(F77_OPTION_COMPILE "-c" CACHE STRING + "Fortran compiler option for compiling without linking.") + SET(F77_OUTPUT_OBJ "-o" CACHE STRING + "Fortran compiler option for setting object file name.") + SET(F77_OUTPUT_EXE "-o" CACHE STRING + "Fortran compiler option for setting executable file name.") + SET(F77_LIB_PATH "" CACHE PATH + "Library path for the fortran compiler") + SET(F77_INCLUDE_PATH "" CACHE PATH + "Include path for the fortran compiler") + ENDIF(${F77} STREQUAL "ifort.exe") + + # Export env variables for fortran compiler. + SET(ENV{PATH} "${C_COMPILER_PATH};${F77_PATH};$ENV{PATH}") + SET(ENV{LIB} "${C_COMPILER_LIB};${F77_LIB_PATH};$ENV{LIB}") + SET(ENV{INCLUDE} "${C_COMPILER_INCLUDE};${F77_INCLUDE_PATH};$ENV{INCLUDE}") + SET(ENV{LIBPATH} "${C_COMPILER_LIBPATH};$ENV{LIBPATH}") + + # make sure the compiler actually works, if not cross-compiling + MESSAGE(STATUS "Checking for working Fortran compiler...") + FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f + "\t PROGRAM TESTFortran \n" + "\t PRINT *, 'Hello' \n" + "\t END \n") + + # lets use execute_process to run the compile test + EXECUTE_PROCESS(COMMAND ${F77} testFortranCompiler.f + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + OUTPUT_VARIABLE OUTPUT + RESULT_VARIABLE RESULT + ERROR_VARIABLE ERROR) + + + IF(RESULT) + SET(F77_SETUP_DONE FALSE CACHE INTERNAL "f77 setup done.") + MESSAGE(STATUS "${OUTPUT}\n${ERROR}") + MESSAGE(STATUS "Fortran compiler ${F77} can't compile a simple fortran program.") + MESSAGE(FATAL_ERROR "Cannot continue. Please check Fortran compiler installation, or disable Fortran 77 support.") + ELSE(RESULT) + MESSAGE(STATUS "Checking for working Fortran compiler...${F77}") + SET(F77_SETUP_DONE TRUE CACHE INTERNAL "f77 setup done.") + ENDIF(RESULT) + + INCLUDE(F77_find_ext_symbol_convention) + # make sure we know the linking convention + # this macro will also test linking with C code + OMPI_F77_FIND_EXT_SYMBOL_CONVENTION() + +ELSEIF(NOT OMPI_WANT_F77_BINDINGS) + SET(OMPI_F77_DOUBLE_UNDERSCORE 0 + CACHE INTERNAL "external symbol convention - double underscore") + SET(OMPI_F77_SINGLE_UNDERSCORE 0 + CACHE INTERNAL "external symbol convention - single underscore") + SET(OMPI_F77_CAPS 0 + CACHE INTERNAL "external symbol convention - captital") + SET(OMPI_F77_PLAIN 0 + CACHE INTERNAL "external symbol convention - plain") + + UNSET(SYMBOL_CONVENTION_CHECK_DONE CACHE) + UNSET(F77_OPTION_COMPILE CACHE) + UNSET(F77_OUTPUT_OBJ CACHE) + UNSET(F77_OUTPUT_EXE CACHE) + UNSET(F77_LIB_PATH CACHE) + UNSET(F77_INCLUDE_PATH CACHE) + UNSET(F77_IFCONSOL_LIB CACHE) + UNSET(F77_SETUP_DONE CACHE) +ENDIF(OMPI_WANT_F77_BINDINGS AND NOT F77_SETUP_DONE) + +# a few definitions needed by OMPI_F77_FIND_EXT_SYMBOL_CONVENTION check. +OMPI_DEF_VAR(OMPI_F77_DOUBLE_UNDERSCORE "Whether fortran symbols have a trailing double underscore or not." 0 1) +OMPI_DEF_VAR(OMPI_F77_SINGLE_UNDERSCORE "Whether fortran symbols have a trailing single underscore or not." 0 1) +OMPI_DEF_VAR(OMPI_F77_CAPS "Whether fortran symbols are all caps or not." 0 1) +OMPI_DEF_VAR(OMPI_F77_PLAIN "Whether fortran symbols have no trailing underscore or not." 0 1) + diff --git a/contrib/platform/win32/ConfigFiles/revision.in b/contrib/platform/win32/ConfigFiles/revision.in index ede63cdf28..fc89e42b32 100644 --- a/contrib/platform/win32/ConfigFiles/revision.in +++ b/contrib/platform/win32/ConfigFiles/revision.in @@ -1 +1 @@ -$WCREV$ +$WCREV$ diff --git a/ompi/CMakeLists.txt b/ompi/CMakeLists.txt index 724f6595fc..e47eeeedba 100644 --- a/ompi/CMakeLists.txt +++ b/ompi/CMakeLists.txt @@ -1,180 +1,180 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2008 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - - -# The source code is compiled as C++ for dynamic build -# and compiled as C for static build - -PROJECT (OMPI) - -# Recuresive search sub directories excluding mca, mpi and tools. -# Add sources in different source groups. -INCLUDE(list_subdirs) -CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}" OMPI_SUBDIRS) - -SET(OMPI_EXCLUDE_SUBDIRS contrib debuggers mca mpi mpiext tools) - -FOREACH(OMPI_SUBDIR ${OMPI_SUBDIRS}) - - LIST(FIND OMPI_EXCLUDE_SUBDIRS ${OMPI_SUBDIR} OMPI_EXCLUDE_SUBDIR) - - IF(${OMPI_EXCLUDE_SUBDIR} EQUAL -1) - - FILE(GLOB_RECURSE OMPI_${OMPI_SUBDIR}_FILES - "${OMPI_SUBDIR}/*.h" "${OMPI_SUBDIR}/*.c" "${OMPI_SUBDIR}/*.cc" "${OMPI_SUBDIR}/*.cpp") - - SET (OMPI_SOURCE_FILES - ${OMPI_SOURCE_FILES} - ${OMPI_${OMPI_SUBDIR}_FILES} - ) - - SOURCE_GROUP("${OMPI_SUBDIR}" FILES ${OMPI_${OMPI_SUBDIR}_FILES}) - - ENDIF(${OMPI_EXCLUDE_SUBDIR} EQUAL -1) - -ENDFOREACH(OMPI_SUBDIR ${OMPI_SUBDIRS}) - -# Special care should be taken for the debugger directory -SET(OMPI_DEBUGGER_FILES "debuggers/ompi_debuggers.c" "debuggers/debuggers.h") -SOURCE_GROUP("debuggers" FILES ${OMPI_DEBUGGER_FILES}) -SET(OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_DEBUGGER_FILES}) -SET_SOURCE_FILES_PROPERTIES("debuggers/ompi_debuggers.c" - PROPERTIES COMPILE_DEFINITIONS "OMPI_MSGQ_DLL=\"\$(pkglibdir)/libompi_dbg_msgq.dll\";OMPI_MSGQ_DLL_PREFIX=\"libompi_dbg_msgq\";OMPI_MPIHANDLES_DLL_PREFIX=\"libompi_dbg_mpihandles\"") - -# Add MPI C files -FILE(GLOB OMPI_MPI_C_FILES "mpi/c/*.h" "mpi/c/*.c") - -# Remove all MPI_File related files if the option is not selected -IF (NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) - MESSAGE( STATUS "Skipping the MPI I/O interface") - SET( TMP_SRC "" ) - FOREACH ( FILENAME ${OMPI_MPI_C_FILES}) - GET_FILENAME_COMPONENT(relname ${FILENAME} NAME) - IF (NOT ${relname} MATCHES "file.*[ch]$") - IF (NOT ${relname} STREQUAL "register_datarep.c") - LIST(APPEND TMP_SRC ${FILENAME}) - ENDIF (NOT ${relname} STREQUAL "register_datarep.c") - ENDIF(NOT ${relname} MATCHES "file.*[ch]$") - ENDFOREACH(FILENAME) - SET( OMPI_MPI_C_FILES ${TMP_SRC}) -ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) - -SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_MPI_C_FILES}) -SOURCE_GROUP(mpi "") -SOURCE_GROUP(mpi\\c FILES ${OMPI_MPI_C_FILES}) - -IF(OMPI_ENABLE_MPI_PROFILING) - # As weak symbols are not supported by MS compiler, - # we have to compile the C source files again for profiler, - # i.e. add the pre-processor "OMPI_PROFILING_DEFINES" explicitly. - - # first get the file names. - # FILE(GLOB OMPI_PROFILE_NAMES "mpi/c/*.c" ) - # then copy them to the build directory with a prefix. - FOREACH(FILE_NAME ${OMPI_MPI_C_FILES}) - GET_FILENAME_COMPONENT(relname ${FILE_NAME} NAME) - IF(NOT ${relname} STREQUAL "attr_fn.c") - CONFIGURE_FILE(${FILE_NAME} - ${PROJECT_BINARY_DIR}/mpi/c/profile/p${relname} [COPYONLY]) - SET(OMPI_C_PROFILE_FILES ${OMPI_C_PROFILE_FILES} ${PROJECT_BINARY_DIR}/mpi/c/profile/p${relname}) - ENDIF(NOT ${relname} STREQUAL "attr_fn.c") - ENDFOREACH(FILE_NAME ${OMPI_MPI_C_FILES}) - - # FILE(GLOB_RECURSE OMPI_C_PROFILE_FILES "${PROJECT_BINARY_DIR}/mpi/c/profile/*.c" ) - - SET_SOURCE_FILES_PROPERTIES(${OMPI_C_PROFILE_FILES} - PROPERTIES COMPILE_DEFINITIONS OMPI_PROFILING_DEFINES) - SET(OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_C_PROFILE_FILES}) - SOURCE_GROUP(mpi\\c\\profile FILES ${OMPI_C_PROFILE_FILES}) -ELSE(OMPI_ENABLE_MPI_PROFILING) - MESSAGE( STATUS "Skipping the MPI profiling interface") -ENDIF(OMPI_ENABLE_MPI_PROFILING) - - -IF(OMPI_WANT_F77_BINDINGS) - # A handful of files in mpi/f77/base must be included in libmpi, in order to build the - # Fortran 77 glue into libmpi - FILE(GLOB OMPI_F77_BASE_FILES "mpi/f77/base/*.c") - SET_SOURCE_FILES_PROPERTIES(${OMPI_F77_BASE_FILES} - PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_COMPILING_F77_WRAPPERS=1 ${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=0") - SET(OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_F77_BASE_FILES}) - SOURCE_GROUP(mpi\\f77\\base FILES ${OMPI_F77_BASE_FILES}) -ENDIF(OMPI_WANT_F77_BINDINGS) - -#configure ompi extension components -INCLUDE (ompi_ext_config) -SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_EXT_FILES}) - -INCLUDE (check_mca_subdirs) -SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${MCA_FILES}) - -ADD_LIBRARY (libmpi ${OMPI_SOURCE_FILES}) -ADD_DEPENDENCIES(libmpi libopen-rte libopen-pal) - -SET_TARGET_PROPERTIES(libmpi PROPERTIES COMPILE_FLAGS - "${OMPI_C_DEF_PRE}OMPI_MPIHANDLES_DLL_PREFIX=libompi_dbg_mpihandles - ${OMPI_C_DEF_PRE}OMPI_MSGQ_DLL_PREFIX=libompi_dbg_msgq - ${OMPI_C_DEF_PRE}OMPI_BUILDING - ${OMPI_C_DEF_PRE}OMPI_BUILDING_CXX_BINDINGS_LIBRARY") - -# Set compile flags for this target -IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(libmpi PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}HAVE_CONFIG_H - ${OMPI_C_DEF_PRE}OMPI_EXPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS ${OMPI_CXX_LAN_FLAG}") - TARGET_LINK_LIBRARIES (libmpi ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib - libopen-rte Ws2_32.lib shlwapi.lib ${EXTRA_LINK_LIBRARIES}) -ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(libmpi PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB") -ENDIF(BUILD_SHARED_LIBS) - -# generate ompi_config.h -CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/ompi_config.h.in ${OpenMPI_BINARY_DIR}/ompi/include/ompi_config.h) - -# generate version.h -CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/ompi/version.h.in ${OpenMPI_BINARY_DIR}/ompi/include/ompi/version.h) - - -ADD_SUBDIRECTORY(mpi) -ADD_SUBDIRECTORY(tools) - - -# Install libraries headers, and shared files -INSTALL(TARGETS libmpi - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -INSTALL(FILES ${PROJECT_BINARY_DIR}/include/mpi.h ${PROJECT_SOURCE_DIR}/include/mpi_portable_platform.h - DESTINATION include) - -INSTALL(FILES errhandler/help-mpi-errors.txt - DESTINATION share/openmpi) - -IF (OMPI_DEBUG_BUILD) - INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi${CMAKE_DEBUG_POSTFIX}.pdb - DESTINATION bin) -ENDIF (OMPI_DEBUG_BUILD) - -IF(OMPI_WANT_F77_BINDINGS) - INSTALL(FILES ${PROJECT_BINARY_DIR}/include/mpif.h - ${PROJECT_BINARY_DIR}/include/mpif-config.h - ${PROJECT_SOURCE_DIR}/include/mpif-common.h - ${PROJECT_SOURCE_DIR}/include/mpif-mpi-io.h - DESTINATION include) -ENDIF(OMPI_WANT_F77_BINDINGS) - -INSTALL(FILES ${PROJECT_SOURCE_DIR}/runtime/help-mpi-runtime.txt ${PROJECT_SOURCE_DIR}/mpi/help-mpi-api.txt - DESTINATION share/openmpi) -INSTALL(DIRECTORY mpi/cxx/ DESTINATION include/openmpi/ompi/mpi/cxx - FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE) - +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2008 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + + +# The source code is compiled as C++ for dynamic build +# and compiled as C for static build + +PROJECT (OMPI) + +# Recuresive search sub directories excluding mca, mpi and tools. +# Add sources in different source groups. +INCLUDE(list_subdirs) +CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}" OMPI_SUBDIRS) + +SET(OMPI_EXCLUDE_SUBDIRS contrib debuggers mca mpi mpiext tools) + +FOREACH(OMPI_SUBDIR ${OMPI_SUBDIRS}) + + LIST(FIND OMPI_EXCLUDE_SUBDIRS ${OMPI_SUBDIR} OMPI_EXCLUDE_SUBDIR) + + IF(${OMPI_EXCLUDE_SUBDIR} EQUAL -1) + + FILE(GLOB_RECURSE OMPI_${OMPI_SUBDIR}_FILES + "${OMPI_SUBDIR}/*.h" "${OMPI_SUBDIR}/*.c" "${OMPI_SUBDIR}/*.cc" "${OMPI_SUBDIR}/*.cpp") + + SET (OMPI_SOURCE_FILES + ${OMPI_SOURCE_FILES} + ${OMPI_${OMPI_SUBDIR}_FILES} + ) + + SOURCE_GROUP("${OMPI_SUBDIR}" FILES ${OMPI_${OMPI_SUBDIR}_FILES}) + + ENDIF(${OMPI_EXCLUDE_SUBDIR} EQUAL -1) + +ENDFOREACH(OMPI_SUBDIR ${OMPI_SUBDIRS}) + +# Special care should be taken for the debugger directory +SET(OMPI_DEBUGGER_FILES "debuggers/ompi_debuggers.c" "debuggers/debuggers.h") +SOURCE_GROUP("debuggers" FILES ${OMPI_DEBUGGER_FILES}) +SET(OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_DEBUGGER_FILES}) +SET_SOURCE_FILES_PROPERTIES("debuggers/ompi_debuggers.c" + PROPERTIES COMPILE_DEFINITIONS "OMPI_MSGQ_DLL=\"\$(pkglibdir)/libompi_dbg_msgq.dll\";OMPI_MSGQ_DLL_PREFIX=\"libompi_dbg_msgq\";OMPI_MPIHANDLES_DLL_PREFIX=\"libompi_dbg_mpihandles\"") + +# Add MPI C files +FILE(GLOB OMPI_MPI_C_FILES "mpi/c/*.h" "mpi/c/*.c") + +# Remove all MPI_File related files if the option is not selected +IF (NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) + MESSAGE( STATUS "Skipping the MPI I/O interface") + SET( TMP_SRC "" ) + FOREACH ( FILENAME ${OMPI_MPI_C_FILES}) + GET_FILENAME_COMPONENT(relname ${FILENAME} NAME) + IF (NOT ${relname} MATCHES "file.*[ch]$") + IF (NOT ${relname} STREQUAL "register_datarep.c") + LIST(APPEND TMP_SRC ${FILENAME}) + ENDIF (NOT ${relname} STREQUAL "register_datarep.c") + ENDIF(NOT ${relname} MATCHES "file.*[ch]$") + ENDFOREACH(FILENAME) + SET( OMPI_MPI_C_FILES ${TMP_SRC}) +ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) + +SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_MPI_C_FILES}) +SOURCE_GROUP(mpi "") +SOURCE_GROUP(mpi\\c FILES ${OMPI_MPI_C_FILES}) + +IF(OMPI_ENABLE_MPI_PROFILING) + # As weak symbols are not supported by MS compiler, + # we have to compile the C source files again for profiler, + # i.e. add the pre-processor "OMPI_PROFILING_DEFINES" explicitly. + + # first get the file names. + # FILE(GLOB OMPI_PROFILE_NAMES "mpi/c/*.c" ) + # then copy them to the build directory with a prefix. + FOREACH(FILE_NAME ${OMPI_MPI_C_FILES}) + GET_FILENAME_COMPONENT(relname ${FILE_NAME} NAME) + IF(NOT ${relname} STREQUAL "attr_fn.c") + CONFIGURE_FILE(${FILE_NAME} + ${PROJECT_BINARY_DIR}/mpi/c/profile/p${relname} [COPYONLY]) + SET(OMPI_C_PROFILE_FILES ${OMPI_C_PROFILE_FILES} ${PROJECT_BINARY_DIR}/mpi/c/profile/p${relname}) + ENDIF(NOT ${relname} STREQUAL "attr_fn.c") + ENDFOREACH(FILE_NAME ${OMPI_MPI_C_FILES}) + + # FILE(GLOB_RECURSE OMPI_C_PROFILE_FILES "${PROJECT_BINARY_DIR}/mpi/c/profile/*.c" ) + + SET_SOURCE_FILES_PROPERTIES(${OMPI_C_PROFILE_FILES} + PROPERTIES COMPILE_DEFINITIONS OMPI_PROFILING_DEFINES) + SET(OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_C_PROFILE_FILES}) + SOURCE_GROUP(mpi\\c\\profile FILES ${OMPI_C_PROFILE_FILES}) +ELSE(OMPI_ENABLE_MPI_PROFILING) + MESSAGE( STATUS "Skipping the MPI profiling interface") +ENDIF(OMPI_ENABLE_MPI_PROFILING) + + +IF(OMPI_WANT_F77_BINDINGS) + # A handful of files in mpi/f77/base must be included in libmpi, in order to build the + # Fortran 77 glue into libmpi + FILE(GLOB OMPI_F77_BASE_FILES "mpi/f77/base/*.c") + SET_SOURCE_FILES_PROPERTIES(${OMPI_F77_BASE_FILES} + PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_COMPILING_F77_WRAPPERS=1 ${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=0") + SET(OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_F77_BASE_FILES}) + SOURCE_GROUP(mpi\\f77\\base FILES ${OMPI_F77_BASE_FILES}) +ENDIF(OMPI_WANT_F77_BINDINGS) + +#configure ompi extension components +INCLUDE (ompi_ext_config) +SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_EXT_FILES}) + +INCLUDE (check_mca_subdirs) +SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${MCA_FILES}) + +ADD_LIBRARY (libmpi ${OMPI_SOURCE_FILES}) +ADD_DEPENDENCIES(libmpi libopen-rte libopen-pal) + +SET_TARGET_PROPERTIES(libmpi PROPERTIES COMPILE_FLAGS + "${OMPI_C_DEF_PRE}OMPI_MPIHANDLES_DLL_PREFIX=libompi_dbg_mpihandles + ${OMPI_C_DEF_PRE}OMPI_MSGQ_DLL_PREFIX=libompi_dbg_msgq + ${OMPI_C_DEF_PRE}OMPI_BUILDING + ${OMPI_C_DEF_PRE}OMPI_BUILDING_CXX_BINDINGS_LIBRARY") + +# Set compile flags for this target +IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmpi PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}HAVE_CONFIG_H + ${OMPI_C_DEF_PRE}OMPI_EXPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS ${OMPI_CXX_LAN_FLAG}") + TARGET_LINK_LIBRARIES (libmpi ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib + libopen-rte Ws2_32.lib shlwapi.lib ${EXTRA_LINK_LIBRARIES}) +ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmpi PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB") +ENDIF(BUILD_SHARED_LIBS) + +# generate ompi_config.h +CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/ompi_config.h.in ${OpenMPI_BINARY_DIR}/ompi/include/ompi_config.h) + +# generate version.h +CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/ompi/version.h.in ${OpenMPI_BINARY_DIR}/ompi/include/ompi/version.h) + + +ADD_SUBDIRECTORY(mpi) +ADD_SUBDIRECTORY(tools) + + +# Install libraries headers, and shared files +INSTALL(TARGETS libmpi + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +INSTALL(FILES ${PROJECT_BINARY_DIR}/include/mpi.h ${PROJECT_SOURCE_DIR}/include/mpi_portable_platform.h + DESTINATION include) + +INSTALL(FILES errhandler/help-mpi-errors.txt + DESTINATION share/openmpi) + +IF (OMPI_DEBUG_BUILD) + INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi${CMAKE_DEBUG_POSTFIX}.pdb + DESTINATION bin) +ENDIF (OMPI_DEBUG_BUILD) + +IF(OMPI_WANT_F77_BINDINGS) + INSTALL(FILES ${PROJECT_BINARY_DIR}/include/mpif.h + ${PROJECT_BINARY_DIR}/include/mpif-config.h + ${PROJECT_SOURCE_DIR}/include/mpif-common.h + ${PROJECT_SOURCE_DIR}/include/mpif-mpi-io.h + DESTINATION include) +ENDIF(OMPI_WANT_F77_BINDINGS) + +INSTALL(FILES ${PROJECT_SOURCE_DIR}/runtime/help-mpi-runtime.txt ${PROJECT_SOURCE_DIR}/mpi/help-mpi-api.txt + DESTINATION share/openmpi) +INSTALL(DIRECTORY mpi/cxx/ DESTINATION include/openmpi/ompi/mpi/cxx + FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE) + diff --git a/ompi/mca/allocator/basic/.windows b/ompi/mca/allocator/basic/.windows index 08f0304c72..5e0af15aec 100644 --- a/ompi/mca/allocator/basic/.windows +++ b/ompi/mca/allocator/basic/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi diff --git a/ompi/mca/bml/r2/.windows b/ompi/mca/bml/r2/.windows index cc346daabd..8d2f3e3450 100644 --- a/ompi/mca/bml/r2/.windows +++ b/ompi/mca/bml/r2/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte diff --git a/ompi/mca/btl/openib/.windows b/ompi/mca/btl/openib/.windows index 81061e522f..f2a72ec316 100644 --- a/ompi/mca/btl/openib/.windows +++ b/ompi/mca/btl/openib/.windows @@ -1,14 +1,14 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte Ws2_32.lib -exclude_list=btl_openib_failover.c;btl_openib_failover.h;btl_openib_fd.c;btl_openib_fd.h;connect/btl_openib_connect_ibcm.h;connect/btl_openib_connect_ibcm.c;connect/btl_openib_connect_xoob.h;connect/btl_openib_connect_xoob.c -required_check=find_ofed_sdk +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte Ws2_32.lib +exclude_list=btl_openib_failover.c;btl_openib_failover.h;btl_openib_fd.c;btl_openib_fd.h;connect/btl_openib_connect_ibcm.h;connect/btl_openib_connect_ibcm.c;connect/btl_openib_connect_xoob.h;connect/btl_openib_connect_xoob.c +required_check=find_ofed_sdk diff --git a/ompi/mca/btl/self/.windows b/ompi/mca/btl/self/.windows index 08f0304c72..5e0af15aec 100644 --- a/ompi/mca/btl/self/.windows +++ b/ompi/mca/btl/self/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi diff --git a/ompi/mca/btl/sm/.windows b/ompi/mca/btl/sm/.windows index 49d5029a49..bd2a56336f 100644 --- a/ompi/mca/btl/sm/.windows +++ b/ompi/mca/btl/sm/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte libmca_common_sm +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte libmca_common_sm diff --git a/ompi/mca/btl/tcp/.windows b/ompi/mca/btl/tcp/.windows index d21e119be0..2f26f617d9 100644 --- a/ompi/mca/btl/tcp/.windows +++ b/ompi/mca/btl/tcp/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte Ws2_32.lib +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte Ws2_32.lib diff --git a/ompi/mca/coll/basic/.windows b/ompi/mca/coll/basic/.windows index 08f0304c72..5e0af15aec 100644 --- a/ompi/mca/coll/basic/.windows +++ b/ompi/mca/coll/basic/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi diff --git a/ompi/mca/coll/hierarch/.windows b/ompi/mca/coll/hierarch/.windows index 08f0304c72..5e0af15aec 100644 --- a/ompi/mca/coll/hierarch/.windows +++ b/ompi/mca/coll/hierarch/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi diff --git a/ompi/mca/coll/self/.windows b/ompi/mca/coll/self/.windows index 08f0304c72..5e0af15aec 100644 --- a/ompi/mca/coll/self/.windows +++ b/ompi/mca/coll/self/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi diff --git a/ompi/mca/coll/sm/.windows b/ompi/mca/coll/sm/.windows index 49d5029a49..bd2a56336f 100644 --- a/ompi/mca/coll/sm/.windows +++ b/ompi/mca/coll/sm/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte libmca_common_sm +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte libmca_common_sm diff --git a/ompi/mca/coll/sync/.windows b/ompi/mca/coll/sync/.windows index cc346daabd..8d2f3e3450 100644 --- a/ompi/mca/coll/sync/.windows +++ b/ompi/mca/coll/sync/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte diff --git a/ompi/mca/common/sm/.windows b/ompi/mca/common/sm/.windows index 78e0bcc194..d3d471108a 100644 --- a/ompi/mca/common/sm/.windows +++ b/ompi/mca/common/sm/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -exclude_list=common_sm_mmap.c;common_sm_mmap.h;common_sm_sysv.c;common_sm_sysv.h;common_sm_posix.c;common_sm_posix.h +# +# Copyright (c) 2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +exclude_list=common_sm_mmap.c;common_sm_mmap.h;common_sm_sysv.c;common_sm_sysv.h;common_sm_posix.c;common_sm_posix.h diff --git a/ompi/mca/dpm/orte/.windows b/ompi/mca/dpm/orte/.windows index cc346daabd..8d2f3e3450 100644 --- a/ompi/mca/dpm/orte/.windows +++ b/ompi/mca/dpm/orte/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte diff --git a/ompi/mca/mpool/rdma/.windows b/ompi/mca/mpool/rdma/.windows index cc346daabd..8d2f3e3450 100644 --- a/ompi/mca/mpool/rdma/.windows +++ b/ompi/mca/mpool/rdma/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte diff --git a/ompi/mca/mpool/sm/.windows b/ompi/mca/mpool/sm/.windows index 49d5029a49..bd2a56336f 100644 --- a/ompi/mca/mpool/sm/.windows +++ b/ompi/mca/mpool/sm/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte libmca_common_sm +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte libmca_common_sm diff --git a/ompi/mca/osc/pt2pt/.windows b/ompi/mca/osc/pt2pt/.windows index 08f0304c72..5e0af15aec 100644 --- a/ompi/mca/osc/pt2pt/.windows +++ b/ompi/mca/osc/pt2pt/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi diff --git a/ompi/mca/osc/rdma/.windows b/ompi/mca/osc/rdma/.windows index 08f0304c72..5e0af15aec 100644 --- a/ompi/mca/osc/rdma/.windows +++ b/ompi/mca/osc/rdma/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi diff --git a/ompi/mca/pml/cm/.windows b/ompi/mca/pml/cm/.windows index 08f0304c72..5e0af15aec 100644 --- a/ompi/mca/pml/cm/.windows +++ b/ompi/mca/pml/cm/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi diff --git a/ompi/mca/pml/ob1/.windows b/ompi/mca/pml/ob1/.windows index cc346daabd..8d2f3e3450 100644 --- a/ompi/mca/pml/ob1/.windows +++ b/ompi/mca/pml/ob1/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte diff --git a/ompi/mca/pml/v/.windows b/ompi/mca/pml/v/.windows index 522a0151e1..c0c20359dc 100644 --- a/ompi/mca/pml/v/.windows +++ b/ompi/mca/pml/v/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte +# +# Copyright (c) 2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte diff --git a/ompi/mca/pubsub/orte/.windows b/ompi/mca/pubsub/orte/.windows index cc346daabd..8d2f3e3450 100644 --- a/ompi/mca/pubsub/orte/.windows +++ b/ompi/mca/pubsub/orte/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte diff --git a/ompi/mca/rcache/vma/.windows b/ompi/mca/rcache/vma/.windows index cc346daabd..8d2f3e3450 100644 --- a/ompi/mca/rcache/vma/.windows +++ b/ompi/mca/rcache/vma/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libmpi libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libmpi libopen-rte diff --git a/ompi/mpi/CMakeLists.txt b/ompi/mpi/CMakeLists.txt index d1a729b86f..a7d72f2877 100644 --- a/ompi/mpi/CMakeLists.txt +++ b/ompi/mpi/CMakeLists.txt @@ -1,20 +1,20 @@ -# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -IF(OMPI_WANT_CXX_BINDINGS) - ADD_SUBDIRECTORY(cxx) -ELSE(OMPI_WANT_CXX_BINDINGS) - MESSAGE(STATUS "Skipping MPI C++ interface") -ENDIF(OMPI_WANT_CXX_BINDINGS) - -IF(OMPI_WANT_F77_BINDINGS) - ADD_SUBDIRECTORY(f77) -ELSE(OMPI_WANT_F77_BINDINGS) - MESSAGE(STATUS "Skipping MPI F77 interface") -ENDIF(OMPI_WANT_F77_BINDINGS) +# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +IF(OMPI_WANT_CXX_BINDINGS) + ADD_SUBDIRECTORY(cxx) +ELSE(OMPI_WANT_CXX_BINDINGS) + MESSAGE(STATUS "Skipping MPI C++ interface") +ENDIF(OMPI_WANT_CXX_BINDINGS) + +IF(OMPI_WANT_F77_BINDINGS) + ADD_SUBDIRECTORY(f77) +ELSE(OMPI_WANT_F77_BINDINGS) + MESSAGE(STATUS "Skipping MPI F77 interface") +ENDIF(OMPI_WANT_F77_BINDINGS) diff --git a/ompi/mpi/cxx/CMakeLists.txt b/ompi/mpi/cxx/CMakeLists.txt index 01f8010560..1af2363a3f 100644 --- a/ompi/mpi/cxx/CMakeLists.txt +++ b/ompi/mpi/cxx/CMakeLists.txt @@ -1,55 +1,55 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB CXX_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -# skip the file interface sources if not wanted -IF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) - SET( TMP_SRC "" ) - FOREACH ( FILENAME ${CXX_SOURCE_FILES}) - GET_FILENAME_COMPONENT(relname ${FILENAME} NAME) - IF (NOT ${relname} MATCHES "file.*[ch]$") - LIST(APPEND TMP_SRC ${FILENAME}) - ENDIF (NOT ${relname} MATCHES "file.*[ch]$") - ENDFOREACH(FILENAME) - SET( CXX_SOURCE_FILES ${TMP_SRC}) -ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) - -ADD_LIBRARY (libmpi_cxx ${CXX_SOURCE_FILES}) - -SET_TARGET_PROPERTIES (libmpi_cxx PROPERTIES LINKER_LANGUAGE CXX) - -# Set compile flags for this target -IF (BUILD_SHARED_LIBS) - - TARGET_LINK_LIBRARIES(libmpi_cxx libmpi libopen-pal) - # Need OMPI_BUILDING_CXX_BINDINGS_LIBRARY so that we can get the path - # names correct inside the MPI C++ library. OMPI_SKIP_MPICXX is necessary - # so that mpi.h doesn't include mpicxx.h through the incorrect pathname - # in any of the C++ bindings .c files. Just use the define for this purpose - # from user code. - ADD_DEFINITIONS (-D_USRDLL -DOMPI_BUILDING - -DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1 -DOMPI_SKIP_MPICXX=1 - -DOMPI_IMPORTS -DOPAL_IMPORTS) - -ELSE (BUILD_SHARED_LIBS) - ADD_DEFINITIONS (-D_LIB -DOMPI_BUILDING - -DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1 -DOMPI_SKIP_MPICXX=1) -ENDIF(BUILD_SHARED_LIBS) - -INSTALL(TARGETS libmpi_cxx - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - -IF (OMPI_DEBUG_BUILD) - INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi_cxx${CMAKE_DEBUG_POSTFIX}.pdb - DESTINATION bin) -ENDIF (OMPI_DEBUG_BUILD) - +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB CXX_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +# skip the file interface sources if not wanted +IF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) + SET( TMP_SRC "" ) + FOREACH ( FILENAME ${CXX_SOURCE_FILES}) + GET_FILENAME_COMPONENT(relname ${FILENAME} NAME) + IF (NOT ${relname} MATCHES "file.*[ch]$") + LIST(APPEND TMP_SRC ${FILENAME}) + ENDIF (NOT ${relname} MATCHES "file.*[ch]$") + ENDFOREACH(FILENAME) + SET( CXX_SOURCE_FILES ${TMP_SRC}) +ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) + +ADD_LIBRARY (libmpi_cxx ${CXX_SOURCE_FILES}) + +SET_TARGET_PROPERTIES (libmpi_cxx PROPERTIES LINKER_LANGUAGE CXX) + +# Set compile flags for this target +IF (BUILD_SHARED_LIBS) + + TARGET_LINK_LIBRARIES(libmpi_cxx libmpi libopen-pal) + # Need OMPI_BUILDING_CXX_BINDINGS_LIBRARY so that we can get the path + # names correct inside the MPI C++ library. OMPI_SKIP_MPICXX is necessary + # so that mpi.h doesn't include mpicxx.h through the incorrect pathname + # in any of the C++ bindings .c files. Just use the define for this purpose + # from user code. + ADD_DEFINITIONS (-D_USRDLL -DOMPI_BUILDING + -DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1 -DOMPI_SKIP_MPICXX=1 + -DOMPI_IMPORTS -DOPAL_IMPORTS) + +ELSE (BUILD_SHARED_LIBS) + ADD_DEFINITIONS (-D_LIB -DOMPI_BUILDING + -DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1 -DOMPI_SKIP_MPICXX=1) +ENDIF(BUILD_SHARED_LIBS) + +INSTALL(TARGETS libmpi_cxx + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +IF (OMPI_DEBUG_BUILD) + INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi_cxx${CMAKE_DEBUG_POSTFIX}.pdb + DESTINATION bin) +ENDIF (OMPI_DEBUG_BUILD) + diff --git a/ompi/mpi/f77/CMakeLists.txt b/ompi/mpi/f77/CMakeLists.txt index 7f028c819a..fa9769adab 100644 --- a/ompi/mpi/f77/CMakeLists.txt +++ b/ompi/mpi/f77/CMakeLists.txt @@ -1,74 +1,74 @@ -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB OMPI_F77_FILES "*.c") -FILE(GLOB OMPI_F77_HEADER_FILES "*.h") - -# Remove all MPI_File related files if the option is not selected -IF (NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) - MESSAGE( STATUS "Skipping the MPI I/O interface") - SET( TMP_SRC "" ) - FOREACH ( FILENAME ${OMPI_F77_FILES}) - GET_FILENAME_COMPONENT(relname ${FILENAME} NAME) - IF (NOT ${relname} MATCHES "file.*[ch]$") - IF (NOT ${relname} STREQUAL "register_datarep.c") - LIST(APPEND TMP_SRC ${FILENAME}) - ENDIF (NOT ${relname} STREQUAL "register_datarep.c") - ENDIF(NOT ${relname} MATCHES "file.*[ch]$") - ENDFOREACH(FILENAME ${OMPI_F77_FILES}) - SET( OMPI_F77_FILES ${TMP_SRC}) -ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) - -SET_SOURCE_FILES_PROPERTIES(${OMPI_F77_FILES} PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=0 ${OMPI_C_DEF_PRE}OMPI_COMPILING_F77_WRAPPERS=1") - -IF(OMPI_ENABLE_MPI_PROFILING) - # As weak symbols are not supported by MS compiler, - # we have to compile the C source files again for profiler, - # i.e. add the pre-processor "OMPI_PROFILING_DEFINES" explicitly. - - # copy the files to the build directory with a prefix. - FOREACH(FILE_NAME ${OMPI_F77_FILES}) - GET_FILENAME_COMPONENT(relname ${FILE_NAME} NAME) - CONFIGURE_FILE(${FILE_NAME} - ${PROJECT_BINARY_DIR}/profile/p${relname} [COPYONLY]) - ENDFOREACH(FILE_NAME ${OMPI_F77_FILES}) - - FILE(GLOB OMPI_F77_PROFILE_FILES "${PROJECT_BINARY_DIR}/profile/*.c" ) - - SET_SOURCE_FILES_PROPERTIES(${OMPI_F77_PROFILE_FILES} PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=1 ${OMPI_C_DEF_PRE}OMPI_COMPILING_F77_WRAPPERS=1") - - SET(OMPI_F77_FILES ${OMPI_F77_FILES} ${OMPI_F77_PROFILE_FILES}) - SOURCE_GROUP(profile FILES ${OMPI_F77_PROFILE_FILES}) - -ELSE(OMPI_ENABLE_MPI_PROFILING) - MESSAGE( STATUS "Skipping the MPI profiling interface") -ENDIF(OMPI_ENABLE_MPI_PROFILING) - - -ADD_LIBRARY(libmpi_f77 ${OMPI_F77_FILES} ${OMPI_F77_HEADER_FILES}) -TARGET_LINK_LIBRARIES(libmpi_f77 libmpi) - -IF(BUILD_SHARED_LIBS) - ADD_DEFINITIONS(${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_CXX_LAN_FLAG}) -ELSE(BUILD_SHARED_LIBS) - ADD_DEFINITIONS(${OMPI_C_DEF_PRE}_LIB) -ENDIF(BUILD_SHARED_LIBS) - -INSTALL(TARGETS libmpi_f77 - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - -IF (OMPI_DEBUG_BUILD) - INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi_f77${CMAKE_DEBUG_POSTFIX}.pdb - DESTINATION bin) +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB OMPI_F77_FILES "*.c") +FILE(GLOB OMPI_F77_HEADER_FILES "*.h") + +# Remove all MPI_File related files if the option is not selected +IF (NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) + MESSAGE( STATUS "Skipping the MPI I/O interface") + SET( TMP_SRC "" ) + FOREACH ( FILENAME ${OMPI_F77_FILES}) + GET_FILENAME_COMPONENT(relname ${FILENAME} NAME) + IF (NOT ${relname} MATCHES "file.*[ch]$") + IF (NOT ${relname} STREQUAL "register_datarep.c") + LIST(APPEND TMP_SRC ${FILENAME}) + ENDIF (NOT ${relname} STREQUAL "register_datarep.c") + ENDIF(NOT ${relname} MATCHES "file.*[ch]$") + ENDFOREACH(FILENAME ${OMPI_F77_FILES}) + SET( OMPI_F77_FILES ${TMP_SRC}) +ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE) + +SET_SOURCE_FILES_PROPERTIES(${OMPI_F77_FILES} PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=0 ${OMPI_C_DEF_PRE}OMPI_COMPILING_F77_WRAPPERS=1") + +IF(OMPI_ENABLE_MPI_PROFILING) + # As weak symbols are not supported by MS compiler, + # we have to compile the C source files again for profiler, + # i.e. add the pre-processor "OMPI_PROFILING_DEFINES" explicitly. + + # copy the files to the build directory with a prefix. + FOREACH(FILE_NAME ${OMPI_F77_FILES}) + GET_FILENAME_COMPONENT(relname ${FILE_NAME} NAME) + CONFIGURE_FILE(${FILE_NAME} + ${PROJECT_BINARY_DIR}/profile/p${relname} [COPYONLY]) + ENDFOREACH(FILE_NAME ${OMPI_F77_FILES}) + + FILE(GLOB OMPI_F77_PROFILE_FILES "${PROJECT_BINARY_DIR}/profile/*.c" ) + + SET_SOURCE_FILES_PROPERTIES(${OMPI_F77_PROFILE_FILES} PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=1 ${OMPI_C_DEF_PRE}OMPI_COMPILING_F77_WRAPPERS=1") + + SET(OMPI_F77_FILES ${OMPI_F77_FILES} ${OMPI_F77_PROFILE_FILES}) + SOURCE_GROUP(profile FILES ${OMPI_F77_PROFILE_FILES}) + +ELSE(OMPI_ENABLE_MPI_PROFILING) + MESSAGE( STATUS "Skipping the MPI profiling interface") +ENDIF(OMPI_ENABLE_MPI_PROFILING) + + +ADD_LIBRARY(libmpi_f77 ${OMPI_F77_FILES} ${OMPI_F77_HEADER_FILES}) +TARGET_LINK_LIBRARIES(libmpi_f77 libmpi) + +IF(BUILD_SHARED_LIBS) + ADD_DEFINITIONS(${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_CXX_LAN_FLAG}) +ELSE(BUILD_SHARED_LIBS) + ADD_DEFINITIONS(${OMPI_C_DEF_PRE}_LIB) +ENDIF(BUILD_SHARED_LIBS) + +INSTALL(TARGETS libmpi_f77 + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +IF (OMPI_DEBUG_BUILD) + INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi_f77${CMAKE_DEBUG_POSTFIX}.pdb + DESTINATION bin) ENDIF (OMPI_DEBUG_BUILD) \ No newline at end of file diff --git a/ompi/tools/CMakeLists.txt b/ompi/tools/CMakeLists.txt index 106602ab6f..8d8d091044 100644 --- a/ompi/tools/CMakeLists.txt +++ b/ompi/tools/CMakeLists.txt @@ -1,118 +1,118 @@ -# Copyright (c) 2007-2009 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2008 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -ADD_SUBDIRECTORY(ompi_info) -ADD_SUBDIRECTORY(ompi-server) - - -MACRO(CONFIGURE_WRAPPER_DATA_FILE APP_NAME) - - # mpic++ and mpicxx share the same input file - IF(${APP_NAME} STREQUAL "mpicxx") - SET(INPUT_PREFIX "mpic++") - ELSE(${APP_NAME} STREQUAL "mpicxx") - SET(INPUT_PREFIX ${APP_NAME}) - ENDIF(${APP_NAME} STREQUAL "mpicxx") - - FILE(READ ${OpenMPI_SOURCE_DIR}/ompi/tools/wrappers/${INPUT_PREFIX}-wrapper-data.txt.in FILE_STRING) - STRING(REGEX REPLACE "-l[-a-zA-Z0-9_]+ " "" OUTPUT ${FILE_STRING}) - - # create a temporary input file, for "write file" command only - # replace the variables in the first level. :( - FILE(WRITE ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in "${OUTPUT}") - - CONFIGURE_FILE(${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in - ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}-wrapper-data.txt @ONLY) - INSTALL(FILES ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}-wrapper-data.txt - DESTINATION share/openmpi) - CONFIGURE_FILE(${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in - ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}.exe-wrapper-data.txt @ONLY) - INSTALL(FILES ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}.exe-wrapper-data.txt - DESTINATION share/openmpi) -ENDMACRO() - -# select debug or release libraries at configure time -IF(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_BASE_LIBS - "libmpid.lib libopen-pald.lib libopen-rted.lib advapi32.lib Ws2_32.lib shlwapi.lib") -ELSE(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_BASE_LIBS - "libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib Ws2_32.lib shlwapi.lib") -ENDIF(OMPI_DEBUG_BUILD) - -IF(BUILD_SHARED_LIBS) - SET(OMPI_WRAPPER_EXTRA_CFLAGS - "${OMPI_C_LAN_FLAG} ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS") -ELSE(BUILD_SHARED_LIBS) - IF(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_EXTRA_CFLAGS "${OMPI_C_LAN_FLAG} ${OMPI_C_MD_DEBUG}") - ELSE(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_EXTRA_CFLAGS "${OMPI_C_LAN_FLAG} ${OMPI_C_MD}") - ENDIF(OMPI_DEBUG_BUILD) -ENDIF(BUILD_SHARED_LIBS) - -SET(OMPI_WRAPPER_EXTRA_LIBS ${OMPI_WRAPPER_BASE_LIBS}) -CONFIGURE_WRAPPER_DATA_FILE(mpicc) -UNSET(OMPI_WRAPPER_EXTRA_LIBS) - -IF(OMPI_WANT_CXX_BINDINGS) - IF(BUILD_SHARED_LIBS) - SET(OMPI_WRAPPER_EXTRA_CXXFLAGS - "${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION} ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS") - ELSE(BUILD_SHARED_LIBS) - IF(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION} ${OMPI_C_MD_DEBUG}") - ELSE(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION} ${OMPI_C_MD}") - ENDIF(OMPI_DEBUG_BUILD) - ENDIF(BUILD_SHARED_LIBS) - - # select debug or release libraries at configure time - IF(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxxd.lib ${OMPI_WRAPPER_BASE_LIBS}") - ELSE(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxx.lib ${OMPI_WRAPPER_BASE_LIBS}") - ENDIF(OMPI_DEBUG_BUILD) - - CONFIGURE_WRAPPER_DATA_FILE(mpic++) - CONFIGURE_WRAPPER_DATA_FILE(mpicxx) -ENDIF(OMPI_WANT_CXX_BINDINGS) - -IF(OMPI_WANT_F77_BINDINGS) - IF(BUILD_SHARED_LIBS) - SET(OMPI_WRAPPER_EXTRA_FFLAGS - "") - ELSE(BUILD_SHARED_LIBS) - IF(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_EXTRA_FFLAGS "${F77_DYNAMIC_FLAG_DEBUG}") - ELSE(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_EXTRA_FFLAGS "${F77_DYNAMIC_FLAG}") - ENDIF(OMPI_DEBUG_BUILD) - ENDIF(BUILD_SHARED_LIBS) - - # select debug or release libraries at configure time - IF(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_EXTRA_LIBS "libmpi_f77d.lib ${OMPI_WRAPPER_BASE_LIBS}") - ELSE(OMPI_DEBUG_BUILD) - SET(OMPI_WRAPPER_EXTRA_LIBS "libmpi_f77.lib ${OMPI_WRAPPER_BASE_LIBS}") - ENDIF(OMPI_DEBUG_BUILD) - CONFIGURE_WRAPPER_DATA_FILE(mpif77) - UNSET(OMPI_WRAPPER_EXTRA_LIBS) -ENDIF(OMPI_WANT_F77_BINDINGS) - -#IF(OMPI_WANT_F90_BINDINGS) -# CONFIGURE_WRAPPER_DATA_FILE(mpif90) -#ENDIF(OMPI_WANT_F90_BINDINGS) - -IF(WANT_INSTALL_HEADERS) - CONFIGURE_WRAPPER_DATA_FILE(opal-wrapper) -ENDIF(WANT_INSTALL_HEADERS) +# Copyright (c) 2007-2009 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2008 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +ADD_SUBDIRECTORY(ompi_info) +ADD_SUBDIRECTORY(ompi-server) + + +MACRO(CONFIGURE_WRAPPER_DATA_FILE APP_NAME) + + # mpic++ and mpicxx share the same input file + IF(${APP_NAME} STREQUAL "mpicxx") + SET(INPUT_PREFIX "mpic++") + ELSE(${APP_NAME} STREQUAL "mpicxx") + SET(INPUT_PREFIX ${APP_NAME}) + ENDIF(${APP_NAME} STREQUAL "mpicxx") + + FILE(READ ${OpenMPI_SOURCE_DIR}/ompi/tools/wrappers/${INPUT_PREFIX}-wrapper-data.txt.in FILE_STRING) + STRING(REGEX REPLACE "-l[-a-zA-Z0-9_]+ " "" OUTPUT ${FILE_STRING}) + + # create a temporary input file, for "write file" command only + # replace the variables in the first level. :( + FILE(WRITE ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in "${OUTPUT}") + + CONFIGURE_FILE(${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in + ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}-wrapper-data.txt @ONLY) + INSTALL(FILES ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}-wrapper-data.txt + DESTINATION share/openmpi) + CONFIGURE_FILE(${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in + ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}.exe-wrapper-data.txt @ONLY) + INSTALL(FILES ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}.exe-wrapper-data.txt + DESTINATION share/openmpi) +ENDMACRO() + +# select debug or release libraries at configure time +IF(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_BASE_LIBS + "libmpid.lib libopen-pald.lib libopen-rted.lib advapi32.lib Ws2_32.lib shlwapi.lib") +ELSE(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_BASE_LIBS + "libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib Ws2_32.lib shlwapi.lib") +ENDIF(OMPI_DEBUG_BUILD) + +IF(BUILD_SHARED_LIBS) + SET(OMPI_WRAPPER_EXTRA_CFLAGS + "${OMPI_C_LAN_FLAG} ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS") +ELSE(BUILD_SHARED_LIBS) + IF(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_EXTRA_CFLAGS "${OMPI_C_LAN_FLAG} ${OMPI_C_MD_DEBUG}") + ELSE(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_EXTRA_CFLAGS "${OMPI_C_LAN_FLAG} ${OMPI_C_MD}") + ENDIF(OMPI_DEBUG_BUILD) +ENDIF(BUILD_SHARED_LIBS) + +SET(OMPI_WRAPPER_EXTRA_LIBS ${OMPI_WRAPPER_BASE_LIBS}) +CONFIGURE_WRAPPER_DATA_FILE(mpicc) +UNSET(OMPI_WRAPPER_EXTRA_LIBS) + +IF(OMPI_WANT_CXX_BINDINGS) + IF(BUILD_SHARED_LIBS) + SET(OMPI_WRAPPER_EXTRA_CXXFLAGS + "${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION} ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS") + ELSE(BUILD_SHARED_LIBS) + IF(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION} ${OMPI_C_MD_DEBUG}") + ELSE(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION} ${OMPI_C_MD}") + ENDIF(OMPI_DEBUG_BUILD) + ENDIF(BUILD_SHARED_LIBS) + + # select debug or release libraries at configure time + IF(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxxd.lib ${OMPI_WRAPPER_BASE_LIBS}") + ELSE(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxx.lib ${OMPI_WRAPPER_BASE_LIBS}") + ENDIF(OMPI_DEBUG_BUILD) + + CONFIGURE_WRAPPER_DATA_FILE(mpic++) + CONFIGURE_WRAPPER_DATA_FILE(mpicxx) +ENDIF(OMPI_WANT_CXX_BINDINGS) + +IF(OMPI_WANT_F77_BINDINGS) + IF(BUILD_SHARED_LIBS) + SET(OMPI_WRAPPER_EXTRA_FFLAGS + "") + ELSE(BUILD_SHARED_LIBS) + IF(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_EXTRA_FFLAGS "${F77_DYNAMIC_FLAG_DEBUG}") + ELSE(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_EXTRA_FFLAGS "${F77_DYNAMIC_FLAG}") + ENDIF(OMPI_DEBUG_BUILD) + ENDIF(BUILD_SHARED_LIBS) + + # select debug or release libraries at configure time + IF(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_EXTRA_LIBS "libmpi_f77d.lib ${OMPI_WRAPPER_BASE_LIBS}") + ELSE(OMPI_DEBUG_BUILD) + SET(OMPI_WRAPPER_EXTRA_LIBS "libmpi_f77.lib ${OMPI_WRAPPER_BASE_LIBS}") + ENDIF(OMPI_DEBUG_BUILD) + CONFIGURE_WRAPPER_DATA_FILE(mpif77) + UNSET(OMPI_WRAPPER_EXTRA_LIBS) +ENDIF(OMPI_WANT_F77_BINDINGS) + +#IF(OMPI_WANT_F90_BINDINGS) +# CONFIGURE_WRAPPER_DATA_FILE(mpif90) +#ENDIF(OMPI_WANT_F90_BINDINGS) + +IF(WANT_INSTALL_HEADERS) + CONFIGURE_WRAPPER_DATA_FILE(opal-wrapper) +ENDIF(WANT_INSTALL_HEADERS) diff --git a/ompi/tools/ompi-server/CMakeLists.txt b/ompi/tools/ompi-server/CMakeLists.txt index 128453369f..6e884674ba 100644 --- a/ompi/tools/ompi-server/CMakeLists.txt +++ b/ompi/tools/ompi-server/CMakeLists.txt @@ -1,32 +1,32 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2008 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE OMPI_SERVER_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (ompi-server ${OMPI_SERVER_SOURCE_FILES}) - -ADD_DEPENDENCIES(ompi-server libmpi) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(ompi-server PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(ompi-server PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (ompi-server libmpi libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) - -INSTALL(TARGETS ompi-server - DESTINATION bin) -INSTALL(FILES help-ompi-server.txt DESTINATION share/openmpi) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2008 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE OMPI_SERVER_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (ompi-server ${OMPI_SERVER_SOURCE_FILES}) + +ADD_DEPENDENCIES(ompi-server libmpi) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(ompi-server PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(ompi-server PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (ompi-server libmpi libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) + +INSTALL(TARGETS ompi-server + DESTINATION bin) +INSTALL(FILES help-ompi-server.txt DESTINATION share/openmpi) diff --git a/ompi/tools/ompi_info/CMakeLists.txt b/ompi/tools/ompi_info/CMakeLists.txt index 72776487f3..2587e98ac2 100644 --- a/ompi/tools/ompi_info/CMakeLists.txt +++ b/ompi/tools/ompi_info/CMakeLists.txt @@ -1,29 +1,29 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE OMPI_INFO_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (ompi_info ${OMPI_INFO_SOURCE_FILES}) - -ADD_DEPENDENCIES(ompi_info libmpi) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(ompi_info PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(ompi_info PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (ompi_info libmpi libopen-rte libopen-pal Ws2_32.lib shlwapi.lib) - -INSTALL(TARGETS ompi_info - DESTINATION bin) -INSTALL(FILES help-ompi_info.txt DESTINATION share/openmpi) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE OMPI_INFO_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (ompi_info ${OMPI_INFO_SOURCE_FILES}) + +ADD_DEPENDENCIES(ompi_info libmpi) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(ompi_info PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(ompi_info PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (ompi_info libmpi libopen-rte libopen-pal Ws2_32.lib shlwapi.lib) + +INSTALL(TARGETS ompi_info + DESTINATION bin) +INSTALL(FILES help-ompi_info.txt DESTINATION share/openmpi) diff --git a/opal/CMakeLists.txt b/opal/CMakeLists.txt index 6b1128aee8..a3e24ae7b6 100644 --- a/opal/CMakeLists.txt +++ b/opal/CMakeLists.txt @@ -1,147 +1,147 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -PROJECT (OPAL) - - - -# Add include sub directory to gernerate opal_config.h -ADD_SUBDIRECTORY (include) - -# These two files need to be compiled twice, one time with preprocessor CHECKSUM. -# Make one copy of them with another file name and add them into the project. -CONFIGURE_FILE(datatype/opal_datatype_pack.c ${PROJECT_BINARY_DIR}/datatype/opal_datatype_pack_checksum.c [COPYONLY]) -CONFIGURE_FILE(datatype/opal_datatype_unpack.c ${PROJECT_BINARY_DIR}/datatype/opal_datatype_unpack_checksum.c [COPYONLY]) - -SET(DATATYPE_CHECKSUM_FILES ${PROJECT_BINARY_DIR}/datatype/opal_datatype_pack_checksum.c - ${PROJECT_BINARY_DIR}/datatype/opal_datatype_unpack_checksum.c ) - -SET_SOURCE_FILES_PROPERTIES(${DATATYPE_CHECKSUM_FILES} - PROPERTIES COMPILE_DEFINITIONS CHECKSUM) -SET(OPAL_SOURCE_FILES ${OPAL_SOURCE_FILES} ${DATATYPE_CHECKSUM_FILES}) -SOURCE_GROUP(datatype FILES ${DATATYPE_CHECKSUM_FILES}) - -IF(OPAL_WANT_LIBLTDL) - INCLUDE(find_libltdl) -ENDIF(OPAL_WANT_LIBLTDL) - - -# Include headers. -FILE(GLOB OPAL_INCLUDE_FILES "include/*.h" "include/opal/*.h" "include/opal/sys/win32/*.h") -SOURCE_GROUP(include FILES ${OPAL_INCLUDE_FILES}) - -SET (OPAL_SOURCE_FILES - ${OPAL_SOURCE_FILES} - ${OPAL_EVENT_FILES} - ${OPAL_INCLUDE_FILES} -) - -# Recuresive search sub directories excluding mca, event, include and tools. -# Add sources in different source groups. -INCLUDE(list_subdirs) -CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}" OPAL_SUBDIRS) - -SET(OPAL_EXCLUDE_SUBDIRS event include libltdl mca tools) - -FOREACH(OPAL_SUBDIR ${OPAL_SUBDIRS}) - - LIST(FIND OPAL_EXCLUDE_SUBDIRS ${OPAL_SUBDIR} OPAL_EXCLUDE_SUBDIR) - - IF(${OPAL_EXCLUDE_SUBDIR} EQUAL -1) - - FILE(GLOB_RECURSE OPAL_${OPAL_SUBDIR}_FILES - "${OPAL_SUBDIR}/*.h" "${OPAL_SUBDIR}/*.c" "${OPAL_SUBDIR}/*.cc" "${OPAL_SUBDIR}/*.cpp") - - SET (OPAL_SOURCE_FILES - ${OPAL_SOURCE_FILES} - ${OPAL_${OPAL_SUBDIR}_FILES} - ) - - SOURCE_GROUP("${OPAL_SUBDIR}" FILES ${OPAL_${OPAL_SUBDIR}_FILES}) - - ENDIF(${OPAL_EXCLUDE_SUBDIR} EQUAL -1) - -ENDFOREACH(OPAL_SUBDIR ${OPAL_SUBDIRS}) - -#only generate if it's not a tarball -IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/keyval/keyval_lex.c) - ADD_FLEX_FILE(OPAL_SOURCE_FILES ./util/keyval/keyval_lex.l - opal_util_keyval_yy "${PROJECT_BINARY_DIR}/util/keyval/") -ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/keyval/keyval_lex.c) - -IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/show_help_lex.c) - ADD_FLEX_FILE(OPAL_SOURCE_FILES ./util/show_help_lex.l - opal_show_help_yy "${PROJECT_BINARY_DIR}/util/") -ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/show_help_lex.c) - - -# Add source files from mca subdirectories. -INCLUDE (check_mca_subdirs) -SET (OPAL_SOURCE_FILES ${OPAL_SOURCE_FILES} ${MCA_FILES}) - - -ADD_LIBRARY (libopen-pal ${OPAL_SOURCE_FILES}) - -# Set compile flags for this target -IF (BUILD_SHARED_LIBS) - ADD_CUSTOM_COMMAND(TARGET libopen-pal POST_BUILD - COMMAND ${OMPI_LIB_CMD} ${EVENT_OBJ_FILES} ${OMPI_LIB_CMD_OUTPUT}${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMENT "Generating static event library." - ) - - SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_EXPORTS") - IF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND) - INCLUDE_DIRECTORIES(${LIBLTDL_INCLUDE_PATH}) - TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib ${LIBLTDL_LIB}) - ELSE(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND) - TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib) - ENDIF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND) -ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB") -ENDIF(BUILD_SHARED_LIBS) - -# Generate install_dirs.h -SET(prefix ${CMAKE_INSTALL_PREFIX}) -SET(bindir ${prefix}/bin) -SET(sbindir ${prefix}/sbin) -SET(libexecdir ${prefix}/libexec) -SET(datarootdir ${prefix}/share) -SET(datadir ${prefix}/share) -SET(PACKAGE "openmpi") -SET(sysconfdir ${prefix}/etc) -SET(sharedstatedir ${prefix}/com) -SET(localstatedir ${prefix}/var) -SET(libdir ${prefix}/lib) -SET(includedir ${prefix}/include) -SET(infodir ${datarootdir}/info) -SET(mandir ${datarootdir}/man) -CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/opal/mca/installdirs/config/install_dirs.h.in - ${OpenMPI_BINARY_DIR}/opal/mca/installdirs/config/install_dirs.h) - -# generate version.h -CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/opal/include/opal/version.h.in ${OpenMPI_BINARY_DIR}/opal/include/opal/version.h) - -ADD_SUBDIRECTORY(tools) - -# Install libraries, shared files. -INSTALL(TARGETS libopen-pal - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -INSTALL(FILES runtime/help-opal-runtime.txt - mca/base/help-mca-base.txt - mca/base/help-mca-param.txt - DESTINATION share/openmpi) - -IF (OMPI_DEBUG_BUILD) - INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libopen-pal${CMAKE_DEBUG_POSTFIX}.pdb - DESTINATION bin) -ENDIF (OMPI_DEBUG_BUILD) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +PROJECT (OPAL) + + + +# Add include sub directory to gernerate opal_config.h +ADD_SUBDIRECTORY (include) + +# These two files need to be compiled twice, one time with preprocessor CHECKSUM. +# Make one copy of them with another file name and add them into the project. +CONFIGURE_FILE(datatype/opal_datatype_pack.c ${PROJECT_BINARY_DIR}/datatype/opal_datatype_pack_checksum.c [COPYONLY]) +CONFIGURE_FILE(datatype/opal_datatype_unpack.c ${PROJECT_BINARY_DIR}/datatype/opal_datatype_unpack_checksum.c [COPYONLY]) + +SET(DATATYPE_CHECKSUM_FILES ${PROJECT_BINARY_DIR}/datatype/opal_datatype_pack_checksum.c + ${PROJECT_BINARY_DIR}/datatype/opal_datatype_unpack_checksum.c ) + +SET_SOURCE_FILES_PROPERTIES(${DATATYPE_CHECKSUM_FILES} + PROPERTIES COMPILE_DEFINITIONS CHECKSUM) +SET(OPAL_SOURCE_FILES ${OPAL_SOURCE_FILES} ${DATATYPE_CHECKSUM_FILES}) +SOURCE_GROUP(datatype FILES ${DATATYPE_CHECKSUM_FILES}) + +IF(OPAL_WANT_LIBLTDL) + INCLUDE(find_libltdl) +ENDIF(OPAL_WANT_LIBLTDL) + + +# Include headers. +FILE(GLOB OPAL_INCLUDE_FILES "include/*.h" "include/opal/*.h" "include/opal/sys/win32/*.h") +SOURCE_GROUP(include FILES ${OPAL_INCLUDE_FILES}) + +SET (OPAL_SOURCE_FILES + ${OPAL_SOURCE_FILES} + ${OPAL_EVENT_FILES} + ${OPAL_INCLUDE_FILES} +) + +# Recuresive search sub directories excluding mca, event, include and tools. +# Add sources in different source groups. +INCLUDE(list_subdirs) +CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}" OPAL_SUBDIRS) + +SET(OPAL_EXCLUDE_SUBDIRS event include libltdl mca tools) + +FOREACH(OPAL_SUBDIR ${OPAL_SUBDIRS}) + + LIST(FIND OPAL_EXCLUDE_SUBDIRS ${OPAL_SUBDIR} OPAL_EXCLUDE_SUBDIR) + + IF(${OPAL_EXCLUDE_SUBDIR} EQUAL -1) + + FILE(GLOB_RECURSE OPAL_${OPAL_SUBDIR}_FILES + "${OPAL_SUBDIR}/*.h" "${OPAL_SUBDIR}/*.c" "${OPAL_SUBDIR}/*.cc" "${OPAL_SUBDIR}/*.cpp") + + SET (OPAL_SOURCE_FILES + ${OPAL_SOURCE_FILES} + ${OPAL_${OPAL_SUBDIR}_FILES} + ) + + SOURCE_GROUP("${OPAL_SUBDIR}" FILES ${OPAL_${OPAL_SUBDIR}_FILES}) + + ENDIF(${OPAL_EXCLUDE_SUBDIR} EQUAL -1) + +ENDFOREACH(OPAL_SUBDIR ${OPAL_SUBDIRS}) + +#only generate if it's not a tarball +IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/keyval/keyval_lex.c) + ADD_FLEX_FILE(OPAL_SOURCE_FILES ./util/keyval/keyval_lex.l + opal_util_keyval_yy "${PROJECT_BINARY_DIR}/util/keyval/") +ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/keyval/keyval_lex.c) + +IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/show_help_lex.c) + ADD_FLEX_FILE(OPAL_SOURCE_FILES ./util/show_help_lex.l + opal_show_help_yy "${PROJECT_BINARY_DIR}/util/") +ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/show_help_lex.c) + + +# Add source files from mca subdirectories. +INCLUDE (check_mca_subdirs) +SET (OPAL_SOURCE_FILES ${OPAL_SOURCE_FILES} ${MCA_FILES}) + + +ADD_LIBRARY (libopen-pal ${OPAL_SOURCE_FILES}) + +# Set compile flags for this target +IF (BUILD_SHARED_LIBS) + ADD_CUSTOM_COMMAND(TARGET libopen-pal POST_BUILD + COMMAND ${OMPI_LIB_CMD} ${EVENT_OBJ_FILES} ${OMPI_LIB_CMD_OUTPUT}${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMENT "Generating static event library." + ) + + SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_EXPORTS") + IF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND) + INCLUDE_DIRECTORIES(${LIBLTDL_INCLUDE_PATH}) + TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib ${LIBLTDL_LIB}) + ELSE(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND) + TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib) + ENDIF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND) +ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB") +ENDIF(BUILD_SHARED_LIBS) + +# Generate install_dirs.h +SET(prefix ${CMAKE_INSTALL_PREFIX}) +SET(bindir ${prefix}/bin) +SET(sbindir ${prefix}/sbin) +SET(libexecdir ${prefix}/libexec) +SET(datarootdir ${prefix}/share) +SET(datadir ${prefix}/share) +SET(PACKAGE "openmpi") +SET(sysconfdir ${prefix}/etc) +SET(sharedstatedir ${prefix}/com) +SET(localstatedir ${prefix}/var) +SET(libdir ${prefix}/lib) +SET(includedir ${prefix}/include) +SET(infodir ${datarootdir}/info) +SET(mandir ${datarootdir}/man) +CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/opal/mca/installdirs/config/install_dirs.h.in + ${OpenMPI_BINARY_DIR}/opal/mca/installdirs/config/install_dirs.h) + +# generate version.h +CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/opal/include/opal/version.h.in ${OpenMPI_BINARY_DIR}/opal/include/opal/version.h) + +ADD_SUBDIRECTORY(tools) + +# Install libraries, shared files. +INSTALL(TARGETS libopen-pal + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +INSTALL(FILES runtime/help-opal-runtime.txt + mca/base/help-mca-base.txt + mca/base/help-mca-param.txt + DESTINATION share/openmpi) + +IF (OMPI_DEBUG_BUILD) + INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libopen-pal${CMAKE_DEBUG_POSTFIX}.pdb + DESTINATION bin) +ENDIF (OMPI_DEBUG_BUILD) diff --git a/opal/include/CMakeLists.txt b/opal/include/CMakeLists.txt index 1c7cab7d86..71a118ab8f 100644 --- a/opal/include/CMakeLists.txt +++ b/opal/include/CMakeLists.txt @@ -1,36 +1,36 @@ -# -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2008 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# make a temporary copy of the input file -FILE(READ ${OpenMPI_SOURCE_DIR}/ompi/include/mpi.h.in MPI_H_IN) - -# change the syntax of the copy into CMake understandable -STRING(REGEX REPLACE "#undef ([-_a-zA-Z0-9]+)[ ]*\n" "#cmakedefine \\1 \${\\1}\n" MPI_H_OUT "${MPI_H_IN}") -STRING(REPLACE "#cmakedefine OMPI_HAVE_FORTRAN_" "#define OMPI_HAVE_FORTRAN_" MPI_H_OUT "${MPI_H_OUT}") -STRING(REPLACE "{OMPI_PROVIDE_MPI_FILE_INTERFACE}" - "{OMPI_PROVIDE_MPI_FILE_INTERFACE_VAL}" MPI_H_OUT "${MPI_H_OUT}") -STRING(REPLACE "\${OMPI_WANT_CXX_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}") -STRING(REPLACE "\${OMPI_WANT_F77_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}") -STRING(REPLACE "\${OMPI_WANT_F90_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}") -STRING(REPLACE "\${OMPI_WANT_MPI_CXX_SEEK}" "1" MPI_H_OUT "${MPI_H_OUT}") -STRING(REPLACE "\${OMPI_WANT_MPI_INTERFACE_WARNING}" "1" MPI_H_OUT "${MPI_H_OUT}") - -FILE(WRITE ${OpenMPI_BINARY_DIR}/ompi/include/mpi.h.in "${MPI_H_OUT}") - -# generate mpi.h -CONFIGURE_FILE(${OpenMPI_BINARY_DIR}/ompi/include/mpi.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpi.h) - -IF(OMPI_WANT_F77_BINDINGS) - CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/mpif.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpif.h) - CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/mpif-config.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpif-config.h) -ENDIF(OMPI_WANT_F77_BINDINGS) +# +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2008 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# make a temporary copy of the input file +FILE(READ ${OpenMPI_SOURCE_DIR}/ompi/include/mpi.h.in MPI_H_IN) + +# change the syntax of the copy into CMake understandable +STRING(REGEX REPLACE "#undef ([-_a-zA-Z0-9]+)[ ]*\n" "#cmakedefine \\1 \${\\1}\n" MPI_H_OUT "${MPI_H_IN}") +STRING(REPLACE "#cmakedefine OMPI_HAVE_FORTRAN_" "#define OMPI_HAVE_FORTRAN_" MPI_H_OUT "${MPI_H_OUT}") +STRING(REPLACE "{OMPI_PROVIDE_MPI_FILE_INTERFACE}" + "{OMPI_PROVIDE_MPI_FILE_INTERFACE_VAL}" MPI_H_OUT "${MPI_H_OUT}") +STRING(REPLACE "\${OMPI_WANT_CXX_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}") +STRING(REPLACE "\${OMPI_WANT_F77_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}") +STRING(REPLACE "\${OMPI_WANT_F90_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}") +STRING(REPLACE "\${OMPI_WANT_MPI_CXX_SEEK}" "1" MPI_H_OUT "${MPI_H_OUT}") +STRING(REPLACE "\${OMPI_WANT_MPI_INTERFACE_WARNING}" "1" MPI_H_OUT "${MPI_H_OUT}") + +FILE(WRITE ${OpenMPI_BINARY_DIR}/ompi/include/mpi.h.in "${MPI_H_OUT}") + +# generate mpi.h +CONFIGURE_FILE(${OpenMPI_BINARY_DIR}/ompi/include/mpi.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpi.h) + +IF(OMPI_WANT_F77_BINDINGS) + CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/mpif.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpif.h) + CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/mpif-config.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpif-config.h) +ENDIF(OMPI_WANT_F77_BINDINGS) diff --git a/opal/mca/backtrace/none/.windows b/opal/mca/backtrace/none/.windows index 9b6c3d67d9..b8c2b6d4c9 100644 --- a/opal/mca/backtrace/none/.windows +++ b/opal/mca/backtrace/none/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -not_single_shared_lib=1 +# +# Copyright (c) 2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +not_single_shared_lib=1 diff --git a/opal/mca/compress/base/.windows b/opal/mca/compress/base/.windows index 00ac6ca144..70b13caa15 100644 --- a/opal/mca/compress/base/.windows +++ b/opal/mca/compress/base/.windows @@ -1,11 +1,11 @@ -# -# Copyright (c) 2009 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -exclude_list=compress_base_fns.c +# +# Copyright (c) 2009 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +exclude_list=compress_base_fns.c diff --git a/opal/mca/installdirs/config/.windows b/opal/mca/installdirs/config/.windows index e69b39ec41..9109e18a87 100644 --- a/opal/mca/installdirs/config/.windows +++ b/opal/mca/installdirs/config/.windows @@ -1,13 +1,13 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -not_single_shared_lib=1 -mca_priority=0 +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +not_single_shared_lib=1 +mca_priority=0 diff --git a/opal/mca/installdirs/env/.windows b/opal/mca/installdirs/env/.windows index 8af033f0c8..3340426f56 100644 --- a/opal/mca/installdirs/env/.windows +++ b/opal/mca/installdirs/env/.windows @@ -1,13 +1,13 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -not_single_shared_lib=1 -mca_priority=2 +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +not_single_shared_lib=1 +mca_priority=2 diff --git a/opal/mca/installdirs/windows/.windows b/opal/mca/installdirs/windows/.windows index 8d8f9c09e3..c36ff08b6c 100644 --- a/opal/mca/installdirs/windows/.windows +++ b/opal/mca/installdirs/windows/.windows @@ -1,13 +1,13 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -not_single_shared_lib=1 -mca_priority=1 +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +not_single_shared_lib=1 +mca_priority=1 diff --git a/opal/mca/timer/windows/.windows b/opal/mca/timer/windows/.windows index 25cd21676d..48475aa466 100644 --- a/opal/mca/timer/windows/.windows +++ b/opal/mca/timer/windows/.windows @@ -1,11 +1,11 @@ -# -# Copyright (c) 2009 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -not_single_shared_lib=1 +# +# Copyright (c) 2009 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +not_single_shared_lib=1 diff --git a/opal/tools/CMakeLists.txt b/opal/tools/CMakeLists.txt index 6231d5f78a..a857add66f 100644 --- a/opal/tools/CMakeLists.txt +++ b/opal/tools/CMakeLists.txt @@ -1,16 +1,16 @@ -# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2008 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -IF(OPAL_ENABLE_FT) - ADD_SUBDIRECTORY(opal-restart) -ENDIF(OPAL_ENABLE_FT) +# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2008 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +IF(OPAL_ENABLE_FT) + ADD_SUBDIRECTORY(opal-restart) +ENDIF(OPAL_ENABLE_FT) ADD_SUBDIRECTORY(wrappers) \ No newline at end of file diff --git a/opal/tools/opal-checkpoint/CMakeLists.txt b/opal/tools/opal-checkpoint/CMakeLists.txt index c9461efb58..4f64708b7a 100644 --- a/opal/tools/opal-checkpoint/CMakeLists.txt +++ b/opal/tools/opal-checkpoint/CMakeLists.txt @@ -1,29 +1,29 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE OPAL_CHECKPOINT_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (opal-checkpoint ${OPAL_CHECKPOINT_SOURCE_FILES}) - -ADD_DEPENDENCIES(opal-checkpoint libopen-pal) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(opal-checkpoint PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(opal-checkpoint PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (opal-checkpoint libopen-pal Ws2_32.lib shlwapi.lib) - -INSTALL(TARGETS opal-checkpoint - DESTINATION bin) -INSTALL(FILES help-opal-checkpoint.txt DESTINATION share/openmpi) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE OPAL_CHECKPOINT_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (opal-checkpoint ${OPAL_CHECKPOINT_SOURCE_FILES}) + +ADD_DEPENDENCIES(opal-checkpoint libopen-pal) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(opal-checkpoint PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(opal-checkpoint PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (opal-checkpoint libopen-pal Ws2_32.lib shlwapi.lib) + +INSTALL(TARGETS opal-checkpoint + DESTINATION bin) +INSTALL(FILES help-opal-checkpoint.txt DESTINATION share/openmpi) diff --git a/opal/tools/opal-restart/CMakeLists.txt b/opal/tools/opal-restart/CMakeLists.txt index 1df9f6a78b..376de21f0a 100644 --- a/opal/tools/opal-restart/CMakeLists.txt +++ b/opal/tools/opal-restart/CMakeLists.txt @@ -1,29 +1,29 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE OPAL_RESTART_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (opal-restart ${OPAL_RESTART_SOURCE_FILES}) - -ADD_DEPENDENCIES(opal-restart libopen-pal) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(opal-restart PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(opal-restart PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (opal-restart libopen-pal Ws2_32.lib shlwapi.lib) - -INSTALL(TARGETS opal-restart - DESTINATION bin) -INSTALL(FILES help-opal-restart.txt DESTINATION share/openmpi) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE OPAL_RESTART_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (opal-restart ${OPAL_RESTART_SOURCE_FILES}) + +ADD_DEPENDENCIES(opal-restart libopen-pal) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(opal-restart PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(opal-restart PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (opal-restart libopen-pal Ws2_32.lib shlwapi.lib) + +INSTALL(TARGETS opal-restart + DESTINATION bin) +INSTALL(FILES help-opal-restart.txt DESTINATION share/openmpi) diff --git a/opal/tools/wrappers/CMakeLists.txt b/opal/tools/wrappers/CMakeLists.txt index 1581af7ff8..abfdc61146 100644 --- a/opal/tools/wrappers/CMakeLists.txt +++ b/opal/tools/wrappers/CMakeLists.txt @@ -1,105 +1,105 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE OPAL_WRAPPER_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (opal-wrapper ${OPAL_WRAPPER_SOURCE_FILES}) - -ADD_DEPENDENCIES(opal-wrapper libopen-pal) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(opal-wrapper PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(opal-wrapper PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - - TARGET_LINK_LIBRARIES (opal-wrapper libopen-pal Ws2_32.lib shlwapi.lib) - -ADD_CUSTOM_COMMAND (TARGET opal-wrapper - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe - ${PROJECT_BINARY_DIR}/mpicc${OMPI_EXE_DEBUG_POSTFIX}.exe - COMMENT "Copying C compiler wrappers...") - -IF(OMPI_WANT_CXX_BINDINGS) - ADD_CUSTOM_COMMAND (TARGET opal-wrapper - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIXX}.exe - ${PROJECT_BINARY_DIR}/mpic++${OMPI_EXE_DEBUG_POSTFIX}.exe - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe - ${PROJECT_BINARY_DIR}/mpicxx${OMPI_EXE_DEBUG_POSTFIX}.exe - COMMENT "Copying C++ compiler wrappers...") - - INSTALL(FILES ${PROJECT_BINARY_DIR}/mpic++${OMPI_EXE_DEBUG_POSTFIX}.exe - ${PROJECT_BINARY_DIR}/mpicxx${OMPI_EXE_DEBUG_POSTFIX}.exe - DESTINATION bin) -ENDIF(OMPI_WANT_CXX_BINDINGS) - -IF(OMPI_WANT_F77_BINDINGS) - ADD_CUSTOM_COMMAND(TARGET opal-wrapper - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe - ${PROJECT_BINARY_DIR}/mpif77${OMPI_EXE_DEBUG_POSTFIX}.exe - COMMENT "Copying F77 compiler wrappers...") - - INSTALL(FILES ${PROJECT_BINARY_DIR}/mpif77${OMPI_EXE_DEBUG_POSTFIX}.exe - DESTINATION bin) -ENDIF(OMPI_WANT_F77_BINDINGS) - -ADD_CUSTOM_COMMAND (TARGET opal-wrapper - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${PROJECT_SOURCE_DIR}/tools/wrappers/help-opal-wrapper.txt - ${PROJECT_BINARY_DIR}/help-opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe.txt - COMMENT "Copying wrapper help files...") - -INSTALL(TARGETS opal-wrapper - DESTINATION bin) -INSTALL(FILES help-opal-wrapper.txt - ${PROJECT_BINARY_DIR}/help-opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe.txt - DESTINATION share/openmpi) -INSTALL(FILES ${PROJECT_BINARY_DIR}/mpicc${OMPI_EXE_DEBUG_POSTFIX}.exe - DESTINATION bin) - -IF(WANT_INSTALL_HEADERS) - - ADD_CUSTOM_COMMAND (TARGET opal-wrapper - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe - ${PROJECT_BINARY_DIR}/opalcc${OMPI_EXE_DEBUG_POSTFIX}.exe - COMMENT "Copying renamed executables...") - - IF(OMPI_WANT_CXX_BINDINGS) - ADD_CUSTOM_COMMAND (TARGET opal-wrapper - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe - ${PROJECT_BINARY_DIR}/opalc++${OMPI_EXE_DEBUG_POSTFIX}.exe - COMMENT "Copying renamed executables...") - - CONFIGURE_FILE(${OPAL_SOURCE_DIR}/tools/wrappers/opalc++-wrapper-data.txt.in - ${OPAL_BINARY_DIR}/tools/wrappers/opalc++-wrapper-data.txt @ONLY) - INSTALL(FILES ${OPAL_BINARY_DIR}/tools/wrappers/opalc++-wrapper-data.txt - DESTINATION share/openmpi) - ENDIF(OMPI_WANT_CXX_BINDINGS) - - CONFIGURE_FILE(${OPAL_SOURCE_DIR}/tools/wrappers/opalcc-wrapper-data.txt.in - ${OPAL_BINARY_DIR}/tools/wrappers/opalcc-wrapper-data.txt @ONLY) - INSTALL(FILES ${OPAL_BINARY_DIR}/tools/wrappers/opalcc-wrapper-data.txt - DESTINATION share/openmpi) - -ENDIF(WANT_INSTALL_HEADERS) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE OPAL_WRAPPER_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (opal-wrapper ${OPAL_WRAPPER_SOURCE_FILES}) + +ADD_DEPENDENCIES(opal-wrapper libopen-pal) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(opal-wrapper PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(opal-wrapper PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + + TARGET_LINK_LIBRARIES (opal-wrapper libopen-pal Ws2_32.lib shlwapi.lib) + +ADD_CUSTOM_COMMAND (TARGET opal-wrapper + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe + ${PROJECT_BINARY_DIR}/mpicc${OMPI_EXE_DEBUG_POSTFIX}.exe + COMMENT "Copying C compiler wrappers...") + +IF(OMPI_WANT_CXX_BINDINGS) + ADD_CUSTOM_COMMAND (TARGET opal-wrapper + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIXX}.exe + ${PROJECT_BINARY_DIR}/mpic++${OMPI_EXE_DEBUG_POSTFIX}.exe + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe + ${PROJECT_BINARY_DIR}/mpicxx${OMPI_EXE_DEBUG_POSTFIX}.exe + COMMENT "Copying C++ compiler wrappers...") + + INSTALL(FILES ${PROJECT_BINARY_DIR}/mpic++${OMPI_EXE_DEBUG_POSTFIX}.exe + ${PROJECT_BINARY_DIR}/mpicxx${OMPI_EXE_DEBUG_POSTFIX}.exe + DESTINATION bin) +ENDIF(OMPI_WANT_CXX_BINDINGS) + +IF(OMPI_WANT_F77_BINDINGS) + ADD_CUSTOM_COMMAND(TARGET opal-wrapper + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe + ${PROJECT_BINARY_DIR}/mpif77${OMPI_EXE_DEBUG_POSTFIX}.exe + COMMENT "Copying F77 compiler wrappers...") + + INSTALL(FILES ${PROJECT_BINARY_DIR}/mpif77${OMPI_EXE_DEBUG_POSTFIX}.exe + DESTINATION bin) +ENDIF(OMPI_WANT_F77_BINDINGS) + +ADD_CUSTOM_COMMAND (TARGET opal-wrapper + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${PROJECT_SOURCE_DIR}/tools/wrappers/help-opal-wrapper.txt + ${PROJECT_BINARY_DIR}/help-opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe.txt + COMMENT "Copying wrapper help files...") + +INSTALL(TARGETS opal-wrapper + DESTINATION bin) +INSTALL(FILES help-opal-wrapper.txt + ${PROJECT_BINARY_DIR}/help-opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe.txt + DESTINATION share/openmpi) +INSTALL(FILES ${PROJECT_BINARY_DIR}/mpicc${OMPI_EXE_DEBUG_POSTFIX}.exe + DESTINATION bin) + +IF(WANT_INSTALL_HEADERS) + + ADD_CUSTOM_COMMAND (TARGET opal-wrapper + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe + ${PROJECT_BINARY_DIR}/opalcc${OMPI_EXE_DEBUG_POSTFIX}.exe + COMMENT "Copying renamed executables...") + + IF(OMPI_WANT_CXX_BINDINGS) + ADD_CUSTOM_COMMAND (TARGET opal-wrapper + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe + ${PROJECT_BINARY_DIR}/opalc++${OMPI_EXE_DEBUG_POSTFIX}.exe + COMMENT "Copying renamed executables...") + + CONFIGURE_FILE(${OPAL_SOURCE_DIR}/tools/wrappers/opalc++-wrapper-data.txt.in + ${OPAL_BINARY_DIR}/tools/wrappers/opalc++-wrapper-data.txt @ONLY) + INSTALL(FILES ${OPAL_BINARY_DIR}/tools/wrappers/opalc++-wrapper-data.txt + DESTINATION share/openmpi) + ENDIF(OMPI_WANT_CXX_BINDINGS) + + CONFIGURE_FILE(${OPAL_SOURCE_DIR}/tools/wrappers/opalcc-wrapper-data.txt.in + ${OPAL_BINARY_DIR}/tools/wrappers/opalcc-wrapper-data.txt @ONLY) + INSTALL(FILES ${OPAL_BINARY_DIR}/tools/wrappers/opalcc-wrapper-data.txt + DESTINATION share/openmpi) + +ENDIF(WANT_INSTALL_HEADERS) diff --git a/opal/win32/ompi_inet.c b/opal/win32/ompi_inet.c index 2ba85ec6a0..bee76159bc 100644 --- a/opal/win32/ompi_inet.c +++ b/opal/win32/ompi_inet.c @@ -1,113 +1,113 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2009 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - - -#include "opal_config.h" - -#include "opal/win32/ompi_inet.h" -#include "opal/util/output.h" - -/* - * convert from presentation format (which usually means ASCII printable) - * to network format (which is usually some kind of binary format). - * - * return: - * 1 if the address was valid for the specified address family - * 0 if the address wasn't valid (`dst' is untouched in this case) - * -1 if some other error occurred (`dst' is untouched in this case, too) - */ -int inet_pton(int af, const char *src, void *dst) -{ - int addr_len; - struct sockaddr sa; - struct sockaddr_in *sin = (struct sockaddr_in *)&sa; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&sa; - - memset (&sa, 0, sizeof(struct sockaddr)); - - switch (af) { - case AF_INET: - addr_len = sizeof(struct sockaddr_in); - break; - - case AF_INET6: - addr_len = sizeof(struct sockaddr_in6); - break; - - default: - return -1; - } - - if ( 0 == WSAStringToAddress ((LPTSTR) src, af, NULL, (LPSOCKADDR) &sa, &addr_len )) { - switch (af) { - case AF_INET: - memcpy (dst, &sin->sin_addr, sizeof(struct in_addr)); - break; - - case AF_INET6: - memcpy (dst, &sin6->sin6_addr, sizeof(struct in6_addr)); - break; - } - return 1; - } else { - opal_output(0, "WSAStringToAddress failed %s:%d. Error code: %d", __FILE__, __LINE__, GetLastError()); - return 0; - } -} - - -/* - * convert a network format address to presentation format. - * - * return: - * pointer to presentation format address (`dst'), or NULL. - */ -const char *inet_ntop(int af, const void *src, char *dst, size_t size) -{ - int addr_len; - struct sockaddr sa; - DWORD str_len = size; - struct sockaddr_in *sin = (struct sockaddr_in *)&sa; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&sa; - - memset (&sa, 0, sizeof (struct sockaddr)); - - switch (af) { - case AF_INET: - addr_len = sizeof(struct sockaddr_in); - sin->sin_family = af; - memcpy (&sin->sin_addr, src, sizeof (struct in_addr)); - break; - - case AF_INET6: - addr_len = sizeof(struct sockaddr_in6); - sin6->sin6_family = af; - memcpy (&sin6->sin6_addr, src, sizeof (struct in6_addr)); - break; - - default: - return NULL; - } - - if ( 0 == WSAAddressToString ((LPSOCKADDR) &sa, addr_len, NULL, dst, &str_len )) { - return dst; - } else { - opal_output(0, "WSAAddressToString failed %s:%d. Error code: %d", __FILE__, __LINE__, GetLastError()); - return NULL; - } -} +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2009 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +#include "opal_config.h" + +#include "opal/win32/ompi_inet.h" +#include "opal/util/output.h" + +/* + * convert from presentation format (which usually means ASCII printable) + * to network format (which is usually some kind of binary format). + * + * return: + * 1 if the address was valid for the specified address family + * 0 if the address wasn't valid (`dst' is untouched in this case) + * -1 if some other error occurred (`dst' is untouched in this case, too) + */ +int inet_pton(int af, const char *src, void *dst) +{ + int addr_len; + struct sockaddr sa; + struct sockaddr_in *sin = (struct sockaddr_in *)&sa; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&sa; + + memset (&sa, 0, sizeof(struct sockaddr)); + + switch (af) { + case AF_INET: + addr_len = sizeof(struct sockaddr_in); + break; + + case AF_INET6: + addr_len = sizeof(struct sockaddr_in6); + break; + + default: + return -1; + } + + if ( 0 == WSAStringToAddress ((LPTSTR) src, af, NULL, (LPSOCKADDR) &sa, &addr_len )) { + switch (af) { + case AF_INET: + memcpy (dst, &sin->sin_addr, sizeof(struct in_addr)); + break; + + case AF_INET6: + memcpy (dst, &sin6->sin6_addr, sizeof(struct in6_addr)); + break; + } + return 1; + } else { + opal_output(0, "WSAStringToAddress failed %s:%d. Error code: %d", __FILE__, __LINE__, GetLastError()); + return 0; + } +} + + +/* + * convert a network format address to presentation format. + * + * return: + * pointer to presentation format address (`dst'), or NULL. + */ +const char *inet_ntop(int af, const void *src, char *dst, size_t size) +{ + int addr_len; + struct sockaddr sa; + DWORD str_len = size; + struct sockaddr_in *sin = (struct sockaddr_in *)&sa; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&sa; + + memset (&sa, 0, sizeof (struct sockaddr)); + + switch (af) { + case AF_INET: + addr_len = sizeof(struct sockaddr_in); + sin->sin_family = af; + memcpy (&sin->sin_addr, src, sizeof (struct in_addr)); + break; + + case AF_INET6: + addr_len = sizeof(struct sockaddr_in6); + sin6->sin6_family = af; + memcpy (&sin6->sin6_addr, src, sizeof (struct in6_addr)); + break; + + default: + return NULL; + } + + if ( 0 == WSAAddressToString ((LPSOCKADDR) &sa, addr_len, NULL, dst, &str_len )) { + return dst; + } else { + opal_output(0, "WSAAddressToString failed %s:%d. Error code: %d", __FILE__, __LINE__, GetLastError()); + return NULL; + } +} diff --git a/orte/CMakeLists.txt b/orte/CMakeLists.txt index b0b550c5c0..814409bc55 100644 --- a/orte/CMakeLists.txt +++ b/orte/CMakeLists.txt @@ -1,89 +1,89 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - -PROJECT (ORTE) - - -# Recuresive search sub directories excluding mca, event, include and tools. -# Add sources in different source groups. -INCLUDE(list_subdirs) -CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}" ORTE_SUBDIRS) - -SET(ORTE_EXCLUDE_SUBDIRS mca test tools) - -FOREACH(ORTE_SUBDIR ${ORTE_SUBDIRS}) - - LIST(FIND ORTE_EXCLUDE_SUBDIRS ${ORTE_SUBDIR} ORTE_EXCLUDE_SUBDIR) - - IF(${ORTE_EXCLUDE_SUBDIR} EQUAL -1) - - FILE(GLOB_RECURSE ORTE_${ORTE_SUBDIR}_FILES - "${ORTE_SUBDIR}/*.h" "${ORTE_SUBDIR}/*.c" "${ORTE_SUBDIR}/*.cc" "${ORTE_SUBDIR}/*.cpp") - - SET (ORTE_SOURCE_FILES - ${ORTE_SOURCE_FILES} - ${ORTE_${ORTE_SUBDIR}_FILES} - ) - - SOURCE_GROUP("${ORTE_SUBDIR}" FILES ${ORTE_${ORTE_SUBDIR}_FILES}) - - ENDIF(${ORTE_EXCLUDE_SUBDIR} EQUAL -1) - -ENDFOREACH(ORTE_SUBDIR ${ORTE_SUBDIRS}) - - -#only generate if it's not a tarball -IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/hostfile/hostfile_lex.c) - ADD_FLEX_FILE(ORTE_SOURCE_FILES ./util/hostfile/hostfile_lex.l "orte_util_hostfile_" - "${PROJECT_BINARY_DIR}/util/hostfile/") -ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/hostfile/hostfile_lex.c) - - -INCLUDE (check_mca_subdirs) -SET (ORTE_SOURCE_FILES ${ORTE_SOURCE_FILES} ${MCA_FILES}) - -ADD_LIBRARY (libopen-rte ${ORTE_SOURCE_FILES}) - -ADD_DEPENDENCIES(libopen-rte libopen-pal) - -# Set compile flags for this target -IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(libopen-rte PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}ORTE_EXPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_CXX_LAN_FLAG}") - TARGET_LINK_LIBRARIES(libopen-rte ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib - libopen-pal Ws2_32.lib shlwapi.lib) -ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(libopen-rte PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -# generate orte_config.h -CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/orte/include/orte_config.h.in ${OpenMPI_BINARY_DIR}/orte/include/orte_config.h) - -# generate version.h -CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/orte/include/orte/version.h.in ${OpenMPI_BINARY_DIR}/orte/include/orte/version.h) - -ADD_SUBDIRECTORY(tools) - -# Install libraries and shared files. -INSTALL(TARGETS libopen-rte - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -INSTALL(FILES orted/help-orted.txt runtime/help-orte-runtime.txt - util/hostfile/help-hostfile.txt util/dash_host/help-dash-host.txt - # we dont build mca/odls/default, but we need the help file anyway. - mca/odls/default/help-orte-odls-default.txt - DESTINATION share/openmpi) - -IF (OMPI_DEBUG_BUILD) - INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libopen-rte${CMAKE_DEBUG_POSTFIX}.pdb - DESTINATION bin) -ENDIF (OMPI_DEBUG_BUILD) - +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + +PROJECT (ORTE) + + +# Recuresive search sub directories excluding mca, event, include and tools. +# Add sources in different source groups. +INCLUDE(list_subdirs) +CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}" ORTE_SUBDIRS) + +SET(ORTE_EXCLUDE_SUBDIRS mca test tools) + +FOREACH(ORTE_SUBDIR ${ORTE_SUBDIRS}) + + LIST(FIND ORTE_EXCLUDE_SUBDIRS ${ORTE_SUBDIR} ORTE_EXCLUDE_SUBDIR) + + IF(${ORTE_EXCLUDE_SUBDIR} EQUAL -1) + + FILE(GLOB_RECURSE ORTE_${ORTE_SUBDIR}_FILES + "${ORTE_SUBDIR}/*.h" "${ORTE_SUBDIR}/*.c" "${ORTE_SUBDIR}/*.cc" "${ORTE_SUBDIR}/*.cpp") + + SET (ORTE_SOURCE_FILES + ${ORTE_SOURCE_FILES} + ${ORTE_${ORTE_SUBDIR}_FILES} + ) + + SOURCE_GROUP("${ORTE_SUBDIR}" FILES ${ORTE_${ORTE_SUBDIR}_FILES}) + + ENDIF(${ORTE_EXCLUDE_SUBDIR} EQUAL -1) + +ENDFOREACH(ORTE_SUBDIR ${ORTE_SUBDIRS}) + + +#only generate if it's not a tarball +IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/hostfile/hostfile_lex.c) + ADD_FLEX_FILE(ORTE_SOURCE_FILES ./util/hostfile/hostfile_lex.l "orte_util_hostfile_" + "${PROJECT_BINARY_DIR}/util/hostfile/") +ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/hostfile/hostfile_lex.c) + + +INCLUDE (check_mca_subdirs) +SET (ORTE_SOURCE_FILES ${ORTE_SOURCE_FILES} ${MCA_FILES}) + +ADD_LIBRARY (libopen-rte ${ORTE_SOURCE_FILES}) + +ADD_DEPENDENCIES(libopen-rte libopen-pal) + +# Set compile flags for this target +IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libopen-rte PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}ORTE_EXPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_CXX_LAN_FLAG}") + TARGET_LINK_LIBRARIES(libopen-rte ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib + libopen-pal Ws2_32.lib shlwapi.lib) +ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libopen-rte PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +# generate orte_config.h +CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/orte/include/orte_config.h.in ${OpenMPI_BINARY_DIR}/orte/include/orte_config.h) + +# generate version.h +CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/orte/include/orte/version.h.in ${OpenMPI_BINARY_DIR}/orte/include/orte/version.h) + +ADD_SUBDIRECTORY(tools) + +# Install libraries and shared files. +INSTALL(TARGETS libopen-rte + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +INSTALL(FILES orted/help-orted.txt runtime/help-orte-runtime.txt + util/hostfile/help-hostfile.txt util/dash_host/help-dash-host.txt + # we dont build mca/odls/default, but we need the help file anyway. + mca/odls/default/help-orte-odls-default.txt + DESTINATION share/openmpi) + +IF (OMPI_DEBUG_BUILD) + INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libopen-rte${CMAKE_DEBUG_POSTFIX}.pdb + DESTINATION bin) +ENDIF (OMPI_DEBUG_BUILD) + diff --git a/orte/mca/debugger/mpir/.windows b/orte/mca/debugger/mpir/.windows index 07efcb4832..3d38f80566 100755 --- a/orte/mca/debugger/mpir/.windows +++ b/orte/mca/debugger/mpir/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte Ws2_32.lib +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte Ws2_32.lib diff --git a/orte/mca/errmgr/app/.windows b/orte/mca/errmgr/app/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/errmgr/app/.windows +++ b/orte/mca/errmgr/app/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/errmgr/hnp/.windows b/orte/mca/errmgr/hnp/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/errmgr/hnp/.windows +++ b/orte/mca/errmgr/hnp/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/errmgr/orted/.windows b/orte/mca/errmgr/orted/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/errmgr/orted/.windows +++ b/orte/mca/errmgr/orted/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/ess/env/.windows b/orte/mca/ess/env/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/ess/env/.windows +++ b/orte/mca/ess/env/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/ess/hnp/.windows b/orte/mca/ess/hnp/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/ess/hnp/.windows +++ b/orte/mca/ess/hnp/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/ess/singleton/.windows b/orte/mca/ess/singleton/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/ess/singleton/.windows +++ b/orte/mca/ess/singleton/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/ess/slave/.windows b/orte/mca/ess/slave/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/ess/slave/.windows +++ b/orte/mca/ess/slave/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/ess/tool/.windows b/orte/mca/ess/tool/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/ess/tool/.windows +++ b/orte/mca/ess/tool/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/grpcomm/basic/.windows b/orte/mca/grpcomm/basic/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/grpcomm/basic/.windows +++ b/orte/mca/grpcomm/basic/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/iof/hnp/.windows b/orte/mca/iof/hnp/.windows index c31ec9526c..47925ab72e 100644 --- a/orte/mca/iof/hnp/.windows +++ b/orte/mca/iof/hnp/.windows @@ -1,12 +1,12 @@ -'# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte Ws2_32.lib +'# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte Ws2_32.lib diff --git a/orte/mca/iof/orted/.windows b/orte/mca/iof/orted/.windows index 07efcb4832..3d38f80566 100644 --- a/orte/mca/iof/orted/.windows +++ b/orte/mca/iof/orted/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte Ws2_32.lib +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte Ws2_32.lib diff --git a/orte/mca/iof/tool/.windows b/orte/mca/iof/tool/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/iof/tool/.windows +++ b/orte/mca/iof/tool/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/odls/process/.windows b/orte/mca/odls/process/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/odls/process/.windows +++ b/orte/mca/odls/process/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/oob/tcp/.windows b/orte/mca/oob/tcp/.windows index 07efcb4832..3d38f80566 100644 --- a/orte/mca/oob/tcp/.windows +++ b/orte/mca/oob/tcp/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte Ws2_32.lib +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte Ws2_32.lib diff --git a/orte/mca/plm/ccp/.windows b/orte/mca/plm/ccp/.windows index b249e3c411..4e9bf3157d 100644 --- a/orte/mca/plm/ccp/.windows +++ b/orte/mca/plm/ccp/.windows @@ -1,13 +1,13 @@ -# -# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte -required_check=find_ccp +# +# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte +required_check=find_ccp diff --git a/orte/mca/plm/ccp/plm_ccp_module.c b/orte/mca/plm/ccp/plm_ccp_module.c index 90edde0aee..4bf21c3ed1 100644 --- a/orte/mca/plm/ccp/plm_ccp_module.c +++ b/orte/mca/plm/ccp/plm_ccp_module.c @@ -1,739 +1,739 @@ -/* - * Copyright (c) 2004-2007 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2010 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - * - */ - -#include "orte_config.h" -#include "orte/constants.h" -#include "orte/types.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_SYS_WAIT_H -#include -#endif -#ifdef HAVE_SCHED_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include -#include - -#include "opal/mca/installdirs/installdirs.h" -#include "opal/mca/event/event.h" -#include "opal/util/argv.h" -#include "opal/util/output.h" -#include "opal/util/opal_environ.h" -#include "opal/util/basename.h" -#include "opal/mca/base/mca_base_param.h" - -#include "orte/util/name_fns.h" -#include "orte/runtime/orte_globals.h" -#include "orte/runtime/orte_wait.h" -#include "orte/mca/errmgr/errmgr.h" -#include "orte/mca/rmaps/rmaps.h" - -#include "orte/mca/plm/plm.h" -#include "orte/mca/plm/base/plm_private.h" -#include "plm_ccp.h" - - -/* Import the Windows CCP API. */ -#import "ccpapi.tlb" named_guids no_namespace raw_interfaces_only \ - rename("SetEnvironmentVariable","SetEnvVar") \ - rename("GetJob", "GetSingleJob") \ - rename("AddJob", "AddSingleJob") - -/* Include the library for ::ConvertBSTRToString */ -#pragma comment(lib, "comsuppw.lib") - -/* - * Local functions - */ -static int plm_ccp_init(void); -static int plm_ccp_launch_job(orte_job_t *jdata); -static int plm_ccp_terminate_orteds(); -static int plm_ccp_signal_job(orte_jobid_t jobid, int32_t signal); -static int plm_ccp_finalize(void); - -static int plm_ccp_connect(ICluster* pCluster); -static int plm_ccp_disconnect(void); - -void plm_get_cluster_message(ICluster* pCluster); -static char *plm_ccp_commandline(char *prefix, char *node_name, int argc, char **argv); - -/* - * Global variable - */ -orte_plm_base_module_t orte_plm_ccp_module = { - plm_ccp_init, - orte_plm_base_set_hnp_name, - plm_ccp_launch_job, - NULL, - orte_plm_base_orted_terminate_job, - plm_ccp_terminate_orteds, - orte_plm_base_orted_kill_local_procs, - plm_ccp_signal_job, - plm_ccp_finalize -}; - - -/* - * Local variables - */ -static orte_jobid_t active_job = ORTE_JOBID_INVALID; - - -/** -* Init the module - */ -static int plm_ccp_init(void) -{ - int rc; - - if (ORTE_SUCCESS != (rc = orte_plm_base_comm_start())) { - ORTE_ERROR_LOG(rc); - } - - return rc; -} - - -/* When working in this function, ALWAYS jump to "cleanup" if - * you encounter an error so that orterun will be woken up and - * the job can cleanly terminate - */ -static int plm_ccp_launch_job(orte_job_t *jdata) -{ - orte_app_context_t **apps; - orte_node_t **nodes; - orte_std_cntr_t launched = 0, i; - - orte_job_map_t *map = NULL; - int argc, rc, proc_vpid_index; - char *param, **env = NULL, *var, **argv = NULL; - bool connected = false; - char *bin_base = NULL, *lib_base = NULL, *command_line; - - struct timeval completionstop, launchstart, launchstop; - struct timeval jobstart, jobstop; - int maxtime=0, mintime=99999999, maxiter = 0, miniter = 0, deltat; - float avgtime=0.0; - bool failed_launch = true; - mode_t current_umask; - IClusterEnumerable* pNodesCollection = NULL; - IEnumVARIANT* pNodes = NULL; - VARIANT v; - - INode* pNode = NULL; - HRESULT hr = S_OK; - ICluster* pCluster = NULL; - IJob* pJob = NULL; - long job_id, num_processors = 0, idle_processors = 0; - IClusterCounter* pClusterCounter = NULL; - ITask* pTask = NULL; - JobPriority job_priority = JobPriority_Normal; - - orte_jobid_t failed_job; - orte_job_state_t job_state = ORTE_JOB_STATE_NEVER_LAUNCHED; - - /* default to declaring the daemon launch failed */ - failed_job = ORTE_PROC_MY_NAME->jobid; - - /* check for timing request - get start time if so */ - if (orte_timing) { - if (0 != gettimeofday(&jobstart, NULL)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: could not obtain job start time")); - } - } - - /* if this jobid isn't invalid, then it already - * has been setup, so skip the setup actions - */ - if (ORTE_JOBID_INVALID != jdata->jobid) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: launching job %s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - ORTE_JOBID_PRINT(jdata->jobid))); - goto GETMAP; - } - - /* setup the job */ - if (ORTE_SUCCESS != (rc = orte_plm_base_setup_job(jdata))) { - ORTE_ERROR_LOG(rc); - goto cleanup; - } - - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: launching job %s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - ORTE_JOBID_PRINT(jdata->jobid))); - -GETMAP: - /* Get the map for this job */ - if (NULL == (map = orte_rmaps.get_job_map(jdata->jobid))) { - ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); - rc = ORTE_ERR_NOT_FOUND; - goto cleanup; - } - - apps = (orte_app_context_t**)jdata->apps->addr; - nodes = (orte_node_t**)map->nodes->addr; - - if (0 == map->num_new_daemons) { - /* have all the daemons we need - launch app */ - goto launch_apps; - } - - /* add the daemon command (as specified by user) */ - argc = 0; - argv = NULL; - orte_plm_base_setup_orted_cmd(&argc, &argv); - - /* Add basic orted command line options */ - orte_plm_base_orted_append_basic_args(&argc, &argv, "env", - &proc_vpid_index, - NULL); - - if (0 < opal_output_get_verbosity(orte_plm_globals.output)) { - param = opal_argv_join(argv, ' '); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: final top-level argv:\n\t%s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - (NULL == param) ? "NULL" : param)); - if (NULL != param) free(param); - } - - /* CCP is not thread safe. Use the apartment model. */ - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - - /* Create the Cluster object. */ - hr = CoCreateInstance( __uuidof(Cluster), - NULL, - CLSCTX_INPROC_SERVER, - __uuidof(ICluster), - reinterpret_cast (&pCluster) ); - if (FAILED(hr)) { - opal_output(orte_plm_globals.output, - "plm:ccp: failed to create cluster object!"); - goto cleanup; - } - - /* Connect to the head node. */ - rc = plm_ccp_connect(pCluster); - if (ORTE_SUCCESS != rc) { - goto cleanup; - } - connected = true; - - hr = pCluster->CreateJob(&pJob); - if (FAILED(hr)) { - plm_get_cluster_message(pCluster); - opal_output(orte_plm_globals.output, - "plm:ccp:failed to create cluster object!"); - goto cleanup; - } - /* Figure out the basenames for the libdir and bindir. There is a - lengthy comment about this in plm_rsh_module.c explaining all - the rationale for how / why we're doing this. */ - lib_base = opal_basename(opal_install_dirs.libdir); - bin_base = opal_basename(opal_install_dirs.bindir); - - /* setup environment */ - env = opal_argv_copy(orte_launch_environ); - - /* add our umask -- see big note in orted.c */ - current_umask = _umask(0); - _umask(current_umask); - asprintf(&var, "0%o", current_umask); - opal_setenv("ORTE_DAEMON_UMASK_VALUE", var, true, &env); - free(var); - - /* If we have a prefix, then modify the PATH and - LD_LIBRARY_PATH environment variables. We only allow - a single prefix to be specified. Since there will - always be at least one app_context, we take it from - there - */ - if (NULL != apps[0]->prefix_dir) { - char *newenv; - - for (i = 0; NULL != env && NULL != env[i]; ++i) { - /* Reset PATH */ - if (0 == strncmp("PATH=", env[i], 5)) { - asprintf(&newenv, "%s/%s:%s", - apps[0]->prefix_dir, bin_base, env[i] + 5); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: resetting PATH: %s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - newenv)); - opal_setenv("PATH", newenv, true, &env); - free(newenv); - } - - /* Reset LD_LIBRARY_PATH */ - else if (0 == strncmp("LD_LIBRARY_PATH=", env[i], 16)) { - asprintf(&newenv, "%s/%s:%s", - apps[0]->prefix_dir, lib_base, env[i] + 16); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: resetting LD_LIBRARY_PATH: %s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - newenv)); - opal_setenv("LD_LIBRARY_PATH", newenv, true, &env); - free(newenv); - } - } - } - - /* This has already been done in RAS, but I have to do it again here. - * Because the node structure doesn't have num_processor member. */ - - /* Get the collection of nodes. */ - hr = pCluster->get_ComputeNodes(&pNodesCollection); - - /* Get the enumerator used to iterate through the collection. */ - hr = pNodesCollection->GetEnumerator(&pNodes); - - VariantInit(&v); - - int *num_procs; - num_procs = (int *) malloc(sizeof(int)*map->num_nodes); - - /* Loop through the collection. */ - while (hr = pNodes->Next(1, &v, NULL) == S_OK) { - v.pdispVal->QueryInterface(IID_INode, reinterpret_cast (&pNode)); - - /* Iterate through each of the nodes and check to sum up all the processors. */ - for (i = 0; i < map->num_nodes; i++) { - orte_node_t* node = nodes[i]; - - BSTR node_name; - hr = pNode->get_Name(&node_name); - - if( 0 == strcmp(_com_util::ConvertBSTRToString(node_name), node->name)) { - /* Get available number of processors on required node. */ - hr = pNode->get_NumberOfIdleProcessors(&idle_processors); - num_procs[i] = idle_processors; - num_processors += idle_processors; - } - } - } - - if(NULL != mca_plm_ccp_component.job_name){ - pJob->put_Name(_bstr_t(mca_plm_ccp_component.job_name)); - } else { - pJob->put_Name(_bstr_t((*(*apps)).app)); - } - - pJob->put_MinimumNumberOfProcessors(num_processors); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to put min num of processors!")); - goto cleanup; - } - - pJob->put_MaximumNumberOfProcessors(num_processors); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to put max num of processors!")); - goto cleanup; - } - - hr = pJob->put_Priority(job_priority); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to set proiority!")); - goto cleanup; - } - - hr = pJob->SetExtendedJobTerm(_bstr_t(L"extended terms"), _bstr_t(L"TermValue")); - - /* set the job state to indicate we attempted to launch */ - job_state = ORTE_JOB_STATE_FAILED_TO_START; - - /* Iterate through each of the nodes and spin - * up a daemon. - */ - for (i = 0; i < map->num_nodes; i++) { - orte_node_t* node = nodes[i]; - char* vpid_string; - - /* if this daemon already exists, don't launch it! */ - if (node->daemon_launched) { - continue; - } - - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: launching on node %s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - node->name)); - - /* setup process name */ - rc = orte_util_convert_vpid_to_string(&vpid_string, nodes[i]->daemon->name.vpid); - if (ORTE_SUCCESS != rc) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp: unable to get daemon vpid as string")); - exit(-1); - } - free(argv[proc_vpid_index]); - argv[proc_vpid_index] = strdup(vpid_string); - free(vpid_string); - - /* exec the daemon */ - if (0 < opal_output_get_verbosity(orte_plm_globals.output)) { - param = opal_argv_join(argv, ' '); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: executing:\n\t%s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - (NULL == param) ? "NULL" : param)); - if (NULL != param) free(param); - } - - /* check for timing request - get start time if so */ - if (orte_timing) { - if (0 != gettimeofday(&launchstart, NULL)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: could not obtain start time")); - launchstart.tv_sec = 0; - launchstart.tv_usec = 0; - } - } - /* Set terms for task. */ - hr = pCluster->CreateTask(&pTask); - if (FAILED(hr)) { - plm_get_cluster_message(pCluster); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to create task object!")); - goto cleanup; - } - - pTask->put_MinimumNumberOfProcessors(num_procs[i]); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to create task object!")); - goto cleanup; - } - - pTask->put_MaximumNumberOfProcessors(num_procs[i]); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to create task object!")); - goto cleanup; - } - - pTask->put_RequiredNodes(_bstr_t(node->name)); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to set required nodes!")); - goto cleanup; - } - - /* Prepare the command line a little bit. */ - command_line = plm_ccp_commandline(apps[0]->prefix_dir, node->name, argc, argv); - - hr = pTask->put_CommandLine(_bstr_t(command_line)); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to put command line!")); - goto cleanup; - } - - if( NULL != mca_plm_ccp_component.stdout_file ) { - hr = pTask->put_Stdout(_bstr_t(mca_plm_ccp_component.stdout_file)); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to set stdout!")); - goto cleanup; - } - } - - if( NULL != mca_plm_ccp_component.stderr_file) { - hr = pTask->put_Stderr(_bstr_t(mca_plm_ccp_component.stderr_file)); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to set stderr!")); - goto cleanup; - } - } - - hr = pJob->AddTask(pTask); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:failed to add task!")); - goto cleanup; - } - - - /* Allow some progress to occur */ - opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK); - - launched++; - - pTask->Release(); - } - - /* Add job to the queue. */ - hr = pCluster->QueueJob(pJob, NULL, NULL, VARIANT_TRUE, 0, &job_id); - if (SUCCEEDED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "Added job %d to scheduling queue.\n", job_id)); - }else { - plm_get_cluster_message(pCluster); - } - - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp:launch: finished spawning orteds", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); - - /* wait for daemons to callback */ - if (ORTE_SUCCESS != (rc = orte_plm_base_daemon_callback(map->num_new_daemons))) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: daemon launch failed for job %s on error %s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - ORTE_JOBID_PRINT(jdata->jobid), ORTE_ERROR_NAME(rc))); - goto cleanup; - } - -launch_apps: - /* if we get here, then daemons launched - change to declaring apps failed */ - failed_job = active_job; - if (ORTE_SUCCESS != (rc = orte_plm_base_launch_apps(jdata->jobid))) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp: launch of apps failed for job %s on error %s", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), - ORTE_JOBID_PRINT(jdata->jobid), ORTE_ERROR_NAME(rc))); - goto cleanup; - } - - /* if we get here, then everything launched okay - record that fact */ - failed_launch = false; - - /* check for timing request - get stop time for launch completion and report */ - if (orte_timing) { - if (0 != gettimeofday(&completionstop, NULL)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: could not obtain completion stop time")); - } else { - deltat = (launchstop.tv_sec - launchstart.tv_sec)*1000000 + - (launchstop.tv_usec - launchstart.tv_usec); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: launch completion required %d usec", deltat)); - } - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: Launch statistics:")); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: Average time to launch an orted: %f usec", avgtime)); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: Max time to launch an orted: %d usec at iter %d", maxtime, maxiter)); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: Min time to launch an orted: %d usec at iter %d", mintime, miniter)); - } - - - cleanup: - if (NULL != argv) { - opal_argv_free(argv); - } - - if (NULL != env) { - opal_argv_free(env); - } - - if (connected) { - plm_ccp_disconnect(); - } - - if (NULL != lib_base) { - free(lib_base); - } - - if (NULL != bin_base) { - free(bin_base); - } - - /* check for failed launch - if so, force terminate */ - if (failed_launch) { - orte_errmgr.update_state(failed_job, job_state, - NULL, ORTE_PROC_STATE_UNDEF, - 0, ORTE_ERROR_DEFAULT_EXIT_CODE); - } - - /* check for timing request - get stop time and process if so */ - if (orte_timing) { - if (0 != gettimeofday(&jobstop, NULL)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: could not obtain stop time")); - } else { - deltat = (jobstop.tv_sec - jobstart.tv_sec)*1000000 + - (jobstop.tv_usec - jobstart.tv_usec); - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm_ccp: launch of entire job required %d usec", deltat)); - } - } - - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "%s plm:ccp:launch: finished", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); - - return rc; -} - - -/** - * Terminate the orteds for a given job - */ -int plm_ccp_terminate_orteds() -{ - int rc; - - /* now tell them to die! */ - if (ORTE_SUCCESS != (rc = orte_plm_base_orted_exit(ORTE_DAEMON_EXIT_CMD))) { - ORTE_ERROR_LOG(rc); - } - - return rc; -} - - -static int plm_ccp_signal_job(orte_jobid_t jobid, int32_t signal) -{ - int rc; - - /* order them to pass this signal to their local procs */ - if (ORTE_SUCCESS != (rc = orte_plm_base_orted_signal_local_procs(jobid, signal))) { - ORTE_ERROR_LOG(rc); - } - - return rc; -} - - -/* - * Free stuff - */ -static int plm_ccp_finalize(void) -{ - int rc; - - /* cleanup any pending recvs */ - if (ORTE_SUCCESS != (rc = orte_plm_base_comm_stop())) { - ORTE_ERROR_LOG(rc); - } - - return ORTE_SUCCESS; -} - - -static int plm_ccp_connect(ICluster* pCluster) -{ - size_t i, len; - char *cluster_head = NULL; - HRESULT hr = S_OK; - - if (NULL == orte_ccp_headnode) { - /* Get the cluster head nodes name */ - _dupenv_s(&cluster_head, &len, "LOGONSERVER"); - - if(cluster_head == NULL) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:allocate: connot find cluster head node!")); - return ORTE_ERROR; - } - - /* Get rid of the beginning '//'. */ - for( i = 0; i < len; i++){ - cluster_head[i] = cluster_head[i+2]; - cluster_head[i+2] = '\0'; - } - } else { - cluster_head = orte_ccp_headnode; - } - - /* Connect to the cluster's head node */ - hr = pCluster->Connect(_bstr_t(cluster_head)); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "plm:ccp:allocate: connection failed!")); - return ORTE_ERROR; - } - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "Connected to Cluster: %s. \n", cluster_head)); - return ORTE_SUCCESS; -} - - -static int plm_ccp_disconnect(void) -{ - return ORTE_SUCCESS; -} - - -/* Generate the proper command line according to the env. */ -static char *plm_ccp_commandline(char *prefix, char *node_name, int argc, char **argv) -{ - char *commandline; - int i, len = 0; - - for( i = 0; i < argc; i++ ) { - len += strlen(argv[i]) + 1; - } - - if(NULL != prefix) { - commandline = (char*)malloc(len + strlen(prefix) + 8); - memset(commandline, 0, len + strlen(prefix) + 8); - commandline[0] = '"'; - strcat(commandline, prefix); - strcat(commandline, "\\bin\"\\"); - } else { - commandline = (char*)malloc(len + 1); - memset(commandline, 0, len + 1); - } - - - for(i=0;iget_ErrorMessage(&message); - if (SUCCEEDED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - _com_util::ConvertBSTRToString(message))); - SysFreeString(message); - } - else { - OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, - "pCluster->get_ErrorMessage failed.\n")); - } -} +/* + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2010 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + */ + +#include "orte_config.h" +#include "orte/constants.h" +#include "orte/types.h" + +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_SCHED_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +#include + +#include "opal/mca/installdirs/installdirs.h" +#include "opal/mca/event/event.h" +#include "opal/util/argv.h" +#include "opal/util/output.h" +#include "opal/util/opal_environ.h" +#include "opal/util/basename.h" +#include "opal/mca/base/mca_base_param.h" + +#include "orte/util/name_fns.h" +#include "orte/runtime/orte_globals.h" +#include "orte/runtime/orte_wait.h" +#include "orte/mca/errmgr/errmgr.h" +#include "orte/mca/rmaps/rmaps.h" + +#include "orte/mca/plm/plm.h" +#include "orte/mca/plm/base/plm_private.h" +#include "plm_ccp.h" + + +/* Import the Windows CCP API. */ +#import "ccpapi.tlb" named_guids no_namespace raw_interfaces_only \ + rename("SetEnvironmentVariable","SetEnvVar") \ + rename("GetJob", "GetSingleJob") \ + rename("AddJob", "AddSingleJob") + +/* Include the library for ::ConvertBSTRToString */ +#pragma comment(lib, "comsuppw.lib") + +/* + * Local functions + */ +static int plm_ccp_init(void); +static int plm_ccp_launch_job(orte_job_t *jdata); +static int plm_ccp_terminate_orteds(); +static int plm_ccp_signal_job(orte_jobid_t jobid, int32_t signal); +static int plm_ccp_finalize(void); + +static int plm_ccp_connect(ICluster* pCluster); +static int plm_ccp_disconnect(void); + +void plm_get_cluster_message(ICluster* pCluster); +static char *plm_ccp_commandline(char *prefix, char *node_name, int argc, char **argv); + +/* + * Global variable + */ +orte_plm_base_module_t orte_plm_ccp_module = { + plm_ccp_init, + orte_plm_base_set_hnp_name, + plm_ccp_launch_job, + NULL, + orte_plm_base_orted_terminate_job, + plm_ccp_terminate_orteds, + orte_plm_base_orted_kill_local_procs, + plm_ccp_signal_job, + plm_ccp_finalize +}; + + +/* + * Local variables + */ +static orte_jobid_t active_job = ORTE_JOBID_INVALID; + + +/** +* Init the module + */ +static int plm_ccp_init(void) +{ + int rc; + + if (ORTE_SUCCESS != (rc = orte_plm_base_comm_start())) { + ORTE_ERROR_LOG(rc); + } + + return rc; +} + + +/* When working in this function, ALWAYS jump to "cleanup" if + * you encounter an error so that orterun will be woken up and + * the job can cleanly terminate + */ +static int plm_ccp_launch_job(orte_job_t *jdata) +{ + orte_app_context_t **apps; + orte_node_t **nodes; + orte_std_cntr_t launched = 0, i; + + orte_job_map_t *map = NULL; + int argc, rc, proc_vpid_index; + char *param, **env = NULL, *var, **argv = NULL; + bool connected = false; + char *bin_base = NULL, *lib_base = NULL, *command_line; + + struct timeval completionstop, launchstart, launchstop; + struct timeval jobstart, jobstop; + int maxtime=0, mintime=99999999, maxiter = 0, miniter = 0, deltat; + float avgtime=0.0; + bool failed_launch = true; + mode_t current_umask; + IClusterEnumerable* pNodesCollection = NULL; + IEnumVARIANT* pNodes = NULL; + VARIANT v; + + INode* pNode = NULL; + HRESULT hr = S_OK; + ICluster* pCluster = NULL; + IJob* pJob = NULL; + long job_id, num_processors = 0, idle_processors = 0; + IClusterCounter* pClusterCounter = NULL; + ITask* pTask = NULL; + JobPriority job_priority = JobPriority_Normal; + + orte_jobid_t failed_job; + orte_job_state_t job_state = ORTE_JOB_STATE_NEVER_LAUNCHED; + + /* default to declaring the daemon launch failed */ + failed_job = ORTE_PROC_MY_NAME->jobid; + + /* check for timing request - get start time if so */ + if (orte_timing) { + if (0 != gettimeofday(&jobstart, NULL)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: could not obtain job start time")); + } + } + + /* if this jobid isn't invalid, then it already + * has been setup, so skip the setup actions + */ + if (ORTE_JOBID_INVALID != jdata->jobid) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: launching job %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + ORTE_JOBID_PRINT(jdata->jobid))); + goto GETMAP; + } + + /* setup the job */ + if (ORTE_SUCCESS != (rc = orte_plm_base_setup_job(jdata))) { + ORTE_ERROR_LOG(rc); + goto cleanup; + } + + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: launching job %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + ORTE_JOBID_PRINT(jdata->jobid))); + +GETMAP: + /* Get the map for this job */ + if (NULL == (map = orte_rmaps.get_job_map(jdata->jobid))) { + ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); + rc = ORTE_ERR_NOT_FOUND; + goto cleanup; + } + + apps = (orte_app_context_t**)jdata->apps->addr; + nodes = (orte_node_t**)map->nodes->addr; + + if (0 == map->num_new_daemons) { + /* have all the daemons we need - launch app */ + goto launch_apps; + } + + /* add the daemon command (as specified by user) */ + argc = 0; + argv = NULL; + orte_plm_base_setup_orted_cmd(&argc, &argv); + + /* Add basic orted command line options */ + orte_plm_base_orted_append_basic_args(&argc, &argv, "env", + &proc_vpid_index, + NULL); + + if (0 < opal_output_get_verbosity(orte_plm_globals.output)) { + param = opal_argv_join(argv, ' '); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: final top-level argv:\n\t%s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + (NULL == param) ? "NULL" : param)); + if (NULL != param) free(param); + } + + /* CCP is not thread safe. Use the apartment model. */ + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + /* Create the Cluster object. */ + hr = CoCreateInstance( __uuidof(Cluster), + NULL, + CLSCTX_INPROC_SERVER, + __uuidof(ICluster), + reinterpret_cast (&pCluster) ); + if (FAILED(hr)) { + opal_output(orte_plm_globals.output, + "plm:ccp: failed to create cluster object!"); + goto cleanup; + } + + /* Connect to the head node. */ + rc = plm_ccp_connect(pCluster); + if (ORTE_SUCCESS != rc) { + goto cleanup; + } + connected = true; + + hr = pCluster->CreateJob(&pJob); + if (FAILED(hr)) { + plm_get_cluster_message(pCluster); + opal_output(orte_plm_globals.output, + "plm:ccp:failed to create cluster object!"); + goto cleanup; + } + /* Figure out the basenames for the libdir and bindir. There is a + lengthy comment about this in plm_rsh_module.c explaining all + the rationale for how / why we're doing this. */ + lib_base = opal_basename(opal_install_dirs.libdir); + bin_base = opal_basename(opal_install_dirs.bindir); + + /* setup environment */ + env = opal_argv_copy(orte_launch_environ); + + /* add our umask -- see big note in orted.c */ + current_umask = _umask(0); + _umask(current_umask); + asprintf(&var, "0%o", current_umask); + opal_setenv("ORTE_DAEMON_UMASK_VALUE", var, true, &env); + free(var); + + /* If we have a prefix, then modify the PATH and + LD_LIBRARY_PATH environment variables. We only allow + a single prefix to be specified. Since there will + always be at least one app_context, we take it from + there + */ + if (NULL != apps[0]->prefix_dir) { + char *newenv; + + for (i = 0; NULL != env && NULL != env[i]; ++i) { + /* Reset PATH */ + if (0 == strncmp("PATH=", env[i], 5)) { + asprintf(&newenv, "%s/%s:%s", + apps[0]->prefix_dir, bin_base, env[i] + 5); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: resetting PATH: %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + newenv)); + opal_setenv("PATH", newenv, true, &env); + free(newenv); + } + + /* Reset LD_LIBRARY_PATH */ + else if (0 == strncmp("LD_LIBRARY_PATH=", env[i], 16)) { + asprintf(&newenv, "%s/%s:%s", + apps[0]->prefix_dir, lib_base, env[i] + 16); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: resetting LD_LIBRARY_PATH: %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + newenv)); + opal_setenv("LD_LIBRARY_PATH", newenv, true, &env); + free(newenv); + } + } + } + + /* This has already been done in RAS, but I have to do it again here. + * Because the node structure doesn't have num_processor member. */ + + /* Get the collection of nodes. */ + hr = pCluster->get_ComputeNodes(&pNodesCollection); + + /* Get the enumerator used to iterate through the collection. */ + hr = pNodesCollection->GetEnumerator(&pNodes); + + VariantInit(&v); + + int *num_procs; + num_procs = (int *) malloc(sizeof(int)*map->num_nodes); + + /* Loop through the collection. */ + while (hr = pNodes->Next(1, &v, NULL) == S_OK) { + v.pdispVal->QueryInterface(IID_INode, reinterpret_cast (&pNode)); + + /* Iterate through each of the nodes and check to sum up all the processors. */ + for (i = 0; i < map->num_nodes; i++) { + orte_node_t* node = nodes[i]; + + BSTR node_name; + hr = pNode->get_Name(&node_name); + + if( 0 == strcmp(_com_util::ConvertBSTRToString(node_name), node->name)) { + /* Get available number of processors on required node. */ + hr = pNode->get_NumberOfIdleProcessors(&idle_processors); + num_procs[i] = idle_processors; + num_processors += idle_processors; + } + } + } + + if(NULL != mca_plm_ccp_component.job_name){ + pJob->put_Name(_bstr_t(mca_plm_ccp_component.job_name)); + } else { + pJob->put_Name(_bstr_t((*(*apps)).app)); + } + + pJob->put_MinimumNumberOfProcessors(num_processors); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to put min num of processors!")); + goto cleanup; + } + + pJob->put_MaximumNumberOfProcessors(num_processors); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to put max num of processors!")); + goto cleanup; + } + + hr = pJob->put_Priority(job_priority); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to set proiority!")); + goto cleanup; + } + + hr = pJob->SetExtendedJobTerm(_bstr_t(L"extended terms"), _bstr_t(L"TermValue")); + + /* set the job state to indicate we attempted to launch */ + job_state = ORTE_JOB_STATE_FAILED_TO_START; + + /* Iterate through each of the nodes and spin + * up a daemon. + */ + for (i = 0; i < map->num_nodes; i++) { + orte_node_t* node = nodes[i]; + char* vpid_string; + + /* if this daemon already exists, don't launch it! */ + if (node->daemon_launched) { + continue; + } + + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: launching on node %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + node->name)); + + /* setup process name */ + rc = orte_util_convert_vpid_to_string(&vpid_string, nodes[i]->daemon->name.vpid); + if (ORTE_SUCCESS != rc) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp: unable to get daemon vpid as string")); + exit(-1); + } + free(argv[proc_vpid_index]); + argv[proc_vpid_index] = strdup(vpid_string); + free(vpid_string); + + /* exec the daemon */ + if (0 < opal_output_get_verbosity(orte_plm_globals.output)) { + param = opal_argv_join(argv, ' '); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: executing:\n\t%s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + (NULL == param) ? "NULL" : param)); + if (NULL != param) free(param); + } + + /* check for timing request - get start time if so */ + if (orte_timing) { + if (0 != gettimeofday(&launchstart, NULL)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: could not obtain start time")); + launchstart.tv_sec = 0; + launchstart.tv_usec = 0; + } + } + /* Set terms for task. */ + hr = pCluster->CreateTask(&pTask); + if (FAILED(hr)) { + plm_get_cluster_message(pCluster); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to create task object!")); + goto cleanup; + } + + pTask->put_MinimumNumberOfProcessors(num_procs[i]); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to create task object!")); + goto cleanup; + } + + pTask->put_MaximumNumberOfProcessors(num_procs[i]); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to create task object!")); + goto cleanup; + } + + pTask->put_RequiredNodes(_bstr_t(node->name)); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to set required nodes!")); + goto cleanup; + } + + /* Prepare the command line a little bit. */ + command_line = plm_ccp_commandline(apps[0]->prefix_dir, node->name, argc, argv); + + hr = pTask->put_CommandLine(_bstr_t(command_line)); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to put command line!")); + goto cleanup; + } + + if( NULL != mca_plm_ccp_component.stdout_file ) { + hr = pTask->put_Stdout(_bstr_t(mca_plm_ccp_component.stdout_file)); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to set stdout!")); + goto cleanup; + } + } + + if( NULL != mca_plm_ccp_component.stderr_file) { + hr = pTask->put_Stderr(_bstr_t(mca_plm_ccp_component.stderr_file)); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to set stderr!")); + goto cleanup; + } + } + + hr = pJob->AddTask(pTask); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:failed to add task!")); + goto cleanup; + } + + + /* Allow some progress to occur */ + opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK); + + launched++; + + pTask->Release(); + } + + /* Add job to the queue. */ + hr = pCluster->QueueJob(pJob, NULL, NULL, VARIANT_TRUE, 0, &job_id); + if (SUCCEEDED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "Added job %d to scheduling queue.\n", job_id)); + }else { + plm_get_cluster_message(pCluster); + } + + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp:launch: finished spawning orteds", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); + + /* wait for daemons to callback */ + if (ORTE_SUCCESS != (rc = orte_plm_base_daemon_callback(map->num_new_daemons))) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: daemon launch failed for job %s on error %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + ORTE_JOBID_PRINT(jdata->jobid), ORTE_ERROR_NAME(rc))); + goto cleanup; + } + +launch_apps: + /* if we get here, then daemons launched - change to declaring apps failed */ + failed_job = active_job; + if (ORTE_SUCCESS != (rc = orte_plm_base_launch_apps(jdata->jobid))) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp: launch of apps failed for job %s on error %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + ORTE_JOBID_PRINT(jdata->jobid), ORTE_ERROR_NAME(rc))); + goto cleanup; + } + + /* if we get here, then everything launched okay - record that fact */ + failed_launch = false; + + /* check for timing request - get stop time for launch completion and report */ + if (orte_timing) { + if (0 != gettimeofday(&completionstop, NULL)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: could not obtain completion stop time")); + } else { + deltat = (launchstop.tv_sec - launchstart.tv_sec)*1000000 + + (launchstop.tv_usec - launchstart.tv_usec); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: launch completion required %d usec", deltat)); + } + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: Launch statistics:")); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: Average time to launch an orted: %f usec", avgtime)); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: Max time to launch an orted: %d usec at iter %d", maxtime, maxiter)); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: Min time to launch an orted: %d usec at iter %d", mintime, miniter)); + } + + + cleanup: + if (NULL != argv) { + opal_argv_free(argv); + } + + if (NULL != env) { + opal_argv_free(env); + } + + if (connected) { + plm_ccp_disconnect(); + } + + if (NULL != lib_base) { + free(lib_base); + } + + if (NULL != bin_base) { + free(bin_base); + } + + /* check for failed launch - if so, force terminate */ + if (failed_launch) { + orte_errmgr.update_state(failed_job, job_state, + NULL, ORTE_PROC_STATE_UNDEF, + 0, ORTE_ERROR_DEFAULT_EXIT_CODE); + } + + /* check for timing request - get stop time and process if so */ + if (orte_timing) { + if (0 != gettimeofday(&jobstop, NULL)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: could not obtain stop time")); + } else { + deltat = (jobstop.tv_sec - jobstart.tv_sec)*1000000 + + (jobstop.tv_usec - jobstart.tv_usec); + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm_ccp: launch of entire job required %d usec", deltat)); + } + } + + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "%s plm:ccp:launch: finished", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); + + return rc; +} + + +/** + * Terminate the orteds for a given job + */ +int plm_ccp_terminate_orteds() +{ + int rc; + + /* now tell them to die! */ + if (ORTE_SUCCESS != (rc = orte_plm_base_orted_exit(ORTE_DAEMON_EXIT_CMD))) { + ORTE_ERROR_LOG(rc); + } + + return rc; +} + + +static int plm_ccp_signal_job(orte_jobid_t jobid, int32_t signal) +{ + int rc; + + /* order them to pass this signal to their local procs */ + if (ORTE_SUCCESS != (rc = orte_plm_base_orted_signal_local_procs(jobid, signal))) { + ORTE_ERROR_LOG(rc); + } + + return rc; +} + + +/* + * Free stuff + */ +static int plm_ccp_finalize(void) +{ + int rc; + + /* cleanup any pending recvs */ + if (ORTE_SUCCESS != (rc = orte_plm_base_comm_stop())) { + ORTE_ERROR_LOG(rc); + } + + return ORTE_SUCCESS; +} + + +static int plm_ccp_connect(ICluster* pCluster) +{ + size_t i, len; + char *cluster_head = NULL; + HRESULT hr = S_OK; + + if (NULL == orte_ccp_headnode) { + /* Get the cluster head nodes name */ + _dupenv_s(&cluster_head, &len, "LOGONSERVER"); + + if(cluster_head == NULL) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:allocate: connot find cluster head node!")); + return ORTE_ERROR; + } + + /* Get rid of the beginning '//'. */ + for( i = 0; i < len; i++){ + cluster_head[i] = cluster_head[i+2]; + cluster_head[i+2] = '\0'; + } + } else { + cluster_head = orte_ccp_headnode; + } + + /* Connect to the cluster's head node */ + hr = pCluster->Connect(_bstr_t(cluster_head)); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "plm:ccp:allocate: connection failed!")); + return ORTE_ERROR; + } + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "Connected to Cluster: %s. \n", cluster_head)); + return ORTE_SUCCESS; +} + + +static int plm_ccp_disconnect(void) +{ + return ORTE_SUCCESS; +} + + +/* Generate the proper command line according to the env. */ +static char *plm_ccp_commandline(char *prefix, char *node_name, int argc, char **argv) +{ + char *commandline; + int i, len = 0; + + for( i = 0; i < argc; i++ ) { + len += strlen(argv[i]) + 1; + } + + if(NULL != prefix) { + commandline = (char*)malloc(len + strlen(prefix) + 8); + memset(commandline, 0, len + strlen(prefix) + 8); + commandline[0] = '"'; + strcat(commandline, prefix); + strcat(commandline, "\\bin\"\\"); + } else { + commandline = (char*)malloc(len + 1); + memset(commandline, 0, len + 1); + } + + + for(i=0;iget_ErrorMessage(&message); + if (SUCCEEDED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + _com_util::ConvertBSTRToString(message))); + SysFreeString(message); + } + else { + OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output, + "pCluster->get_ErrorMessage failed.\n")); + } +} diff --git a/orte/mca/plm/process/.windows b/orte/mca/plm/process/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/plm/process/.windows +++ b/orte/mca/plm/process/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/ras/ccp/.windows b/orte/mca/ras/ccp/.windows index b249e3c411..4e9bf3157d 100644 --- a/orte/mca/ras/ccp/.windows +++ b/orte/mca/ras/ccp/.windows @@ -1,13 +1,13 @@ -# -# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte -required_check=find_ccp +# +# Copyright (c) 2009-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte +required_check=find_ccp diff --git a/orte/mca/ras/ccp/ras_ccp_module.c b/orte/mca/ras/ccp/ras_ccp_module.c index 3452d273be..ef091c4e57 100644 --- a/orte/mca/ras/ccp/ras_ccp_module.c +++ b/orte/mca/ras/ccp/ras_ccp_module.c @@ -1,342 +1,342 @@ -/* - * Copyright (c) 2004-2007 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2009 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "orte_config.h" -#include "orte/constants.h" - -#include -#include -#include -#include - -#include -#include - -#include "opal/util/output.h" -#include "orte/util/show_help.h" - -#include "orte/runtime/orte_globals.h" - -#include "orte/mca/ras/base/ras_private.h" -#include "ras_ccp.h" - -/* Import the Windows CCP API. */ -#import "ccpapi.tlb" named_guids no_namespace raw_interfaces_only \ - rename("SetEnvironmentVariable","SetEnvVar") \ - rename("GetJob", "GetSingleJob") \ - rename("AddJob", "AddSingleJob") - -/* Include the library for ::ConvertBSTRToString */ -#pragma comment(lib, "comsuppw.lib") - -/* - * Local functions - */ -static int orte_ras_ccp_allocate(opal_list_t *nodes); -static int orte_ras_ccp_finalize(void); -static int discover(opal_list_t* nodelist, ICluster* pCluster); -void ras_get_cluster_message(ICluster* pCluster); - - -/* - * Local variables - */ -orte_ras_base_module_t orte_ras_ccp_module = { - orte_ras_ccp_allocate, - orte_ras_ccp_finalize -}; - - -/** - * Discover available (pre-allocated) nodes. Allocate the - * requested number of nodes/process slots to the job. - */ -static int orte_ras_ccp_allocate(opal_list_t *nodes) -{ - int ret, i; - size_t len; - char *cluster_head = NULL; - HRESULT hr = S_OK; - ICluster* pCluster = NULL; - - /* CCP is not thread safe. Use the apartment model. */ - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - - /* Create the Cluster object. */ - hr = CoCreateInstance( __uuidof(Cluster), - NULL, - CLSCTX_INPROC_SERVER, - __uuidof(ICluster), - reinterpret_cast (&pCluster) ); - - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:allocate: failed to create cluster object!")); - return ORTE_ERROR; - } - - if(NULL == orte_ccp_headnode) { - /* Get the cluster head nodes name */ - _dupenv_s(&cluster_head, &len, "LOGONSERVER"); - - if(cluster_head == NULL) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:allocate: connot find cluster head node!")); - return ORTE_ERROR; - } - - /* Get rid of the beginning '//'. */ - for( i = 0; i < len - 2; i++){ - cluster_head[i] = cluster_head[i+2]; - cluster_head[i+2] = '\0'; - } - } else { - cluster_head = orte_ccp_headnode; - } - - /* Connect to the cluster's head node */ - hr = pCluster->Connect(_bstr_t(cluster_head)); - if (FAILED(hr)) { - ras_get_cluster_message(pCluster); - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:allocate: connection failed!")); - return ORTE_ERROR; - } - - if (ORTE_SUCCESS != (ret = discover(nodes, pCluster))) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:allocate: discover failed!")); - return ret; - } - - /* in the CCP world, if we didn't find anything, then this - * is an unrecoverable error - report it - */ - if (opal_list_is_empty(nodes)) { - orte_show_help("help-ras-ccp.txt", "no-nodes-found", true); - return ORTE_ERR_NOT_FOUND; - } - - /* All finished, release cluster object*/ - pCluster->Release(); - CoUninitialize(); - - return ret; -} - -/* - * There's really nothing to do here - */ -static int orte_ras_ccp_finalize(void) -{ - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:finalize: success (nothing to do)")); - return ORTE_SUCCESS; -} - - -/** - * Discover the available resources. Obtain directly from head node - * - * - validate any Windows Cluster nodes - * - check for additional nodes that have already been allocated - */ - -static int discover(opal_list_t* nodelist, ICluster* pCluster) -{ - int ret = ORTE_ERROR; - int32_t nodeid; - orte_node_t *node; - opal_list_item_t* item; - opal_list_t new_nodes; - struct timeval start, stop; - - HRESULT hr = S_OK; - long idle_processors = 0; - IClusterEnumerable* pNodesCollection = NULL; - IEnumVARIANT* pNodes = NULL; - INode* pNode = NULL; - BSTR node_name = NULL, node_arch = NULL; - VARIANT var; - NodeStatus Status; - size_t len; - - /* check for timing request - get start time if so */ - if (orte_timing) { - gettimeofday(&start, NULL); - } - - /* Get the collection of nodes. */ - hr = pCluster->get_ComputeNodes(&pNodesCollection); - if (FAILED(hr)) { - ras_get_cluster_message(pCluster); - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:pCluster->get_ComputeNodes failed.")); - return ORTE_ERROR; - } - - /* Get the enumerator used to iterate through the collection. */ - hr = pNodesCollection->GetEnumerator(&pNodes); - if (FAILED(hr)) { - ras_get_cluster_message(pCluster); - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:pNodesCollection->GetEnumerator failed.")); - return ORTE_ERROR; - } - - VariantInit(&var); - - /* Construct new node list. */ - OBJ_CONSTRUCT(&new_nodes, opal_list_t); - nodeid=0; - - /* Loop through the collection. */ - while (hr = pNodes->Next(1, &var, NULL) == S_OK) { - var.pdispVal->QueryInterface(IID_INode, reinterpret_cast (&pNode)); - - /* Check wether the node is ready. - * There are four states: - * NodeStatus_Ready = 0, - * NodeStatus_Paused = 1, - * NodeStatus_Unreachable = 2, probably not a windows cluster node. - * NodeStatus_PendingApproval = 3 - */ - hr = pNode->get_Status(&Status); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:pNode->get_Status failed.")); - ret = ORTE_ERROR; - goto cleanup; - } - - /* Get available number of processors on each node. */ - hr = pNode->get_NumberOfIdleProcessors(&idle_processors); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:pNode->get_NumberOfIdleProcessors failed.")); - ret = ORTE_ERROR; - goto cleanup; - } - - /* Do we have enough processors on the available nodes? - * Question: How do we get the required number of processors? - */ - if ( (Status == NodeStatus_Ready) && (idle_processors > 0) ) { - - /* Get node name. */ - hr = pNode->get_Name(&node_name); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:pNode->get_Name failed.")); - ret = ORTE_ERROR; - goto cleanup; - } - - /* Get node processor architecture. */ - hr = pNode->get_ProcessorArchitecture(&node_arch); - if (FAILED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:pNode->get_ProcessorArchitecture failed.")); - ret = ORTE_ERROR; - goto cleanup; - } - - /* Prevent duplicated nodes in the list*/ - for (item = opal_list_get_first(&new_nodes); - opal_list_get_end(&new_nodes) != item; - item = opal_list_get_next(item)) { - - node = (orte_node_t*) item; - if (0 == strcmp(node->name, (char *)node_name)) { - ++node->slots; - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:allocate:discover: found -- bumped slots to %d", - node->slots)); - break; - } - } - /* Did we find it? */ - - if (opal_list_get_end(&new_nodes) == item) { - - /* Nope -- didn't find it, so add a new item to the list */ - - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:allocate:discover: not found -- added to list")); - - node = OBJ_NEW(orte_node_t); - - /* The function _dupenv_s is much safer than getenv on Windows. */ - _dupenv_s(&node->username, &len, "username"); - - node->name = _com_util::ConvertBSTRToString(node_name); - node->launch_id = nodeid; - node->slots_inuse = 0; - node->slots_max = 0; - node->slots = 1; - opal_list_append(nodelist, &node->super); - } - /* up the nodeid */ - nodeid++; - } - - pNode->Release(); - VariantClear(&var); - } - - pNodes->Release(); - - if (nodeid > 0) ret = ORTE_SUCCESS; - - /* All done */ -cleanup: - - if (ORTE_SUCCESS == ret) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:allocate:discover: success")); - } else { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "ras:ccp:allocate:discover: failed (rc=%d)", ret)); - } - - OBJ_DESTRUCT(&new_nodes); - SysFreeString(node_name); - SysFreeString(node_arch); - - /* check for timing request - get stop time and report elapsed time if so */ - if (orte_timing) { - gettimeofday(&stop, NULL); - opal_output(0, "ras_ccp: time to allocate is %ld usec", - (long int)((stop.tv_sec - start.tv_sec)*1000000 + - (stop.tv_usec - start.tv_usec))); - gettimeofday(&start, NULL); - } - - return ret; -} - -void ras_get_cluster_message(ICluster* pCluster) -{ - HRESULT hr = S_OK; - BSTR message = NULL; - - hr = pCluster->get_ErrorMessage(&message); - if (SUCCEEDED(hr)) { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - _com_util::ConvertBSTRToString(message))); - SysFreeString(message); - } - else { - OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, - "pCluster->get_ErrorMessage failed.\n")); - } -} +/* + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2009 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +#include "orte_config.h" +#include "orte/constants.h" + +#include +#include +#include +#include + +#include +#include + +#include "opal/util/output.h" +#include "orte/util/show_help.h" + +#include "orte/runtime/orte_globals.h" + +#include "orte/mca/ras/base/ras_private.h" +#include "ras_ccp.h" + +/* Import the Windows CCP API. */ +#import "ccpapi.tlb" named_guids no_namespace raw_interfaces_only \ + rename("SetEnvironmentVariable","SetEnvVar") \ + rename("GetJob", "GetSingleJob") \ + rename("AddJob", "AddSingleJob") + +/* Include the library for ::ConvertBSTRToString */ +#pragma comment(lib, "comsuppw.lib") + +/* + * Local functions + */ +static int orte_ras_ccp_allocate(opal_list_t *nodes); +static int orte_ras_ccp_finalize(void); +static int discover(opal_list_t* nodelist, ICluster* pCluster); +void ras_get_cluster_message(ICluster* pCluster); + + +/* + * Local variables + */ +orte_ras_base_module_t orte_ras_ccp_module = { + orte_ras_ccp_allocate, + orte_ras_ccp_finalize +}; + + +/** + * Discover available (pre-allocated) nodes. Allocate the + * requested number of nodes/process slots to the job. + */ +static int orte_ras_ccp_allocate(opal_list_t *nodes) +{ + int ret, i; + size_t len; + char *cluster_head = NULL; + HRESULT hr = S_OK; + ICluster* pCluster = NULL; + + /* CCP is not thread safe. Use the apartment model. */ + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + /* Create the Cluster object. */ + hr = CoCreateInstance( __uuidof(Cluster), + NULL, + CLSCTX_INPROC_SERVER, + __uuidof(ICluster), + reinterpret_cast (&pCluster) ); + + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:allocate: failed to create cluster object!")); + return ORTE_ERROR; + } + + if(NULL == orte_ccp_headnode) { + /* Get the cluster head nodes name */ + _dupenv_s(&cluster_head, &len, "LOGONSERVER"); + + if(cluster_head == NULL) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:allocate: connot find cluster head node!")); + return ORTE_ERROR; + } + + /* Get rid of the beginning '//'. */ + for( i = 0; i < len - 2; i++){ + cluster_head[i] = cluster_head[i+2]; + cluster_head[i+2] = '\0'; + } + } else { + cluster_head = orte_ccp_headnode; + } + + /* Connect to the cluster's head node */ + hr = pCluster->Connect(_bstr_t(cluster_head)); + if (FAILED(hr)) { + ras_get_cluster_message(pCluster); + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:allocate: connection failed!")); + return ORTE_ERROR; + } + + if (ORTE_SUCCESS != (ret = discover(nodes, pCluster))) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:allocate: discover failed!")); + return ret; + } + + /* in the CCP world, if we didn't find anything, then this + * is an unrecoverable error - report it + */ + if (opal_list_is_empty(nodes)) { + orte_show_help("help-ras-ccp.txt", "no-nodes-found", true); + return ORTE_ERR_NOT_FOUND; + } + + /* All finished, release cluster object*/ + pCluster->Release(); + CoUninitialize(); + + return ret; +} + +/* + * There's really nothing to do here + */ +static int orte_ras_ccp_finalize(void) +{ + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:finalize: success (nothing to do)")); + return ORTE_SUCCESS; +} + + +/** + * Discover the available resources. Obtain directly from head node + * + * - validate any Windows Cluster nodes + * - check for additional nodes that have already been allocated + */ + +static int discover(opal_list_t* nodelist, ICluster* pCluster) +{ + int ret = ORTE_ERROR; + int32_t nodeid; + orte_node_t *node; + opal_list_item_t* item; + opal_list_t new_nodes; + struct timeval start, stop; + + HRESULT hr = S_OK; + long idle_processors = 0; + IClusterEnumerable* pNodesCollection = NULL; + IEnumVARIANT* pNodes = NULL; + INode* pNode = NULL; + BSTR node_name = NULL, node_arch = NULL; + VARIANT var; + NodeStatus Status; + size_t len; + + /* check for timing request - get start time if so */ + if (orte_timing) { + gettimeofday(&start, NULL); + } + + /* Get the collection of nodes. */ + hr = pCluster->get_ComputeNodes(&pNodesCollection); + if (FAILED(hr)) { + ras_get_cluster_message(pCluster); + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:pCluster->get_ComputeNodes failed.")); + return ORTE_ERROR; + } + + /* Get the enumerator used to iterate through the collection. */ + hr = pNodesCollection->GetEnumerator(&pNodes); + if (FAILED(hr)) { + ras_get_cluster_message(pCluster); + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:pNodesCollection->GetEnumerator failed.")); + return ORTE_ERROR; + } + + VariantInit(&var); + + /* Construct new node list. */ + OBJ_CONSTRUCT(&new_nodes, opal_list_t); + nodeid=0; + + /* Loop through the collection. */ + while (hr = pNodes->Next(1, &var, NULL) == S_OK) { + var.pdispVal->QueryInterface(IID_INode, reinterpret_cast (&pNode)); + + /* Check wether the node is ready. + * There are four states: + * NodeStatus_Ready = 0, + * NodeStatus_Paused = 1, + * NodeStatus_Unreachable = 2, probably not a windows cluster node. + * NodeStatus_PendingApproval = 3 + */ + hr = pNode->get_Status(&Status); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:pNode->get_Status failed.")); + ret = ORTE_ERROR; + goto cleanup; + } + + /* Get available number of processors on each node. */ + hr = pNode->get_NumberOfIdleProcessors(&idle_processors); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:pNode->get_NumberOfIdleProcessors failed.")); + ret = ORTE_ERROR; + goto cleanup; + } + + /* Do we have enough processors on the available nodes? + * Question: How do we get the required number of processors? + */ + if ( (Status == NodeStatus_Ready) && (idle_processors > 0) ) { + + /* Get node name. */ + hr = pNode->get_Name(&node_name); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:pNode->get_Name failed.")); + ret = ORTE_ERROR; + goto cleanup; + } + + /* Get node processor architecture. */ + hr = pNode->get_ProcessorArchitecture(&node_arch); + if (FAILED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:pNode->get_ProcessorArchitecture failed.")); + ret = ORTE_ERROR; + goto cleanup; + } + + /* Prevent duplicated nodes in the list*/ + for (item = opal_list_get_first(&new_nodes); + opal_list_get_end(&new_nodes) != item; + item = opal_list_get_next(item)) { + + node = (orte_node_t*) item; + if (0 == strcmp(node->name, (char *)node_name)) { + ++node->slots; + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:allocate:discover: found -- bumped slots to %d", + node->slots)); + break; + } + } + /* Did we find it? */ + + if (opal_list_get_end(&new_nodes) == item) { + + /* Nope -- didn't find it, so add a new item to the list */ + + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:allocate:discover: not found -- added to list")); + + node = OBJ_NEW(orte_node_t); + + /* The function _dupenv_s is much safer than getenv on Windows. */ + _dupenv_s(&node->username, &len, "username"); + + node->name = _com_util::ConvertBSTRToString(node_name); + node->launch_id = nodeid; + node->slots_inuse = 0; + node->slots_max = 0; + node->slots = 1; + opal_list_append(nodelist, &node->super); + } + /* up the nodeid */ + nodeid++; + } + + pNode->Release(); + VariantClear(&var); + } + + pNodes->Release(); + + if (nodeid > 0) ret = ORTE_SUCCESS; + + /* All done */ +cleanup: + + if (ORTE_SUCCESS == ret) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:allocate:discover: success")); + } else { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "ras:ccp:allocate:discover: failed (rc=%d)", ret)); + } + + OBJ_DESTRUCT(&new_nodes); + SysFreeString(node_name); + SysFreeString(node_arch); + + /* check for timing request - get stop time and report elapsed time if so */ + if (orte_timing) { + gettimeofday(&stop, NULL); + opal_output(0, "ras_ccp: time to allocate is %ld usec", + (long int)((stop.tv_sec - start.tv_sec)*1000000 + + (stop.tv_usec - start.tv_usec))); + gettimeofday(&start, NULL); + } + + return ret; +} + +void ras_get_cluster_message(ICluster* pCluster) +{ + HRESULT hr = S_OK; + BSTR message = NULL; + + hr = pCluster->get_ErrorMessage(&message); + if (SUCCEEDED(hr)) { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + _com_util::ConvertBSTRToString(message))); + SysFreeString(message); + } + else { + OPAL_OUTPUT_VERBOSE((1, orte_ras_base.ras_output, + "pCluster->get_ErrorMessage failed.\n")); + } +} diff --git a/orte/mca/rmaps/round_robin/.windows b/orte/mca/rmaps/round_robin/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/rmaps/round_robin/.windows +++ b/orte/mca/rmaps/round_robin/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/rmaps/seq/.windows b/orte/mca/rmaps/seq/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/rmaps/seq/.windows +++ b/orte/mca/rmaps/seq/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/rmaps/topo/.windows b/orte/mca/rmaps/topo/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/rmaps/topo/.windows +++ b/orte/mca/rmaps/topo/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/rml/ftrm/.windows b/orte/mca/rml/ftrm/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/rml/ftrm/.windows +++ b/orte/mca/rml/ftrm/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/rml/oob/.windows b/orte/mca/rml/oob/.windows index 07efcb4832..3d38f80566 100644 --- a/orte/mca/rml/oob/.windows +++ b/orte/mca/rml/oob/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte Ws2_32.lib +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte Ws2_32.lib diff --git a/orte/mca/routed/binomial/.windows b/orte/mca/routed/binomial/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/routed/binomial/.windows +++ b/orte/mca/routed/binomial/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/mca/routed/linear/.windows b/orte/mca/routed/linear/.windows index 7a934e8f29..aa7d7bbbe5 100644 --- a/orte/mca/routed/linear/.windows +++ b/orte/mca/routed/linear/.windows @@ -1,12 +1,12 @@ -# -# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Specific to this module -mca_link_libraries=libopen-rte +# +# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Specific to this module +mca_link_libraries=libopen-rte diff --git a/orte/tools/CMakeLists.txt b/orte/tools/CMakeLists.txt index c9e138257f..3a991d13d7 100644 --- a/orte/tools/CMakeLists.txt +++ b/orte/tools/CMakeLists.txt @@ -1,33 +1,33 @@ -# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2008 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -ADD_SUBDIRECTORY(orted) -ADD_SUBDIRECTORY(orterun) -ADD_SUBDIRECTORY(orte-clean) -ADD_SUBDIRECTORY(orte-ps) -IF(OPAL_ENABLE_FT) - ADD_SUBDIRECTORY(orte-checkpoint) -ENDIF(OPAL_ENABLE_FT) - -IF(WANT_INSTALL_HEADERS) - - CONFIGURE_FILE(${ORTE_SOURCE_DIR}/tools/wrappers/ortec++-wrapper-data.txt.in - ${ORTE_BINARY_DIR}/tools/wrappers/ortec++-wrapper-data.txt @ONLY) - CONFIGURE_FILE(${ORTE_SOURCE_DIR}/tools/wrappers/ortecc-wrapper-data.txt.in - ${ORTE_BINARY_DIR}/tools/wrappers/ortecc-wrapper-data.txt @ONLY) - - INSTALL(FILES ${ORTE_BINARY_DIR}/tools/wrappers/ortec++-wrapper-data.txt - DESTINATION share/openmpi) - INSTALL(FILES ${ORTE_BINARY_DIR}/tools/wrappers/ortecc-wrapper-data.txt - DESTINATION share/openmpi) - +# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2008 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +ADD_SUBDIRECTORY(orted) +ADD_SUBDIRECTORY(orterun) +ADD_SUBDIRECTORY(orte-clean) +ADD_SUBDIRECTORY(orte-ps) +IF(OPAL_ENABLE_FT) + ADD_SUBDIRECTORY(orte-checkpoint) +ENDIF(OPAL_ENABLE_FT) + +IF(WANT_INSTALL_HEADERS) + + CONFIGURE_FILE(${ORTE_SOURCE_DIR}/tools/wrappers/ortec++-wrapper-data.txt.in + ${ORTE_BINARY_DIR}/tools/wrappers/ortec++-wrapper-data.txt @ONLY) + CONFIGURE_FILE(${ORTE_SOURCE_DIR}/tools/wrappers/ortecc-wrapper-data.txt.in + ${ORTE_BINARY_DIR}/tools/wrappers/ortecc-wrapper-data.txt @ONLY) + + INSTALL(FILES ${ORTE_BINARY_DIR}/tools/wrappers/ortec++-wrapper-data.txt + DESTINATION share/openmpi) + INSTALL(FILES ${ORTE_BINARY_DIR}/tools/wrappers/ortecc-wrapper-data.txt + DESTINATION share/openmpi) + ENDIF(WANT_INSTALL_HEADERS) \ No newline at end of file diff --git a/orte/tools/orte-checkpoint/CMakeLists.txt b/orte/tools/orte-checkpoint/CMakeLists.txt index d92c0fdf65..00437c440f 100644 --- a/orte/tools/orte-checkpoint/CMakeLists.txt +++ b/orte/tools/orte-checkpoint/CMakeLists.txt @@ -1,38 +1,38 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE ORTE_CHECKPOINT_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (orte-checkpoint ${ORTE_CHECKPOINT_SOURCE_FILES}) - -ADD_DEPENDENCIES(orte-checkpoint libopen-rte libopen-pal) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(orte-checkpoint PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(orte-checkpoint PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (orte-checkpoint libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) - -ADD_CUSTOM_COMMAND (TARGET orte-checkpoint - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orte-checkpoint.exe - ${PROJECT_BINARY_DIR}/ompi-checkpoint.exe - COMMENT "Copying renamed executables...") - -INSTALL(TARGETS orte-checkpoint - DESTINATION bin) -INSTALL(FILES help-orte-checkpoint.txt DESTINATION share/openmpi) -INSTALL(FILES ${PROJECT_BINARY_DIR}/ompi-checkpoint.exe - DESTINATION bin) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE ORTE_CHECKPOINT_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (orte-checkpoint ${ORTE_CHECKPOINT_SOURCE_FILES}) + +ADD_DEPENDENCIES(orte-checkpoint libopen-rte libopen-pal) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(orte-checkpoint PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(orte-checkpoint PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (orte-checkpoint libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) + +ADD_CUSTOM_COMMAND (TARGET orte-checkpoint + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orte-checkpoint.exe + ${PROJECT_BINARY_DIR}/ompi-checkpoint.exe + COMMENT "Copying renamed executables...") + +INSTALL(TARGETS orte-checkpoint + DESTINATION bin) +INSTALL(FILES help-orte-checkpoint.txt DESTINATION share/openmpi) +INSTALL(FILES ${PROJECT_BINARY_DIR}/ompi-checkpoint.exe + DESTINATION bin) diff --git a/orte/tools/orte-clean/CMakeLists.txt b/orte/tools/orte-clean/CMakeLists.txt index ee36b1723b..bb5f22611c 100644 --- a/orte/tools/orte-clean/CMakeLists.txt +++ b/orte/tools/orte-clean/CMakeLists.txt @@ -1,38 +1,38 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE ORTE_CLEAN_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (orte-clean ${ORTE_CLEAN_SOURCE_FILES}) - -ADD_DEPENDENCIES(orte-clean libopen-rte libopen-pal) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(orte-clean PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(orte-clean PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (orte-clean libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) - -ADD_CUSTOM_COMMAND (TARGET orte-clean - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orte-clean.exe - ${PROJECT_BINARY_DIR}/ompi-clean.exe - COMMENT "Copying renamed executables...") - -INSTALL(TARGETS orte-clean - DESTINATION bin) -INSTALL(FILES help-orte-clean.txt DESTINATION share/openmpi) -INSTALL(FILES ${PROJECT_BINARY_DIR}/ompi-clean.exe - DESTINATION bin) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE ORTE_CLEAN_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (orte-clean ${ORTE_CLEAN_SOURCE_FILES}) + +ADD_DEPENDENCIES(orte-clean libopen-rte libopen-pal) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(orte-clean PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(orte-clean PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (orte-clean libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) + +ADD_CUSTOM_COMMAND (TARGET orte-clean + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orte-clean.exe + ${PROJECT_BINARY_DIR}/ompi-clean.exe + COMMENT "Copying renamed executables...") + +INSTALL(TARGETS orte-clean + DESTINATION bin) +INSTALL(FILES help-orte-clean.txt DESTINATION share/openmpi) +INSTALL(FILES ${PROJECT_BINARY_DIR}/ompi-clean.exe + DESTINATION bin) diff --git a/orte/tools/orte-migrate/CMakeLists.txt b/orte/tools/orte-migrate/CMakeLists.txt index e82d16661d..a36139c0a6 100644 --- a/orte/tools/orte-migrate/CMakeLists.txt +++ b/orte/tools/orte-migrate/CMakeLists.txt @@ -1,40 +1,40 @@ -# Copyright (c) 2007-2009 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2009-2010 The Trustees of Indiana University and Indiana -# University Research and Technology -# Corporation. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE ORTE_MIGRATE_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (orte-migrate ${ORTE_MIGRATE_SOURCE_FILES}) - -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(orte-migrate PROPERTIES - COMPILE_FLAGS "-D_USRDLL -DOPAL_IMPORTS -DOMPI_IMPORTS -DORTE_IMPORTS /TP") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(orte-migrate PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (orte-migrate Ws2_32.lib shlwapi.lib) - -ADD_DEPENDENCIES (orte-migrate libopen-pal libopen-rte) - -ADD_CUSTOM_COMMAND (TARGET orte-migrate - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orte-migrate.exe - ${PROJECT_BINARY_DIR}/ompi-migrate.exe - COMMENT "Copying renamed executables...") - -INSTALL(TARGETS orte-migrate - DESTINATION bin) -INSTALL(FILES help-orte-migrate.txt DESTINATION share/openmpi) -INSTALL(FILES ${PROJECT_BINARY_DIR}/ompi-migrate.exe - DESTINATION bin) +# Copyright (c) 2007-2009 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2009-2010 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE ORTE_MIGRATE_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (orte-migrate ${ORTE_MIGRATE_SOURCE_FILES}) + +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(orte-migrate PROPERTIES + COMPILE_FLAGS "-D_USRDLL -DOPAL_IMPORTS -DOMPI_IMPORTS -DORTE_IMPORTS /TP") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(orte-migrate PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (orte-migrate Ws2_32.lib shlwapi.lib) + +ADD_DEPENDENCIES (orte-migrate libopen-pal libopen-rte) + +ADD_CUSTOM_COMMAND (TARGET orte-migrate + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orte-migrate.exe + ${PROJECT_BINARY_DIR}/ompi-migrate.exe + COMMENT "Copying renamed executables...") + +INSTALL(TARGETS orte-migrate + DESTINATION bin) +INSTALL(FILES help-orte-migrate.txt DESTINATION share/openmpi) +INSTALL(FILES ${PROJECT_BINARY_DIR}/ompi-migrate.exe + DESTINATION bin) diff --git a/orte/tools/orte-ps/CMakeLists.txt b/orte/tools/orte-ps/CMakeLists.txt index dba4ef83f7..b2a025ba42 100644 --- a/orte/tools/orte-ps/CMakeLists.txt +++ b/orte/tools/orte-ps/CMakeLists.txt @@ -1,38 +1,38 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE ORTE_PS_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (orte-ps ${ORTE_PS_SOURCE_FILES}) - -ADD_DEPENDENCIES(orte-ps libopen-rte libopen-pal) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(orte-ps PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(orte-ps PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (orte-ps libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) - -ADD_CUSTOM_COMMAND (TARGET orte-ps - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orte-ps.exe - ${PROJECT_BINARY_DIR}/ompi-ps.exe - COMMENT "Copying renamed executables...") - -INSTALL(TARGETS orte-ps - DESTINATION bin) -INSTALL(FILES help-orte-ps.txt DESTINATION share/openmpi) -INSTALL(FILES ${PROJECT_BINARY_DIR}/ompi-ps.exe - DESTINATION bin) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE ORTE_PS_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (orte-ps ${ORTE_PS_SOURCE_FILES}) + +ADD_DEPENDENCIES(orte-ps libopen-rte libopen-pal) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(orte-ps PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(orte-ps PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (orte-ps libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) + +ADD_CUSTOM_COMMAND (TARGET orte-ps + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orte-ps.exe + ${PROJECT_BINARY_DIR}/ompi-ps.exe + COMMENT "Copying renamed executables...") + +INSTALL(TARGETS orte-ps + DESTINATION bin) +INSTALL(FILES help-orte-ps.txt DESTINATION share/openmpi) +INSTALL(FILES ${PROJECT_BINARY_DIR}/ompi-ps.exe + DESTINATION bin) diff --git a/orte/tools/orte-restart/CMakeLists.txt b/orte/tools/orte-restart/CMakeLists.txt index 8d9dd85a0e..d3ccc073ad 100644 --- a/orte/tools/orte-restart/CMakeLists.txt +++ b/orte/tools/orte-restart/CMakeLists.txt @@ -1,24 +1,24 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE ORTE_RESTART_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (orte-restart ${ORTE_RESTART_SOURCE_FILES}) - -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(orte-restart PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(orte-restart PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (orte-restart libopen-pal libopen-rte) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE ORTE_RESTART_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (orte-restart ${ORTE_RESTART_SOURCE_FILES}) + +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(orte-restart PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(orte-restart PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (orte-restart libopen-pal libopen-rte) diff --git a/orte/tools/orted/CMakeLists.txt b/orte/tools/orted/CMakeLists.txt index 2fd7dd7d6b..23394f66f6 100644 --- a/orte/tools/orted/CMakeLists.txt +++ b/orte/tools/orted/CMakeLists.txt @@ -1,28 +1,28 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE ORTED_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (orted ${ORTED_SOURCE_FILES}) - -ADD_DEPENDENCIES(orted libopen-rte libopen-pal) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(orted PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(orted PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (orted libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) - -INSTALL(TARGETS orted - DESTINATION bin) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE ORTED_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (orted ${ORTED_SOURCE_FILES}) + +ADD_DEPENDENCIES(orted libopen-rte libopen-pal) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(orted PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(orted PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (orted libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) + +INSTALL(TARGETS orted + DESTINATION bin) diff --git a/orte/tools/orterun/CMakeLists.txt b/orte/tools/orterun/CMakeLists.txt index 0b8acad192..6ebfdff4bf 100644 --- a/orte/tools/orterun/CMakeLists.txt +++ b/orte/tools/orterun/CMakeLists.txt @@ -1,44 +1,44 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -FILE(GLOB_RECURSE ORTERUN_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") - -ADD_EXECUTABLE (orterun ${ORTERUN_SOURCE_FILES}) - -ADD_DEPENDENCIES(orterun libopen-rte libopen-pal) -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(orterun PROPERTIES - COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS - ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS - ${OMPI_CXX_LAN_FLAG}") -ENDIF(BUILD_SHARED_LIBS) - -SET_TARGET_PROPERTIES(orterun PROPERTIES - DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") - -TARGET_LINK_LIBRARIES (orterun libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) - -ADD_CUSTOM_COMMAND (TARGET orterun - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orterun${OMPI_EXE_DEBUG_POSTFIX}.exe - ${PROJECT_BINARY_DIR}/mpirun${OMPI_EXE_DEBUG_POSTFIX}.exe - COMMAND ${CMAKE_COMMAND} -E copy - ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orterun${OMPI_EXE_DEBUG_POSTFIX}.exe - ${PROJECT_BINARY_DIR}/mpiexec${OMPI_EXE_DEBUG_POSTFIX}.exe - COMMENT "Copying renamed executables...") - -INSTALL(TARGETS orterun - DESTINATION bin) -INSTALL(FILES help-orterun.txt DESTINATION share/openmpi) -INSTALL(FILES ${PROJECT_BINARY_DIR}/mpirun${OMPI_EXE_DEBUG_POSTFIX}.exe - DESTINATION bin) -INSTALL(FILES ${PROJECT_BINARY_DIR}/mpiexec${OMPI_EXE_DEBUG_POSTFIX}.exe - DESTINATION bin) - +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +FILE(GLOB_RECURSE ORTERUN_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp") + +ADD_EXECUTABLE (orterun ${ORTERUN_SOURCE_FILES}) + +ADD_DEPENDENCIES(orterun libopen-rte libopen-pal) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(orterun PROPERTIES + COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS + ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS + ${OMPI_CXX_LAN_FLAG}") +ENDIF(BUILD_SHARED_LIBS) + +SET_TARGET_PROPERTIES(orterun PROPERTIES + DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}") + +TARGET_LINK_LIBRARIES (orterun libopen-pal libopen-rte Ws2_32.lib shlwapi.lib) + +ADD_CUSTOM_COMMAND (TARGET orterun + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orterun${OMPI_EXE_DEBUG_POSTFIX}.exe + ${PROJECT_BINARY_DIR}/mpirun${OMPI_EXE_DEBUG_POSTFIX}.exe + COMMAND ${CMAKE_COMMAND} -E copy + ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/orterun${OMPI_EXE_DEBUG_POSTFIX}.exe + ${PROJECT_BINARY_DIR}/mpiexec${OMPI_EXE_DEBUG_POSTFIX}.exe + COMMENT "Copying renamed executables...") + +INSTALL(TARGETS orterun + DESTINATION bin) +INSTALL(FILES help-orterun.txt DESTINATION share/openmpi) +INSTALL(FILES ${PROJECT_BINARY_DIR}/mpirun${OMPI_EXE_DEBUG_POSTFIX}.exe + DESTINATION bin) +INSTALL(FILES ${PROJECT_BINARY_DIR}/mpiexec${OMPI_EXE_DEBUG_POSTFIX}.exe + DESTINATION bin) + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d9fdaf29eb..05c2644727 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,12 +1,12 @@ -# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - - +# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + + + ADD_SUBDIRECTORY(mpi) \ No newline at end of file diff --git a/test/mpi/CMakeLists.txt b/test/mpi/CMakeLists.txt index 2cf036e33e..f3747a1643 100644 --- a/test/mpi/CMakeLists.txt +++ b/test/mpi/CMakeLists.txt @@ -1,10 +1,10 @@ -# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -ADD_SUBDIRECTORY(environment) +# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +ADD_SUBDIRECTORY(environment) diff --git a/test/mpi/environment/CMakeLists.txt b/test/mpi/environment/CMakeLists.txt index fc37ff5e2e..964fa55dbf 100644 --- a/test/mpi/environment/CMakeLists.txt +++ b/test/mpi/environment/CMakeLists.txt @@ -1,16 +1,16 @@ -# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -SET(CHELLO_FILES - chello.c -) - -ADD_EXECUTABLE (chello ${CHELLO_FILES}) - -TARGET_LINK_LIBRARIES (chello libmpi) +# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +SET(CHELLO_FILES + chello.c +) + +ADD_EXECUTABLE (chello ${CHELLO_FILES}) + +TARGET_LINK_LIBRARIES (chello libmpi)