Commit 99eb5e98 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

SWZ: files to build standalone ms-sbvar binaries

parent f2fac8fa
# -*- Makefile -*-
# Generic makefile for IMSL, MKL, blas/lapack, and FORTRAN libraries
# Generic makefile Tao's and Daniel's C routines
# Generic makefile for various machines
# All output is to OUT_DIR
# MACHINE
STANDALONE_HB = STANDALONE_HB
#MACOSX = MACOSX
# LIBRARIES
USE_TAO = USE_TAO
#USE_MKL = USE_MKL
#USE_IMSL = USE_IMSL
USE_LAPACK = USE_LAPACK
USE_FORTRAN = USE_FORTRAN
USE_MATH = USE_MATH
USE_GSL = USE_GSL
#USE_GSL_CBLAS = USE_GSL_CBLAS
WORK_DIR = .
OUT_DIR = ../bin
CFLAGS = -g -DINTELCMATHLIBRARY -ansi
# MACHINE DEPENDENT DIRECTORIES
# LAPTOP
ifdef USE_LAPTOP
WORK_DIR =/home/kalagman/Documents/InternshipJob/Dynare/
OUT_DIR = /home/kalagman/Documents/InternshipJob/Dynare/work/
CC = /usr/bin/gcc-4.3.2
CXX = g++
FC = gfortran
CFLAGS := $(CFLAGS) -static
TAO_DIR = $(WORK_DIR)/utilities/TZCcode
IMSL_BASE_DIR = /opt/vni/CTT6.0
GSL_INCLUDE_DIR = /usr/include/gsl
GSL_LIBS_DIR = /usr/lib
MKL_BASE_DIR = /usr
MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib
MKL_LIBS = -llapack -lblas
NPSOL_DIR = /home/f1dfw14/data/npsol-5.0
FORTRAN_LIBS = /usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/libgfortran.a
endif
ifdef USE_MICHEL_LAPTOP
CC = gcc
CXX = g++
#CC = /opt/intel/Compiler/11.0/074/bin/intel64/icc -no-multibyte-chars
FC = gfortran
CFLAGS := $(CFLAGS) -static
TAO_DIR = $(WORK_DIR)/utilities/TZCcode
GSL_INCLUDE_DIR = /usr/include/gsl
GSL_LIBS_DIR = /usr/lib
INTEL_LIBS_DIR = /opt/intel/Compiler/11.0/074/lib/intel64
INTEL_LIBS = -lguide
MKL_BASE_DIR = /opt/intel/Compiler/11.0/074/mkl
MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib/em64t
MKL_LIBS = -lmkl_lapack -lmkl_em64t
endif
ifdef STANDALONE_HB
CC = gcc
CXX = g++
FC = gfortran
GSL_INCLUDE_DIR = /usr/local64/include/gsl
GSL_LIBS_DIR = /usr/local64/lib
TAO_DIR = $(WORK_DIR)/utilities/TZCcode
endif
#ifdef MACOSX
#MAC_LIBS = #-framework Accelerate #-lmx -lmex -lmat -lstdc++ -L/Applications/MATLAB_R2009b.app/bin/maci64/ -lmwblas -lmwlapack
#CFLAGS := $(CFLAGS) -DMACOSX
#endif
#################################################################################
VPATH =
INCLUDE_DIR = -I/Applications/MATLAB_R2010b.app/extern/include
LIBS_DIR =
LIBS = $(MAC_LIBS)
OBJS =
#################################################################################
### TAO'S FILES #################################################################
# TAO_DIR MUST be defined
ifdef USE_TAO
VPATH := $(VPATH) $(TAO_DIR)
INCLUDE_DIR := $(INCLUDE_DIR) -I$(TAO_DIR)
endif
#################################################################################
### GLS #########################################################################
# GSL_LIBS_DIR and GSL_INCLUDE_DIR muste be defined
ifdef USE_GSL
INCLUDE_DIR := $(INCLUDE_DIR) -I$(GSL_INCLUDE_DIR)
LIBS_DIR := $(LIBS_DIR) -L$(GSL_LIBS_DIR)
LIBS := $(LIBS) -lgsl
endif
#################################################################################
### GLS CBLAS ###################################################################
# GSL_LIBS_DIR and GSL_INCLUDE_DIR muste be defined
ifdef USE_GSL_CBLAS
ifndef USE_GSL
INCLUDE_DIR := $(INCLUDE_DIR) -I$(GSL_INCLUDE_DIR)
LIBS_DIR := $(LIBS_DIR) -L$(GSL_LIBS_DIR)
endif
LIBS := $(LIBS) -lgslcblas
endif
#################################################################################
### IMSL ########################################################################
# IMSL_BASE_DIR must be defined
ifdef USE_IMSL
USE_PTHREAD = USE_PTHREAD
IMSL_LIBS_DIR =$(IMSL_BASE_DIR)/lib/lib.linux_icc
INCLUDE_DIR := $(INCLUDE_DIR) -I$(IMSL_BASE_DIR)/include
LIBS_DIR := $(LIBS_DIR) -L$(IMSL_LIBS_DIR)
LIBS := $(LIBS) $(IMSL_LIBS_DIR)/libimslcmath.a $(IMSL_LIBS_DIR)/libimslcstat.a
endif
#################################################################################
### NPSOL #######################################################################
ifdef USE_NPSOL
NPSOL_LIBS = -lnpsol_f77 -llssol_f77
LIBS_DIR := $(LIBS_DIR) -L$(NPSOL_DIR)
LIBS := $(LIBS) $(NPSOL_LIBS)
endif
#################################################################################
### MKL #########################################################################
# MKL_BASE_DIR and MKL_LIBS must be defined
ifdef USE_MKL
USE_PTHREAD = USE_PTHREAD
INCLUDE_DIR := $(INCLUDE_DIR) -I$(MKL_BASE_DIR)/include
LIBS_DIR := $(LIBS_DIR) -Wl,-rpath=$(MKL_LIBS_DIR) -L$(MKL_LIBS_DIR) -L $(INTEL_LIBS_DIR)
LIBS := $(LIBS) $(MKL_LIBS) $(INTEL_LIBS)
endif
#################################################################################
### BLAS / LAPACK LIBRARIES #####################################################
ifdef USE_LAPACK
ifndef USE_MKL
USE_FORTRAN = USE_FORTRAN
ifdef LAPACK_LIBS_DIR
LIBS_DIR := $(LIBS_DIR) -L$(LAPACK_LIBS_DIR)
endif
LIBS := $(LIBS) -llapack -lblas
endif
endif
#################################################################################
### FORTRAN #####################################################################
# FORTRAN_LIBS should be defined
ifdef USE_FORTRAN
ifdef FORTRAN_LIBS_DIR
LIBS_DIR := $(LIBS_DIR) -L$(FORTRAN_LIBS_DIR)
endif
LIBS := $(LIBS) $(FORTRAN_LIBS)
endif
#################################################################################
### PTHREAD #####################################################################
ifdef USE_PTHREAD
LIBS := $(LIBS) -lpthread
endif
#################################################################################
### MATH LIBRARY ################################################################
ifdef USE_MATH
LIBS := $(LIBS) -lm
endif
#################################################################################
### DW FILES ####################################################################
MATRIX_DIR = $(WORK_DIR)/utilities/DWCcode/matrix
ERROR_DIR = $(WORK_DIR)/utilities/DWCcode/error
ARRAY_DIR = $(WORK_DIR)/utilities/DWCcode/arrays
ASCII_DIR = $(WORK_DIR)/utilities/DWCcode/ascii
HIST_DIR = $(WORK_DIR)/utilities/DWCcode/histogram
STAT_DIR = $(WORK_DIR)/utilities/DWCcode/stat
SPHERICAL_DIR = $(WORK_DIR)/utilities/DWCcode/spherical
SORT_DIR = $(WORK_DIR)/utilities/DWCcode/sort
SWITCH_DIR = $(WORK_DIR)/sbvar/switching
VAR_DIR = $(WORK_DIR)/sbvar/var
#################################################################################
# DW FILES
INCLUDE_DIR := -I$(MATRIX_DIR) -I$(ERROR_DIR) -I$(ARRAY_DIR) -I$(ASCII_DIR) -I$(HIST_DIR) -I$(STAT_DIR) -I$(SPHERICAL_DIR) -I$(SORT_DIR) -I$(SWITCH_DIR) -I$(VAR_DIR) $(INCLUDE_DIR)
VPATH := $(VPATH) $(MATRIX_DIR) $(ERROR_DIR) $(ARRAY_DIR) $(ASCII_DIR) $(HIST_DIR) $(STAT_DIR) $(SPHERICAL_DIR) $(SORT_DIR) $(SWITCH_DIR) $(VAR_DIR)
OBJS := $(OBJS) bmatrix.o swzmatrix.o dw_error.o dw_rand.o dw_matrix_rand.o dw_array.o dw_matrix_array.o dw_matrix_sort.o dw_ascii.o dw_parse_cmd.o dw_histogram.o
# MEX
INCLUDE_DIR := -I$(WORK_DIR)/mex $(INCLUDE_DIR)
VPATH := $(VPATH) $(WORK_DIR)/mex
OBJS := $(OBJS) modify_for_mex.o
# TAO FILES
OBJS := $(OBJS)
# PROJECT FILE
INCLUDE_DIR := $(INCLUDE_DIR)
VPATH := $(VPATH)
OBJS_DRAWS := $(OBJS) PrintDraws.o switch.o switchio.o VARbase.o VARio.o command_line_VAR.o
OBJS_TAO := tzmatlab.o mathlib.o cstz_dw.o
OBJS_ESTIM := $(OBJS) $(OBJS_TAO) estimate.o VARbase.o VARio.o command_line_VAR.o switch.o switchio.o switch_opt.o csminwel.o
OBJS_INIT := $(OBJS) create_init_file.o switch.o switchio.o VARbase.o VARio.o VARio_matlab.o
OBJS_MHM_1 := $(OBJS) mhm_VAR_main_1.o mhm_VAR.o VARbase.o VARio.o command_line_VAR.o switch.o switchio.o
OBJS_MHM_2 := $(OBJS) mhm_VAR_main_2.o spherical.o VARbase.o VARio.o switch.o switchio.o mhm_VAR.o
OBJS_PROBA := $(OBJS) probabilities.o switch.o switchio.o VARbase.o VARio.o command_line_VAR.o
OBJS_FORECAST := $(OBJS) forecast.o switch.o switchio.o VARbase.o VARio.o command_line_VAR.o
#################################################################################
# OUTPUT
all: $(OUT_DIR)/sbvar_draws $(OUT_DIR)/sbvar_estimation $(OUT_DIR)/sbvar_init_file $(OUT_DIR)/sbvar_mhm_1 $(OUT_DIR)/sbvar_mhm_2 $(OUT_DIR)/sbvar_probabilities $(OUT_DIR)/sbvar_forecast
$(OUT_DIR)/sbvar_draws: $(OBJS_DRAWS)
$(CXX) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(OUT_DIR)/sbvar_draws
$(OUT_DIR)/sbvar_estimation: $(OBJS_ESTIM)
$(CXX) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(OUT_DIR)/sbvar_estimation
$(OUT_DIR)/sbvar_init_file: $(OBJS_INIT)
$(CXX) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(OUT_DIR)/sbvar_init_file
$(OUT_DIR)/sbvar_mhm_1: $(OBJS_MHM_1)
$(CXX) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(OUT_DIR)/sbvar_mhm_1
$(OUT_DIR)/sbvar_mhm_2: $(OBJS_MHM_2)
$(CXX) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(OUT_DIR)/sbvar_mhm_2
$(OUT_DIR)/sbvar_probabilities: $(OBJS_PROBA)
$(CXX) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(OUT_DIR)/sbvar_probabilities
$(OUT_DIR)/sbvar_forecast: $(OBJS_FORECAST)
$(CXX) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(OUT_DIR)/sbvar_forecast
%.o : %.c
$(CC) $(CFLAGS) $(INCLUDE_DIR) -fexceptions -c $< -o $@
%.o : %.cc
$(CXX) $(CFLAGS) $(INCLUDE_DIR) -fexceptions -c $< -o $@
#
#################################################################################
clean:
rm -f $(OUT_DIR)/*.o *.o ; rm -f ../bin/*
#
#################################################################################
# -*- Makefile -*-
# Generic makefile for IMSL, MKL, blas/lapack, and FORTRAN libraries
# Generic makefile Tao's and Daniel's C routines
# Generic makefile for various machines
# MACHINE
#USE_HOME=USE_HOME
#USE_LAPTOP=USE_LAPTOP
USE_WORK_64=USE_WORK_64
#USE_WORK_32=USE_WORK_32
#USE_WULF=USE_WULF
# LIBRARIES SUPPORTED
#USE_TZ = USE_TZ
USE_DW = USE_DW
USE_DW_MATRIX = USE_DW_MATRIX
USE_DW_ERROR = USE_DW_ERROR
USE_DW_ARRAY = USE_DW_ARRAY
USE_DW_ASCII = USE_DW_ASCII
USE_DW_STAT = USE_DW_STAT
USE_DW_SORT = USE_DW_SORT
USE_DW_ELLIPTICAL = USE_DW_ELLIPTICAL
USE_DW_HISTO = USE_DW_HISTO
USE_DW_MATH = USE_DW_MATH
USE_DW_SWITCH = USE_DW_SWITCH
USE_DW_STATE_SPACE = USE_DW_STATE_SPACE
#USE_MKL = USE_MKL
#USE_ATLAS = USE_ATLAS
#USE_IMSL = USE_IMSL
USE_LAPACK = USE_LAPACK
#USE_FORTRAN = USE_FORTRAN
USE_MATH = USE_MATH
USE_GSL = USE_GSL
#USE_GSL_CBLAS = USE_GSL_CBLAS
#USE_BOOST = USE_BOOST
#USE_MYSQL_CPP_CONN = USE_MYSQL_CPP_CONN
#USE_LOG4CXX = USE_LOG4CXX
BASE_DIR = .
USE_GCC = USE_GCC
CFLAGS = -g -DSTRUCTURED_COLUMN_MAJOR
#CFLAGS = -g -static
MAKEFILE_DIR = $(BASE_DIR)
include $(MAKEFILE_DIR)/make_machines_master
include $(MAKEFILE_DIR)/make_libraries_master
#################################################################################
# PROJECT PATHS
PROJECT_DIR = $(BASE_DIR)
PROJECT_SRC_DIR = $(BASE_DIR)/switch_dw/state_space/sbvar
EXE_DIR = $(BASE_DIR)
BUILD_DIR = $(BASE_DIR)
INCLUDE_DIR := $(INCLUDE_DIR) -I$(PROJECT_SRC_DIR)
VPATH := $(VPATH) $(PROJECT_SRC_DIR) $(BUILD_DIR)
# INIT_EXEC #####################################################################
# DW FILES
INIT_OBJS = $(OBJS) dw_switch.o dw_switchio.o dw_dirichlet_restrictions.o dw_metropolis_theta.o
# PROJECT FILES
INIT_OBJS := $(INIT_OBJS) create_init_file.o VARbase.o VARio.o VARio_matlab.o
# OUTPUT
INIT_EFILE = $(EXE_DIR)/sbvar_init_file
# EXEC ######################################################################
# DW FILES
EXEC_OBJS = $(OBJS) dw_switch.o dw_switchio.o dw_dirichlet_restrictions.o dw_metropolis_theta.o dw_switch_opt.o dw_mdd_switch.o
# TZ FILES
# EXEC_OBJS := $(EXEC_OBJS) tzmatlab.o csminwel.o
# PROJECT FILES
EXEC_OBJS := $(EXEC_OBJS) VARbase.o VARio.o dw_sbvar_command_line.o sbvar_estimate.o sbvar_simulate.o \
sbvar_probabilities.o sbvar_mdd.o dw_csminwel.o sbvar_impulse_responses.o sbvar_forecast.o
# OUTPUT
EXEC_EFILE = $(EXE_DIR)/sbvar_commandline
#################################################################################
all : INIT_EXEC EXEC
INIT_EXEC : $(INIT_EFILE)
EXEC : $(EXEC_EFILE)
$(INIT_EFILE): $(INIT_OBJS)
$(CC) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(INIT_EFILE)
$(EXEC_EFILE): $(EXEC_OBJS)
$(CC) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(EXEC_EFILE)
%.o : %.c
$(CC) $(CFLAGS) $(INCLUDE_DIR) -c $< -o $(BUILD_DIR)/$@
%.o : %.cpp
$(CC) $(CFLAGS) $(INCLUDE_DIR) -c $< -o $(BUILD_DIR)/$@
#################################################################################
clean:
rm -f $(BUILD_DIR)/*.o sbvar_commandline sbvar_init_file *~
#
#################################################################################
test:
echo "EXE_DIR: $(EXE_DIR)"
echo "BUILD_DIR: $(BUILD_DIR)"
echo "VPATH: $(VPATH)"
echo "INCLUDE_DIR: $(INCLUDE_DIR)"
echo "LIBS_DIR: $(LIBS_DIR)"
echo "OBJS: $(OBJS)"
echo "INIT_OBJS: $(INIT_OBJS)"
echo "EXEC_OBJS: $(EXEC_OBJS)"
# -*- Makefile -*-
# Generic makefile for IMSL, MKL, blas/lapack, and FORTRAN libraries
# Generic makefile Tao's and Dan's C routines
# LIBRARIES SUPPORTED
#USE_TZ - TZ_DIR may be defined
#USE_DW - DW_BASE_DIR may be defined
# USE_DW_MATRIX - matrix.o bmatrix_blas_laback.o dw_error.o
# USE_DW_ERROR - dw_error.o
# USE_DW_ARRAY - dw_array.o (dw_matrix_array.o if USE_DW_MATRIX is set)
# USE_DW_ASCII - dw_ascii.o dw_parse_cmd.o
# 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)
# USE_DW_SORT - dw_matrix_sort.o
# USE_DW_ELLIPTICAL - dw_elliptical.o
# USE_DW_HISTO - dw_histogram.o
# USE_DW_MATH - dw_math.o
# USE_DW_SWITCH - only VPATH is set
# USE_DW_STATE_SPACE - only VPATH is set
# USE_DW_MIXTURE_MODELS - only VPATH is set
#USE_MKL - MKL_BASE_DIR and MKL_LIBS
#USE_ATLAS - ATLAS_LIBS_BASE and ATLAS_LIBS
#USE_IMSL - IMSL_BASE_DIR
#USE_LAPACK - none (LAPACK_LIBS and LAPACK_LIBS_DIR may be defined)
#USE_GSL - none (GSL_LIBS_DIR and GSL_INCLUDE_DIR may be defined)
#USE_GSL_CBLAS - none (GSL_LIBS_DIR and GSL_INCLUDE_DIR may be defined)
#USE_NPSOL - NPSOL_LIBS and NPSOL_DIR
#USE_FORTRAN - none (FORTRAN_LIBS and FORTRAN_DIR may be defined)
#USE_MATH - none
#USE_PTHREAD - none
#USE_BOOST - BOOST_DIR
#USE_MYSQL_CPP_CONN - CPPCONN_DIR
#USE_LOG4CXX - LOG4CXX
#USE_LIBCONFIG - none
### TAO'S FILES #################################################################
ifdef USE_TZ
ifndef TZ_DIR
TZ_DIR=$(BASE_DIR)/TZcode/CFiles
endif
VPATH := $(VPATH) $(TZ_DIR)
INCLUDE_DIR := $(INCLUDE_DIR) -I$(TZ_DIR)
endif
#################################################################################
### DAN'S FILES #################################################################
# DW_BASE_DIR MUST be defined. The directories utilities_dw and switch_dw must
# be subdirectories of DW_BASE_DIR.
ifdef USE_DW
ifndef DW_BASE_DIR
DW_BASE_DIR = $(BASE_DIR)
endif
DW_UTILITIES_BASE = $(DW_BASE_DIR)/utilities_dw
DW_MATRIX_DIR =$(DW_UTILITIES_BASE)/matrix
DW_ERROR_DIR = $(DW_UTILITIES_BASE)/error
DW_ARRAY_DIR = $(DW_UTILITIES_BASE)/arrays
DW_ASCII_DIR = $(DW_UTILITIES_BASE)/ascii
DW_STAT_DIR = $(DW_UTILITIES_BASE)/stat
DW_SORT_DIR = $(DW_UTILITIES_BASE)/sort
DW_HISTO_DIR = $(DW_UTILITIES_BASE)/histogram
DW_ELLIPTICAL_DIR = $(DW_UTILITIES_BASE)/elliptical
DW_MATH_DIR = $(DW_UTILITIES_BASE)/math
DW_SWITCH_BASE = $(DW_BASE_DIR)/switch_dw
DW_SWITCH_DIR = $(DW_SWITCH_BASE)/switching
DW_STATE_SPACE_DIR = $(DW_SWITCH_BASE)/state_space
DW_MIXTURE_MODELS_DIR = $(DW_SWITCH_BASE)/mixture_models
INCLUDE_DIR := $(INCLUDE_DIR) -I$(DW_UTILITIES_BASE)/include
ifdef USE_DW_MATRIX
VPATH := $(VPATH) $(DW_MATRIX_DIR)
OBJS := $(OBJS) dw_matrix.o bmatrix.o
USE_DW_ERROR = USE_DW_ERROR
endif
ifdef USE_DW_ERROR
VPATH := $(VPATH) $(DW_ERROR_DIR)
OBJS := $(OBJS) dw_error.o
endif
ifdef USE_DW_ARRAY
VPATH := $(VPATH) $(DW_ARRAY_DIR)
OBJS := $(OBJS) dw_array.o
ifdef USE_DW_MATRIX
OBJS := $(OBJS) dw_matrix_array.o
endif
endif
ifdef USE_DW_ASCII
VPATH := $(VPATH) $(DW_ASCII_DIR)
OBJS := $(OBJS) dw_ascii.o dw_parse_cmd.o
endif
ifdef USE_DW_STAT
VPATH := $(VPATH) $(DW_STAT_DIR)
ifdef USE_GSL
OBJS := $(OBJS) dw_rand_gsl.o
else
OBJS := $(OBJS) dw_rand.o
endif
ifdef USE_DW_MATRIX
OBJS := $(OBJS) dw_matrix_rand.o
endif
endif
ifdef USE_DW_SORT
VPATH := $(VPATH) $(DW_SORT_DIR)
OBJS := $(OBJS) dw_matrix_sort.o
endif
ifdef USE_DW_HISTO
VPATH := $(VPATH) $(DW_HISTO_DIR)
OBJS := $(OBJS) dw_histogram.o
endif
ifdef USE_DW_ELLIPTICAL
VPATH := $(VPATH) $(DW_ELLIPTICAL_DIR)
OBJS := $(OBJS) dw_elliptical.o
endif
ifdef USE_DW_MATH
VPATH := $(VPATH) $(DW_MATH_DIR)
OBJS := $(OBJS) dw_math.o
endif
ifdef USE_DW_SWITCH
VPATH := $(VPATH) $(DW_SWITCH_DIR)
INCLUDE_DIR := $(INCLUDE_DIR) -I$(DW_SWITCH_DIR)
# dw_dirichlet_restrictions.o dw_mdd_switch.o dw_metropolis_simulation.o
# dw_metropolis_theta.o dw_switch.o dw_switch_opt.o dw_switchio.o dw_temp_output.o
endif
ifdef USE_DW_STATE_SPACE
VPATH := $(VPATH) $(DW_STATE_SPACE_DIR)
INCLUDE_DIR := $(INCLUDE_DIR) -I$(DW_STATE_SPACE_DIR)
# dw_MSStateSpace.o dw_state_space_impulse_response.o dw_state_space_forecast.o
endif
ifdef USE_DW_MIXTURE_MODELS
VPATH := $(VPATH) $(DW_MIXTURE_MODELS_DIR)
INCLUDE_DIR := $(INCLUDE_DIR) -I$(DW_MIXTURE_MODELS_DIR)
# dw_mixture.o
endif
endif
#################################################################################
### GLS #########################################################################
# GSL_LIBS_DIR and GSL_INCLUDE_DIR must be defined. Following GSL convention,
# .h files are in GSL_INCLUDE_DIR/include and this is encoded in the include
# directive
ifdef USE_GSL
ifdef GSL_INCLUDE_DIR
INCLUDE_DIR := $(INCLUDE_DIR) -I$(GSL_INCLUDE_DIR)
endif
ifdef GSL_LIBS_DIR
LIBS_DIR := $(LIBS_DIR) -L$(GSL_LIBS_DIR)
endif
LIBS := $(LIBS) -lgsl
endif
#################################################################################
### GLS CBLAS ###################################################################
# GSL_LIBS_DIR and GSL_INCLUDE_DIR muste be defined
ifdef USE_GSL_CBLAS
ifndef USE_GSL
INCLUDE_DIR := $(INCLUDE_DIR) -I$(GSL_INCLUDE_DIR)
LIBS_DIR := $(LIBS_DIR) -L$(GSL_LIBS_DIR)
endif
LIBS := $(LIBS) -lgslcblas
endif
#################################################################################
### IMSL ########################################################################
# IMSL_BASE_DIR must be defined.
ifdef USE_IMSL
USE_PTHREAD = USE_PTHREAD
IMSL_LIBS_DIR =$(IMSL_BASE_DIR)/lib/lib.linux_icc
INCLUDE_DIR := $(INCLUDE_DIR) -I$(IMSL_BASE_DIR)/include
LIBS_DIR := $(LIBS_DIR) -L$(IMSL_LIBS_DIR)
LIBS := $(LIBS) $(IMSL_LIBS_DIR)/libimslcmath.a $(IMSL_LIBS_DIR)/libimslcstat.a
endif
#################################################################################
### MKL #########################################################################
# MKL_BASE_DIR and MKL_LIBS must be defined. The directory include must be a
# subdirectory of MKL_BASE_DIR.
ifdef USE_MKL
USE_PTHREAD = USE_PTHREAD
INCLUDE_DIR := $(INCLUDE_DIR) -I$(MKL_BASE_DIR)/include
LIBS_DIR := $(LIBS_DIR) -L$(MKL_LIBS_DIR)
LIBS := $(LIBS) $(MKL_LIBS)
endif
#################################################################################
### NPSOL #######################################################################
# NPSOL_DIR must be defined.
ifdef USE_NPSOL
# CFLAGS := $(CFLAGS) -D_NPSOL_ # D_NPSOL is not a standard flag - this should be in make_machine_master
USE_FORTRAN = USE_FORTRAN
NPSOL_LIBS = -lnpsol_f77 -llssol_f77
LIBS_DIR := $(LIBS_DIR) -L$(NPSOL_DIR)
LIBS := $(LIBS) $(NPSOL_LIBS)
endif
#################################################################################
### ATLAS #######################################################################
# ATLAS_LIBS_BASE and ATLAS_LIBS must be defined. The directory lib must be a
# subdirectory of ATLAS_LIBS_BASE.
ifdef USE_ATLAS
USE_PTHREAD = USE_PTHREAD
USE_FORTRAN = USE_FORTRAN
LIBS_DIR := $(LIBS_DIR) -L$(ATLAS_LIBS_BASE)/lib
LIBS := $(LIBS) $(ATLAS_LIBS)
endif
#################################################################################
### BLAS / LAPACK LIBRARIES #####################################################
# LAPACK_LIBS and LAPACK_LIBS_DIR may be defined.
ifdef USE_LAPACK
ifndef USE_MKL
ifndef USE_ATLAS
USE_FORTRAN = USE_FORTRAN
ifdef LAPACK_LIBS_DIR
LIBS_DIR := $(LIBS_DIR) -L$(LAPACK_LIBS_DIR)
endif
ifdef LAPACK_LIBS
LIBS := $(LIBS) $(LAPACK_LIBS)
else
LIBS := $(LIBS) -llapack -lblas
endif
endif
endif
endif
#################################################################################
### FORTRAN #####################################################################
# FORTRAN_LIBS and FORTRAN_LIBS_DIR may be defined.
ifdef USE_FORTRAN
ifdef FORTRAN_LIBS_DIR
LIBS_DIR := $(LIBS_DIR) -L$(FORTRAN_LIBS_DIR)
endif
ifdef FORTRAN_LIBS
LIBS := $(LIBS) $(FORTRAN_LIBS)
endif
endif
#################################################################################
### PTHREAD #####################################################################
ifdef USE_PTHREAD
LIBS := $(LIBS) -lpthread
endif
#################################################################################
### BOOST #######################################################################
# BOOST_DIR must be defined
ifdef USE_BOOST
INCLUDE_DIR := $(INCLUDE_DIR) -I$(BOOST_DIR)/include
LIBS_DIR := $(LIBS_DIR) -L$(BOOST_DIR)/lib
LIBS := $(LIBS) -lboost_thread
endif
#################################################################################
### MySQL C++ Connection ########################################################
# CPPCONN_DIR must be defined
ifdef USE_MYSQL_CPP_CONN