This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  2ad09c5ddd133bc4e543b15eb5e75b6e0aaaf197 (commit)
       via  1c87bc60eef7de896215b0b8a2d0e0abf411f113 (commit)
      from  e15a9187b04336b64c92bde0a6b879237193ac5f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ad09c5ddd133bc4e543b15eb5e75b6e0aaaf197
commit 2ad09c5ddd133bc4e543b15eb5e75b6e0aaaf197
Merge: e15a918 1c87bc6
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Aug 21 14:50:06 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Wed Aug 21 10:51:48 2019 -0400

    Merge topic 'ProcessorCount-solaris'
    
    1c87bc60ee ProcessorCount: Fix virtual processor count on Solaris
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3694


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c87bc60eef7de896215b0b8a2d0e0abf411f113
commit 1c87bc60eef7de896215b0b8a2d0e0abf411f113
Author:     Jon Chronopoulos <patc...@crondog.com>
AuthorDate: Sun Aug 11 19:11:32 2019 +1000
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue Aug 20 10:26:06 2019 -0400

    ProcessorCount: Fix virtual processor count on Solaris
    
    The previous code did not count the number of virtual processors across
    physical processors on SunOS.
    
    Can handle the following situations:
    
    ```
    $ uname -a
    SunOS solaris 5.11 11.4.0.15.0 i86pc i386 i86pc
    $ psrinfo -p -v
    The physical processor has 1 virtual processor (0)
      x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
            Intel Core Processor (Broadwell)
    The physical processor has 1 virtual processor (1)
      x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
            Intel Core Processor (Broadwell)
    The physical processor has 1 virtual processor (2)
      x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
            Intel Core Processor (Broadwell)
    The physical processor has 1 virtual processor (3)
      x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
            Intel Core Processor (Broadwell)
    ```
    
    ```
    $ uname -a
    SunOS sol11x86 5.11 11.0 i86pc i386 i86pc
    $ psrinfo -p -v
    The physical processor has 2 virtual processors (0 1)
      x86 (GenuineIntel 50650 family 6 model 85 step 0 clock 2000 MHz)
            Intel(r) Xeon(r) Gold 6138 CPU @ 2.00GHz
    ```
    
    ```
    $ uname -a
    SunOS sol11 5.11 11.0 sun4v sparc sun4v
    $ psrinfo -p -v
    The physical processor has 2 cores and 16 virtual processors (0-15)
      The core has 8 virtual processors (0-7)
      The core has 8 virtual processors (8-15)
        SPARC-T4 (chipid 0, clock 2848 MHz)
    ```

diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 8c25256..43ec889 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -168,9 +168,13 @@ function(ProcessorCount var)
         ERROR_QUIET
         OUTPUT_STRIP_TRAILING_WHITESPACE
         OUTPUT_VARIABLE psrinfo_output)
-      string(REGEX MATCH "([0-9]+) virtual processor" procs 
"${psrinfo_output}")
-      set(count "${CMAKE_MATCH_1}")
-      #message("ProcessorCount: trying psrinfo -p -v 
'${ProcessorCount_cmd_prvinfo}'")
+      string(REGEX MATCHALL "has [0-9]+ virtual processor" procs 
"${psrinfo_output}")
+      set(count "")
+      foreach(proc ${procs})
+        string(REGEX MATCH "has ([0-9]+) virtual" res ${proc})
+        math(EXPR count "${count} + ${CMAKE_MATCH_1}")
+      endforeach()
+      #message("ProcessorCount: trying '${ProcessorCount_cmd_psrinfo}' -p -v")
     else()
       # Sun (systems where uname -X emits "NumCPU" in its output):
       find_program(ProcessorCount_cmd_uname uname)

-----------------------------------------------------------------------

Summary of changes:
 Modules/ProcessorCount.cmake | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to