From e5f31e4ed38ed8cf61dca5366f5379d571885e51 Mon Sep 17 00:00:00 2001 From: sebastien Date: Mon, 2 Nov 2009 12:04:07 +0000 Subject: [PATCH] Build system: * added dynare_simul_ DLL * factorized in a library object the Dynare++ code shared between gensylv, k_order_perturbation and dynare_simul_ git-svn-id: https://www.dynare.org/svn/dynare/trunk@3114 ac1d8469-bf42-47a9-8791-bf33cf982152 --- mex/build/dynare_simul_.am | 10 +++ mex/build/gensylv.am | 43 ++---------- mex/build/k_order_perturbation.am | 74 +------------------- mex/build/libdynare++.am | 78 ++++++++++++++++++++++ mex/build/matlab/Makefile.am | 3 +- mex/build/matlab/configure.ac | 5 +- mex/build/matlab/dynare_simul_/Makefile.am | 2 + mex/build/matlab/libdynare++/Makefile.am | 2 + mex/build/octave/Makefile.am | 3 +- mex/build/octave/configure.ac | 7 +- mex/build/octave/dynare_simul_/Makefile.am | 2 + mex/build/octave/libdynare++/Makefile.am | 2 + 12 files changed, 116 insertions(+), 115 deletions(-) create mode 100644 mex/build/dynare_simul_.am create mode 100644 mex/build/libdynare++.am create mode 100644 mex/build/matlab/dynare_simul_/Makefile.am create mode 100644 mex/build/matlab/libdynare++/Makefile.am create mode 100644 mex/build/octave/dynare_simul_/Makefile.am create mode 100644 mex/build/octave/libdynare++/Makefile.am diff --git a/mex/build/dynare_simul_.am b/mex/build/dynare_simul_.am new file mode 100644 index 000000000..672adb696 --- /dev/null +++ b/mex/build/dynare_simul_.am @@ -0,0 +1,10 @@ +vpath %.cpp $(top_srcdir)/../../../dynare++/extern/matlab + +noinst_PROGRAMS = dynare_simul_ + +# Can't use gensylv_CPPFLAGS, because it interacts badly with VPATH +CPPFLAGS += -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../sources + +dynare_simul__LDADD = ../libdynare++/libdynare++.a + +nodist_dynare_simul__SOURCES = dynare_simul.cpp diff --git a/mex/build/gensylv.am b/mex/build/gensylv.am index e09be2b7a..ebedd6594 100644 --- a/mex/build/gensylv.am +++ b/mex/build/gensylv.am @@ -1,45 +1,10 @@ -vpath %.cpp $(top_srcdir)/../../../dynare++/sylv/cc $(top_srcdir)/../../../dynare++/sylv/matlab -vpath %.h $(top_srcdir)/../../../dynare++/sylv/cc +vpath %.cpp $(top_srcdir)/../../../dynare++/sylv/matlab noinst_PROGRAMS = gensylv # Can't use gensylv_CPPFLAGS, because it interacts badly with VPATH CPPFLAGS += -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../sources -nodist_gensylv_SOURCES = \ - gensylv.cpp \ - BlockDiagonal.cpp \ - GeneralMatrix.cpp \ - GeneralSylvester.cpp \ - IterativeSylvester.cpp \ - KronUtils.cpp \ - KronVector.cpp \ - QuasiTriangular.cpp \ - QuasiTriangularZero.cpp \ - SchurDecomp.cpp \ - SchurDecompEig.cpp \ - SimilarityDecomp.cpp \ - SylvException.cpp \ - SylvMatrix.cpp \ - SylvMemory.cpp \ - SylvParams.cpp \ - TriangularSylvester.cpp \ - Vector.cpp \ - BlockDiagonal.h \ - GeneralMatrix.h \ - GeneralSylvester.h \ - IterativeSylvester.h \ - KronUtils.h \ - KronVector.h \ - QuasiTriangular.h \ - QuasiTriangularZero.h \ - SchurDecomp.h \ - SchurDecompEig.h \ - SimilarityDecomp.h \ - SylvException.h \ - SylvMatrix.h \ - SylvMemory.h \ - SylvParams.h \ - TriangularSylvester.h \ - Vector.h \ - SylvesterSolver.h +gensylv_LDADD = ../libdynare++/libdynare++.a + +nodist_gensylv_SOURCES = gensylv.cpp diff --git a/mex/build/k_order_perturbation.am b/mex/build/k_order_perturbation.am index 239e767b2..54d7ded32 100644 --- a/mex/build/k_order_perturbation.am +++ b/mex/build/k_order_perturbation.am @@ -1,4 +1,4 @@ -vpath %.cpp $(top_srcdir)/../../sources/k_order_perturbation $(top_srcdir)/../../../dynare++/sylv/cc $(top_srcdir)/../../../dynare++/tl/cc $(top_srcdir)/../../../dynare++/kord $(top_srcdir)/../../../dynare++/integ/cc $(top_srcdir)/../../../dynare++/src +vpath %.cpp $(top_srcdir)/../../sources/k_order_perturbation noinst_PROGRAMS = k_order_perturbation @@ -7,79 +7,11 @@ CPPFLAGS += -I$(top_srcdir)/../../../dynare++/src -I$(top_srcdir)/../../../dynar CXXFLAGS += $(PTHREAD_CFLAGS) -LIBS += $(PTHREAD_LIBS) $(LIBADD_DLOPEN) - -KORD_SRCS = \ - faa_di_bruno.cpp \ - korder_stoch.cpp \ - journal.cpp \ - decision_rule.cpp \ - dynamic_model.cpp \ - random.cpp \ - first_order.cpp \ - normal_conjugate.cpp \ - approximation.cpp \ - global_check.cpp \ - korder.cpp - -SYLV_SRCS = \ - IterativeSylvester.cpp \ - QuasiTriangular.cpp \ - QuasiTriangularZero.cpp \ - GeneralMatrix.cpp \ - GeneralSylvester.cpp \ - SimilarityDecomp.cpp \ - SylvException.cpp \ - SchurDecompEig.cpp \ - Vector.cpp \ - TriangularSylvester.cpp \ - SylvParams.cpp \ - BlockDiagonal.cpp \ - KronVector.cpp \ - SylvMemory.cpp \ - SymSchurDecomp.cpp \ - SylvMatrix.cpp \ - SchurDecomp.cpp \ - KronUtils.cpp - -TL_SRCS = \ - normal_moments.cpp \ - int_sequence.cpp \ - tensor.cpp \ - ps_tensor.cpp \ - pyramid_prod2.cpp \ - equivalence.cpp \ - fine_container.cpp \ - kron_prod.cpp \ - t_polynomial.cpp \ - symmetry.cpp \ - stack_container.cpp \ - twod_matrix.cpp \ - sparse_tensor.cpp \ - sthread.cpp \ - gs_tensor.cpp \ - pyramid_prod.cpp \ - fs_tensor.cpp \ - permutation.cpp \ - rfs_tensor.cpp \ - t_container.cpp \ - tl_static.cpp - -INTEG_SRCS = \ - product.cpp \ - quadrature.cpp \ - quasi_mcarlo.cpp \ - smolyak.cpp \ - vector_function.cpp +k_order_perturbation_LDADD = $(PTHREAD_LIBS) $(LIBADD_DLOPEN) ../libdynare++/libdynare++.a nodist_k_order_perturbation_SOURCES = \ k_order_perturbation.cpp \ k_ord_dynare.cpp \ k_ord_dynare.h \ dynamic_dll.cpp \ - dynamic_dll.h \ - $(KORD_SRCS) \ - $(TL_SRCS) \ - $(SYLV_SRCS) \ - $(INTEG_SRCS) \ - nlsolve.cpp + dynamic_dll.h diff --git a/mex/build/libdynare++.am b/mex/build/libdynare++.am new file mode 100644 index 000000000..bbe523012 --- /dev/null +++ b/mex/build/libdynare++.am @@ -0,0 +1,78 @@ +vpath %.cpp $(top_srcdir)/../../../dynare++/sylv/cc $(top_srcdir)/../../../dynare++/tl/cc $(top_srcdir)/../../../dynare++/kord $(top_srcdir)/../../../dynare++/integ/cc $(top_srcdir)/../../../dynare++/src + +noinst_LIBRARIES = libdynare++.a + +# Can't use k_order_perturbation_CPPFLAGS, because it interacts badly with VPATH +CPPFLAGS += -I$(top_srcdir)/../../../dynare++/src -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/utils/cc -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/integ/cc -I$(top_srcdir)/../../sources + +CXXFLAGS += $(PTHREAD_CFLAGS) + +KORD_SRCS = \ + faa_di_bruno.cpp \ + korder_stoch.cpp \ + journal.cpp \ + decision_rule.cpp \ + dynamic_model.cpp \ + random.cpp \ + first_order.cpp \ + normal_conjugate.cpp \ + approximation.cpp \ + global_check.cpp \ + korder.cpp + +SYLV_SRCS = \ + IterativeSylvester.cpp \ + QuasiTriangular.cpp \ + QuasiTriangularZero.cpp \ + GeneralMatrix.cpp \ + GeneralSylvester.cpp \ + SimilarityDecomp.cpp \ + SylvException.cpp \ + SchurDecompEig.cpp \ + Vector.cpp \ + TriangularSylvester.cpp \ + SylvParams.cpp \ + BlockDiagonal.cpp \ + KronVector.cpp \ + SylvMemory.cpp \ + SymSchurDecomp.cpp \ + SylvMatrix.cpp \ + SchurDecomp.cpp \ + KronUtils.cpp + +TL_SRCS = \ + normal_moments.cpp \ + int_sequence.cpp \ + tensor.cpp \ + ps_tensor.cpp \ + pyramid_prod2.cpp \ + equivalence.cpp \ + fine_container.cpp \ + kron_prod.cpp \ + t_polynomial.cpp \ + symmetry.cpp \ + stack_container.cpp \ + twod_matrix.cpp \ + sparse_tensor.cpp \ + sthread.cpp \ + gs_tensor.cpp \ + pyramid_prod.cpp \ + fs_tensor.cpp \ + permutation.cpp \ + rfs_tensor.cpp \ + t_container.cpp \ + tl_static.cpp + +INTEG_SRCS = \ + product.cpp \ + quadrature.cpp \ + quasi_mcarlo.cpp \ + smolyak.cpp \ + vector_function.cpp + +nodist_libdynare___a_SOURCES = \ + $(KORD_SRCS) \ + $(TL_SRCS) \ + $(SYLV_SRCS) \ + $(INTEG_SRCS) \ + nlsolve.cpp diff --git a/mex/build/matlab/Makefile.am b/mex/build/matlab/Makefile.am index ac99288bc..a7bd8029b 100644 --- a/mex/build/matlab/Makefile.am +++ b/mex/build/matlab/Makefile.am @@ -1,7 +1,8 @@ ACLOCAL_AMFLAGS = -I ../../../m4 +# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_ if DO_SOMETHING -SUBDIRS = mjdgges gensylv kronecker bytecode k_order_perturbation +SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ endif EXTRA_DIST = mex.def mexFunction-MacOSX.map diff --git a/mex/build/matlab/configure.ac b/mex/build/matlab/configure.ac index 22f7f02fb..794ff7c83 100644 --- a/mex/build/matlab/configure.ac +++ b/mex/build/matlab/configure.ac @@ -47,6 +47,7 @@ fi AC_PROG_CC AC_PROG_CXX +AC_PROG_RANLIB AX_PROG_LN_S AX_PTHREAD # Check for dlopen(), needed by k_order_perturbation DLL @@ -59,8 +60,10 @@ AC_CONFIG_FILES([Makefile mjdgges/Makefile kronecker/Makefile gensylv/Makefile + libdynare++/Makefile bytecode/Makefile - k_order_perturbation/Makefile]) + k_order_perturbation/Makefile + dynare_simul_/Makefile]) if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"; then if test x"$ax_pthread_ok" = "xyes"; then diff --git a/mex/build/matlab/dynare_simul_/Makefile.am b/mex/build/matlab/dynare_simul_/Makefile.am new file mode 100644 index 000000000..b7301c554 --- /dev/null +++ b/mex/build/matlab/dynare_simul_/Makefile.am @@ -0,0 +1,2 @@ +include ../mex.am +include ../../dynare_simul_.am diff --git a/mex/build/matlab/libdynare++/Makefile.am b/mex/build/matlab/libdynare++/Makefile.am new file mode 100644 index 000000000..c1283b13c --- /dev/null +++ b/mex/build/matlab/libdynare++/Makefile.am @@ -0,0 +1,2 @@ +include ../mex.am +include ../../libdynare++.am diff --git a/mex/build/octave/Makefile.am b/mex/build/octave/Makefile.am index 3bbb96603..4e70da5e6 100644 --- a/mex/build/octave/Makefile.am +++ b/mex/build/octave/Makefile.am @@ -1,5 +1,6 @@ ACLOCAL_AMFLAGS = -I ../../../m4 +# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_ if DO_SOMETHING -SUBDIRS = mjdgges gensylv kronecker bytecode k_order_perturbation +SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ endif diff --git a/mex/build/octave/configure.ac b/mex/build/octave/configure.ac index 6b6fc0f10..995e94264 100644 --- a/mex/build/octave/configure.ac +++ b/mex/build/octave/configure.ac @@ -33,6 +33,7 @@ fi AC_PROG_CC AC_PROG_CXX +AC_PROG_RANLIB AX_PROG_LN_S AX_PTHREAD # Check for dlopen(), needed by k_order_perturbation DLL @@ -63,8 +64,10 @@ Binaries (with "make"): AC_CONFIG_FILES([Makefile mjdgges/Makefile kronecker/Makefile - gensylv/Makefile bytecode/Makefile - k_order_perturbation/Makefile]) + libdynare++/Makefile + gensylv/Makefile + k_order_perturbation/Makefile + dynare_simul_/Makefile]) AC_OUTPUT diff --git a/mex/build/octave/dynare_simul_/Makefile.am b/mex/build/octave/dynare_simul_/Makefile.am new file mode 100644 index 000000000..b7301c554 --- /dev/null +++ b/mex/build/octave/dynare_simul_/Makefile.am @@ -0,0 +1,2 @@ +include ../mex.am +include ../../dynare_simul_.am diff --git a/mex/build/octave/libdynare++/Makefile.am b/mex/build/octave/libdynare++/Makefile.am new file mode 100644 index 000000000..c1283b13c --- /dev/null +++ b/mex/build/octave/libdynare++/Makefile.am @@ -0,0 +1,2 @@ +include ../mex.am +include ../../libdynare++.am