problem with mex files

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

problem with mex files

Postby marv » Fri Apr 17, 2009 8:16 pm

Hi,
I am trying to install Dynare on Linux (Red Hat4, 64-bit, gcc4) for Matlab7.4. According the DynareWiki, after running the function build_matlab.m (to compile the mex file), Matlab exits if compilation is successful. In case of error, Matlab will stop and display the error message. In my case, Matlab does not exist but I don`t get any error.


However when I try to run an example I get the following error message:

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.

Starting Dynare ...
Starting preprocessing of the model file ...
WARNING: Alt_Ex1_kat.mod:9.11-25: Symbol beta declared twice.
6 equation(s) found
Processing derivation ...
Processing Order 1... done
Processing Order 2... done
Processing outputs ...
Preprocessing completed.
Starting Matlab computing ...


------------------------------------------------------------------------
Segmentation violation detected at Fri Apr 17 16:14:23 2009
------------------------------------------------------------------------

Configuration:
MATLAB Version: 7.4.0.287 (R2007a)
MATLAB License: 288117
Operating System: Linux 2.6.9-42.0.8.ELsmp #1 SMP Tue Jan 23 12:49:51 EST 2007 x86_64
GNU C Library: 2.3.4 stable
Window System: Citrix Systems Inc (56668), display scu04545:12.0
Current Visual: 0x23 (class 4, depth 24)
Virtual Machine: Java 1.5.0_04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
Default Charset: UTF-8

Register State:
rax = 0000000000000003 rbx = 0000007f00000001
rcx = 0000000000000006 rdx = 0000000000000001
rbp = 0000000000000001 rsi = 0000000000000003
rdi = 0000000000000002 rsp = 0000007fbffec620
r8 = 0000007fbfff4850 r9 = 0000002aa09f41d8
r10 = 0000007fbffe93e0 r11 = 0000007fbfff47fc
r12 = 0000000000000006 r13 = 0000007fbfff4850
r14 = 0000007fbfff47fc r15 = 0000000000000003
rip = 0000002a9cab5351 flg = 0000000000010206

Stack Trace:

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

If it is an official MathWorks function, please
follow these steps to report this problem to The MathWorks so we
have the best chance of correcting it:

The next time MATLAB is launched under typical usage, a dialog box will
open to help you send the error log to The MathWorks. Alternatively, you
can send an e-mail to segv@mathworks.com with the following file attached:
/home/asd/marv/matlab_crash_dump.13194

If the problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contac ... est_1.html

A technical support engineer might contact you with further information.

Thank you for your help. Save your workspace and restart MATLAB.

Error in ==> dr1 at 598
B1 = B*A_times_B_kronecker_C(dr.ghxx,hx,hu1);

Error in ==> resol at 101
[dr,info,M_,options_,oo_] = dr1(dr,check_flag,M_,options_,oo_);

Error in ==> stoch_simul at 40
[oo_.dr, info] = resol(oo_.steady_state,0);

Error in ==> Alt_Ex1_kat at 127
info = stoch_simul(var_list_);

Error in ==> dynare at 102
evalin('base',fname) ;

Any help on that would be appreciate.

When I run the function build_matlab.m this is the output I get in Matlab:

>> build_matlab
Compiling mjdgges...
-> mexopts.sh sourced from directory (DIR = $MATLAB/bin)
FILE = /apps/matlab74/bin/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /apps/matlab74
-> CC = gcc
-> CC flags:
CFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> CXX = g++
-> CXX flags:
CXXFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O -DNDEBUG
CXXLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> FC = g95
-> FC flags:
FFLAGS = -fPIC -fno-omit-frame-pointer -fexceptions
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> LD = gcc
-> Link flags:
LDFLAGS = -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments = -lmwlapack
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments = -lmwlapack
----------------------------------------------------------------

-> gcc -c -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG mjdgges/mjdgges.c -o ../2007a/mjdgges.o

-> gcc -c -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG /apps/matlab74/extern/src/mexversion.c -o ../2007a/mexversion.o

-> gcc -O -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o ../2007a/mjdgges.mexa64 ../2007a/mjdgges.o ../2007a/mexversion.o -lmwlapack -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++

Compiling sparse_hessian_times_B_kronecker_C...
-> mexopts.sh sourced from directory (DIR = $MATLAB/bin)
FILE = /apps/matlab74/bin/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /apps/matlab74
-> CC = gcc
-> CC flags:
CFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> CXX = g++
-> CXX flags:
CXXFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O -DNDEBUG
CXXLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> FC = g95
-> FC flags:
FFLAGS = -fPIC -fno-omit-frame-pointer -fexceptions
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> LD = g++
-> Link flags:
LDFLAGS = -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments = -lmwlapack
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments = -lmwlapack
----------------------------------------------------------------

-> g++ -c -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG kronecker/sparse_hessian_times_B_kronecker_C.cc -o ../2007a/sparse_hessian_times_B_kronecker_C.o

-> gcc -c -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG /apps/matlab74/extern/src/mexversion.c -o ../2007a/mexversion.o

-> g++ -O -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o ../2007a/sparse_hessian_times_B_kronecker_C.mexa64 ../2007a/sparse_hessian_times_B_kronecker_C.o ../2007a/mexversion.o -lmwlapack -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm

Compiling A_times_B_kronecker_C...
-> mexopts.sh sourced from directory (DIR = $MATLAB/bin)
FILE = /apps/matlab74/bin/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /apps/matlab74
-> CC = gcc
-> CC flags:
CFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> CXX = g++
-> CXX flags:
CXXFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O -DNDEBUG
CXXLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> FC = g95
-> FC flags:
FFLAGS = -fPIC -fno-omit-frame-pointer -fexceptions
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> LD = g++
-> Link flags:
LDFLAGS = -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments = -lmwlapack
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments = -lmwlapack
----------------------------------------------------------------

-> g++ -c -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG kronecker/A_times_B_kronecker_C.cc -o ../2007a/A_times_B_kronecker_C.o

-> gcc -c -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG /apps/matlab74/extern/src/mexversion.c -o ../2007a/mexversion.o

-> g++ -O -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o ../2007a/A_times_B_kronecker_C.mexa64 ../2007a/A_times_B_kronecker_C.o ../2007a/mexversion.o -lmwlapack -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm

Compiling gensylv...
-> mexopts.sh sourced from directory (DIR = $MATLAB/bin)
FILE = /apps/matlab74/bin/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /apps/matlab74
-> CC = gcc
-> CC flags:
CFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
arguments = -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB
-> CXX = g++
-> CXX flags:
CXXFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O -DNDEBUG
CXXLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB
-> FC = g95
-> FC flags:
FFLAGS = -fPIC -fno-omit-frame-pointer -fexceptions
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB
-> LD = g++
-> Link flags:
LDFLAGS = -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments = -lmwlapack -lmwlapack
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments = -lmwlapack -lmwlapack
----------------------------------------------------------------

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/matlab/gensylv.cpp -o ../2007a/gensylv.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/BlockDiagonal.cpp -o ../2007a/BlockDiagonal.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/GeneralMatrix.cpp -o ../2007a/GeneralMatrix.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/GeneralSylvester.cpp -o ../2007a/GeneralSylvester.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/IterativeSylvester.cpp -o ../2007a/IterativeSylvester.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/KronUtils.cpp -o ../2007a/KronUtils.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/KronVector.cpp -o ../2007a/KronVector.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/QuasiTriangular.cpp -o ../2007a/QuasiTriangular.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/QuasiTriangularZero.cpp -o ../2007a/QuasiTriangularZero.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/SchurDecomp.cpp -o ../2007a/SchurDecomp.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/SchurDecompEig.cpp -o ../2007a/SchurDecompEig.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/SimilarityDecomp.cpp -o ../2007a/SimilarityDecomp.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/SylvException.cpp -o ../2007a/SylvException.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/SylvMatrix.cpp -o ../2007a/SylvMatrix.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/SylvMemory.cpp -o ../2007a/SylvMemory.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/SylvParams.cpp -o ../2007a/SylvParams.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/TriangularSylvester.cpp -o ../2007a/TriangularSylvester.o

-> g++ -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG gensylv/cc/Vector.cpp -o ../2007a/Vector.o

-> gcc -c -Igensylv/cc -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions -DNO_BLAS_H -DNO_LAPACK_H -DMATLAB -O -DNDEBUG /apps/matlab74/extern/src/mexversion.c -o ../2007a/mexversion.o

-> g++ -O -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o ../2007a/gensylv.mexa64 ../2007a/gensylv.o ../2007a/BlockDiagonal.o ../2007a/GeneralMatrix.o ../2007a/GeneralSylvester.o ../2007a/IterativeSylvester.o ../2007a/KronUtils.o ../2007a/KronVector.o ../2007a/QuasiTriangular.o ../2007a/QuasiTriangularZero.o ../2007a/SchurDecomp.o ../2007a/SchurDecompEig.o ../2007a/SimilarityDecomp.o ../2007a/SylvException.o ../2007a/SylvMatrix.o ../2007a/SylvMemory.o ../2007a/SylvParams.o ../2007a/TriangularSylvester.o ../2007a/Vector.o ../2007a/mexversion.o -lmwlapack -lmwlapack -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm

Compiling simulate...
-> mexopts.sh sourced from directory (DIR = $MATLAB/bin)
FILE = /apps/matlab74/bin/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /apps/matlab74
-> CC = gcc
-> CC flags:
CFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> CXX = g++
-> CXX flags:
CXXFLAGS = -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O -DNDEBUG
CXXLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> FC = g95
-> FC flags:
FFLAGS = -fPIC -fno-omit-frame-pointer -fexceptions
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DNO_BLAS_H -DNO_LAPACK_H
-> LD = g++
-> Link flags:
LDFLAGS = -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments =
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments =
----------------------------------------------------------------

-> g++ -c -Isimulate -I../../preprocessor/include -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG simulate/simulate.cc -o ../2007a/simulate.o

-> g++ -c -Isimulate -I../../preprocessor/include -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG simulate/Interpreter.cc -o ../2007a/Interpreter.o

-> g++ -c -Isimulate -I../../preprocessor/include -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG simulate/Mem_Mngr.cc -o ../2007a/Mem_Mngr.o

-> g++ -c -Isimulate -I../../preprocessor/include -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG simulate/SparseMatrix.cc -o ../2007a/SparseMatrix.o

-> gcc -c -Isimulate -I../../preprocessor/include -I/apps/matlab74/extern/include -DMATLAB_MEX_FILE -fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread -fexceptions -DNO_BLAS_H -DNO_LAPACK_H -O -DNDEBUG /apps/matlab74/extern/src/mexversion.c -o ../2007a/mexversion.o

-> g++ -O -pthread -shared -Wl,--version-script,/apps/matlab74/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o ../2007a/simulate.mexa64 ../2007a/simulate.o ../2007a/Interpreter.o ../2007a/Mem_Mngr.o ../2007a/SparseMatrix.o ../2007a/mexversion.o -Wl,-rpath-link,/apps/matlab74/bin/glnxa64 -L/apps/matlab74/bin/glnxa64 -lmx -lmex -lmat -lm

>>
marv
 
Posts: 9
Joined: Fri Apr 28, 2006 1:25 pm

Re: problem with mex files

Postby MichelJuillard » Sat Apr 18, 2009 9:22 am

We had problems trying to fix the code for the DLL to be compatible with Matlab 7.8 (2009).
I made some correction in the snapshot, could you try to see if it fixes your problem?

Matlab doesn't exit after build_matlab anymore. I will correct the wiki.

Thanks for reporting the problem

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Re: problem with mex files

Postby marv » Mon Apr 20, 2009 7:12 pm

Hi,
I am using Matlab 7.4 not 7.8, on a 64 bit machine (linux red hat 4 with gcc4). I will try with the snaphsot.

Thanks!
Katerine
marv
 
Posts: 9
Joined: Fri Apr 28, 2006 1:25 pm

Re: problem with mex files

Postby marv » Tue Apr 21, 2009 4:10 pm

Hi,

I tried with the snapshot and it still does not work. If I compile the dll with Matlab 7.1 instead of 7.4(64 bit linux machine) using the command build_matlab it seems to work. I would like to use Matlab 7.4.
marv
 
Posts: 9
Joined: Fri Apr 28, 2006 1:25 pm

Re: problem with mex files

Postby MichelJuillard » Tue Apr 21, 2009 8:47 pm

Hi,

can you post the log of build_matlab with Matlab 7.4? Note that you need to redo build_matlab if you change between Matlab 7.1 and Matlab 7.4

Best

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Re: problem with mex files

Postby marv » Fri Apr 24, 2009 1:49 pm

Hi,

I downloaded the snapshot again and everything seems to work fine! I did not run the function build_matlab.m. Do we have to run this function? Not sure if I understand the role of this function.

Also when I compile the preprocessor I get the following warning:

make: warning: Clock skew detected. Your build may be incomplete.
marv
 
Posts: 9
Joined: Fri Apr 28, 2006 1:25 pm

Re: problem with mex files

Postby MichelJuillard » Sat Apr 25, 2009 8:57 am

When you compile Dynare, you need to do two different things
1) compile the preprocessor with make
2) compile the DLL that Dynare uses to accelerate Matlab with build_matlab

If you don't do 2), Dynare will work, but will be slower

The clock skew warning means that some of the files that you create during compilation have date/time older than the source they were compiled from. This can come from a difference in the clock between your computer and our web server. I don't think that it can have adverse consequences for compiling Dynare.

Best

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Re: problem with mex files

Postby marv » Wed Apr 29, 2009 8:17 pm

Hi,

Everything works fine if I don't run the command build_matlab. If I run this command I can't run any examples. I am using the snapshot with Matlab 7.4 on Linux 64 bit. The error I get is

dynare Alt_Ex1

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Fast model evaluation.

Starting Dynare ...
Starting preprocessing of the model file ...
WARNING: Alt_Ex1.mod:6.11-25: Symbol beta declared twice.
Found 6 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting Matlab computing ...


------------------------------------------------------------------------
Segmentation violation detected at Wed Apr 29 16:15:02 2009
------------------------------------------------------------------------

Configuration:
MATLAB Version: 7.4.0.287 (R2007a)
MATLAB License: 288117
Operating System: Linux 2.6.9-42.0.8.ELsmp #1 SMP Tue Jan 23 12:49:51 EST 2007 x86_64
GNU C Library: 2.3.4 stable
Window System: Citrix Systems Inc (56668), display scu04545:12.0
Current Visual: 0x23 (class 4, depth 24)
Virtual Machine: Java 1.5.0_04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
Default Charset: UTF-8

Register State:
rax = 0000000000000003 rbx = 0000007f00000001
rcx = 0000000000000006 rdx = 0000000000000001
rbp = 0000000000000001 rsi = 0000000000000003
rdi = 0000000000000002 rsp = 0000007fbffec630
r8 = 0000007fbfff4860 r9 = 0000002aa0a0d3c8
r10 = 00000000015d6ff0 r11 = 0000007fbfff4814
r12 = 0000000000000006 r13 = 0000007fbfff4860
r14 = 0000007fbfff4814 r15 = 0000000000000003
rip = 0000002a9cab5351 flg = 0000000000010206

Stack Trace:

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

If it is an official MathWorks function, please
follow these steps to report this problem to The MathWorks so we
have the best chance of correcting it:

The next time MATLAB is launched under typical usage, a dialog box will
open to help you send the error log to The MathWorks. Alternatively, you
can send an e-mail to segv@mathworks.com with the following file attached:
/home/asd/marv/matlab_crash_dump.418

If the problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contac ... est_1.html

A technical support engineer might contact you with further information.

Thank you for your help. Save your workspace and restart MATLAB.

Error in ==> dr1 at 615
B1 = B*A_times_B_kronecker_C(dr.ghxx,hx,hu1);

Error in ==> resol at 118
[dr,info,M_,options_,oo_] = dr1(dr,check_flag,M_,options_,oo_);

Error in ==> stoch_simul at 40
[oo_.dr, info] = resol(oo_.steady_state,0);

Error in ==> Alt_Ex1 at 124
info = stoch_simul(var_list_);

Error in ==> dynare at 125
evalin('base',fname) ;
marv
 
Posts: 9
Joined: Fri Apr 28, 2006 1:25 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 11 guests