get_system_info.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #-------------------------------------------------------------------------------------------------------
  2. # Copyright (C) Microsoft. All rights reserved.
  3. # Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. #-------------------------------------------------------------------------------------------------------
  5. if [[ $# -eq 0 ]]; then
  6. echo "No platform passed in- assuming Linux"
  7. _PLATFORM="linux"
  8. fi
  9. while [[ $# -gt 0 ]]; do
  10. case "$1" in
  11. --linux)
  12. _PLATFORM="linux"
  13. ;;
  14. --osx)
  15. _PLATFORM="osx"
  16. ;;
  17. esac
  18. shift
  19. done
  20. echo
  21. echo "=================================================="
  22. echo
  23. if [[ $_PLATFORM =~ "linux" ]]; then
  24. echo "Number of processors (nproc):"
  25. echo
  26. nproc
  27. elif [[ $_PLATFORM =~ "osx" ]]; then
  28. echo "Number of processors (sysctl -n hw.logicalcpu):"
  29. echo
  30. sysctl -n hw.logicalcpu
  31. else
  32. echo "Unknown platform"
  33. exit 1
  34. fi
  35. echo
  36. echo "--------------------------------------------------"
  37. echo
  38. if [[ $_PLATFORM =~ "linux" ]]; then
  39. echo "Linux version (lsb_release -a):"
  40. echo
  41. lsb_release -a
  42. elif [[ $_PLATFORM =~ "osx" ]]; then
  43. echo "OS X version (sw_vers -productVersion):"
  44. echo
  45. sw_vers -productVersion
  46. fi
  47. echo
  48. echo "--------------------------------------------------"
  49. echo
  50. echo "Clang version (clang --version):"
  51. echo
  52. clang --version
  53. echo
  54. echo "--------------------------------------------------"
  55. echo
  56. echo "cmake version (cmake --version):"
  57. echo
  58. cmake --version
  59. echo
  60. echo "=================================================="
  61. echo