forked from thierry3000/tumorcode
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·460 lines (396 loc) · 18.9 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
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
cmake_minimum_required(VERSION 3.3)
project(tumorcode CXX)
# I try to follow the tutorial at:
# https://cmake.org/cmake-tutorial/
set(TUMORCODE_VERSION_MAJOR 2)
set(TUMORCODE_VERSION_MINOR 1)
# I try to follow the tutorial at:
# https://cmake.org/cmake-tutorial/
set(TUMORCODE_VERSION_MAJOR 2)
set(TUMORCODE_VERSION_MINOR 1)
if(FALSE)
############### set up spack stuff ##############
# enable @rpath in the install name for any shared library being built
# note: it is planned that a future version of CMake will enable this by default
set(CMAKE_MACOSX_RPATH 1)
# Always use full RPATH
# http://www.cmake.org/Wiki/CMake_RPATH_handling
# http://www.kitware.com/blog/home/post/510
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
#this one is needed for the project itself
#SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/milotti_mts/lib")
ENDIF("${isSystemDir}" STREQUAL "-1")
# Include all the transitive dependencies determined by Spack.
# If we're not running with Spack, this does nothing...
include_directories($ENV{SPACK_TRANSITIVE_INCLUDE_PATH})
endif()
############### end spack stuff ##############
### build external stuff numpycpp is still needed, maybe we could get rid of this in future withe build in stuff
### adapted from:
# https://crascit.com/2015/07/25/cmake-gtest/
# Download and unpack numpycpp at configure time
find_package(Boost REQUIRED)
if(Boost_VERSION GREATER 106500)
message("no numpy cpp!!!")
else()
configure_file(externalProjects/numpycpp/CMakeLists.txt.in externalProjects/numpycpp/CMakeLists.txt)
message("CMAKE_COMMAND: ${CMAKE_COMMAND}")
message("CMAKE_GENERATOR: ${CMAKE_GENERATOR}")
endif()
# T.F. try to remove this since boost::python::numpy does now exist in boost 1.65.1
# numpycpp has its own modules
if(Boost_VERSION GREATER 106500)
else()
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_BINARY_DIR}/externalProjects/numpycpp-src/.cmake/modules;")
message("CMAKE_MODULE_PATH at numpycpp build: ${CMAKE_MODULE_PATH}")
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externalProjects/numpycpp" )
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externalProjects/numpycpp" )
include_directories("${CMAKE_BINARY_DIR}/externalProjects/numpycpp-src")
# Add numpycpp directly to our build. This adds
# the following targets: numpycpp
add_subdirectory("${CMAKE_BINARY_DIR}/externalProjects/numpycpp-src"
"${CMAKE_BINARY_DIR}/externalProjects/numpycpp-build")
endif()
## HDF5-cpp-wrapper does not need compilation
configure_file(externalProjects/HDF5-cpp-wrapper/CMakeLists.txt.in externalProjects/HDF5-cpp-wrapper/CMakeLists.txt)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externalProjects/HDF5-cpp-wrapper" )
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externalProjects/HDF5-cpp-wrapper" )
include_directories("${CMAKE_BINARY_DIR}/externalProjects/HDF5-cpp-wrapper-src")
# add_subdirectory("${CMAKE_BINARY_DIR}/externalProjects/HDF5-cpp-wrapper-src"
# "${CMAKE_BINARY_DIR}/externalProjects/HDF5-cpp-wrapper-build")
## ANN
# it is now supposed, that ANN is present on the system
# to find nearest vessels for cells we contact the ANN add_library
# configure_file(externalProjects/ANN/CMakeLists.txt.in externalProjects/ANN/CMakeLists.txt)
# message("CMAKE_COMMAND: ${CMAKE_COMMAND}")
# message("CMAKE_GENERATOR: ${CMAKE_GENERATOR}")
# # numpycpp has its own modules
# set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_BINARY_DIR}/externalProjects/ANN-src/.cmake/modules;")
# message("CMAKE_MODULE_PATH at ANN build: ${CMAKE_MODULE_PATH}")
# execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
# WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externalProjects/ANN" )
# execute_process(COMMAND "${CMAKE_COMMAND}" --build .
# WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externalProjects/ANN" )
# include_directories("${CMAKE_BINARY_DIR}/externalProjects/ANN-src/include")
# # Add numpycpp directly to our build. This adds
# # the following targets: numpycpp
# add_subdirectory("${CMAKE_BINARY_DIR}/externalProjects/ANN-src"
# "${CMAKE_BINARY_DIR}/externalProjects/ANN-build")
list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)
add_definitions(-DSILENT)
find_package(Threads REQUIRED)
# set a search path for additional custom cmake modules.
# according to recommendation in https://cmake.org/Wiki/CMake:How_To_Find_Libraries
message("CMAKE_ROOT: ${CMAKE_ROOT}")
message("CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/;")
message("CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
message("CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
set (HDF5_DIR CACHE PATH "Provided module path for HDF5" )
set (Trilinos_DIR CACHE PATH "Provided module path for Trilinos" )
set (CGAL_DIR CACHE PATH "Provided module path for CGAL" )
include(${CMAKE_ROOT}/Modules/CMakeDependentOption.cmake)
option(BUILD_TESTS "build test directory" ON)
option(USE_MILOTTI_MTS "decide to use libvbl.so" OFF)
if(USE_MILOTTI_MTS)
message("MILOTTI_MTS preprocessor defined")
add_definitions(-DMILOTTI_MTS)
endif()
option(USE_ADAPTION "decide to build the adaption library" OFF)
CMAKE_DEPENDENT_OPTION(USE_PAGMO "Use Pagmo" OFF "USE_ADAPTION" ON)
#CMAKE_DEPENDENT_OPTION(USE_PAGMO_MPI "MPI version of Pagmo" OFF "USE_ADAPTION;USE_PAGMO" ON)
option(TOTAL_SILENCE "suppress all output, good for running on cluster" OFF)
if(TOTAL_SILENCE)
message("TOTAL_SILENCE preprocessor defined")
add_definitions(-DTOTAL_SILENCE)
endif()
#It would be nicer to see if pagmo was compilled
#with mpi automatically, pagmo2 is supporting that
# option(USE_PAGMO_MPI OFF)
# if(USE_PAGMO_MPI)
# set(USE_PAGMO ON)
# endif()
if(USE_PAGMO)
# if(NOT USE_ADAPTION)
# message("so far there is no usage for pagmo without adation, we set it to be true!!!")
# set(USE_ADAPTION ON)
# endif()
message("USE_PAGMO preprocessor defined")
add_definitions(-DUSE_PAGMO)
endif()
if(USE_ADAPTION)
message(STATUS "ADAPTION: USE_ADAPTION preprocessor defined")
add_definitions(-DUSE_ADAPTION)
endif()
set (MAX_OPTIMIZATION TRUE CACHE BOOL "compile with -march=native (important for VM) and some other optimization options")
# set (MPI_NEEDED FALSE CACHE BOOL "Must we link to the MPI libraries?")
set (ADDITIONAL_INCLUDE_DIRS CACHE PATH "Additional dirs to search for included files")
set (ADDITIONAL_LIBRARY_DIRS CACHE PATH "Additional dirs to search for linked libraries")
find_package(Boost REQUIRED COMPONENTS "program_options")
message("Boost_PROGRAM_OPTIONS_LIBRARY: ${Boost_PROGRAM_OPTIONS_LIBRARY}")
set(myLibs "${myLibs};${Boost_PROGRAM_OPTIONS_LIBRARY}")
find_package(Boost REQUIRED COMPONENTS "system")
message("Boost_SYSTEM_LIBRARY: ${Boost_SYSTEM_LIBRARY}")
set(myLibs "${myLibs};${Boost_SYSTEM_LIBRARY}")
find_package(Boost REQUIRED COMPONENTS "serialization")
message("Boost_SERIALIZATION_LIBRARY: ${Boost_SERIALIZATION_LIBRARY}")
set(myLibs "${myLibs};${Boost_SERIALIZATION_LIBRARY}")
find_package(Boost REQUIRED COMPONENTS "thread")
message("Boost_THREAD_LIBRARY: ${Boost_THREAD_LIBRARY}")
set(myLibs "${myLibs};${Boost_THREAD_LIBRARY}")
find_package(Boost REQUIRED COMPONENTS "filesystem")
message("Boost_FILESYSTEM_LIBRARY: ${Boost_FILESYSTEM_LIBRARY}")
set(myLibs "${myLibs};${Boost_FILESYSTEM_LIBRARY}")
if(Boost_VERSION GREATER 106500)
find_package(Boost REQUIRED COMPONENTS "numpy")
set(myLibs "${myLibs};${Boost_NUMPY_LIBRARY}")
endif()
#note there are system without eigen, so let the configure fail here
find_package(Eigen3 3.2 QUIET)
#find_package(HDF5 1.8.10 REQUIRED)
find_package(HDF5 REQUIRED COMPONENTS CXX)
if(HDF5_IS_PARALLEL)
message(WARNING "your hdf5 is parallel, you probably need to compile with mpic++")
endif()
find_package(LAPACK REQUIRED)
find_package(BLAS REQUIRED)
find_package(PNG REQUIRED)
find_package(TBB REQUIRED)
find_package(Trilinos REQUIRED COMPONENTS Belos)
find_package(Trilinos REQUIRED COMPONENTS Epetra)
#the find_package load some defaults, but they are too much
#set(Trilinos_LIBRARIES "${Trilinos_LIBRARIES};belosepetra;ml")
#under Ubuntu the library is named differently
execute_process(COMMAND lsb_release -cs
OUTPUT_VARIABLE RELEASE_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "running on sytem: ${RELEASE_CODENAME}")
## 14.04 trusty
## 16.04 xenial
## 18.04 bionic
if( "${RELEASE_CODENAME}" MATCHES "bionic" OR "${RELEASE_CODENAME}" MATCHES "trusty" OR "${RELEASE_CODENAME}" MATCHES "xenial")
set(Trilinos_LIBRARIES "trilinos_belos;trilinos_belosepetra;trilinos_ml")
else()
set(Trilinos_LIBRARIES "trilinos_belos;trilinos_belosepetra;trilinos_ml")
endif()
message(STATUS "Trilinos libs = ${Trilinos_LIBRARIES}")
message(STATUS "Your Trilions depends on: ${Trilinos_TPL_LIST}")
if (";${Trilinos_TPL_LIST};" MATCHES ";MPI;")
message(STATUS "your trilinos depends on MPI, use the wrapper")
#set(MPI_NEEDED TRUE)
endif()
# if (MPI_NEEDED)
# #set(MPI_CXX_COMPILER "/usr/bin/mpic++.openmpi") --> system dependent, move to do configure
# find_package(MPI REQUIRED)
# add_definitions(-DMPI_NEEDED)
# message(STATUS "Including MPI")
# message(STATUS "MPI cxx libs = ${MPI_CXX_LIBRARIES}")
# #message(STATUS "MPI libs = ${MPI_LIBRARIES}") # depricated
# message(STATUS "MPI include dirs = ${MPI_CXX_INCLUDE_PATH}")
# #message(STATUS "MPI_LIBRARY = ${MPI_LIBRARY}") #depricated
# message(STATUS "MPI_CXX_COMPILER_FLAGS = ${MPI_CXX_COMPILER_FLAGS}")
# message(STATUS "MPI_CXX_LINK_FLAGS = ${MPI_CXX_LINK_FLAGS}")
# #message(STATUS "MPI_COMPILE_FLAGS = ${MPI_COMPILE_FLAGS}") #depricated
# #message(STATUS "MPI_LINK_FLAGS = ${MPI_LINK_FLAGS}") #depricated
# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILER_FLAGS}" )
# set( CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} ${MPI_CXX_LINK_FLAGS}")
# include_directories(${MPI_CXX_INCLUDE_PATH})
# #include_directories(${MPI_INCLUDE_PATH})
# #set(myLibs ${MPI_CXX_LIBRARIES})
# set(myLibs "${myLibs};${MPI_LIBRARIES};${MPI_CXX_LIBRARY}")
# if (HDF5_IS_PARALLEL) #good here
# message(WARNING "good choice here")
# else()
# message(WARNING "You are using trilinos with mpi support and hdf5 without, do you know what you are doing?")
# endif()
# endif()
#from cmake 2.8 module documentation:
#The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of version numbers that should be # taken into account when searching for Python. You need to set this variable before calling find_package(PythonLibs).
#for manual configuration, set PYTHON_INCLUDE_DIR and PYTHON_LIBRARY
#see also do-configure-tumorcode-lusi.sh script
set(Python_ADDITIONAL_VERSIONS 2.7)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Numpy REQUIRED)
include_directories(${PYTHON_INCLUDE_DIR})
include_directories(${PYTHON_NUMPY_INCLUDE_DIR})#this is needed here so that the whole system uses the same numpy source, if this is let out here the compiler may fall back to default numpy
#this package has a different name on ubuntu14
#so either one of this is needed!
find_package(Boost REQUIRED COMPONENTS "python")
set(myLibs "${myLibs};${Boost_PYTHON_LIBRARY}")
#I have to deal with this on the new arch system
# if( NOT Boost_PYTHON-2.7_FOUND)
# #we are on ubuntu14
# find_package(Boost REQUIRED COMPONENTS "python-py27")
# endif()
# find_package(Boost COMPONENTS "python-py27")
# if( NOT Boost_PYTHON-PY27_FOUND)
# #we are not on ubuntu
# find_package(Boost REQUIRED COMPONENTS "python-2.7")
# endif()
message(STATUS "PYTHON_INCLUDE_DIRS =${PYTHON_INCLUDE_DIRS}")
message(STATUS "PYTHON_LIBRARIES =${PYTHON_LIBRARIES}")
IF(Boost_PYTHON-PY27_FOUND)
message(STATUS "Boost_PYTHON-PY27_LIBRARY =${Boost_PYTHON-PY27_LIBRARY}")
message(STATUS "Boost_PYTHON-PY27_LIBRARY_DEBUG = ${Boost_PYTHON-PY27_LIBRARY_DEBUG}")
message(STATUS "Boost_PYTHON-PY27_LIBRARY_RELEASE = ${Boost_PYTHON-PY27_LIBRARY_RELEASE}")
set(myLibs "${myLibs};${Boost_PYTHON-PY27_LIBRARY}")
ENDIF()
IF(Boost_PYTHON-2.7_FOUND)
message(STATUS "Boost_PYTHON-2.7_LIBRARY =${Boost_PYTHON-2.7_LIBRARY}")
message(STATUS "Boost_PYTHON-2.7_LIBRARY_DEBUG = ${Boost_PYTHON-2.7_LIBRARY_DEBUG}")
message(STATUS "Boost_PYTHON-2.7_LIBRARY_RELEASE = ${Boost_PYTHON-2.7_LIBRARY_RELEASE}")
set(myLibs "${myLibs};${Boost_PYTHON-2.7_LIBRARY}")
ENDIF()
message(STATUS "Numpy include dirs =${PYTHON_NUMPY_INCLUDE_DIR}")
message(STATUS "PYTHON_LIBRARIES =${PYTHON_LIBRARIES}")
#message(STATUS "Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE =${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE}")
message(STATUS "LAPACK lib =${LAPACK_LIBRARIES}")
message(STATUS "BLAS_LIBRARIES = ${BLAS_LIBRARIES}")
message(STATUS "HDF5_CXX_LIBRARIES = ${HDF5_CXX_LIBRARIES}")
message(STATUS "HDF5_C_LIBRARIES = ${HDF5_C_LIBRARIES}")
message(STATUS "HDF5_LIBRARIES = ${HDF5_LIBRARIES}")
message(STATUS "HDF5_LIBRARY_DIRS = ${HDF5_LIBRARY_DIRS}")
message(STATUS "HDF5_INCLUDE_DIRS = ${HDF5_INCLUDE_DIRS}")
message(STATUS "Boost_lib dirs = ${Boost_LIBRARY_DIRS}")
message(STATUS "Boost include dirs = ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}")
#TF: somehow the cmake is broken here, I overwrite with environmental variabels
message(STATUS "TBB_LIBRARIES = $ENV{TBB_LIBRARY_RELEASE}")
set(TBB_LIBRARIES_DIR $ENV{TBB_LIBRARY_RELEASE})
message(STATUS "TBB_INCLUDE_DIR = $ENV{TBB_INCLUDE_DIR}")
set(TBB_INCLUDE_DIRS $ENV{TBB_INCLUDE_DIR})
message(STATUS "Trilinos_dir = ${Trilinos_DIR}")
message(STATUS "Trilinos libs = ${Trilinos_LIBRARIES}")
message(STATUS "Trilinos lib dirs = ${Trilinos_LIBRARY_DIRS}")
message(STATUS "Trilinos include dirs = ${Trilinos_INCLUDE_DIRS}")
include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${Trilinos_INCLUDE_DIRS})
#link_directories(${Trilinos_LIBRARY_DIRS})
include_directories(${HDF5_INCLUDE_DIRS})
link_directories(${HDF5_LIBRARY_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
include_directories(${PNG_INCLUDE_DIRS})
include_directories(${TBB_INCLUDE_DIRS})
link_directories(${TBB_LIBRARIES_DIR})
include_directories(${ADDITIONAL_INCLUDE_DIRS})
link_directories(${ADDITIONAL_LIBRARY_DIRS})
include_directories("src/")
if(Boost_VERSION GREATER 106500)
set(myLibs
${myLibs} #maybe something is already there
common # part of this software
mwlib # part of this software
#tbb
${TBB_LIBRARIES}
${Trilinos_LIBRARIES} # -> trilinos
#${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE}
${Boost_PYTHON_LIBRARY}
${HDF5_LIBRARIES}
${HDF5_CXX_LIBRARIES}
${LAPACK_LIBRARIES}
${BLAS_LIBRARIES}
${PNG_LIBRARIES}
${PYTHON_LIBRARIES}
)
else()
set(myLibs
${myLibs} #maybe something is already there
common # part of this software
mwlib # part of this software
numpycpp #see https://github.com/DaWelter/numpycpp
#tbb
${TBB_LIBRARIES}
${Trilinos_LIBRARIES} # -> trilinos
#${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE}
${Boost_PYTHON_LIBRARY}
${HDF5_LIBRARIES}
${HDF5_CXX_LIBRARIES}
${LAPACK_LIBRARIES}
${BLAS_LIBRARIES}
${PNG_LIBRARIES}
${PYTHON_LIBRARIES}
)
endif()
#message(STATUS "myLibs = ${myLibs}")
### compiler stuff
# this must come first as it overwrites preceeding compiler flags
# need openmp
# all variables propagate down the tree so set up as much as possible here
option(USE_OPENMP CACHE ON)
if (USE_OPENMP)
message(STATUS "openMP: USE_OPENMP preprocessor defined")
find_package(OpenMP REQUIRED)
#add_definitions(-D_OPENMP) #is this done by find_package
if (NOT OPENMP_FOUND)
message(FATAL_ERROR "OpenMP not found")
endif()
message(STATUS "OpenMP_CXX_FLAGS = ${OpenMP_CXX_FLAGS}")
message(STATUS "OpenMP_C_FLAGS = ${OpenMP_C_FLAGS}")
set (CMAKE_C_FLAGS "${OpenMP_C_FLAGS} -DOPENMP_ENABLED=1 ${CMAKE_C_FLAGS} ")
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} -DOPENMP_ENABLED=1 ${CMAKE_CXX_FLAGS}")
#to get rid of the no #pragma warnings
#add_definitions(-DENABLE_OMP)
endif()
# GET_FILENAME_COMPONENT(compiler_name ${CMAKE_C_COMPILER} NAME)
# string(COMPARE EQUAL ${compiler_name} "icc" IS_INTEL_COMPILER)
# if (NOT IS_INTEL_COMPILER)
# message("Set for gnu gxx")
# set(Warnings "-Wall -Wextra -Wno-sign-compare -Wno-reorder -Wno-deprecated -Wuninitialized -Wno-unused-parameter -Wno-unused-variable -Wno-unused-result -Wno-unused-function -Wno-unused-local-typedefs") # -Wno-unknown-pragmas -Wpointer-arith -Wwrite-strings -Woverloaded-virtual -Wno-long-long -Wuninitialized ")
# set(Warnings "${Warnings} -Wno-deprecated-declarations") # -Wswitch -Wno-extra -Wsynth
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Warnings} -pthread -fPIC -ftemplate-depth-128")
# else()
# #1478 is a deprecation warning for auto_ptr
# #set(Warnings "-gcc -cxxlib -wd1478") #gnu++0x
# #set(Warnings "-wd1478") #gnu++0x
# message("Set for intel using:")
# message("CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
# message("CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
# endif()
#always use new c++11 standard
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
# if (IS_INTEL_COMPILER)
# #1478 is a deprecation warning for auto_ptr
# set(Warnings "${Warnings} -wd1478")
# endif()
#-fstrict-aliasing
#[ 82%] Linking CXX shared library lib/libkrebs_.so
#/usr/bin/ld: ../common/lib/libcommon.a(continuum-surfacetension.cpp.o): relocation R_X86_64_PC32 against symbol `_ZN12ConstArray3dI3VecIfLi3EEE12destructFuncEPvm' can not be used when making a shared object; recompile with -fPIC
#/usr/bin/ld: final link failed: Ungültiger Wert
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Warnings} -pthread -fPIC -ftemplate-depth-128")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -g -Wno-unknown-pragmas" )
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O2 -g") # -funroll-all-loops
if (MAX_OPTIMIZATION)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -march=native")
endif()
set(PYTHON_LIB_COMMON_INSTALL_DIR "lib")
#set(CMAKE_SKIP_RPATH TRUE)
set(LIBRARY_OUTPUT_PATH ${PYTHON_LIB_COMMON_INSTALL_DIR})
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# this makes that all executables are placed in the top level build dir
#if (CMAKE_BUILD_TYPE STREQUAL "Release")
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
#message("executables go to ${EXECUTABLE_OUTPUT_PATH}")
#endif()
message(STATUS "myLibs = ${myLibs}")
# defer to build scripts in the src dir
add_subdirectory(src)
add_subdirectory(utils)