1
1

Completely remove ltdl support for Windows build.

This commit was SVN r21170.
This commit is contained in:
Shiqing Fan 2009-05-05 18:59:13 +00:00
parent a827fd0f4e
commit cd565923d3
51 changed files with 38 additions and 302 deletions

View File

@ -70,7 +70,7 @@ SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OpenMPI_BINARY_DIR})
SET (CMAKE_SUPPRESS_REGENERATION true)
# Dynamic/shared build, the default is set to static(OFF)
OPTION(BUILD_SHARED_LIBS "Wether we want to build shared libraries." OFF)
OPTION(BUILD_SHARED_LIBS "Wether we want to build shared libraries." ON)
INCLUDE(ompi_configure)

View File

@ -121,13 +121,6 @@ FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST})
IF(BUILD_COMPONENT)
# 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 "")
# check out if we have to exlude some source files.
SET(EXCLUDE_LIST "")
FILE(STRINGS ${CURRENT_PATH}/.windows EXCLUDE_LIST REGEX "^exclude_list=")
@ -141,109 +134,35 @@ FOREACH (MCA_FRAMEWORK ${MCA_FRAMEWORK_LIST})
LIST(REMOVE_ITEM COMPONENT_FILES "${CURRENT_PATH}/${FILE}")
ENDFOREACH(FILE)
IF(NOT OMPI_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})
# 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})
INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_PATH})
IF(EXISTS "${CURRENT_PATH}/configure.params")
FILE(STRINGS "${CURRENT_PATH}/configure.params"
CURRENT_COMPONENT_PRIORITY REGEX "PRIORITY")
IF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "")
STRING(REGEX REPLACE "[A-Z_]+=" "" CURRENT_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY})
ENDIF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "")
ENDIF(EXISTS "${CURRENT_PATH}/configure.params")
IF(EXISTS "${CURRENT_PATH}/configure.params")
FILE(STRINGS "${CURRENT_PATH}/configure.params"
CURRENT_COMPONENT_PRIORITY REGEX "PRIORITY")
IF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "")
STRING(REGEX REPLACE "[A-Z_]+=" "" CURRENT_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY})
ENDIF(NOT CURRENT_COMPONENT_PRIORITY STREQUAL "")
ENDIF(EXISTS "${CURRENT_PATH}/configure.params")
IF(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
# I have a higher priority for this mca, put me at the very beginning.
SET (OUTFILE_EXTERN
"extern const mca_base_component_t mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component"
"\n${OUTFILE_EXTERN}")
SET(FRAMEWORK_STRUCT_DEF
"&mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component,\n"
${FRAMEWORK_STRUCT_DEF})
SET(BEST_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY})
ELSE(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
SET (OUTFILE_EXTERN ${OUTFILE_EXTERN}
"\nextern const mca_base_component_t mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component;")
SET(FRAMEWORK_STRUCT_DEF ${FRAMEWORK_STRUCT_DEF}
"&mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component,\n")
ENDIF(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
ELSE(NOT OMPI_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1")
# get the dependencies for this component.
SET(MCA_DEPENDENCIES "")
FILE(STRINGS ${CURRENT_PATH}/.windows VALUE REGEX "^mca_dependencies=")
IF(NOT VALUE STREQUAL "")
STRING(REPLACE "mca_dependencies=" "" MCA_DEPENDENCIES ${VALUE})
ENDIF(NOT VALUE STREQUAL "")
# 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")
ELSE("${MCA_FRAMEWORK}" STREQUAL "common")
SET(LIB_NAME_PREFIX "")
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi/debug
LIBRARY DESTINATION lib/openmpi/debug
ARCHIVE DESTINATION lib/openmpi/debug")
ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(INSTALL_DEST "RUNTIME DESTINATION lib/openmpi
LIBRARY DESTINATION lib/openmpi
ARCHIVE DESTINATION lib/openmpi")
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
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
SET_SOURCE_FILES_PROPERTIES(\${COMPONENT_FILES}
PROPERTIES LANGUAGE CXX)
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\")
TARGET_LINK_LIBRARIES (${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} ${MCA_LINK_LIBRARIES})
ADD_DEPENDENCIES(${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} libopen-pal ${MCA_DEPENDENCIES})
INSTALL(TARGETS ${LIB_NAME_PREFIX}mca_${MCA_FRAMEWORK}_${MCA_COMPONENT} ${INSTALL_DEST})
")
ADD_SUBDIRECTORY (${PROJECT_BINARY_DIR}/mca/${MCA_FRAMEWORK}/${MCA_COMPONENT} mca/${MCA_FRAMEWORK}/${MCA_COMPONENT})
ENDIF(NOT OMPI_WANT_LIBLTDL OR NOT_SINGLE_SHARED_LIB STREQUAL "1")
IF(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
# I have a higher priority for this mca, put me at the very beginning.
SET (OUTFILE_EXTERN
"extern const mca_base_component_t mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component"
"\n${OUTFILE_EXTERN}")
SET(FRAMEWORK_STRUCT_DEF
"&mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component,\n"
${FRAMEWORK_STRUCT_DEF})
SET(BEST_COMPONENT_PRIORITY ${CURRENT_COMPONENT_PRIORITY})
ELSE(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
SET (OUTFILE_EXTERN ${OUTFILE_EXTERN}
"\nextern const mca_base_component_t mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component;")
SET(FRAMEWORK_STRUCT_DEF ${FRAMEWORK_STRUCT_DEF}
"&mca_${MCA_FRAMEWORK}_${MCA_COMPONENT}_component,\n")
ENDIF(CURRENT_COMPONENT_PRIORITY GREATER BEST_COMPONENT_PRIORITY)
# Install help files if they are here.
INSTALL(DIRECTORY ${CURRENT_PATH}/ DESTINATION share/openmpi/

View File

@ -1,38 +0,0 @@
#
# Copyright (c) 2009 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
#
# LIBLTDL_PATH - path to ltdl.h
# LIBLTDL_FOUND - system has Libltdl
#
MACRO(FIND_LIBLTDL)
IF(NOT LIBLTDL_FOUND)
MESSAGE(STATUS "Looking for libltdl...")
FIND_PATH(LIBLTDL_PATH ltdl.h PATHS "$ENV{ProgramFiles}/GnuWin32/share/libtool/libltdl" ${LIBLTDL_PATH})
IF (WIN32)
IF(LIBLTDL_PATH)
MESSAGE(STATUS "Looking for libltdl...found")
SET(LIBLTDL_FOUND TRUE TRUE CACHE INTERNAL "found libltdl")
ELSE(LIBLTDL_PATH)
MESSAGE(STATUS "Looking for libltdl...not found. Skip.")
SET(LIBLTDL_FOUND FALSE)
ENDIF(LIBLTDL_PATH)
ELSE(WIN32)
# nothing to do here at moment.
ENDIF(WIN32)
ENDIF(NOT LIBLTDL_FOUND)
ENDMACRO(FIND_LIBLTDL)

View File

@ -133,6 +133,16 @@ SET(OMPI_F90_ABSOLUTE "\"none\"")
SET(OMPI_F90_BUILD_SIZE "\"small\"")
# we don't support libtool on Windows.
SET(OMPI_WANT_LIBLTDL 0)
# set the im/export decleration here.
# Don't bother with OMPI_IMPORTS
IF(BUILD_SHARED_LIBS)
SET(OMPI_DECLSPEC "__declspec(dllimport)")
ELSE(BUILD_SHARED_LIBS)
SET(OMPI_DECLSPEC "")
ENDIF(BUILD_SHARED_LIBS)
###################################################################
# Options #
@ -349,28 +359,6 @@ ELSE(NOT ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT)
SET (ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT 1)
ENDIF(NOT ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT)
OPTION(OMPI_ENABLE_DLOPEN_SUPPORT "Whether to include support for libltdl or not" OFF)
MARK_AS_ADVANCED(OMPI_ENABLE_DLOPEN_SUPPORT)
IF(OMPI_ENABLE_DLOPEN_SUPPORT)
SET(BUILD_SHARED_LIBS TRUE)
INCLUDE(FIND_LIBLTDL)
FIND_LIBLTDL()
IF(LIBLTDL_FOUND)
SET(OMPI_WANT_LIBLTDL 1)
ELSE(LIBLTDL_FOUND)
SET(OMPI_WANT_LIBLTDL 0)
ENDIF(LIBLTDL_FOUND)
ELSE(OMPI_ENABLE_DLOPEN_SUPPORT)
SET(OMPI_WANT_LIBLTDL 0)
ENDIF(OMPI_ENABLE_DLOPEN_SUPPORT)
# set the im/export decleration here.
# Don't bother with OMPI_IMPORTS
IF(BUILD_SHARED_LIBS)
SET(OMPI_DECLSPEC "__declspec(dllimport)")
ELSE(BUILD_SHARED_LIBS)
SET(OMPI_DECLSPEC "")
ENDIF(BUILD_SHARED_LIBS)
###################################################################

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte libmca_common_sm

View File

@ -9,7 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte
mca_link_libraries=Ws2_32.lib

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte libmca_common_sm

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte libmca_common_sm

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libmpi libopen-rte

View File

@ -91,25 +91,6 @@ IF(EXISTS ${PROJECT_SOURCE_DIR}/util/keyval/show_help_lex.c)
LIST(REMOVE_ITEM OPAL_SOURCE_FILES "${PROJECT_SOURCE_DIR}/util/keyval/show_help_lex.c")
ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/util/keyval/show_help_lex.c)
# Add Libtool support
IF(OMPI_WANT_LIBLTDL)
# if we want libltdl, that means ltdl.h and ltdl.c has been found,
# just copy them into the source tree for compiling.
CONFIGURE_FILE("${LIBLTDL_PATH}/ltdl.c" ${CMAKE_CURRENT_BINARY_DIR}/libltdl/ltdl.c COPYONLY)
CONFIGURE_FILE("${LIBLTDL_PATH}/ltdl.h" ${CMAKE_CURRENT_BINARY_DIR}/libltdl/ltdl.h COPYONLY)
# insert "#include opal_config.h" into ltdl.c, otherwise, it won't compile.
FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/libltdl/ltdl.c LTDL_C_PART1 LIMIT 1183)
FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/libltdl/ltdl.c LTDL_C_PART2 OFFSET 1183)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/libltdl/ltdl.c
"${LTDL_C_PART1}" "\n#include \"opal_config.h\"\n" "${LTDL_C_PART2}")
SET (LIBLTDL_FILES libltdl/ltdl.c libltdl/ltdl.h)
SET_SOURCE_FILES_PROPERTIES(${LIBLTDL_FILES} PROPERTIES COMPILE_DEFINITIONS
"error_t=int;HAVE_ERRNO_H;LTDL_OBJDIR=\".\";LTDL_SHLIB_EXT=\".dll\"")
SET (OPAL_SOURCE_FILES ${OPAL_SOURCE_FILES} ${LIBLTDL_FILES})
SOURCE_GROUP(libltdl FILES ${LIBLTDL_FILES})
ENDIF(OMPI_WANT_LIBLTDL)
# Add source files from mca subdirectories.
INCLUDE (check_mca_subdirs)

View File

@ -10,5 +10,3 @@
# Specific to this module
not_single_shared_lib=1

View File

@ -308,11 +308,6 @@ static void find_dyn_components(const char *path, const char *type_name,
file->filename[OMPI_PATH_MAX] = '\0';
file->status = UNVISITED;
#if defined(__WINDOWS__) && defined(_DEBUG)
/* remove the debug suffix 'd', otherwise we will fail to
load the module in later phase. */
file->name[strlen(file->name)-1]='\0';
#endif
opal_list_append(&found_files, (opal_list_item_t *)
file);
}

View File

@ -69,11 +69,7 @@ int mca_base_open(void)
#if OMPI_WANT_HOME_CONFIG_FILES
asprintf(&value, "%s%c%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_install_dirs.pkglibdir, OPAL_ENV_SEP, opal_home_directory() );
#else
# if defined(__WINDOWS__) && defined(_DEBUG)
asprintf(&value, "%s/debug", opal_install_dirs.pkglibdir);
# else
asprintf(&value, "%s", opal_install_dirs.pkglibdir);
# endif
asprintf(&value, "%s", opal_install_dirs.pkglibdir);
#endif
mca_base_param_component_path =

View File

@ -9,6 +9,3 @@
#
# Specific to this module
not_single_shared_lib=1

View File

@ -10,5 +10,3 @@
# Specific to this module
not_single_shared_lib=1

View File

@ -10,5 +10,3 @@
# Specific to this module
not_single_shared_lib=1

View File

@ -7,5 +7,3 @@
#
# $HEADER$
#
not_single_shared_lib=1

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte
mca_link_libraries=Ws2_32.lib

View File

@ -10,5 +10,3 @@
# Specific to this module
mca_dependencies=libopen-rte
mca_link_libraries=Ws2_32.lib

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte
mca_link_libraries=Ws2_32.lib

View File

@ -10,5 +10,4 @@
# Specific to this module
mca_dependencies=libopen-rte
required_check=find_ccp

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -10,5 +10,4 @@
# Specific to this module
mca_dependencies=libopen-rte
required_check=find_ccp

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,6 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte
mca_link_libraries=Ws2_32.lib

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte

View File

@ -9,5 +9,3 @@
#
# Specific to this module
mca_dependencies=libopen-rte