Merge topic 'import-KWSys-subtree'

68579cd Merge branch 'upstream-kwsys' into import-KWSys-subtree
cd83da9 KWSys 2012-11-05 (df32fa6f)
3517106 CTestCustom: Suppress LNK4089 warning about PSAPI
5c63fa3 Merge branch 'ctest-SUBMIT_INDEX-cdash' into import-KWSys-subtree
17fb60b Merge branch 'upstream-kwsys' into import-KWSys-subtree
7ae44db KWSys 2012-10-16 (b7a97ac3)
97c9887 pre-commit: Update KWSys rejection message for new workflow
3db0b51 KWSys: Submit dashboard builds to PublicDashboard
4b8d363 Merge branch 'upstream-kwsys' into import-KWSys-subtree
a61f633 Merge branch 'master' into import-KWSys-subtree
8c55ea0 Merge branch 'upstream-kwsys' into import-KWSys-subtree
5d0de36 KWSys 2012-10-01 (bab53989)
7d3c295 KWSys 2012-05-02 (719638e2)
This commit is contained in:
Brad King 2012-11-07 09:07:15 -05:00 committed by CMake Topic Stage
commit 56a687d173
11 changed files with 1650 additions and 362 deletions

View File

@ -31,6 +31,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"remark: .*LOOP WAS VECTORIZED"
"warning .980: wrong number of actual arguments to intrinsic function .std::basic_"
"LINK : warning LNK4089: all references to.*ADVAPI32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*PSAPI.DLL.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
"Warning: library was too large for page size.*"
"Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"

View File

