-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.comm.txt
212 lines (192 loc) · 5.75 KB
/
CMakeLists.comm.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
## DEBUG
macro(var_message var)
message(${var} " : " ${${var}})
endmacro()
## MPI
find_package(MPI REQUIRED)
include_directories (${MPI_INCLUDE_PATH})
if (WIN32)
## HDF5
set(HDF5_LIBNAMES hdf5dll)
## The following doesn't work
#set(HDF5_LIBNAMES hdf5)
find_path(HDF5_INCLUDE_DIR hdf5.h)
include_directories(${HDF5_INCLUDE_DIR} ${HDF5_INCLUDE_DIR}/cpp)
add_definitions(-DH5_USE_16_API)
foreach(LIB ${HDF5_LIBNAMES})
set(HDF5_LIB "HDF5_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(HDF5_LIB ${LIB})
if (HDF5_LIB)
list(APPEND HDF5_LIBRARIES ${HDF5_LIB})
else (HDF5_LIB)
message(SEND_ERROR "Unable to find HDF5 library ${LIB}")
endif (HDF5_LIB)
endforeach(LIB)
else (WIN32)
## HDF5
find_package(HDF5 REQUIRED)
include_directories (${HDF5_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS}/cpp)
add_definitions(-DH5_USE_16_API)
endif (WIN32)
## GSL
if (WIN32)
set(GSL_LIBNAMES libgsl libgslcblas)
set(GSL_GSL_LIBNAME libgsl)
set(GSL_GSLCBLAS_LIBNAME libgslcblas)
#add_definitions(/DGSL_DLL)
else (WIN32)
set(GSL_LIBNAMES gsl gslcblas)
set(GSL_GSL_LIBNAME gsl)
set(GSL_GSLCBLAS_LIBNAME gslcblas)
endif (WIN32)
find_path(GSL_INCLUDE_DIR
NAMES gsl/gsl_blas.h
HINTS
$ENV{GSL_HOME} $ENV{GSL_ROOT} $ENV{GSL_DIR}
PATH_SUFFIXES
include Include
)
set(GSL_LIBRARIES)
foreach(LIB ${GSL_LIBNAMES})
set(GSL_LIB "GSL_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(GSL_LIB
NAMES ${LIB}
HINTS
$ENV{GSL_HOME} $ENV{GSL_ROOT} $ENV{GSL_DIR}
ENV GSL_DIR
PATH_SUFFIXES
lib
)
message(${GSL_LIB})
if (GSL_LIB)
list(APPEND GSL_LIBRARIES ${GSL_LIB})
else (GSL_LIB)
message(SEND_ERROR "Unable to find GSL library ${LIB}")
endif (GSL_LIB)
endforeach(LIB)
set(GSL_LIB "GSL_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for GSL detection" FORCE)
find_library(GSL_GSL_LIBRARY
NAMES ${GSL_GSL_LIBNAME}
HINTS
$ENV{GSL_HOME} $ENV{GSL_ROOT} $ENV{GSL_DIR}
PATH_SUFFIXES
lib
)
find_library(GSL_GSLCBLAS_LIBRARY
NAMES ${GSL_GSLCBLAS_LIBNAME}
HINTS
$ENV{GSL_HOME} $ENV{GSL_ROOT} $ENV{GSL_DIR}
PATH_SUFFIXES
lib
)
mark_as_advanced(
GSL_INCLUDE_DIR
GSL_LIBRARIES
GSL_GSL_LIBRARY
GSL_GSLCBLAS_LIBRARY
)
include_directories(${GSL_INCLUDE_DIR})
#-----------------------------------------------------------------------------
# Option to enable USE_MKL
#-----------------------------------------------------------------------------
option (USE_MKL "Enable the use of MKL" OFF)
if (USE_MKL)
set(MKL_LIBNAMES mkl_intel_lp64 mkl_sequential mkl_core)
find_path(MKL_INCLUDE_DIR
NAMES mkl.h
HINTS
ENV MKL_HOME MKL_ROOT MKLROOT
PATH_SUFFIXES
include Include
)
set(MKL_LIBRARIES)
foreach(LIB ${MKL_LIBNAMES})
set(MKL_LIB "MKL_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(MKL_LIB
NAMES ${LIB}
HINTS
ENV MKL_HOME MKL_ROOT MKLROOT
PATH
$ENV{MKLROOT} $ENV{MKLROOT}/lib
PATH_SUFFIXES
lib intel64
)
if (MKL_LIB)
list(APPEND MKL_LIBRARIES ${MKL_LIB})
else (MKL_LIB)
message(SEND_ERROR "Unable to find MKL library ${LIB}")
endif (MKL_LIB)
endforeach(LIB)
set(MKL_LIB "MKL_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MKL detection" FORCE)
mark_as_advanced(
MKL_INCLUDE_DIR
MKL_LIBRARIES
)
endif (USE_MKL)
#-----------------------------------------------------------------------------
# Option to enable USE_ACML
#-----------------------------------------------------------------------------
option (USE_ACML "Enable the use of ACML" OFF)
if (USE_ACML)
find_library(ACML_CBLAS_LIBRARY
NAMES acmlcblas
HINTS
ENV GSL_HOME GSL_ROOT
PATH_SUFFIXES
lib
)
endif (USE_ACML)
#-----------------------------------------------------------------------------
# Option to enable USE_IPP
#-----------------------------------------------------------------------------
option (USE_IPP "Enable the use of IPP" OFF)
if (USE_IPP)
include_directories($ENV{IPPROOT}/include)
add_definitions(-DCOMM_IPP_ON)
endif (USE_IPP)
#-----------------------------------------------------------------------------
# Compiler Settings
#-----------------------------------------------------------------------------
if (WIN32)
set (CMAKE_C_COMPILER icl)
set (CMAKE_C_FLAGS "/Qstd=c99")
set (CMAKE_CXX_COMPILER icl)
set (CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
add_definitions(-DWIN32)
elseif (APPLE)
if (${CMAKE_GENERATOR} MATCHES "Xcode")
## Unable to set icc in Xcode
else ()
#set (CMAKE_C_COMPILER icc CACHE FILEPATH "C compiler used.")
#set (CMAKE_C_FLAGS "-O3 -mtune=core2 -march=core2 -m64 -fp-model strict")
#set (CMAKE_CXX_COMPILER icpc)
#set (CMAKE_CXX_FLAGS "-O3 -mtune=core2 -march=core2 -m64 -fp-model strict")
endif ()
else ()
if (NOT BUILD_PLATFORM)
message("General platform ... ")
set (CMAKE_C_COMPILER pathcc)
set (CMAKE_C_FLAGS "-std=c99")
elseif (BUILD_PLATFORM MATCHES "Cray")
message("Cray ... ")
add_definitions(-DMPICH_IGNORE_CXX_SEEK)
else ()
message("Unknown platform ... ")
endif()
endif ()
#add_definitions(-DUSE_LOCAL_GSL)
#add_definitions(-DCLS=16)
#-----------------------------------------------------------------------------
# Option to enable USE_TICTOC
#-----------------------------------------------------------------------------
option (USE_TICTOC "Enable tic/toc timing" OFF)
if (USE_TICTOC)
add_definitions(-DLOG_TICTOC_ON)
endif (USE_TICTOC)
#-----------------------------------------------------------------------------
# Option to enable USE_TICTOC
#-----------------------------------------------------------------------------
option (USE_VECTORIZED_DIST "Enable to use VECTORIZED_DIST" OFF)
if (USE_VECTORIZED_DIST)
add_definitions(-DCOMM_VECTORIZED_DIST_ON)
endif (USE_VECTORIZED_DIST)