-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
154 lines (136 loc) · 5.83 KB
/
CMakeLists.txt
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
################################################################################
# #
# Copyright (c) 2011-2014, University of Delaware #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions #
# are met: #
# #
# 1. Redistributions of source code must retain the above copyright #
# notice, this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE #
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
# POSSIBILITY OF SUCH DAMAGE. #
# #
################################################################################
cmake_minimum_required( VERSION 2.6 )
ENABLE_TESTING()
project ( darts )
if( "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local" )
message( "HOME" )
set (CMAKE_INSTALL_PREFIX $ENV{HOME} )
endif( "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local" )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
# Look for supported threading libraries
find_package( Threads REQUIRED )
if( UNIX )
if( NOT CMAKE_USE_PTHREADS_INIT )
message( FATAL_ERROR "Require pthreads on Unix-like systems" )
endif( NOT CMAKE_USE_PTHREADS_INIT )
elseif( WIN32 )
if( NOT CMAKE_USE_WIN32_THREADS_INIT )
message( FATAL_ERROR "Require win32 threads on Windows systems" )
endif( NOT CMAKE_USE_WIN32_THREADS_INIT )
else( WIN32 )
message( FATAL_ERROR "Unsupported operating system" )
endif( UNIX )
find_package( Hwloc REQUIRED )
if( HWLOC_FOUND )
include_directories( ${HWLOC_INCLUDE_DIR} )
link_directories( ${HWLOC_LIBRARIES} )
endif( HWLOC_FOUND )
option(TBB "TBB" ON)
if(TBB)
find_package( TBB )
if ( TBB_FOUND )
add_definitions( -DTBB )
include_directories( ${TBB_INCLUDE_DIR} )
link_directories( ${TBB_LIBRARY_DIRS} )
endif ( TBB_FOUND )
else()
message("DEQUE ON")
endif(TBB)
option(MKL "MKL" OFF)
option(ACML "ACML" OFF)
option(ACML "ATLAS" OFF)
if(MKL)
message("mkl ON")
add_definitions( -DMKL )
include_directories(/opt/intel/mkl/include)
link_directories(/opt/intel/mkl/lib/intel64)
elseif(ACML)
message("ACML ON")
add_definitions( -DACML )
include_directories(/opt/shared/ACML/5.3.0/gfortran64_fma4/include)
link_directories(/opt/shared/ACML/5.3.0/gfortran64_fma4/lib)
elseif(ATLAS)
message("ATLAS ON")
add_definitions( -DATLAS )
include_directories(/usr/include/atlas)
include_directories(/usr/lib/atlas-base)
else()
message("DEFAULT ON")
endif(MKL)
include_directories(include/abstractmachine
include/common
include/runtime
include/scheduler
include/threading
include/threadlocal
include/threadsafe )
option(DEBUG "DEBUG" OFF)
if(DEBUG)
message("DEBUG VERSION!!!")
set (CMAKE_BUILD_TYPE "DEBUG")
else()
message("Release Version")
set (CMAKE_BUILD_TYPE "RELEASE")
endif()
set (CMAKE_CXX_FLAGS_DEBUG "-g -pg")
set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
## Compiler flags
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" )
set( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-g -std=c++11 -Wall -Wextra -Werror -Wno-pmf-conversions" )
set( CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-g -std=c11 -Wall -Wextra -Werror" )
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
set( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-g -std=c++11 -Wall -Wextra -Werror " )
set( CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-g -std=c11 -Wall -Wextra -Werror " )
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" )
set( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "/W3 /wd4995" )
else()
message( FATAL_ERROR "Unsupported compiler: ${CMAKE_CXX_COMPILER_ID}" )
endif()
option(TRACE "TRACE" OFF)
if(TRACE)
message("Tracing ON!")
add_definitions(-DTRACE)
else()
message("Tracing off")
endif(TRACE)
option(TRACE "COUNT" OFF)
if(COUNT)
message("Counting ON!")
add_definitions(-DCOUNT)
include_directories( /home/software/papi/5.1.1/include )
link_directories( /home/software/papi/5.1.1/lib )
else()
message("Counting off")
endif(COUNT)
add_subdirectory( include )
add_subdirectory( src )
add_subdirectory( apps )