@ -509,19 +509,28 @@ ENDIF(KWSYS_USE_FundamentalType)
IF(KWSYS_USE_IOStream)
# Determine whether iostreams support long long.
IF(KWSYS_CXX_HAS_LONG_LONG)
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
-DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI}
-DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD})
IF(KWSYS_CXX_HAS_LONG_LONG)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAS_ISTREAM_LONG_LONG
"Checking if istream supports long long" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAS_OSTREAM_LONG_LONG
"Checking if ostream supports long long" DIRECT)
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES)
ELSE()
SET(KWSYS_IOS_HAS_ISTREAM_LONG_LONG 0)
SET(KWSYS_IOS_HAS_OSTREAM_LONG_LONG 0)
ENDIF()
IF(KWSYS_CXX_HAS___INT64)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAS_ISTREAM___INT64
"Checking if istream supports __int64" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAS_OSTREAM___INT64
"Checking if ostream supports __int64" DIRECT)
ELSE()
SET(KWSYS_IOS_HAS_ISTREAM___INT64 0)
SET(KWSYS_IOS_HAS_OSTREAM___INT64 0)
ENDIF()
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES)
ENDIF(KWSYS_USE_IOStream)
IF(KWSYS_NAMESPACE MATCHES "^kwsys$")
@ -566,9 +575,76 @@ IF(KWSYS_USE_SystemTools)
ENDIF()
IF(KWSYS_USE_SystemInformation)
SET_PROPERTY(SOURCE SystemInformation.cxx PROPERTY
COMPILE_DEFINITIONS KWSYS_USE_LONG_LONG=${KWSYS_USE_LONG_LONG}
KWSYS_USE___INT64=${KWSYS_USE___INT64})
IF(NOT CYGWIN)
INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES("sys/types.h;ifaddrs.h" KWSYS_SYS_HAS_IFADDRS_H)
IF(KWSYS_SYS_HAS_IFADDRS_H)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_SYS_HAS_IFADDRS_H=1)
ENDIF()
ENDIF()
IF(WIN32)
INCLUDE(CheckSymbolExists)
SET(CMAKE_REQUIRED_LIBRARIES Psapi)
CHECK_SYMBOL_EXISTS(GetProcessMemoryInfo "windows.h;psapi.h" KWSYS_SYS_HAS_PSAPI)
UNSET(CMAKE_REQUIRED_LIBRARIES)
IF(KWSYS_SYS_HAS_PSAPI)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_SYS_HAS_PSAPI=1)
IF(MSVC70 OR MSVC71)
# Suppress LNK4089: all references to 'PSAPI.DLL' discarded by /OPT:REF
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /IGNORE:4089")
ENDIF()
ENDIF()
ENDIF()
IF(KWSYS_LFS_AVAILABLE AND NOT KWSYS_LFS_DISABLE)
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES -DKWSYS_HAS_LFS=1)
ENDIF()
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_RLIMIT64
"Checking whether CXX compiler has rlimit64" DIRECT)
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES)
IF(KWSYS_CXX_HAS_RLIMIT64)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_CXX_HAS_RLIMIT64=1)
ENDIF()
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ATOL
"Checking whether CXX compiler has atol" DIRECT)
IF(KWSYS_CXX_HAS_ATOL)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_CXX_HAS_ATOL=1)
ENDIF()
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ATOLL
"Checking whether CXX compiler has atoll" DIRECT)
IF(KWSYS_CXX_HAS_ATOLL)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_CXX_HAS_ATOLL=1)
ENDIF()
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS__ATOI64
"Checking whether CXX compiler has _atoi64" DIRECT)
IF(KWSYS_CXX_HAS__ATOI64)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_CXX_HAS__ATOI64=1)
ENDIF()
IF(KWSYS_USE___INT64)
SET_PROPERTY(SOURCE SystemInformation.cxx testSystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_USE___INT64=1)
ENDIF()
IF(KWSYS_USE_LONG_LONG)
SET_PROPERTY(SOURCE SystemInformation.cxx testSystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_USE_LONG_LONG=1)
ENDIF()
IF(KWSYS_IOS_HAS_OSTREAM_LONG_LONG)
SET_PROPERTY(SOURCE SystemInformation.cxx testSystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_IOS_HAS_OSTREAM_LONG_LONG=1)
ENDIF()
IF(KWSYS_IOS_HAS_OSTREAM___INT64)
SET_PROPERTY(SOURCE SystemInformation.cxx testSystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_IOS_HAS_OSTREAM___INT64=1)
ENDIF()
IF(KWSYS_BUILD_SHARED)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_BUILD_SHARED=1)
ENDIF()
ENDIF()
#-----------------------------------------------------------------------------
@ -805,6 +881,9 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
IF(KWSYS_USE_SystemInformation AND WIN32)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ws2_32)
IF(KWSYS_SYS_HAS_PSAPI)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} Psapi)
ENDIF()
ENDIF(KWSYS_USE_SystemInformation AND WIN32)
# Apply user-defined target properties to the library.
@ -842,6 +921,16 @@ ENDIF(KWSYS_ENABLE_C AND KWSYS_C_SRCS)
# line to configure the namespace in the C and C++ source files.
ADD_DEFINITIONS("-DKWSYS_NAMESPACE=${KWSYS_NAMESPACE}")
# Disable deprecation warnings for standard C functions.
IF(MSVC OR (WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$"))
ADD_DEFINITIONS(
-D_CRT_NONSTDC_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_DEPRECATE
)
ENDIF()
IF(KWSYS_USE_String)
# Activate code in "String.c". See the comment in the source.
SET_SOURCE_FILES_PROPERTIES(String.c PROPERTIES

View File

@ -1,6 +1,6 @@
#=============================================================================
# KWSys - Kitware System Library
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
# Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@ -9,10 +9,9 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
set (CTEST_PROJECT_NAME "kwsys")
set(CTEST_PROJECT_NAME "KWSys")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
set(CTEST_DROP_SITE_CDASH TRUE)

View File

@ -37,20 +37,6 @@
/* Whether kwsys namespace is "kwsys". */
#define @KWSYS_NAMESPACE@_NAME_IS_KWSYS @KWSYS_NAME_IS_KWSYS@
/* If we are building a kwsys .c or .cxx file, suppress the Microsoft
deprecation warnings. */
#if defined(KWSYS_NAMESPACE)
# ifndef _CRT_NONSTDC_NO_DEPRECATE
# define _CRT_NONSTDC_NO_DEPRECATE
# endif
# ifndef _CRT_SECURE_NO_DEPRECATE
# define _CRT_SECURE_NO_DEPRECATE
# endif
# ifndef _SCL_SECURE_NO_DEPRECATE
# define _SCL_SECURE_NO_DEPRECATE
# endif
#endif
/* Whether Large File Support is requested. */
#define @KWSYS_NAMESPACE@_LFS_REQUESTED @KWSYS_LFS_REQUESTED@

View File

@ -2732,6 +2732,7 @@ static void kwsysProcessesSignalHandler(int signum
kwsysProcess* cp = kwsysProcesses.Processes[i];
kwsysProcess_ssize_t status=
read(cp->PipeReadEnds[KWSYSPE_PIPE_SIGNAL], &buf, 1);
(void)status;
status=write(cp->SignalPipe, &buf, 1);
(void)status;
}

File diff suppressed because it is too large Load Diff

View File

@ -24,14 +24,22 @@
namespace @KWSYS_NAMESPACE@
{
// forward declare the implementation class
class SystemInformationImplementation;
class @KWSYS_NAMESPACE@_EXPORT SystemInformation
{
#if @KWSYS_USE_LONG_LONG@
typedef long long LongLong;
#elif @KWSYS_USE___INT64@
typedef __int64 LongLong;
#else
# error "No Long Long"
#endif
friend class SystemInformationImplementation;
SystemInformationImplementation* Implementation;
public:
SystemInformation ();
~SystemInformation ();
@ -40,6 +48,7 @@ public:
kwsys_stl::string GetTypeID();
kwsys_stl::string GetFamilyID();
kwsys_stl::string GetModelID();
kwsys_stl::string GetModelName();
kwsys_stl::string GetSteppingCode();
const char * GetExtendedProcessorName();
const char * GetProcessorSerialNumber();
@ -50,12 +59,26 @@ public:
int GetProcessorCacheXSize(long int);
bool DoesCPUSupportFeature(long int);
const char * GetOSName();
// returns an informative general description of the cpu
// on this system.
kwsys_stl::string GetCPUDescription();
const char * GetHostname();
kwsys_stl::string GetFullyQualifiedDomainName();
const char * GetOSName();
const char * GetOSRelease();
const char * GetOSVersion();
const char * GetOSPlatform();
int GetOSIsWindows();
int GetOSIsLinux();
int GetOSIsApple();
// returns an informative general description of the os
// on this system.
kwsys_stl::string GetOSDescription();
bool Is64Bits();
unsigned int GetNumberOfLogicalCPU(); // per physical cpu
@ -63,20 +86,62 @@ public:
bool DoesCPUSupportCPUID();
// Retrieve id of the current running process
LongLong GetProcessId();
// Retrieve memory information in megabyte.
size_t GetTotalVirtualMemory();
size_t GetAvailableVirtualMemory();
size_t GetTotalPhysicalMemory();
size_t GetAvailablePhysicalMemory();
// returns an informative general description if the installed and
// available ram on this system. See the GetHostMmeoryTotal, and
// Get{Host,Proc}MemoryAvailable methods for more information.
kwsys_stl::string GetMemoryDescription(
const char *hostLimitEnvVarName=NULL,
const char *procLimitEnvVarName=NULL);
// Retrieve amount of physical memory installed on the system in KiB
// units.
LongLong GetHostMemoryTotal();
// Get total system RAM in units of KiB available colectivley to all
// processes in a process group. An example of a process group
// are the processes comprising an mpi program which is running in
// parallel. The amount of memory reported may differ from the host
// total if a host wide resource limit is applied. Such reource limits
// are reported to us via an applicaiton specified environment variable.
LongLong GetHostMemoryAvailable(const char *hostLimitEnvVarName=NULL);
// Get total system RAM in units of KiB available to this process.
// This may differ from the host available if a per-process resource
// limit is applied. per-process memory limits are applied on unix
// system via rlimit api. Resource limits that are not imposed via
// rlimit api may be reported to us via an application specified
// environment variable.
LongLong GetProcMemoryAvailable(
const char *hostLimitEnvVarName=NULL,
const char *procLimitEnvVarName=NULL);
// Get the system RAM used by all processes on the host, in units of KiB.
LongLong GetHostMemoryUsed();
// Get system RAM used by this process id in units of KiB.
LongLong GetProcMemoryUsed();
// enable/disable stack trace signal handler. In order to
// produce an informative stack trace the application should
// be dynamically linked and compiled with debug symbols.
static
void SetStackTraceOnError(int enable);
/** Run the different checks */
void RunCPUCheck();
void RunOSCheck();
void RunMemoryCheck();
private:
SystemInformationImplementation* Implementation;
};
} // namespace @KWSYS_NAMESPACE@
/* Undefine temporary macros. */

View File

@ -1665,7 +1665,7 @@ kwsys_stl::string SystemTools::EscapeChars(
kwsys_stl::string n;
if (str)
{
if (!chars_to_escape | !*chars_to_escape)
if (!chars_to_escape || !*chars_to_escape)
{
n.append(str);
}

View File

@ -358,6 +358,30 @@ int main()
}
#endif
#ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64
int test_istream(kwsys_ios::istream& is, __int64& x)
{
return (is >> x)? 1:0;
}
int main()
{
__int64 x = 0;
return test_istream(kwsys_ios::cin, x);
}
#endif
#ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64
int test_ostream(kwsys_ios::ostream& os, __int64 x)
{
return (os << x)? 1:0;
}
int main()
{
__int64 x = 0;
return test_ostream(kwsys_ios::cout, x);
}
#endif
#ifdef TEST_KWSYS_CHAR_IS_SIGNED
/* Return 0 for char signed and 1 for char unsigned. */
int main()
@ -428,6 +452,48 @@ int main()
}
#endif
#ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
# if defined(KWSYS_HAS_LFS)
# define _LARGEFILE_SOURCE
# define _LARGEFILE64_SOURCE
# define _LARGE_FILES
# define _FILE_OFFSET_BITS 64
# endif
# include <sys/resource.h>
int main()
{
struct rlimit64 rlim;
return getrlimit64(0,&rlim);
}
#endif
#ifdef TEST_KWSYS_CXX_HAS_ATOLL
#include <stdlib.h>
int main()
{
const char *str="1024";
return static_cast<int>(atoll(str));
}
#endif
#ifdef TEST_KWSYS_CXX_HAS_ATOL
#include <stdlib.h>
int main()
{
const char *str="1024";
return static_cast<int>(atol(str));
}
#endif
#ifdef TEST_KWSYS_CXX_HAS__ATOI64
#include <stdlib.h>
int main()
{
const char *str="1024";
return static_cast<int>(_atoi64(str));
}
#endif
#ifdef TEST_KWSYS_CXX_TYPE_INFO
/* Collect fundamental type information and save it to a CMake script. */

View File

@ -13,8 +13,6 @@
#include KWSYS_HEADER(SystemInformation.hxx)
#include KWSYS_HEADER(ios/iostream)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
@ -22,12 +20,31 @@
# include "kwsys_ios_iostream.h.in"
#endif
#define printMethod(inof, m) kwsys_ios::cout << #m << ": " \
#if defined(KWSYS_USE_LONG_LONG)
# if defined(KWSYS_IOS_HAS_OSTREAM_LONG_LONG)
# define iostreamLongLong(x) (x)
# else
# define iostreamLongLong(x) ((long)x)
# endif
#elif defined(KWSYS_USE___INT64)
# if defined(KWSYS_IOS_HAS_OSTREAM___INT64)
# define iostreamLongLong(x) (x)
# else
# define iostreamLongLong(x) ((long)x)
# endif
#else
# error "No Long Long"
#endif
#define printMethod(info, m) kwsys_ios::cout << #m << ": " \
<< info.m() << "\n"
#define printMethod2(inof, m, unit) kwsys_ios::cout << #m << ": " \
#define printMethod2(info, m, unit) kwsys_ios::cout << #m << ": " \
<< info.m() << " " << unit << "\n"
#define printMethod3(info, m, unit) kwsys_ios::cout << #m << ": " \
<< iostreamLongLong(info.m) << " " << unit << "\n"
int testSystemInformation(int, char*[])
{
kwsys::SystemInformation info;
@ -35,7 +52,11 @@ int testSystemInformation(int, char*[])
info.RunOSCheck();
info.RunMemoryCheck();
printMethod(info, GetOSName);
printMethod(info, GetOSIsLinux);
printMethod(info, GetOSIsApple);
printMethod(info, GetOSIsWindows);
printMethod(info, GetHostname);
printMethod(info, GetFullyQualifiedDomainName);
printMethod(info, GetOSRelease);
printMethod(info, GetOSVersion);
printMethod(info, GetOSPlatform);
@ -58,6 +79,11 @@ int testSystemInformation(int, char*[])
printMethod2(info, GetAvailableVirtualMemory, "MB");
printMethod2(info, GetTotalPhysicalMemory, "MB");
printMethod2(info, GetAvailablePhysicalMemory, "MB");
printMethod3(info, GetHostMemoryTotal(), "KiB");
printMethod3(info, GetHostMemoryAvailable("KWSHL"), "KiB");
printMethod3(info, GetProcMemoryAvailable("KWSHL","KWSPL"), "KiB");
printMethod3(info, GetHostMemoryUsed(), "KiB");
printMethod3(info, GetProcMemoryUsed(), "KiB");
//int GetProcessorCacheXSize(long int);
// bool DoesCPUSupportFeature(long int);

View File

@ -47,18 +47,16 @@ if test -z "$HOOKS_ALLOW_KWSYS"; then
'"$(echo "$files" | sed 's/^/ /')"'
cannot be committed through Git. KWSys is kept in a CVS repository
shared by several projects. A robot replays changes committed there
into the Source/kwsys directory in CMake. Please send changes to
this directory separately. Run
should not be made directly in CMake. KWSys is kept in its own Git
repository and shared by several projects. Please visit
http://public.kitware.com/Wiki/KWSys/Git
to contribute changes directly to KWSys. Run
git reset HEAD -- Source/kwsys
to unstage these changes and then
git diff -- Source/kwsys > kwsys.patch
to construct the patch. Alternatively, set environment variable
to unstage these changes. Alternatively, set environment variable
HOOKS_ALLOW_KWSYS=1