forked from merzlab/QUICK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
208 lines (164 loc) · 7.79 KB
/
Makefile
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
# !---------------------------------------------------------------------!
# ! Written by Madu Manathunga on 07/17/2020 !
# ! !
# ! Copyright (C) 2020-2021 Merz lab !
# ! Copyright (C) 2020-2021 Götz lab !
# ! !
# ! This Source Code Form is subject to the terms of the Mozilla Public !
# ! License, v. 2.0. If a copy of the MPL was not distributed with this !
# ! file, You can obtain one at http://mozilla.org/MPL/2.0/. !
# !_____________________________________________________________________!
#
# !---------------------------------------------------------------------!
# ! This is the main Makefile for compiling QUICK source code !
# !---------------------------------------------------------------------!
MAKEIN=./make.in
include $(MAKEIN)
# !---------------------------------------------------------------------!
# ! Build targets !
# !---------------------------------------------------------------------!
.PHONY: nobuildtypes serial mpi cuda cudampi all
all:$(BUILDTYPES)
@echo "Building successful."
nobuildtypes:
@echo "Error: No build type found. Plesae run configure script first."
serial: checkfolders
@echo "Building serial version.."
@cp -f $(buildfolder)/make.serial.in $(buildfolder)/make.in
@cd $(buildfolder) && make serial
mpi: checkfolders
@echo "Building mpi version.."
@cp -f $(buildfolder)/make.mpi.in $(buildfolder)/make.in
@cd $(buildfolder) && make mpi
cuda: checkfolders
@echo "Building cuda version.."
@cp -f $(buildfolder)/make.cuda.in $(buildfolder)/make.in
@cd $(buildfolder) && make cuda
cudampi: checkfolders
@echo "Building cuda-mpi version.."
@cp -f $(buildfolder)/make.cudampi.in $(buildfolder)/make.in
@cd $(buildfolder) && make cudampi
checkfolders:
@if [ ! -d $(exefolder) ]; then echo "Error: $(exefolder) not found. Please configure first."; \
exit 1; fi
@if [ ! -d $(buildfolder) ]; then echo "Error: $(buildfolder) not found. Please configure first."; \
exit 1; fi
# !---------------------------------------------------------------------!
# ! Installation targets !
# !---------------------------------------------------------------------!
.PHONY: noinstall install serialinstall mpiinstall cudainstall cudampiinstall aminstall
install: $(INSTALLTYPES)
@echo "Installation sucessful."
@echo ""
@echo "Please add the following into your .bash_profile or .bashrc file."
@echo " export QUICK_BASIS=$(installfolder)/basis"
noinstall:
@echo "Please find QUICK executables in $(exefolder)."
serialinstall:
@if [ -x $(exefolder)/quick ]; then cp -f $(exefolder)/quick $(installfolder)/bin; \
else echo "Error: Executable not found. You must run 'make' before running 'make install'."; \
exit 1; fi
@cp -f $(buildfolder)/include/serial/* $(installfolder)/include/serial
@cp -f $(buildfolder)/lib/serial/* $(installfolder)/lib/serial
mpiinstall:
@if [ -x $(exefolder)/quick.mpi ]; then cp -f $(exefolder)/quick.mpi $(installfolder)/bin; \
else echo "Error: Executable not found. You must run 'make' before running 'make install'."; \
exit 1; fi
@cp -f $(buildfolder)/include/mpi/* $(installfolder)/include/mpi
@cp -f $(buildfolder)/lib/mpi/* $(installfolder)/lib/mpi
cudainstall:
@if [ -x $(exefolder)/quick.cuda ]; then cp -f $(exefolder)/quick.cuda $(installfolder)/bin; \
else echo "Error: Executable not found. You must run 'make' before running 'make install'."; \
exit 1; fi
@cp -f $(exefolder)/quick.cuda $(installfolder)/bin
@cp -f $(buildfolder)/include/cuda/* $(installfolder)/include/cuda
@cp -f $(buildfolder)/lib/cuda/* $(installfolder)/lib/cuda
cudampiinstall:
@if [ -x $(exefolder)/quick.cuda.mpi ]; then cp -f $(exefolder)/quick.cuda.mpi $(installfolder)/bin; \
else echo "Error: Executable not found. You must run 'make' before running 'make install'."; \
exit 1; fi
@cp -f $(exefolder)/quick.cuda.mpi $(installfolder)/bin
@cp -f $(buildfolder)/include/cudampi/* $(installfolder)/include/cudampi
@cp -f $(buildfolder)/lib/cudampi/* $(installfolder)/lib/cudampi
aminstall:
@if [ "$(AMINSTALL)" = 'true' ]; then cp -f $(exefolder)/quick* $(amfolder)/bin; \
echo "Successfully installed QUICK executables in $(amfolder)/bin folder."; \
else echo "Error: You must set the path to AMBER home directory before running 'make aminstall'."; fi
# !---------------------------------------------------------------------!
# ! Installation targets !
# !---------------------------------------------------------------------!
.PHONY: test buildtest installtest
test:$(TESTTYPE)
buildtest:
@cp $(toolsfolder)/runtest $(homefolder)
$(homefolder)/runtest
installtest:
@if [ ! -x $(installfolder)/bin/quick* ]; then \
echo "Error: Executables not found. You must run 'make install' before running 'make test'."; \
exit 1; fi
@cp $(toolsfolder)/runtest $(installfolder)
@cd $(installfolder) && ./runtest
# !---------------------------------------------------------------------!
# ! Cleaning targets !
# !---------------------------------------------------------------------!
.PHONY:serialclean mpiclean cudaclean cudampiclean makeinclean
clean:$(CLEANTYPES)
@-rm -f $(homefolder)/runtest
@echo "Cleaned up successfully."
serialclean:
@cp -f $(buildfolder)/make.serial.in $(buildfolder)/make.in
@cd $(buildfolder) && make --no-print-directory clean
mpiclean:
@cp -f $(buildfolder)/make.mpi.in $(buildfolder)/make.in
@cd $(buildfolder) && make --no-print-directory clean
cudaclean:
@cp -f $(buildfolder)/make.cuda.in $(buildfolder)/make.in
@cd $(buildfolder) && make --no-print-directory clean
cudampiclean:
@cp -f $(buildfolder)/make.cudampi.in $(buildfolder)/make.in
@cd $(buildfolder) && make --no-print-directory clean
distclean: makeinclean
@-rm -f $(homefolder)/runtest
@-rm -rf $(buildfolder) $(exefolder)
@echo "Removed build and bin directories."
makeinclean:
@-rm -f $(libxcfolder)/make.in
@-rm -f $(libxcfolder)/maple2c_device/make.in
@-rm -f $(subfolder)/make.in
@-rm -f $(modfolder)/make.in
@-rm -f $(octfolder)/make.in
@-rm -f $(blasfolder)/make.in
@-rm -f $(cudafolder)/make.in
# !---------------------------------------------------------------------!
# ! Uninstall targets !
# !---------------------------------------------------------------------!
.PHONY: nouninstall uninstall serialuninstall mpiuninstall cudauninstall cudampiuninstall amuninstall
uninstall: $(UNINSTALLTYPES)
@if [ "$(TESTTYPE)" = 'installtest' ]; then rm -rf $(installfolder)/basis; \
rm -rf $(installfolder)/test; fi
@-rm -f $(installfolder)/runtest
@echo "Uninstallation sucessful."
nouninstall:
@echo "Nothing to uninstall."
serialuninstall:
@-rm -f $(installfolder)/bin/quick
@-rm -rf $(installfolder)/include/serial
@-rm -rf $(installfolder)/lib/serial
mpiuninstall:
@-rm -f $(installfolder)/bin/quick.mpi
@-rm -rf $(installfolder)/include/mpi
@-rm -rf $(installfolder)/lib/mpi
cudauninstall:
@-rm -f $(installfolder)/bin/quick.cuda
@-rm -rf $(installfolder)/include/cuda
@-rm -rf $(installfolder)/lib/cuda
cudampiuninstall:
@-rm -f $(installfolder)/bin/quick.cuda.mpi
@-rm -rf $(installfolder)/include/cudampi
@-rm -rf $(installfolder)/lib/cudampi
amuninstall:
@-rm -f $(amfolder)/bin/quick
@-rm -f $(amfolder)/bin/quick.mpi
@-rm -f $(amfolder)/bin/quick.cuda
@-rm -f $(amfolder)/bin/quick.cuda.mpi
@echo "Successfully uninstalled QUICK executables in $(amfolder)/bin folder."