-
Notifications
You must be signed in to change notification settings - Fork 22
/
ScriptConfig.cmake
86 lines (76 loc) · 2.82 KB
/
ScriptConfig.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
##
## SPIRAL License
##
## Copyright (c) 2018, Carnegie Mellon University
## All rights reserved.
##
## See LICENSE file for full information
##
cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})
## Determine various configuration properties to create necessary inputs for launch/batch scripts
string (COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "AMD64" INTEL_WIN)
string (COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "x86_64" INTEL_LINUX)
string (COMPARE EQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}" "armv7l" ARM_LINUX)
if (${INTEL_WIN} OR ${INTEL_LINUX})
## Intel architecture, SupportedCPU = Core_AVX
set (CPU_ARCH_TYPE "Core_AVX")
set (CPU_FREQUENCY 2195)
set (SPIRAL_MEMORY_POOL "2048m")
elseif (${ARM_LINUX})
## Raspberry Pi, SupportedCPU = armv7l
set (CPU_ARCH_TYPE "ARMV7L")
set (CPU_FREQUENCY 1500)
set (SPIRAL_MEMORY_POOL "1024m")
elseif (${CMAKE_HOST_APPLE})
## Apple ... MacBook
set (CPU_ARCH_TYPE "Core_AVX")
set (CPU_FREQUENCY 2195)
set (SPIRAL_MEMORY_POOL "2048m")
endif ()
if (WIN32)
## Windows ... now determine which C compiler we're using...
string (COMPARE EQUAL "${CMAKE_C_COMPILER_ID}" "Intel" ICC_COMPILER)
string (COMPARE EQUAL "${CMAKE_C_COMPILER_ID}" "GNU" GCC_COMPILER)
set(SPIRAL_OS_NAME "Windows8")
if (${ICC_COMPILER})
## Intel ICC compiler
set (USE_COMPILER_ICC "true")
set (USE_COMPILER_GCC "false")
set (PROFILER_TARGET "win-x64-icc")
elseif (${GNU_COMPILER})
## GNU C compiler
set (USE_COMPILER_ICC "false")
set (USE_COMPILER_GCC "true")
set (PROFILER_TARGET "win-x86-gcc")
else ()
## Default to Visual Studio
set (USE_COMPILER_ICC "false")
set (USE_COMPILER_GCC "false")
set (PROFILER_TARGET "win-x86-vcc")
endif ()
elseif (${ARM_LINUX})
## Raspberry Pi
## Use GDB as debugger, --args ==> arguments after program name are for debugged process
set (PROFILER_TARGET "linux-arm-gcc")
set (PROFILE_TARGET_ID "linux_arm_gcc")
set (SPIRAL_OS_NAME "ArmLinux")
set (SPIRAL_COMPILER_NAME "GnuC_ARM")
set (SPIRAL_DEBUGGER_NAME "gdb --args")
elseif (${CMAKE_HOST_APPLE})
## Apple ... MacBook
## Use LLDB as debugger, requires --arch, and "--" after program name to identify program arguments
set (PROFILER_TARGET "darwin-x86")
set (PROFILE_TARGET_ID "linux_x86_gcc")
set (SPIRAL_OS_NAME "Linux64")
set (SPIRAL_COMPILER_NAME "GnuC")
set (SPIRAL_DEBUGGER_NAME "lldb --arch x86_64")
set (SPIRAL_CMD_ARGS_FLAG "--")
elseif (${INTEL_WIN} OR ${INTEL_LINUX})
## Linux ...
## Use GDB as debugger, --args ==> arguments after program name are for debugged process
set (PROFILER_TARGET "linux-x86")
set (PROFILE_TARGET_ID "linux_x86_gcc")
set (SPIRAL_OS_NAME "Linux64")
set (SPIRAL_COMPILER_NAME "GnuC")
set (SPIRAL_DEBUGGER_NAME "gdb --args")
endif ()