Commit 965ea728 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Build system: add detection and linking of MatIO library for Estimation DLL under Octave

parent fa3e19fd
...@@ -2,8 +2,11 @@ ACLOCAL_AMFLAGS = -I ../../../m4 ...@@ -2,8 +2,11 @@ ACLOCAL_AMFLAGS = -I ../../../m4
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_ # libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
if DO_SOMETHING if DO_SOMETHING
SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ logposterior logMHMCMCposterior qzcomplex ordschur libslicot kalman_steady_state SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ qzcomplex ordschur libslicot kalman_steady_state
if HAVE_GSL if HAVE_GSL
SUBDIRS += swz SUBDIRS += swz
endif endif
if HAVE_MATIO
SUBDIRS += logposterior logMHMCMCposterior
endif
endif endif
...@@ -59,6 +59,12 @@ AC_SUBST([LIBADD_DLOPEN]) ...@@ -59,6 +59,12 @@ AC_SUBST([LIBADD_DLOPEN])
AX_GSL AX_GSL
AM_CONDITIONAL([HAVE_GSL], [test "x$has_gsl" = "xyes"]) AM_CONDITIONAL([HAVE_GSL], [test "x$has_gsl" = "xyes"])
# Check for libmatio, needed by estimation DLL (only under Octave, as an alternative to MATLAB's libmat)
AC_CHECK_HEADER([matio.h])
AC_CHECK_LIB([matio], [Mat_Open], [LIBADD_MATIO="-lmatio"])
AC_SUBST([LIBADD_MATIO])
AM_CONDITIONAL([HAVE_MATIO], [test "x$ac_cv_header_matio_h" = "xyes" -a "x$ac_cv_lib_matio_Mat_Open" = "xyes"])
AM_CONDITIONAL([DO_SOMETHING], [test "x$MKOCTFILE" != "x"]) AM_CONDITIONAL([DO_SOMETHING], [test "x$MKOCTFILE" != "x"])
if test "x$MKOCTFILE" != "x"; then if test "x$MKOCTFILE" != "x"; then
...@@ -77,6 +83,12 @@ else ...@@ -77,6 +83,12 @@ else
BUILD_SWZ_MEX_OCTAVE="no (missing GSL)" BUILD_SWZ_MEX_OCTAVE="no (missing GSL)"
fi fi
if test "x$MKOCTFILE" != "x" -a "x$ac_cv_header_matio_h" = "xyes" -a "x$ac_cv_lib_matio_Mat_Open" = "xyes"; then
BUILD_ESTIMATION_MEX_OCTAVE="yes"
else
BUILD_ESTIMATION_MEX_OCTAVE="no (missing MatIO library)"
fi
AC_ARG_ENABLE([openmp], AS_HELP_STRING([--enable-openmp], [use OpenMP for parallelization of some MEX files]), [ AC_ARG_ENABLE([openmp], AS_HELP_STRING([--enable-openmp], [use OpenMP for parallelization of some MEX files]), [
if test "x$enable_openmp" = "xyes"; then if test "x$enable_openmp" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_OMP" CPPFLAGS="$CPPFLAGS -DUSE_OMP"
...@@ -92,6 +104,7 @@ Dynare is now configured for building the following components... ...@@ -92,6 +104,7 @@ Dynare is now configured for building the following components...
Binaries (with "make"): Binaries (with "make"):
MEX files for Octave (except SWZ): $BUILD_MEX_OCTAVE MEX files for Octave (except SWZ): $BUILD_MEX_OCTAVE
SWZ MEX files for Octave: $BUILD_SWZ_MEX_OCTAVE SWZ MEX files for Octave: $BUILD_SWZ_MEX_OCTAVE
Estimation MEX for Octave: $BUILD_ESTIMATION_MEX_OCTAVE
]) ])
......
EXEEXT = .mex EXEEXT = .mex
include ../mex.am include ../mex.am
include ../../logMHMCMCposterior.am include ../../logMHMCMCposterior.am
logMHMCMCposterior_LDADD += $(LIBADD_MATIO)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment