Added build system for Octave MEX files

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2932 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
sebastien 2009-09-16 13:49:47 +00:00
parent 705d1a78ff
commit 83c3023274
12 changed files with 142 additions and 1 deletions

View File

@ -1,4 +1,4 @@
SUBDIRS = preprocessor doc tests
SUBDIRS = preprocessor doc tests mex/build
if HAVE_CTANGLE
if HAVE_BLAS

View File

@ -30,6 +30,7 @@ AC_LANG([C++])
CXXFLAGS="$CXXFLAGS -Wall"
AC_PROG_RANLIB
AC_PROG_LN_S
AM_PROG_LEX
AX_PROG_FLEX([], AC_MSG_ERROR([No suitable flex found.]))
@ -71,6 +72,9 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN" != "x"])
AC_CHECK_PROG([OCTAVE], [octave], [octave])
AM_CONDITIONAL([HAVE_OCTAVE], [test "x$OCTAVE" != "x"])
AC_CHECK_PROG([MKOCTFILE], [mkoctfile], [mkoctfile])
AM_CONDITIONAL([HAVE_MKOCTFILE], [test "x$MKOCTFILE" != "x"])
AC_CHECK_PROG([CTANGLE], [ctangle], [ctangle])
AM_CONDITIONAL([HAVE_CTANGLE], [test "x$CTANGLE" != "x"])
@ -121,6 +125,11 @@ AC_CONFIG_FILES([Makefile
dynare++/integ/testing/Makefile
dynare++/kord/Makefile
dynare++/src/Makefile
mex/build/Makefile
mex/build/mjdgges/octave/Makefile
mex/build/kronecker/octave/Makefile
mex/build/gensylv/octave/Makefile
mex/build/bytecode/octave/Makefile
])
# Construct final output message
@ -169,6 +178,12 @@ else
BUILD_DYNARE_PREPROC_DOC="no (missing doxygen)"
fi
if test "x$MKOCTFILE" != "x"; then
BUILD_MEX_OCTAVE="yes"
else
BUILD_MEX_OCTAVE="no (missing mkoctfile)"
fi
if test "x$OCTAVE" != "x"; then
TESTSUITE_OCTAVE="yes"
else
@ -187,6 +202,7 @@ Dynare is now configured for building the following components...
Binaries (with "make"):
Dynare preprocessor: $BUILD_PREPROCESSOR
MEX files for Octave: $BUILD_MEX_OCTAVE
Dynare++: $BUILD_DYNAREPLUSPLUS
PDF documentation (with "make pdf"):

11
mex/build/Makefile.am Normal file
View File

@ -0,0 +1,11 @@
SUBDIRS =
if HAVE_MKOCTFILE
SUBDIRS += mjdgges/octave kronecker/octave gensylv/octave bytecode/octave
endif
EXTRA_DIST = \
../sources/matlab_versions_compatibility.h \
../sources/build_matlab.m \
../sources/build_matlab_multithread.m \
../sources/build_octave.m

16
mex/build/bytecode.am Normal file
View File

@ -0,0 +1,16 @@
VPATH = $(top_srcdir)/mex/sources/bytecode
noinst_PROGRAMS = bytecode
# bytecode_CPPFLAGS interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/mex/sources/bytecode -I$(top_srcdir)/preprocessor
bytecode_SOURCES = \
bytecode.cc \
Interpreter.cc \
Mem_Mngr.cc \
SparseMatrix.cc \
bytecode.hh \
Interpreter.hh \
Mem_Mngr.hh \
SparseMatrix.hh

View File

@ -0,0 +1,2 @@
include ../../mkoctfile.am
include ../../bytecode.am

47
mex/build/gensylv.am Normal file
View File

@ -0,0 +1,47 @@
VPATH = $(top_srcdir)/mex/sources/gensylv/cc:$(top_srcdir)/mex/sources/gensylv/matlab
noinst_PROGRAMS = gensylv
# Can't use gensylv_CPPFLAGS, because it interacts badly with VPATH
CPPFLAGS += -DMATLAB -I$(top_srcdir)/mex/sources/gensylv/cc
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 \
cppblas.h \
cpplapack.h \
SylvesterSolver.h

View File

@ -0,0 +1,2 @@
include ../../mkoctfile.am
include ../../gensylv.am

6
mex/build/kronecker.am Normal file
View File

@ -0,0 +1,6 @@
VPATH = $(top_srcdir)/mex/sources/kronecker
noinst_PROGRAMS = sparse_hessian_times_B_kronecker_C A_times_B_kronecker_C
sparse_hessian_times_B_kronecker_C_SOURCES = sparse_hessian_times_B_kronecker_C.cc
A_times_B_kronecker_C_SOURCES = A_times_B_kronecker_C.cc

View File

@ -0,0 +1,2 @@
include ../../mkoctfile.am
include ../../kronecker.am

5
mex/build/mjdgges.am Normal file
View File

@ -0,0 +1,5 @@
VPATH = $(top_srcdir)/mex/sources/mjdgges
noinst_PROGRAMS = mjdgges
mjdgges_SOURCES = mjdgges.c

View File

@ -0,0 +1,2 @@
include ../../mkoctfile.am
include ../../mjdgges.am

32
mex/build/mkoctfile.am Normal file
View File

@ -0,0 +1,32 @@
EXEEXT = .mex
CPPFLAGS = $(shell $(MKOCTFILE) -p CPPFLAGS)
DEFS = -DNO_BLAS_H -DNO_LAPACK_H -DOCTAVE
CC = $(shell $(MKOCTFILE) -p CC)
CFLAGS = $(shell $(MKOCTFILE) -p CPICFLAG)
CFLAGS += $(shell $(MKOCTFILE) -p ALL_CFLAGS)
CXX = $(shell $(MKOCTFILE) -p CXX)
CXXFLAGS = $(shell $(MKOCTFILE) -p CXXPICFLAG)
CXXFLAGS += $(shell $(MKOCTFILE) -p ALL_CXXFLAGS)
LDFLAGS = $(shell $(MKOCTFILE) -p DL_LDFLAGS)
LDFLAGS += $(shell $(MKOCTFILE) -p LFLAGS)
LDFLAGS += $(shell $(MKOCTFILE) -p LDFLAGS)
LIBS = $(shell $(MKOCTFILE) -p OCTAVE_LIBS)
LIBS += $(shell $(MKOCTFILE) -p BLAS_LIBS)
LIBS += $(shell $(MKOCTFILE) -p FFTW_LIBS)
LIBS += $(shell $(MKOCTFILE) -p LIBS)
LIBS += $(shell $(MKOCTFILE) -p FLIBS)
all-local:
cd $(top_srcdir)/mex/octave && \
for p in $(PROGRAMS); do \
$(LN_S) -f $(abs_srcdir)/$$p $$p; \
done
clean-local:
cd $(top_srcdir)/mex/octave && rm -f $(PROGRAMS)