From 0065d7f0c938a6a8d2b10fa74b8946fd657ad252 Mon Sep 17 00:00:00 2001 From: Shiqing Fan Date: Wed, 18 Mar 2009 17:46:24 +0000 Subject: [PATCH] Enable two variables for CPack, for packaging binary tarball and adding a page in the installer. Enable the debug library suffix, which is extremely necessary on Windows. If users want to debug their own programs in Visual Studio, but linking the programs to the release version libraries of Open MPI, i.e. mixing debug and release version DLLs, that will definitely cause some errors. What we have to do is providing both debug and release versions libraries, distinguished with suffix 'd', e.g. libmpid.dll for debug version. This commit was SVN r20828. --- CMakeLists.txt | 9 +++++---- opal/mca/base/mca_base_component_find.c | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92ead56cf7..2a4e7f5d01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,9 @@ IF (NOT CMAKE_BUILD_TYPE) "Choose the type of build, options are: None, Debug, Release, RelWithDebInfo and MinSizeRel." FORCE) ENDIF (NOT CMAKE_BUILD_TYPE) +# add debug-suffix to distinguish between debug and release version libraries. +SET(CMAKE_DEBUG_POSTFIX "d") + # preset install dir IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/installed" CACHE PATH "CMAKE_INSTALL_PREFIX" FORCE) @@ -113,8 +116,9 @@ SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.open-mpi.org") # SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable") -SET(CPACK_NSIS_MODIFY_PATH OFF) +SET(CPACK_NSIS_MODIFY_PATH ON) SET(CPACK_SOURCE_ZIP ON) +SET(CPACK_BINARY_ZIP ON) # setup the register entries when install SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} " @@ -134,9 +138,6 @@ SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} " WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_PKGDATADIR\\\" \\\"$INSTDIR\\\\share\\\\openmpi\\\" WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_PKGLIBDIR\\\" \\\"$INSTDIR\\\\lib\\\\openmpi\\\" WriteRegStr HKLM \\\"SOFTWARE\\\\${CPACK_PACKAGE_VENDOR}\\\" \\\"OPAL_PKGINCLUDEDIR\\\" \\\"$INSTDIR\\\\include\\\\openmpi\\\" - ReadRegStr $0 HKLM \\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\" \\\"PATH\\\" - StrCpy $0 $0;$INSTDIR\\\\bin - WriteRegExpandStr HKLM \\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\" \\\"PATH\\\" $0 ") diff --git a/opal/mca/base/mca_base_component_find.c b/opal/mca/base/mca_base_component_find.c index f2c569b4a1..964f4aed6b 100644 --- a/opal/mca/base/mca_base_component_find.c +++ b/opal/mca/base/mca_base_component_find.c @@ -307,6 +307,12 @@ static void find_dyn_components(const char *path, const char *type_name, strncpy(file->filename, found_filenames[i], OMPI_PATH_MAX); 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); }