Debian Codegraph @

contrib/ms-sbvar/make_libraries_master

raw
1 # -*- Makefile -*-
2 # Generic makefile for IMSL, MKL, blas/lapack, and FORTRAN libraries
3 # Generic makefile Tao's and Dan's C routines
4
5 # LIBRARIES SUPPORTED
6 #USE_TZ - TZ_DIR may be defined
7 #USE_DW - DW_BASE_DIR may be defined
8 # USE_DW_MATRIX - matrix.o bmatrix_blas_laback.o dw_error.o
9 # USE_DW_ERROR - dw_error.o
10 # USE_DW_ARRAY - dw_array.o (dw_matrix_array.o if USE_DW_MATRIX is set)
11 # USE_DW_ASCII - dw_ascii.o dw_parse_cmd.o
12 # USE_DW_STAT - dw_rand_gsl.o if USE_GSL is set, otherwise dw_rand.o (dw_matrix_rand.o if USE_DW_MATRIX is set)
13 # USE_DW_SORT - dw_matrix_sort.o
14 # USE_DW_ELLIPTICAL - dw_elliptical.o
15 # USE_DW_HISTO - dw_histogram.o
16 # USE_DW_MATH - dw_math.o
17 # USE_DW_SWITCH - only VPATH is set
18 # USE_DW_STATE_SPACE - only VPATH is set
19 # USE_DW_MIXTURE_MODELS - only VPATH is set
20 #USE_MKL - MKL_BASE_DIR and MKL_LIBS
21 #USE_ATLAS - ATLAS_LIBS_BASE and ATLAS_LIBS
22 #USE_IMSL - IMSL_BASE_DIR
23 #USE_LAPACK - none (LAPACK_LIBS and LAPACK_LIBS_DIR may be defined)
24 #USE_GSL - none (GSL_LIBS_DIR and GSL_INCLUDE_DIR may be defined)
25 #USE_GSL_CBLAS - none (GSL_LIBS_DIR and GSL_INCLUDE_DIR may be defined)
26 #USE_NPSOL - NPSOL_LIBS and NPSOL_DIR
27 #USE_FORTRAN - none (FORTRAN_LIBS and FORTRAN_DIR may be defined)
28 #USE_MATH - none
29 #USE_PTHREAD - none
30 #USE_BOOST - BOOST_DIR
31 #USE_MYSQL_CPP_CONN - CPPCONN_DIR
32 #USE_LOG4CXX - LOG4CXX
33 #USE_LIBCONFIG - none
34
35
36 ### TAO'S FILES #################################################################
37 ifdef USE_TZ
38 ifndef TZ_DIR
39 TZ_DIR=$(BASE_DIR)/TZcode/CFiles
40 endif
41 VPATH := $(VPATH) $(TZ_DIR)
42 INCLUDE_DIR := $(INCLUDE_DIR) -I$(TZ_DIR)
43 endif
44 #################################################################################
45
46 ### DAN'S FILES #################################################################
47 # DW_BASE_DIR MUST be defined. The directories utilities_dw and switch_dw must
48 # be subdirectories of DW_BASE_DIR.
49 ifdef USE_DW
50 ifndef DW_BASE_DIR
51 DW_BASE_DIR = $(BASE_DIR)
52 endif
53
54 DW_UTILITIES_BASE = $(DW_BASE_DIR)/utilities_dw
55 DW_MATRIX_DIR =$(DW_UTILITIES_BASE)/matrix
56 DW_ERROR_DIR = $(DW_UTILITIES_BASE)/error
57 DW_ARRAY_DIR = $(DW_UTILITIES_BASE)/arrays
58 DW_ASCII_DIR = $(DW_UTILITIES_BASE)/ascii
59 DW_STAT_DIR = $(DW_UTILITIES_BASE)/stat
60 DW_SORT_DIR = $(DW_UTILITIES_BASE)/sort
61 DW_HISTO_DIR = $(DW_UTILITIES_BASE)/histogram
62 DW_ELLIPTICAL_DIR = $(DW_UTILITIES_BASE)/elliptical
63 DW_MATH_DIR = $(DW_UTILITIES_BASE)/math
64
65 DW_SWITCH_BASE = $(DW_BASE_DIR)/switch_dw
66 DW_SWITCH_DIR = $(DW_SWITCH_BASE)/switching
67 DW_STATE_SPACE_DIR = $(DW_SWITCH_BASE)/state_space
68 DW_MIXTURE_MODELS_DIR = $(DW_SWITCH_BASE)/mixture_models
69
70 INCLUDE_DIR := $(INCLUDE_DIR) -I$(DW_UTILITIES_BASE)/include
71
72 ifdef USE_DW_MATRIX
73 VPATH := $(VPATH) $(DW_MATRIX_DIR)
74 OBJS := $(OBJS) dw_matrix.o bmatrix.o
75 USE_DW_ERROR = USE_DW_ERROR
76 endif
77 ifdef USE_DW_ERROR
78 VPATH := $(VPATH) $(DW_ERROR_DIR)
79 OBJS := $(OBJS) dw_error.o
80 endif
81 ifdef USE_DW_ARRAY
82 VPATH := $(VPATH) $(DW_ARRAY_DIR)
83 OBJS := $(OBJS) dw_array.o
84 ifdef USE_DW_MATRIX
85 OBJS := $(OBJS) dw_matrix_array.o
86 endif
87 endif
88 ifdef USE_DW_ASCII
89 VPATH := $(VPATH) $(DW_ASCII_DIR)
90 OBJS := $(OBJS) dw_ascii.o dw_parse_cmd.o
91 endif
92 ifdef USE_DW_STAT
93 VPATH := $(VPATH) $(DW_STAT_DIR)
94 ifdef USE_GSL
95 OBJS := $(OBJS) dw_rand_gsl.o
96 else
97 OBJS := $(OBJS) dw_rand.o
98 endif
99 ifdef USE_DW_MATRIX
100 OBJS := $(OBJS) dw_matrix_rand.o
101 endif
102 endif
103 ifdef USE_DW_SORT
104 VPATH := $(VPATH) $(DW_SORT_DIR)
105 OBJS := $(OBJS) dw_matrix_sort.o
106 endif
107 ifdef USE_DW_HISTO
108 VPATH := $(VPATH) $(DW_HISTO_DIR)
109 OBJS := $(OBJS) dw_histogram.o
110 endif
111 ifdef USE_DW_ELLIPTICAL
112 VPATH := $(VPATH) $(DW_ELLIPTICAL_DIR)
113 OBJS := $(OBJS) dw_elliptical.o
114 endif
115 ifdef USE_DW_MATH
116 VPATH := $(VPATH) $(DW_MATH_DIR)
117 OBJS := $(OBJS) dw_math.o
118 endif
119
120 ifdef USE_DW_SWITCH
121 VPATH := $(VPATH) $(DW_SWITCH_DIR)
122 INCLUDE_DIR := $(INCLUDE_DIR) -I$(DW_SWITCH_DIR)
123 # dw_dirichlet_restrictions.o dw_mdd_switch.o dw_metropolis_simulation.o
124 # dw_metropolis_theta.o dw_switch.o dw_switch_opt.o dw_switchio.o dw_temp_output.o
125 endif
126 ifdef USE_DW_STATE_SPACE
127 VPATH := $(VPATH) $(DW_STATE_SPACE_DIR)
128 INCLUDE_DIR := $(INCLUDE_DIR) -I$(DW_STATE_SPACE_DIR)
129 # dw_MSStateSpace.o dw_state_space_impulse_response.o dw_state_space_forecast.o
130 endif
131 ifdef USE_DW_MIXTURE_MODELS
132 VPATH := $(VPATH) $(DW_MIXTURE_MODELS_DIR)
133 INCLUDE_DIR := $(INCLUDE_DIR) -I$(DW_MIXTURE_MODELS_DIR)
134 # dw_mixture.o
135 endif
136 endif
137 #################################################################################
138
139 ### GLS #########################################################################
140 # GSL_LIBS_DIR and GSL_INCLUDE_DIR must be defined. Following GSL convention,
141 # .h files are in GSL_INCLUDE_DIR/include and this is encoded in the include
142 # directive
143 ifdef USE_GSL
144 ifdef GSL_INCLUDE_DIR
145 INCLUDE_DIR := $(INCLUDE_DIR) -I$(GSL_INCLUDE_DIR)
146 endif
147 ifdef GSL_LIBS_DIR
148 LIBS_DIR := $(LIBS_DIR) -L$(GSL_LIBS_DIR)
149 endif
150 LIBS := $(LIBS) -lgsl
151 endif
152 #################################################################################
153
154 ### GLS CBLAS ###################################################################
155 # GSL_LIBS_DIR and GSL_INCLUDE_DIR muste be defined
156 ifdef USE_GSL_CBLAS
157 ifndef USE_GSL
158 INCLUDE_DIR := $(INCLUDE_DIR) -I$(GSL_INCLUDE_DIR)
159 LIBS_DIR := $(LIBS_DIR) -L$(GSL_LIBS_DIR)
160 endif
161 LIBS := $(LIBS) -lgslcblas
162 endif
163 #################################################################################
164
165 ### IMSL ########################################################################
166 # IMSL_BASE_DIR must be defined.
167 ifdef USE_IMSL
168 USE_PTHREAD = USE_PTHREAD
169 IMSL_LIBS_DIR =$(IMSL_BASE_DIR)/lib/lib.linux_icc
170 INCLUDE_DIR := $(INCLUDE_DIR) -I$(IMSL_BASE_DIR)/include
171 LIBS_DIR := $(LIBS_DIR) -L$(IMSL_LIBS_DIR)
172 LIBS := $(LIBS) $(IMSL_LIBS_DIR)/libimslcmath.a $(IMSL_LIBS_DIR)/libimslcstat.a
173 endif
174 #################################################################################
175
176 ### MKL #########################################################################
177 # MKL_BASE_DIR and MKL_LIBS must be defined. The directory include must be a
178 # subdirectory of MKL_BASE_DIR.
179 ifdef USE_MKL
180 USE_PTHREAD = USE_PTHREAD
181 INCLUDE_DIR := $(INCLUDE_DIR) -I$(MKL_BASE_DIR)/include
182 LIBS_DIR := $(LIBS_DIR) -L$(MKL_LIBS_DIR)
183 LIBS := $(LIBS) $(MKL_LIBS)
184 endif
185 #################################################################################
186
187 ### NPSOL #######################################################################
188 # NPSOL_DIR must be defined.
189 ifdef USE_NPSOL
190 # CFLAGS := $(CFLAGS) -D_NPSOL_ # D_NPSOL is not a standard flag - this should be in make_machine_master
191 USE_FORTRAN = USE_FORTRAN
192 NPSOL_LIBS = -lnpsol_f77 -llssol_f77
193 LIBS_DIR := $(LIBS_DIR) -L$(NPSOL_DIR)
194 LIBS := $(LIBS) $(NPSOL_LIBS)
195 endif
196 #################################################################################
197
198 ### ATLAS #######################################################################
199 # ATLAS_LIBS_BASE and ATLAS_LIBS must be defined. The directory lib must be a
200 # subdirectory of ATLAS_LIBS_BASE.
201 ifdef USE_ATLAS
202 USE_PTHREAD = USE_PTHREAD
203 USE_FORTRAN = USE_FORTRAN
204 LIBS_DIR := $(LIBS_DIR) -L$(ATLAS_LIBS_BASE)/lib
205 LIBS := $(LIBS) $(ATLAS_LIBS)
206 endif
207 #################################################################################
208
209 ### BLAS / LAPACK LIBRARIES #####################################################
210 # LAPACK_LIBS and LAPACK_LIBS_DIR may be defined.
211 ifdef USE_LAPACK
212 ifndef USE_MKL
213 ifndef USE_ATLAS
214 USE_FORTRAN = USE_FORTRAN
215 ifdef LAPACK_LIBS_DIR
216 LIBS_DIR := $(LIBS_DIR) -L$(LAPACK_LIBS_DIR)
217 endif
218 ifdef LAPACK_LIBS
219 LIBS := $(LIBS) $(LAPACK_LIBS)
220 else
221 LIBS := $(LIBS) -llapack -lblas
222 endif
223 endif
224 endif
225 endif
226 #################################################################################
227
228 ### FORTRAN #####################################################################
229 # FORTRAN_LIBS and FORTRAN_LIBS_DIR may be defined.
230 ifdef USE_FORTRAN
231 ifdef FORTRAN_LIBS_DIR
232 LIBS_DIR := $(LIBS_DIR) -L$(FORTRAN_LIBS_DIR)
233 endif
234 ifdef FORTRAN_LIBS
235 LIBS := $(LIBS) $(FORTRAN_LIBS)
236 endif
237 endif
238 #################################################################################
239
240 ### PTHREAD #####################################################################
241 ifdef USE_PTHREAD
242 LIBS := $(LIBS) -lpthread
243 endif
244 #################################################################################
245
246 ### BOOST #######################################################################
247 # BOOST_DIR must be defined
248 ifdef USE_BOOST
249 INCLUDE_DIR := $(INCLUDE_DIR) -I$(BOOST_DIR)/include
250 LIBS_DIR := $(LIBS_DIR) -L$(BOOST_DIR)/lib
251 LIBS := $(LIBS) -lboost_thread
252 endif
253 #################################################################################
254
255 ### MySQL C++ Connection ########################################################
256 # CPPCONN_DIR must be defined
257 ifdef USE_MYSQL_CPP_CONN
258 INCLUDE_DIR := $(INCLUDE_DIR) -I$(CPPCONN_DIR)/cppconn
259 LIBS_DIR := $(LIBS_DIR) -L$(CPPCONN_DIR)/driver -L/usr/lib64/mysql -L/usr/lib64
260 LIBS := $(LIBS) -lmysqlcppconn-static -lmysqlclient -lz -lcrypt -lnsl -lm -lssl -lcrypto
261 endif
262 #################################################################################
263
264 ### LOG4CXX #####################################################################
265 # LOG4CXX must be defined
266 ifdef USE_LOG4CXX
267 INCLUDE_DIR := $(INCLUDE_DIR) -I$(LOG4CXX_DIR)/include
268 LIBS_DIR := $(LIBS_DIR) -L$(LOG4CXX_DIR)/lib
269 LIBS := $(LIBS) -llog4cxx
270 endif
271 #################################################################################
272
273 ### MATH LIBRARY ################################################################
274 ifdef USE_MATH
275 LIBS := $(LIBS) -lm
276 endif
277 #################################################################################
278
279 ### LIBCONFIG LIBRARY ###########################################################
280 ifdef USE_LIBCONFIG
281 LIBS := $(LIBS) -lconfig
282 endif
283 #################################################################################