diff --git a/CMakeLists.txt b/CMakeLists.txt index bb5ca762c980145be0b3315764ebd8623a637170..cdafaba1843dbc5b579a49fd179fde211400f17f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) include(ADIOSFunctions) # Default to a debug build if not specified -if(NOT CMAKE_BUILD_TYPE) +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE) endif() @@ -90,7 +90,7 @@ adios_option(ZeroMQ "Enable support for ZeroMQ" AUTO) adios_option(HDF5 "Enable support for the HDF5 engine" AUTO) adios_option(ADIOS1 "Enable support for the ADIOS 1.x engine" AUTO) adios_option(Python "Enable support for Python bindings" AUTO) -adios_option(Fortran "Enable support for Fortran bindings" AUTO) +adios_option(Fortran "Enable support for Fortran bindings" OFF) adios_option(SysVShMem "Enable support for SysV Shared Memory IPC on *NIX" AUTO) include(${ADIOS2_SOURCE_DIR}/cmake/DetectOptions.cmake) diff --git a/cmake/DetectOptions.cmake b/cmake/DetectOptions.cmake index 75047541003b27673f3d6118776f5f3c32332445..2562e77a2b94180e0d3e5d2b397bdb3c326050c0 100644 --- a/cmake/DetectOptions.cmake +++ b/cmake/DetectOptions.cmake @@ -33,25 +33,32 @@ if(ZFP_FOUND) set(ADIOS2_HAVE_ZFP TRUE) endif() +set(mpi_find_components C) + +# Fortran +if(ADIOS2_USE_Fortran STREQUAL AUTO) + # Currently auto-detection for language support does not work in CMake. See + # documentation for the "enable_language" command + message(WARN "Auto-detection of Fortran is not currently supported; Disabling") + #enable_language(Fortran OPTIONAL) +elseif(ADIOS2_USE_Fortran) + enable_language(Fortran) +endif() +if(CMAKE_Fortran_COMPILER_LOADED) + set(ADIOS2_HAVE_Fortran TRUE) + list(APPEND mpi_find_components Fortran) +endif() + # MPI if(ADIOS2_USE_MPI STREQUAL AUTO) - find_package(MPI) + find_package(MPI COMPONENTS ${mpi_find_components}) elseif(ADIOS2_USE_MPI) - find_package(MPI REQUIRED) + find_package(MPI COMPONENTS ${mpi_find_components} REQUIRED) endif() if(MPI_FOUND) set(ADIOS2_HAVE_MPI TRUE) endif() -# Fortran -if(ADIOS2_USE_Fortran) - set(ADIOS2_HAVE_Fortran TRUE) - enable_language(Fortran) - if(ADIOS2_HAVE_MPI) - find_package(MPI COMPONENTS Fortran REQUIRED) - endif() -endif() - # DataMan if(SHARED_LIBS_SUPPORTED AND NOT MSVC) set(ADIOS2_HAVE_DataMan TRUE) diff --git a/examples/plugins/engine/ExampleEnginePlugin.cpp b/examples/plugins/engine/ExampleEnginePlugin.cpp index 09d55a509900e074eccb0df05b258f9b52dee8ba..2fdbf85b04035e9cd9c0f29712ec952f9825b000 100644 --- a/examples/plugins/engine/ExampleEnginePlugin.cpp +++ b/examples/plugins/engine/ExampleEnginePlugin.cpp @@ -15,7 +15,7 @@ #include <cstring> #include <ctime> -#ifndef _WIN32_ +#ifndef _WIN32 #include <sys/time.h> #endif @@ -27,7 +27,7 @@ std::string now() #ifdef _WIN32 time_t rawTime; std::time(&rawTime); - timeInfo = std::localtime(&rawtime); + timeInfo = std::localtime(&rawTime); #else timeval curTime; gettimeofday(&curTime, nullptr); diff --git a/source/adios2/CMakeLists.txt b/source/adios2/CMakeLists.txt index 5cca920095ce3fcb6c74e737182a4590a58d50b9..24c36ffe8831289b79f03ddb8a39658ab8978cd2 100644 --- a/source/adios2/CMakeLists.txt +++ b/source/adios2/CMakeLists.txt @@ -55,7 +55,7 @@ target_include_directories(adios2 $<BUILD_INTERFACE:${ADIOS2_BINARY_DIR}/source> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> ) -target_link_libraries(adios2 PRIVATE adios2sys pugixml) +target_link_libraries(adios2 PRIVATE adios2sys_interface pugixml) target_link_libraries(adios2 PUBLIC ${CMAKE_THREAD_LIBS_INIT}) if(UNIX) diff --git a/source/dataman/CMakeLists.txt b/source/dataman/CMakeLists.txt index 11e4823c7da126aee5a4d635182d0c2f161cc28d..6defa0d619677d1d3672dda13b8cd6897b497a6b 100644 --- a/source/dataman/CMakeLists.txt +++ b/source/dataman/CMakeLists.txt @@ -19,7 +19,7 @@ target_include_directories(dataman PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> ) target_link_libraries(dataman - PRIVATE adios2sys + PRIVATE adios2sys_interface PUBLIC NLohmannJson ) set_target_properties(dataman PROPERTIES diff --git a/thirdparty/KWSys/CMakeLists.txt b/thirdparty/KWSys/CMakeLists.txt index a801248a1766bc96b887d866a2a924007ffaf8eb..952fd5e0ca8ce201a9e7c17ee9e6365574e32f2e 100644 --- a/thirdparty/KWSys/CMakeLists.txt +++ b/thirdparty/KWSys/CMakeLists.txt @@ -2,15 +2,14 @@ set(KWSYS_NAMESPACE adios2sys) set(KWSYS_USE_DynamicLoader ON) set(KWSYS_USE_RegularExpression ON) set(KWSYS_USE_SystemTools ON) -set(KWSYS_BUILD_SHARED ${BUILD_SHARED_LIBS}) - if(WIN32) - set(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE OFF) + set(KWSYS_BUILD_SHARED OFF) else() - set(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE ON) + set(KWSYS_BUILD_SHARED ${BUILD_SHARED_LIBS}) endif() - +set(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE ON) set(KWSYS_INSTALL_EXPORT_NAME adios2Exports) set(KWSYS_INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR}) add_subdirectory(adios2sys) +add_library(adios2sys_interface ALIAS adios2sys_private) diff --git a/thirdparty/KWSys/adios2sys/CMakeLists.txt b/thirdparty/KWSys/adios2sys/CMakeLists.txt index e9bae831c62bfbac1020833ef1cae45303be1a67..13375df81790e5f5589220f749a171d9a920624e 100644 --- a/thirdparty/KWSys/adios2sys/CMakeLists.txt +++ b/thirdparty/KWSys/adios2sys/CMakeLists.txt @@ -23,18 +23,18 @@ # KWSYS_SPLIT_OBJECTS_FROM_INTERFACE # = Instead of creating a single ${KWSYS_NAMESPACE} library # target, create three separate targets: +# ${KWSYS_NAMESPACE} +# - An INTERFACE library only containing usage +# requirements. # ${KWSYS_NAMESPACE}_objects # - An OBJECT library for the built kwsys objects. -# ${KWSYS_NAMESPACE}_interface -# - An INTERFACE library for the usage requirements. -# ${KWSYS_NAMESPACE} +# Note: This is omitted from the install rules +# ${KWSYS_NAMESPACE}_private # - An INTERFACE library combining both that is # appropriate for use with PRIVATE linking in # target_link_libraries. Because of how interface # properties propagate, this target is not suitable # for use with PUBLIC or INTERFACE linking. -# Note: only the ${KWSYS_NAMESPACE}_interface library will -# be installed # # Example: # @@ -438,6 +438,10 @@ ELSE() SET(KWSYS_LIBRARY_TYPE STATIC) ENDIF() +IF(NOT KWSYS_DEFINE_SYMBOL) + SET(KWSYS_DEFINE_SYMBOL ${KWSYS_NAMESPACE}_EXPORTS) +ENDIF() + #----------------------------------------------------------------------------- # Configure some implementation details. @@ -449,6 +453,11 @@ SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}" ) +IF(DEFINED KWSYS_PROCESS_USE_SELECT) + GET_PROPERTY(ProcessUNIX_FLAGS SOURCE ProcessUNIX.c PROPERTY COMPILE_FLAGS) + SET_PROPERTY(SOURCE ProcessUNIX.c PROPERTY COMPILE_FLAGS "${ProcessUNIX_FLAGS} -DKWSYSPE_USE_SELECT=${KWSYSPE_USE_SELECT}") +ENDIF() + IF(KWSYS_USE_DynamicLoader) GET_PROPERTY(KWSYS_SUPPORTS_SHARED_LIBS GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS) IF(KWSYS_SUPPORTS_SHARED_LIBS) @@ -815,15 +824,18 @@ ENDFOREACH() # Add the library with the configured name and list of sources. IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) IF(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE) - SET(KWSYS_TARGET_INTERFACE ${KWSYS_NAMESPACE}_interface) + SET(KWSYS_TARGET_INTERFACE ${KWSYS_NAMESPACE}) SET(KWSYS_TARGET_OBJECT ${KWSYS_NAMESPACE}_objects) - SET(KWSYS_TARGET_LINK ${KWSYS_NAMESPACE}) + SET(KWSYS_TARGET_LINK ${KWSYS_NAMESPACE}_private) + SET(KWSYS_TARGET_INSTALL ${KWSYS_TARGET_INTERFACE} ${KWSYS_TARGET_LINK}) SET(KWSYS_LINK_DEPENDENCY INTERFACE) ADD_LIBRARY(${KWSYS_TARGET_OBJECT} OBJECT ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS}) IF(KWSYS_BUILD_SHARED) SET_PROPERTY(TARGET ${KWSYS_TARGET_OBJECT} PROPERTY POSITION_INDEPENDENT_CODE TRUE) + TARGET_COMPILE_DEFINITIONS(${KWSYS_TARGET_OBJECT} PRIVATE + ${KWSYS_DEFINE_SYMBOL}) ENDIF() ADD_LIBRARY(${KWSYS_TARGET_INTERFACE} INTERFACE) ADD_LIBRARY(${KWSYS_TARGET_LINK} INTERFACE) @@ -835,6 +847,7 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) SET(KWSYS_TARGET_INTERFACE ${KWSYS_NAMESPACE}) SET(KWSYS_TARGET_OBJECT ${KWSYS_NAMESPACE}) SET(KWSYS_TARGET_LINK ${KWSYS_NAMESPACE}) + set(KWSYS_TARGET_INSTALL ${KWSYS_TARGET_LINK}) SET(KWSYS_LINK_DEPENDENCY PUBLIC) ADD_LIBRARY(${KWSYS_TARGET_INTERFACE} ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS}) @@ -895,21 +908,25 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) # Create an install target for the library. IF(KWSYS_INSTALL_LIBRARY_RULE) - INSTALL(TARGETS ${KWSYS_TARGET_LINK} ${KWSYS_TARGET_INTERFACE} ${KWSYS_INSTALL_LIBRARY_RULE}) + INSTALL(TARGETS ${KWSYS_TARGET_INSTALL} ${KWSYS_INSTALL_LIBRARY_RULE}) ENDIF() ENDIF() # Add a C-only library if requested. IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) IF(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE) - SET(KWSYS_TARGET_C_INTERFACE ${KWSYS_NAMESPACE}_c_interface) - SET(KWSYS_TARGET_C_OBJECT ${KWSYS_NAMESPACE}_c_object) - SET(KWSYS_TARGET_C_LINK ${KWSYS_NAMESPACE}_c) + SET(KWSYS_TARGET_C_INTERFACE ${KWSYS_NAMESPACE}_c) + SET(KWSYS_TARGET_C_OBJECT ${KWSYS_NAMESPACE}_c_objects) + SET(KWSYS_TARGET_C_LINK ${KWSYS_NAMESPACE}_c_private) + SET(KWSYS_TARGET_C_INSTALL + ${KWSYS_TARGET_C_INTERFACE} ${KWSYS_TARGET_C_LINK}) SET(KWSYS_LINK_DEPENDENCY INTERFACE) ADD_LIBRARY(${KWSYS_TARGET_C_OBJECT} OBJECT ${KWSYS_C_SRCS}) IF(KWSYS_BUILD_SHARED) SET_PROPERTY(TARGET ${KWSYS_TARGET_C_OBJECT} PROPERTY POSITION_INDEPENDENT_CODE TRUE) + TARGET_COMPILE_DEFINITIONS(${KWSYS_TARGET_C_OBJECT} PRIVATE + ${KWSYS_DEFINE_SYMBOL}) ENDIF() ADD_LIBRARY(${KWSYS_TARGET_C_INTERFACE} INTERFACE) ADD_LIBRARY(${KWSYS_TARGET_C_LINK} INTERFACE) @@ -921,6 +938,7 @@ IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) SET(KWSYS_TARGET_C_INTERFACE ${KWSYS_NAMESPACE}_c) SET(KWSYS_TARGET_C_OBJECT ${KWSYS_NAMESPACE}_c) SET(KWSYS_TARGET_C_LINK ${KWSYS_NAMESPACE}_c) + SET(KWSYS_TARGET_C_INSTALL ${KWSYS_TARGET_C_LINK}) SET(KWSYS_LINK_DEPENDENCY PUBLIC) ADD_LIBRARY(${KWSYS_TARGET_C_INTERFACE} ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS}) @@ -946,8 +964,8 @@ IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) # Create an install target for the library. IF(KWSYS_INSTALL_LIBRARY_RULE) - INSTALL(TARGETS ${KWSYS_TARGET_C_INTERFACE} ${KWSYS_INSTALL_LIBRARY_RULE}) - ENDIF() + INSTALL(TARGETS ${KWSYS_TARGET_C_INSTALL}) + ENDIF() ENDIF() # For building kwsys itself, we use a macro defined on the command @@ -1022,6 +1040,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) testSystemTools testCommandLineArguments testCommandLineArguments1 + testDirectory ) IF(KWSYS_STL_HAS_WSTRING) SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS} diff --git a/thirdparty/KWSys/adios2sys/Configure.h.in b/thirdparty/KWSys/adios2sys/Configure.h.in index 0afcae781d6ae46d6e27b3864948e6915119e542..921e1ae599a414a66ed05ee4c72dd1e8a9205d9b 100644 --- a/thirdparty/KWSys/adios2sys/Configure.h.in +++ b/thirdparty/KWSys/adios2sys/Configure.h.in @@ -71,7 +71,7 @@ /* Setup the export macro. */ #if @KWSYS_BUILD_SHARED@ #if defined(_WIN32) || defined(__CYGWIN__) -#if defined(@KWSYS_NAMESPACE@_EXPORTS) +#if defined(@KWSYS_DEFINE_SYMBOL@) #define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport) #else #define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport) diff --git a/thirdparty/KWSys/adios2sys/Directory.cxx b/thirdparty/KWSys/adios2sys/Directory.cxx index 5141d451929bc2499fa1e45e046b25063ff479a5..69068aaf88d7e96ae159430d0644bedd8f391d69 100644 --- a/thirdparty/KWSys/adios2sys/Directory.cxx +++ b/thirdparty/KWSys/adios2sys/Directory.cxx @@ -118,8 +118,8 @@ bool Directory::Load(const std::string& name) struct _wfinddata_t data; // data of current file // Now put them into the file array - srchHandle = - _wfindfirst_func((wchar_t*)Encoding::ToWide(buf).c_str(), &data); + srchHandle = _wfindfirst_func( + (wchar_t*)Encoding::ToWindowsExtendedPath(buf).c_str(), &data); delete[] buf; if (srchHandle == -1) { diff --git a/thirdparty/KWSys/adios2sys/ProcessUNIX.c b/thirdparty/KWSys/adios2sys/ProcessUNIX.c index 9ebcfce592759922ce8fdb5cc02882ea2aae5e10..3b32ca7d0a26b388e7a88cebb2e2e76747157b9e 100644 --- a/thirdparty/KWSys/adios2sys/ProcessUNIX.c +++ b/thirdparty/KWSys/adios2sys/ProcessUNIX.c @@ -99,7 +99,8 @@ static inline void kwsysProcess_usleep(unsigned int msec) * pipes' file handles to be non-blocking and just poll them directly * without select(). */ -#if !defined(__BEOS__) && !defined(__VMS) && !defined(__MINT__) +#if !defined(__BEOS__) && !defined(__VMS) && !defined(__MINT__) && \ + !defined(KWSYSPE_USE_SELECT) #define KWSYSPE_USE_SELECT 1 #endif diff --git a/thirdparty/KWSys/adios2sys/RegularExpression.cxx b/thirdparty/KWSys/adios2sys/RegularExpression.cxx index 6d7f832955911e5352e6f60e246b743c37c3ebdb..26e84e04eb1a98912aeee699f6f3d80f23bed3b6 100644 --- a/thirdparty/KWSys/adios2sys/RegularExpression.cxx +++ b/thirdparty/KWSys/adios2sys/RegularExpression.cxx @@ -258,11 +258,6 @@ const unsigned char MAGIC = 0234; #define UCHARAT(p) (reinterpret_cast<const unsigned char*>(p))[0] -#define FAIL(m) \ - { \ - regerror(m); \ - return (0); \ - } #define ISMULT(c) ((c) == '*' || (c) == '+' || (c) == '?') #define META "^$.[()|?+*\\" diff --git a/thirdparty/KWSys/adios2sys/SystemTools.cxx b/thirdparty/KWSys/adios2sys/SystemTools.cxx index c5bbd416a39e4ee92ad9e08b4cac7a77c85b00f9..560c19c0292ee01d3fc9dc18f2f129cc7fa0dc6a 100644 --- a/thirdparty/KWSys/adios2sys/SystemTools.cxx +++ b/thirdparty/KWSys/adios2sys/SystemTools.cxx @@ -847,6 +847,8 @@ void SystemTools::ReplaceString(std::string& source, const char* replace, free(orig); } +#if defined(_WIN32) && !defined(__CYGWIN__) + #if defined(KEY_WOW64_32KEY) && defined(KEY_WOW64_64KEY) #define KWSYS_ST_KEY_WOW64_32KEY KEY_WOW64_32KEY #define KWSYS_ST_KEY_WOW64_64KEY KEY_WOW64_64KEY @@ -855,7 +857,6 @@ void SystemTools::ReplaceString(std::string& source, const char* replace, #define KWSYS_ST_KEY_WOW64_64KEY 0x0100 #endif -#if defined(_WIN32) && !defined(__CYGWIN__) static bool SystemToolsParseRegistryKey(const std::string& key, HKEY& primaryKey, std::string& second, std::string& valuename) @@ -2268,11 +2269,7 @@ bool SystemTools::CopyADirectory(const std::string& source, const std::string& destination, bool always) { Directory dir; -#ifdef _WIN32 - dir.Load(Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source))); -#else dir.Load(source); -#endif size_t fileNum; if (!SystemTools::MakeDirectory(destination)) { return false; @@ -2625,11 +2622,7 @@ bool SystemTools::RemoveADirectory(const std::string& source) } Directory dir; -#ifdef _WIN32 - dir.Load(Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source))); -#else dir.Load(source); -#endif size_t fileNum; for (fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum) { if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)), ".") && @@ -3796,11 +3789,7 @@ std::string SystemTools::GetFilenamePath(const std::string& filename) */ std::string SystemTools::GetFilenameName(const std::string& filename) { -#if defined(_WIN32) std::string::size_type slash_pos = filename.find_last_of("/\\"); -#else - std::string::size_type slash_pos = filename.rfind('/'); -#endif if (slash_pos != std::string::npos) { return filename.substr(slash_pos + 1); } else { diff --git a/thirdparty/KWSys/adios2sys/testDirectory.cxx b/thirdparty/KWSys/adios2sys/testDirectory.cxx new file mode 100644 index 0000000000000000000000000000000000000000..983f2c6314aed869954606ca82c8ae0c13014cdd --- /dev/null +++ b/thirdparty/KWSys/adios2sys/testDirectory.cxx @@ -0,0 +1,79 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying +file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ +#include "kwsysPrivate.h" +#include KWSYS_HEADER(Directory.hxx) +#include KWSYS_HEADER(Encoding.hxx) +#include KWSYS_HEADER(SystemTools.hxx) + +// Work-around CMake dependency scanning limitation. This must +// duplicate the above list of headers. +#if 0 +#include "Directory.hxx.in" +#include "Encoding.hxx.in" +#include "SystemTools.hxx.in" +#endif + +#include <fstream> +#include <iostream> +#include <sstream> + +#include <testSystemTools.h> + +int _doLongPathTest() +{ + using namespace kwsys; + static const int LONG_PATH_THRESHOLD = 512; + int res = 0; + std::string topdir(TEST_SYSTEMTOOLS_BINARY_DIR "/directory_testing/"); + std::stringstream testpathstrm; + std::string testdirpath; + std::string extendedtestdirpath; + + testpathstrm << topdir; + size_t pathlen = testpathstrm.str().length(); + testpathstrm.seekp(0, std::ios_base::end); + while (pathlen < LONG_PATH_THRESHOLD) { + testpathstrm << "0123456789/"; + pathlen = testpathstrm.str().length(); + } + + testdirpath = testpathstrm.str(); +#ifdef _WIN32 + extendedtestdirpath = + Encoding::ToNarrow(SystemTools::ConvertToWindowsExtendedPath(testdirpath)); +#else + extendedtestdirpath = testdirpath; +#endif + + if (SystemTools::MakeDirectory(extendedtestdirpath)) { + std::ofstream testfile1( + (extendedtestdirpath + "longfilepathtest1.txt").c_str()); + std::ofstream testfile2( + (extendedtestdirpath + "longfilepathtest2.txt").c_str()); + testfile1 << "foo"; + testfile2 << "bar"; + testfile1.close(); + testfile2.close(); + + Directory testdir; + // Set res to failure if the directory doesn't load + res += !testdir.Load(testdirpath); + // Increment res failure if the directory appears empty + res += testdir.GetNumberOfFiles() == 0; + // Increment res failures if the path has changed from + // what was provided. + res += testdirpath != testdir.GetPath(); + + SystemTools::RemoveADirectory(topdir); + } else { + std::cerr << "Failed to create directory with long path: " + << extendedtestdirpath << std::endl; + res += 1; + } + return res; +} + +int testDirectory(int, char* []) +{ + return _doLongPathTest(); +} diff --git a/thirdparty/KWSys/adios2sys/testSystemTools.cxx b/thirdparty/KWSys/adios2sys/testSystemTools.cxx index e6fbf6cdafb8ae2197ac3b815ff8b3e5c6535b72..1871f5dd0d81767d9cab71863184000d92cfd7de 100644 --- a/thirdparty/KWSys/adios2sys/testSystemTools.cxx +++ b/thirdparty/KWSys/adios2sys/testSystemTools.cxx @@ -758,6 +758,30 @@ static bool CheckGetPath() return res; } +static bool CheckGetFilenameName() +{ + const char* windowsFilepath = "C:\\somewhere\\something"; + const char* unixFilepath = "/somewhere/something"; + + std::string expectedFilename = "something"; + + bool res = true; + std::string filename = kwsys::SystemTools::GetFilenameName(windowsFilepath); + if (filename != expectedFilename) { + std::cerr << "GetFilenameName(" << windowsFilepath << ") yielded " + << filename << " instead of " << expectedFilename << std::endl; + res = false; + } + + filename = kwsys::SystemTools::GetFilenameName(unixFilepath); + if (filename != expectedFilename) { + std::cerr << "GetFilenameName(" << unixFilepath << ") yielded " << filename + << " instead of " << expectedFilename << std::endl; + res = false; + } + return res; +} + static bool CheckFind() { bool res = true; @@ -875,5 +899,7 @@ int testSystemTools(int, char* []) res &= CheckGetLineFromStream(); + res &= CheckGetFilenameName(); + return res ? 0 : 1; } diff --git a/thirdparty/KWSys/update.sh b/thirdparty/KWSys/update.sh index 53d24129ec3b2b9962517cc603e15079c74e8441..c10e61e75e4381a284d56b3432088c37dfb3232d 100755 --- a/thirdparty/KWSys/update.sh +++ b/thirdparty/KWSys/update.sh @@ -7,13 +7,8 @@ shopt -s dotglob readonly name="KWSys" readonly ownership="KWSys Upstream <kwrobot@kitware.com>" readonly subtree="thirdparty/KWSys/adios2sys" -#readonly repo="https://gitlab.kitware.com/utils/kwsys.git" -#readonly tag="master" - -# This commit contains a patch to allow object libraries for kwsys. -# Use 'master' off the main repo instead once its been merged -readonly repo="https://gitlab.kitware.com/chuck.atkins/kwsys.git" -readonly tag="ab645c9" +readonly repo="https://gitlab.kitware.com/utils/kwsys.git" +readonly tag="master" readonly shortlog="true" readonly paths="