-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
92 lines (78 loc) · 2.43 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
cmake_minimum_required(VERSION 2.8)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
project(fk_mc CXX)
set(FK_MC_VERSION 0.1)
# check ../cmake/BoldHybCommondModuleDefinitions.cmake for all of the macro/functions below
include(CommonDefs)
# Disable build in source
no_source_builds()
# Rpath to absoulte path
fix_rpath()
# Workarounds for bugs in compilers
compiler_workarounds()
# C++11
option(AutoSetCXX11 "Auto set c++11 flags" ON)
if (AutoSetCXX11)
set_cxx11()
endif (AutoSetCXX11)
option(FKMC_COMPLEX_MATRIX_ELEMENTS "Use complex matrix elements" OFF)
# Print build type
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
set (fk_mc_src
mc_metropolis
lattice
lattice/hypercubic
lattice/graph
configuration
moves
measures/energy
measures/spectrum
measures/spectrum_history
measures/focc_history
fk_mc
)
if (NOT FKMC_COMPLEX_MATRIX_ELEMENTS)
set (fk_mc_src ${fk_mc_src} moves_chebyshev measures/eigenfunctions
)
endif(FKMC_COMPLEX_MATRIX_ELEMENTS)
#add_definitions("-Wno-deprecated-register -Wno-mismatched-new-delete")
include_directories(${CMAKE_SOURCE_DIR}/include/fk_mc ${CMAKE_BINARY_DIR}/include/fk_mc)
add_this_package(${fk_mc_src})
# Dependencies
add_alpscore()
add_eigen3()
add_gftools()
add_boost(mpi)
add_fftw3()
find_package (Arpack)
message(STATUS "Arpack libraries: " ${ARPACK_LIBRARIES} )
target_link_libraries(${PROJECT_NAME} PUBLIC ${ARPACK_LIBRARIES})
#configure compile definitions file
configure_file(${CMAKE_SOURCE_DIR}/include/fk_mc/definitions.hpp.in ${CMAKE_BINARY_DIR}/include/fk_mc/definitions.hpp)
# build executable
option(Execs "Enable executables" ON)
if (Execs)
list(APPEND all_lattices cubic1d cubic2d cubic3d)
list(LENGTH LATTICES lattice_len)
if (${lattice_len} EQUAL 0)
set(LATTICES ${all_lattices})
endif()
set (lattices ${LATTICES} CACHE STRING "Lattices for FK MC calculation" FORCE)
add_subdirectory(prog)
endif (Execs)
option(Benchmark "Enable benchmark" OFF)
option(Testing "Enable testing" OFF)
if (Benchmark OR Testing)
include(EnableGtests) #defined in common/cmake
include_directories(${gtest_INCLUDE_DIR})
endif()
if (Benchmark)
message(STATUS "Building benchmark")
add_subdirectory(benchmark)
endif (Benchmark)
if (Testing)
enable_testing()
add_subdirectory(test)
endif(Testing)
### Additional installation files
configure_file("${CMAKE_SOURCE_DIR}/fk_mc.lmod.in" "${CMAKE_BINARY_DIR}/${FK_MC_VERSION}")