From 7a301bc417ac0c8a4129ba231516a84bb0bf4cb1 Mon Sep 17 00:00:00 2001 From: Shiqing Fan Date: Mon, 23 Aug 2010 13:16:30 +0000 Subject: [PATCH] Add support for ompi_ext on Windows. This commit was SVN r23632. --- contrib/Makefile.am | 1 + .../win32/CMakeModules/ompi_configure.cmake | 2 +- .../win32/CMakeModules/ompi_ext_config.cmake | 55 +++++++++++++++++++ ompi/CMakeLists.txt | 3 + 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 contrib/platform/win32/CMakeModules/ompi_ext_config.cmake diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 5b3a84c4ca..87ee7d0008 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -82,6 +82,7 @@ EXTRA_DIST = \ platform/win32/CMakeModules/check_mca_subdirs.cmake \ platform/win32/CMakeModules/ompi_base_checks.cmake \ platform/win32/CMakeModules/ompi_define.cmake \ + platform/win32/CMakeModules/ompi_ext_config.cmake \ platform/win32/CMakeModules/f77_check.cmake \ platform/win32/CMakeModules/f77_check_real16_c_equiv.cmake \ platform/win32/CMakeModules/f77_check_type.cmake \ diff --git a/contrib/platform/win32/CMakeModules/ompi_configure.cmake b/contrib/platform/win32/CMakeModules/ompi_configure.cmake index 885bef60f5..a0208bec09 100644 --- a/contrib/platform/win32/CMakeModules/ompi_configure.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_configure.cmake @@ -181,7 +181,7 @@ OPAL_WITH_OPTION_MIN_MAX_VALUE(port_name 1024 255 2048) OPAL_WITH_OPTION_MIN_MAX_VALUE(datarep_string 128 64 256) -OMPI_DEF_CACHE_VAR(OMPI_EXT_COMPONENTS Example STRING "Specify user defined MPI Extended Interface Components. (not implemented on Windows)" 1 1) +OMPI_DEF_CACHE_VAR(OMPI_MPIEXT_COMPONENTS none STRING "Specify user defined MPI Extended Interface Components." 1 1) OMPI_DEF_OPT(MCA_mtl_DIRECT_CALL "Whether mtl should use direct calls instead of components." OFF) diff --git a/contrib/platform/win32/CMakeModules/ompi_ext_config.cmake b/contrib/platform/win32/CMakeModules/ompi_ext_config.cmake new file mode 100644 index 0000000000..c3e1f00afe --- /dev/null +++ b/contrib/platform/win32/CMakeModules/ompi_ext_config.cmake @@ -0,0 +1,55 @@ +# 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) + + message("${OMPI_EXT_SUBDIRS} ${OMPI_MPIEXT_COMPONENT} ${VALID_COMPONENT}") + + IF(NOT VALID_COMPONENT EQUAL -1) + FILE(GLOB ${OMPI_MPIEXT_COMPONENT}_FILES + ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/*.h ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/*.c) + SOURCE_GROUP(mpiext\\${OMPI_MPIEXT_COMPONENT} FILES ${${OMPI_MPIEXT_COMPONENT}_FILES}) + + FILE(GLOB ${OMPI_MPIEXT_COMPONENT}_C_FILES + ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/c/*.h ${PROJECT_SOURCE_DIR}/mpiext/${OMPI_MPIEXT_COMPONENT}/c/*.c) + SOURCE_GROUP(mpiext\\${OMPI_MPIEXT_COMPONENT}\\c FILES ${${OMPI_MPIEXT_COMPONENT}_C_FILES}) + + SET(OMPI_EXT_FILES ${OMPI_EXT_FILES} ${${OMPI_MPIEXT_COMPONENT}_FILES} ${${OMPI_MPIEXT_COMPONENT}_C_FILES}) + ENDIF(NOT VALID_COMPONENT EQUAL -1) +ENDFOREACH(OMPI_MPIEXT_COMPONENT ${OMPI_MPIEXT_COMPONENTS}) + + +# write out static-component.h for this mca. +FILE(WRITE "${PROJECT_BINARY_DIR}/mpiext/static-components.h" + "/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern \"C\" { +#endif + + + +const ompi_mpiext_component_t *ompi_mpiext_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + ") diff --git a/ompi/CMakeLists.txt b/ompi/CMakeLists.txt index 35ec53ba80..fa8b1e9cab 100644 --- a/ompi/CMakeLists.txt +++ b/ompi/CMakeLists.txt @@ -111,6 +111,9 @@ IF(OMPI_WANT_F77_BINDINGS) 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})