Convert the bad dos line endings to unix style for all windows related files.
This commit was SVN r24137.
Этот коммит содержится в:
родитель
aaad8ae891
Коммит
f43862420c
@ -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 <stdio.h>
|
||||
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 <stdbool.h>)." 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 <stdio.h>
|
||||
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 <stdbool.h>)." 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)
|
@ -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)
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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 <stdio.h>\n"
|
||||
"#include <stdlib.h>\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 <stdio.h>\n"
|
||||
"#include <stdlib.h>\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)
|
||||
|
@ -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)
|
@ -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)
|
@ -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 <stdio.h> \n"
|
||||
"\t #include <stdlib.h> \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 <stdio.h> \n"
|
||||
"\t #include <stdlib.h> \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)
|
||||
|
@ -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 <stdio.h>\n"
|
||||
"#include <limits.h>\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 <stdio.h>\n"
|
||||
"#include <limits.h>\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)
|
||||
|
@ -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 <stdio.h> \n"
|
||||
"#include <stdlib.h> \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 <stdio.h> \n"
|
||||
"#include <stdlib.h> \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)
|
@ -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 <stdio.h>\n"
|
||||
"#include <stdlib.h>\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 <stdio.h>\n"
|
||||
"#include <stdlib.h>\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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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 <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>")
|
||||
|
||||
IF(HAVE_STDINT_H)
|
||||
SET(INCLUDE_HEADERS "${INCLUDE_HEADERS}\n#include <stdint.h>\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 <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>")
|
||||
|
||||
IF(HAVE_STDINT_H)
|
||||
SET(INCLUDE_HEADERS "${INCLUDE_HEADERS}\n#include <stdint.h>\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 )
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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 <windows.h>\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 <windows.h>\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)
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@ -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)
|
||||
|
@ -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
|
||||
")
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -1 +1 @@
|
||||
$WCREV$
|
||||
$WCREV$
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
26
opal/mca/installdirs/env/.windows
поставляемый
26
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
24
orte/mca/ess/env/.windows
поставляемый
24
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <comutil.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#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<void **> (&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<void **> (&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 <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <comutil.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#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<void **> (&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<void **> (&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"));
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
@ -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)
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче
Block a user