forked from evenmn/VMaChine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
163 lines (143 loc) · 4.7 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
cmake_minimum_required(VERSION 3.10)
project(VMaChine)
find_package(MPI REQUIRED)
# find_package(GTest REQUIRED)
# Set compiler
set(CMAKE_C_COMPILER mpicc)
set(CMAKE_CXX_COMPILER mpicxx)
# Compilation flags used
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -o -DNDEBUG -std=c++14")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
# Add the cmake folder so the FindSphinx module is found
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
# Set default build configuration
if( NOT CMAKE_BUILD_TYPE )
SET(CMAKE_BUILD_TYPE Release)
endif()
# Include directories
include_directories(
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/Activation
${PROJECT_SOURCE_DIR}/src/Basis
${PROJECT_SOURCE_DIR}/src/Hamiltonians
${PROJECT_SOURCE_DIR}/src/InitialStates
${PROJECT_SOURCE_DIR}/src/InitialWeights
${PROJECT_SOURCE_DIR}/src/Interaction
${PROJECT_SOURCE_DIR}/src/Layer
${PROJECT_SOURCE_DIR}/src/Metropolis
${PROJECT_SOURCE_DIR}/src/Optimization
${PROJECT_SOURCE_DIR}/src/RNG
${PROJECT_SOURCE_DIR}/src/WaveFunctions
${PROJECT_SOURCE_DIR}/include
# ${PROJECT_SOURCE_DIR}/include/block
# ${PROJECT_SOURCE_DIR}/src/Eigen
# ${PROJECT_SOURCE_DIR}/src/blocker/c++
# ${PROJECT_SOURCE_DIR}/test
# ${GTEST_INCLUDE_DIRS}
${MPI_INCLUDE_PATH}
)
# Specify which functions to compile
set(SOURCES
src/main.cpp
src/system.cpp
src/parser.cpp
src/printinfo.cpp
src/userinput.cpp
src/elementoperation.cpp
src/Activation/activation.cpp
src/Activation/elu.cpp
src/Activation/leakyrelu.cpp
src/Activation/relu.cpp
src/Activation/purelinear.cpp
src/Activation/sigmoid.cpp
src/Hamiltonians/hamiltonian.cpp
src/Hamiltonians/harmonicoscillator.cpp
src/Hamiltonians/ellipticalharmonicoscillator.cpp
src/Hamiltonians/doublewell.cpp
src/WaveFunctions/wavefunction.cpp
src/InitialStates/initialstate.cpp
src/InitialStates/randomuniform.cpp
src/sampler.cpp
src/InitialStates/randomnormal.cpp
src/Hamiltonians/atomicnucleus.cpp
src/InitialWeights/initialweights.cpp
src/InitialWeights/randomuniform.cpp
src/InitialWeights/randomnormal.cpp
src/InitialWeights/automatize.cpp
src/InitialWeights/xavier.cpp
src/InitialWeights/fromfile.cpp
src/InitialWeights/customized.cpp
src/Interaction/interaction.cpp
src/Interaction/nointeraction.cpp
src/Interaction/coulomb.cpp
src/Layer/layer.cpp
src/Layer/dense.cpp
src/Layer/input.cpp
src/Layer/output.cpp
src/Metropolis/metropolis.cpp
src/Metropolis/bruteforce.cpp
src/Metropolis/importancesampling.cpp
src/InitialWeights/constant.cpp
src/Optimization/optimization.cpp
src/WaveFunctions/gaussian.cpp
src/WaveFunctions/partlyrestricted.cpp
src/WaveFunctions/slaterdeterminant.cpp
src/RNG/rng.cpp
src/RNG/mersennetwister.cpp
src/Optimization/gradientdescent.cpp
src/Basis/basis.cpp
src/Basis/hermite.cpp
#src/Basis/hartreefock.cpp
src/Basis/hydrogenorbital.cpp
#src/Basis/hermiteexpansion.cpp
src/WaveFunctions/hydrogenlike.cpp
src/Optimization/sgd.cpp
src/Optimization/asgd.cpp
src/Optimization/adam.cpp
src/Basis/none.cpp
src/WaveFunctions/padejastrow.cpp
src/WaveFunctions/simplejastrow.cpp
src/WaveFunctions/hardcorejastrow.cpp
src/WaveFunctions/rbmgaussian.cpp
src/WaveFunctions/rbmproduct.cpp
src/WaveFunctions/fnn.cpp
include/block/blocker.cpp
)
#set(TESTSOURCES
# tests/main.cpp
# tests/test_basis.cpp
#)
#set(TEST_EXECUTABLE vmachinetest)
set(PROJECT_EXECUTABLE vmachine)
# Add executable file VMaChine
add_executable(${PROJECT_EXECUTABLE} ${SOURCES})
target_link_libraries(${PROJECT_EXECUTABLE} ${MPI_LIBRARIES})
if(MPI_COMPILE_FLAGS)
set_target_properties(${PROJECT_EXECUTABLE} PROPERTIES
COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
endif()
if(MPI_LINK_FLAGS)
set_target_properties(${PROJECT_EXECUTABLE} PROPERTIES
LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
if(armadillo)
target_link_libraries(${PROJECT_EXECUTABLE} ${ARMADILLO_LIBRARIES})
endif()
# Docs
#add_subdirectory("docs")
# Add test executable file
#add_executable(${TEST_EXECUTABLE} ${TESTSOURCES})
# target_link_libraries(${TEST_EXECUTABLE} ${GTEST_LIBRARIES} ${MPI_LIBRARIES})
#target_link_libraries(${TEST_EXECUTABLE} ${MPI_LIBRARIES})
#add_test(${TEST_EXECUTABLE} ${TEST_EXECUTABLE})
#if(MPI_COMPILE_FLAGS)
# set_target_properties(${TEST_EXECUTABLE} PROPERTIES
# COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
#endif()
#if(MPI_LINK_FLAGS)
# set_target_properties(${TEST_EXECUTABLE} PROPERTIES
# LINK_FLAGS "${MPI_LINK_FLAGS}")
#endif()
# Add library to make source files visible for doxygen
# add_library(SourceFiles ${SOURCES})
# target_include_directories(SourceFiles PUBLIC .)