diff --git a/contrib/platform/win32/CMakeModules/check_mca_subdirs.cmake b/contrib/platform/win32/CMakeModules/check_mca_subdirs.cmake index 169866dd5f..3a417603cf 100644 --- a/contrib/platform/win32/CMakeModules/check_mca_subdirs.cmake +++ b/contrib/platform/win32/CMakeModules/check_mca_subdirs.cmake @@ -119,7 +119,7 @@ FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST}) SET(COMPONENT_FILES "") SET(CURRENT_PATH ${PROJECT_SOURCE_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}) - FILE(GLOB COMPONENT_FILES "${CURRENT_PATH}/*.C" "${CURRENT_PATH}/*.h" + FILE(GLOB_RECURSE COMPONENT_FILES "${CURRENT_PATH}/*.C" "${CURRENT_PATH}/*.h" "${CURRENT_PATH}/*.cc" "${CURRENT_PATH}/*.cpp") #check exclude list @@ -132,7 +132,7 @@ FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST}) # remove the files in the exclude list FOREACH(FILE ${EXCLUDE_LIST}) - LIST(REMOVE_ITEM MCA_FRAMEWORK_BASE_FILES "${CURRENT_PATH}/${FILE}") + LIST(REMOVE_ITEM COMPONENT_FILES "${CURRENT_PATH}/${FILE}") ENDFOREACH(FILE) # by default, build this component. @@ -141,14 +141,18 @@ FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST}) # 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) @@ -164,19 +168,6 @@ FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST}) STRING(REPLACE "not_single_shared_lib=" "" NOT_SINGLE_SHARED_LIB ${VALUE}) ENDIF(NOT VALUE STREQUAL "") - # check out if we have to exclude some source 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 COMPONENT_FILES "${CURRENT_PATH}/${FILE}") - ENDFOREACH(FILE) - 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. @@ -266,7 +257,7 @@ 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}) + libopen-pal ${MCA_LINK_LIBRARIES} ${EXTRA_LINK_LIBRARIES}) INSTALL(TARGETS ${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} ${INSTALL_DEST}) IF (OMPI_DEBUG_BUILD) @@ -275,8 +266,13 @@ IF (OMPI_DEBUG_BUILD) ENDIF (OMPI_DEBUG_BUILD) ") - ADD_SUBDIRECTORY (${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT} mca/${MCA_FRAMEWORK}/${MCA_COMPONENT}) - ENDIF(NOT OPAL_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1") + 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/ diff --git a/contrib/platform/win32/CMakeModules/find_ofed_sdk.cmake b/contrib/platform/win32/CMakeModules/find_ofed_sdk.cmake new file mode 100644 index 0000000000..dafea7be51 --- /dev/null +++ b/contrib/platform/win32/CMakeModules/find_ofed_sdk.cmake @@ -0,0 +1,73 @@ +# 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.") + + 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}) + SET(RESULT TRUE) + MESSAGE(STATUS "looking for OFED SDK...found.") + ELSE(OFED_SDK_INCLUDE_PATH AND OFED_SDK_LIBIBVERBS) + SET(OFED_SDK_FOUND FALSE CACHE INTERNAL "find result of OFED SDK.") + 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}) + SET(RESULT TRUE) + ENDIF(NOT OFED_SDK_FOUND) + +ENDIF(NOT OMPI_WANT_OFED) diff --git a/contrib/platform/win32/CMakeModules/ompi_configure.cmake b/contrib/platform/win32/CMakeModules/ompi_configure.cmake index 1d7b3a9bf3..8ed50cbd1f 100644 --- a/contrib/platform/win32/CMakeModules/ompi_configure.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_configure.cmake @@ -245,6 +245,7 @@ OMPI_DEF_OPT(OMPI_WANT_NETWORK_DIRECT "Whether we want to enable Network Direct OMPI_DEF_OPT(ORTE_WANT_NOTIFIER_LOG_EVENT "if the notifier_log_event should be enabled" OFF) +OMPI_DEF_OPT(OMPI_WANT_OFED "Whether we want to enable OFED support." OFF) IF (NOT MSVC) diff --git a/ompi/CMakeLists.txt b/ompi/CMakeLists.txt index a0f6ac323e..8394d6face 100644 --- a/ompi/CMakeLists.txt +++ b/ompi/CMakeLists.txt @@ -127,7 +127,7 @@ 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}ORTE_IMPORTS ${OMPI_CXX_LAN_FLAG}") - TARGET_LINK_LIBRARIES (libmpi libopen-rte Ws2_32.lib shlwapi.lib) + TARGET_LINK_LIBRARIES (libmpi 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) diff --git a/ompi/mca/btl/openib/.windows b/ompi/mca/btl/openib/.windows new file mode 100644 index 0000000000..5413bf037a --- /dev/null +++ b/ompi/mca/btl/openib/.windows @@ -0,0 +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_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