-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (67 loc) · 2.9 KB
/
Makefile
File metadata and controls
84 lines (67 loc) · 2.9 KB
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
# Makefile for example programs that demonstrate different features of
# the Adept library
#
# Note that this Makefile is hand-coded rather than being generated by
# automake
#
# The -DADEPT_RECORDING_PAUSABLE option enables the pause_recording
# and continue_recording functionality and is used by test_adept,
# although it will run correctly (but slightly more slowly) without
# this flag
# The configure script writes the following file, which contains
# variables controlling the compilation
include makefile_include
ADEPT_DIR = /mnt/home/mkuchera/external/Adept-2
LIBTOOL = $(ADEPT_DIR)/libtool
# Uncomment the following to check what happens if thread safety
# disabled
# ADEPT_FLAGS = -DADEPT_STACK_THREAD_UNSAFE
# The objects to create
OBJECTS = HMC_base.o algorithm.o \
test_adept.o BNN.o
#GSL_OBJECTS = test_gsl_interface.o state.o rosenbrock_banana_function.o
#GSL_LIBS = -lgsl
COMPILE_FLAGS = $(CXXFLAGS) $(CPPFLAGS) $(ADEPT_FLAGS) -I$(ADEPT_DIR)/include
# Because we aren't going to install the test programs, and we want
# them to work even if Adept is not installed, it is easiest to use
# libtool to create statically-linked executables
top_builddir = $(ADEPT_DIR)
CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) $(CXXFLAGS) \
-static -no-install -L$(ADEPT_DIR)/adept/.libs $(LDFLAGS) -ladept -o $@
# Dependency on the presence of the Adept static library
LIBADEPT = $(ADEPT_DIR)/adept/.libs/libadept.a
MYLIBS = $(LIBS)
PROGRAMS = test_adept BNN_adept HMC_BNN_adept pMSSM_test
all:
@echo "********************************************************"
@echo "*** To compile test programs in test/ and benchmark/ ***"
@echo "*** type \"make check\" ***"
@echo "********************************************************"
# Compile all four programs
check: $(PROGRAMS)
# Test program 1
test_adept: algorithm.o test_adept.o $(LIBADEPT)
$(CXXLINK) algorithm.o test_adept.o $(MYLIBS)
# Test program 2
BNN_adept: algorithm.o BNN_adept.o $(LIBADEPT)
$(CXXLINK) algorithm.o BNN_adept.o $(MYLIBS)
# Test program 3
HMC_BNN_adept: HMC_base.o algorithm.o BNN.o HMC_BNN_adept.o $(LIBADEPT)
$(CXXLINK) HMC_base.o algorithm.o BNN.o HMC_BNN_adept.o $(MYLIBS)
pMSSM_test: HMC_base.o algorithm.o BNN.o pMSSM_test.o $(LIBADEPT)
$(CXXLINK) HMC_base.o algorithm.o BNN.o pMSSM_test.o $(MYLIBS)
# All other object files created by compiling the corresponding source
# file without this flag
%.o: %.cpp *.h ${ADEPT_DIR}/include/adept.h
$(CXX) $(COMPILE_FLAGS) $(INCLUDES) -c $<
# Remove all object files and executables
clean:
rm -f $(OBJECTS) $(GSL_OBJECTS) $(PROGRAMS)
mostlyclean: clean
# Null targets to satisfy autotools
EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \
install-dvi install-html install-info install-ps install-pdf \
installdirs installcheck distclean maintainer-clean \
dvi pdf ps info html tags ctags
.PHONY: $(EMPTY_AUTOMAKE_TARGETS)
$(EMPTY_AUTOMAKE_TARGETS):