From 612cf9fa9be4757441d6a9719a03c76bdfe73c5e Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 17 Sep 2009 16:35:33 +0000 Subject: [PATCH] Build system: * always set -DNO_OPENMP * fix for MEX/Octave with MinGW git-svn-id: https://www.dynare.org/svn/dynare/trunk@2945 ac1d8469-bf42-47a9-8791-bf33cf982152 --- m4/ax_mexopts.m4 | 6 +++--- mex/build/mkoctfile.am | 3 ++- mex/sources/build_octave.m | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/m4/ax_mexopts.m4 b/m4/ax_mexopts.m4 index 2ebbb264b..7606cf731 100644 --- a/m4/ax_mexopts.m4 +++ b/m4/ax_mexopts.m4 @@ -31,7 +31,7 @@ MATLAB_DEFS="-DNO_OPENMP" # Don't use OpenMP (flag used by S. Adjemian in some D case ${MATLAB_ARCH} in glnx86 | glnxa64) - MATLAB_DEFS="-D_GNU_SOURCE -DNDEBUG" + MATLAB_DEFS="$MATLAB_DEFS -D_GNU_SOURCE -DNDEBUG" MATLAB_CFLAGS="-ansi -fexceptions -fPIC -pthread -g -O2" MATLAB_CXXFLAGS="-ansi -fPIC -pthread -g -O2" MATLAB_LDFLAGS="-shared -Wl,--version-script,$MATLAB/extern/lib/${MATLAB_ARCH}/mexFunction.map -Wl,--no-undefined -Wl,-rpath-link,$MATLAB/bin/${MATLAB_ARCH} -L$MATLAB/bin/${MATLAB_ARCH}" @@ -51,8 +51,8 @@ case ${MATLAB_ARCH} in case ${host_os} in *cygwin*) # MATLAB can't use native Cygwin DLLs - MATLAB_CFLAGS="$MATLAB_CFLAGS -mno-cygwin" - MATLAB_CXXFLAGS="$MATLAB_CXXFLAGS -mno-cygwin" + MATLAB_CFLAGS="$MATLAB_CFLAGS -mno-cygwin" + MATLAB_CXXFLAGS="$MATLAB_CXXFLAGS -mno-cygwin" ;; esac ax_mexopts_ok="yes" diff --git a/mex/build/mkoctfile.am b/mex/build/mkoctfile.am index bc7fd7c12..a73bdba78 100644 --- a/mex/build/mkoctfile.am +++ b/mex/build/mkoctfile.am @@ -2,7 +2,7 @@ EXEEXT = .mex CPPFLAGS = $(shell $(MKOCTFILE) -p CPPFLAGS) -DEFS = -DNO_BLAS_H -DNO_LAPACK_H -DOCTAVE +DEFS = -DNO_BLAS_H -DNO_LAPACK_H -DOCTAVE -DNO_OPENMP CC = $(shell $(MKOCTFILE) -p CC) CFLAGS = $(shell $(MKOCTFILE) -p CPICFLAG) @@ -21,6 +21,7 @@ LIBS += $(shell $(MKOCTFILE) -p BLAS_LIBS) LIBS += $(shell $(MKOCTFILE) -p FFTW_LIBS) LIBS += $(shell $(MKOCTFILE) -p LIBS) LIBS += $(shell $(MKOCTFILE) -p FLIBS) +LIBS += $(shell $(MKOCTFILE) -p CXXLIBS) # Only used for Octave/MinGW all-local: cd $(top_srcdir)/mex/octave && \ diff --git a/mex/sources/build_octave.m b/mex/sources/build_octave.m index 9ca4612fc..5a092044d 100644 --- a/mex/sources/build_octave.m +++ b/mex/sources/build_octave.m @@ -1,6 +1,6 @@ % Build file for Dynare MEX Librairies for Octave -% Copyright (C) 2008 Dynare Team +% Copyright (C) 2008-2009 Dynare Team % % This file is part of Dynare. % @@ -17,7 +17,7 @@ % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -COMPILE_OPTIONS = '-DNO_BLAS_H -DNO_LAPACK_H -DOCTAVE'; +COMPILE_OPTIONS = '-DNO_BLAS_H -DNO_LAPACK_H -DOCTAVE -DNO_OPENMP'; % Comment next line to suppress compilation debugging info COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -v' ];