v4 mex: fixed compilation for Octave/Windows/MSVC2008

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1904 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
sebastien 2008-06-27 23:22:52 +00:00
parent 051428ee36
commit d3e739d9be
8 changed files with 22 additions and 13 deletions

View File

@ -70,10 +70,10 @@ eval([ COMPILE_COMMAND ' kronecker/sparse_hessian_times_B_kronecker_C.cc ' BLAS_
disp('Compiling A_times_B_kronecker_C...')
eval([ COMPILE_COMMAND ' kronecker/A_times_B_kronecker_C.cc ' BLAS_PATH ]);
disp('Compiling gensylv...')
eval([ COMPILE_COMMAND ' -DMATLAB -Igensylv/cc gensylv/matlab/gensylv.cpp' ...
eval([ COMPILE_COMMAND ' -Igensylv/cc gensylv/matlab/gensylv.cpp' ...
' gensylv/cc/*.cpp ' BLAS_PATH ' ' LAPACK_PATH ]);
disp('Compiling simulate...')
eval([ COMPILE_COMMAND ' -DMATLAB -Isimulate -I../../preprocessor/include simulate/simulate.cc simulate/Interpreter.cc simulate/Mem_Mngr.cc simulate/SparseMatrix.cc simulate/linbcg.cc' ]);
eval([ COMPILE_COMMAND ' -Isimulate -I../../preprocessor/include simulate/simulate.cc simulate/Interpreter.cc simulate/Mem_Mngr.cc simulate/SparseMatrix.cc simulate/linbcg.cc' ]);
% Forcing exit is necessary when autobuilding MEX files for Debian packages.
% In interactive mode, if anything fails during the compilation process,

View File

@ -2,7 +2,7 @@
% Copyright Dynare Team (2008)
% GNU Public License
COMPILE_OPTIONS = '-DNO_BLAS_H -DNO_LAPACK_H';
COMPILE_OPTIONS = '-DNO_BLAS_H -DNO_LAPACK_H -DOCTAVE';
% Comment next line to suppress compilation debugging info
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -v' ];
@ -16,6 +16,7 @@ eval([ COMPILE_COMMAND ' kronecker/sparse_hessian_times_B_kronecker_C.cc -o ../o
disp('Compiling A_times_B_kronecker_C...')
eval([ COMPILE_COMMAND ' kronecker/A_times_B_kronecker_C.cc -o ../octave/A_times_B_kronecker_C.mex']);
disp('Compiling gensylv...')
eval([ COMPILE_COMMAND ' -DMATLAB -Igensylv/cc gensylv/matlab/gensylv.cpp gensylv/cc/*.cpp -o ../octave/gensylv.mex']);
% With MS Visual C++ it is necessary to list all the source file names (a wildcard will not make it)
eval([ COMPILE_COMMAND ' -DMATLAB -Igensylv/cc gensylv/matlab/gensylv.cpp gensylv/cc/BlockDiagonal.cpp gensylv/cc/GeneralMatrix.cpp gensylv/cc/GeneralSylvester.cpp gensylv/cc/IterativeSylvester.cpp gensylv/cc/KronUtils.cpp gensylv/cc/KronVector.cpp gensylv/cc/QuasiTriangular.cpp gensylv/cc/QuasiTriangularZero.cpp gensylv/cc/SchurDecomp.cpp gensylv/cc/SchurDecompEig.cpp gensylv/cc/SimilarityDecomp.cpp gensylv/cc/SylvException.cpp gensylv/cc/SylvMatrix.cpp gensylv/cc/SylvMemory.cpp gensylv/cc/SylvParams.cpp gensylv/cc/TriangularSylvester.cpp gensylv/cc/Vector.cpp -o ../octave/gensylv.mex']);
disp('Compiling simulate...')
eval([ COMPILE_COMMAND ' -DMATLAB -Isimulate -I../../preprocessor/include simulate/simulate.cc simulate/Interpreter.cc simulate/Mem_Mngr.cc simulate/SparseMatrix.cc simulate/linbcg.cc -o ../octave/simulate.mex']);
eval([ COMPILE_COMMAND ' -Isimulate -I../../preprocessor/include simulate/simulate.cc simulate/Interpreter.cc simulate/Mem_Mngr.cc simulate/SparseMatrix.cc simulate/linbcg.cc -o ../octave/simulate.mex']);

View File

@ -437,7 +437,11 @@ bool ConstGeneralMatrix::isFinite() const
{
for (int i = 0; i < numRows(); i++)
for (int j = 0; j < numCols(); j++)
#ifdef _MSC_VER
if (! _finite(get(i,j)))
#else
if (! std::isfinite(get(i,j)))
#endif
return false;
return true;
}

View File

@ -16,6 +16,10 @@
using namespace std;
#ifdef _MSC_VER
# define isfinite _finite
#endif
ZeroPad zero_pad;
void Vector::copy(const double* d, int inc)

View File

@ -5,7 +5,7 @@
#ifndef CPPBLAS_H
#define CPPBLAS_H
#if defined(MATLAB) && !defined(__linux__)
#if defined(MATLAB) && !defined(__linux__) && !defined(OCTAVE)
#define BLAS_dgemm dgemm
#define BLAS_dgemv dgemv
#define BLAS_dtrsv dtrsv
@ -16,7 +16,7 @@
#define BLAS_dscal dscal
#define BLAS_dtrsm dtrsm
#define BLAS_ddot ddot
#else /* defined(MATLAB) && !defined(__linux__) */
#else
#define BLAS_dgemm dgemm_
#define BLAS_dgemv dgemv_
#define BLAS_dtrsv dtrsv_
@ -27,7 +27,7 @@
#define BLAS_dscal dscal_
#define BLAS_dtrsm dtrsm_
#define BLAS_ddot ddot_
#endif /* defined(MATLAB) && !defined(__linux__) */
#endif
#define BLCHAR const char*
#define CONST_BLINT const int*

View File

@ -5,7 +5,7 @@
#ifndef CPPLAPACK_H
#define CPPLAPACK_H
#if defined(MATLAB) && !defined(__linux__)
#if defined(MATLAB) && !defined(__linux__) && !defined(OCTAVE)
#define LAPACK_dgetrs dgetrs
#define LAPACK_dgetrf dgetrf
#define LAPACK_dgees dgees
@ -15,7 +15,7 @@
#define LAPACK_dpotrf dpotrf
#define LAPACK_dgges dgges
#define LAPACK_dsyev dsyev
#else /* MATLAB */
#else
#define LAPACK_dgetrs dgetrs_
#define LAPACK_dgetrf dgetrf_
#define LAPACK_dgees dgees_
@ -25,7 +25,7 @@
#define LAPACK_dpotrf dpotrf_
#define LAPACK_dgges dgges_
#define LAPACK_dsyev dsyev_
#endif /* MATLAB */
#endif
#define LACHAR const char*
#define CONST_LAINT const int*

View File

@ -16,7 +16,7 @@ typedef int mwSize;
#endif
#ifdef NO_BLAS_H
# ifdef __linux__
# if defined(__linux__) || defined(OCTAVE)
# define dgemm dgemm_
# endif
extern "C" {

View File

@ -2,7 +2,7 @@
#include "mex.h"
#ifdef NO_LAPACK_H
# ifdef __linux__
# if defined(__linux__) || defined(OCTAVE)
# define dgges dgges_
# endif
void dgges(char *, char *, char *, int (*)(), int *, double *, int *, double *, int *, int *, double *, double *, double *,