-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
104 lines (88 loc) · 2.62 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
cmake_minimum_required(VERSION 3.20.2)
project(
stanbench
VERSION 0.0.1
LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
set(CMAKE_VERBOSE_MAKEFILE YES)
include(FetchContent)
# Externally provided libraries
FetchContent_Declare(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main)
FetchContent_Declare(googlebenchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG main) # need master for benchmark::benchmark
FetchContent_MakeAvailable(
googletest
googlebenchmark)
FetchContent_Declare(
tbb
GIT_REPOSITORY https://github.com/oneapi-src/oneTBB
GIT_TAG v2021.7.0 # adjust this to the version you need
)
FetchContent_MakeAvailable(tbb)
FetchContent_Declare(
Eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.4.0)
set(EIGEN_BUILD_DOC OFF)
# note: To disable eigen tests,
# you should put this code in a add_subdirectory to avoid to change
# BUILD_TESTING for your own project too since variables are directory
# scoped
set(BUILD_TESTING OFF)
set(EIGEN_BUILD_PKGCONFIG OFF)
FetchContent_MakeAvailable(Eigen)
FetchContent_Declare(
sundials
GIT_REPOSITORY https://github.com/LLNL/sundials
GIT_TAG v6.5.1
# adjust this to the version you need
)
FetchContent_GetProperties(sundials)
if(NOT sundials_POPULATED)
FetchContent_Populate(sundials)
add_subdirectory(${sundials_SOURCE_DIR} ${sundials_BINARY_DIR})
endif()
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
set(BOOST_ENABLE_CMAKE ON)
FetchContent_Declare(
boost
URL https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.gz
)
FetchContent_GetProperties(boost)
if(NOT boost_POPULATED)
FetchContent_Populate(boost)
set(boost_INCLUDE_DIR ${boost_SOURCE_DIR})
endif()
FetchContent_Declare(
stanmath
GIT_REPOSITORY https://github.com/stan-dev/math
GIT_TAG develop # replace with the version you want to use
)
FetchContent_GetProperties(stanmath)
if(NOT stanmath_POPULATED)
FetchContent_Populate(stanmath)
endif()
FetchContent_Declare(
stan
GIT_REPOSITORY https://github.com/stan-dev/stan
GIT_TAG develop # replace with the version you want to use
)
FetchContent_GetProperties(stan)
if(NOT stan_POPULATED)
FetchContent_Populate(stan)
endif()
add_compile_options(
-DNO_FPRINTF_OUTPUT
-DBOOST_DISABLE_ASSERTS
-DTBB_INTERFACE_NEW
-D_REENTRANT
-Wno-deprecated-declarations -O3 -march=native -mtune=native)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
include_directories(benchmarks)
add_subdirectory(benchmarks)