Invalid MEX-FILE in MATLAB 2017 prerelease version

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.

Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby katejcooper » Sun Feb 12, 2017 11:11 am

Hi Everyone,

I have a problem running my code which is written in Dynare and runs in MATLAB. It is a log-linearized model with Bayesian estimation of parameters. The code runs perfectly in earlier versions of MATLAB on both PC and Mac but cannot run after computing steady state in my current version of MATLAB: 2017 prerelease (updated in December 2016).
The error reports:
Invalid MEX-file '/Applications/Dynare/4.4.3/matlab/../mex/matlab/osx64/mjdgges.mexmaci64':
dlopen(/Applications/Dynare/4.4.3/matlab/../mex/matlab/osx64/mjdgges.mexmaci64, 6): Library not loaded:
@loader_path/libmex.dylib
Referenced from: /Applications/Dynare/4.4.3/mex/matlab/osx64/mjdgges.mexmaci64
Reason: image not found.

Does anyone encounter the same problem and does anyone know how to solve this?

I tried copying the 'mex' file under Dynare/4.4.3/matlab but it didn't work, still reporting the same error. I also tried changing the path in the 'Dynare_config.m' to make MATLAB follow the path of 'Dynare/4.4.3/mex' but still reporting the same error.


Thanks in advance

Kate
katejcooper
 
Posts: 3
Joined: Sun Feb 12, 2017 9:25 am

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby HoutanBastani » Mon Feb 13, 2017 2:06 pm

My first guess is that, with this version, Matlab renamed or removed a shared library that they used to distribute. In any case, I'd recommend you stick with an earlier version of Matlab as Dynare 4.4.3 was released a few years ago it's not guaranteed to be compatible with versions of Matlab or Octave that have been released since then.

If this problem persists in the official Matlab release, I'll consider making new mex files and distributing them. I'll make a post here if I do.
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby katejcooper » Mon Feb 13, 2017 10:28 pm

Thank you Houtan. The code does run in earlier versions of MATLAB. I'll let you know when I get the 2017 official version if the problem still exists.

Best,
Kate
katejcooper
 
Posts: 3
Joined: Sun Feb 12, 2017 9:25 am

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby katejcooper » Sun Mar 19, 2017 4:15 am

Hi Houtan,

I'm posting this follow-up replay to let you know that, regarding the problem with invalid MEX-File in MATLAB with Dynare 4.4.3, I updated my MATLAB to the official release R2017a, but the problem remains. It happens after the computation of initial values (steady states). Error reports as below:

************************************************************************************************************************************
Invalid MEX-file
'/Applications/Dynare/4.4.3/matlab/../mex/matlab/osx64/mjdgges.mexmaci64':
dlopen(/Applications/Dynare/4.4.3/matlab/../mex/matlab/osx64/mjdgges.mexmaci64, 6):
Library not loaded: @loader_path/libmex.dylib
Referenced from: /Applications/Dynare/4.4.3/mex/matlab/osx64/mjdgges.mexmaci64
Reason: image not found.
************************************************************************************************************************************


Do you have any suggestions for this problem, besides turning the clock back to pre-2017 matlab time?

Many thanks.

Best,
Kate
katejcooper
 
Posts: 3
Joined: Sun Feb 12, 2017 9:25 am

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby jpfeifer » Sun Mar 19, 2017 1:26 pm

Dear Kate,
is the problem also present when you use the unstable version of Dynare?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby HoutanBastani » Mon Mar 20, 2017 11:13 am

Hi Kate,

I'm unable to produce the same problem as you're experiencing, but I am encountering other problems and am working to fix them.

My question for you is, does your code run with Dynare 4.4.3 or the unstable version on a previous version of Matlab?
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby wjgatt » Mon Mar 20, 2017 3:36 pm

I am experiencing the same problem, which cropped up when I updated to Matlab 2017a. I am using the stable 4.4.3 release.

I confirm the problem crops up on MacOS Sierra but not on Windows 10. On windows the new Matlab release runs dynare just fine.

Will
wjgatt
 
Posts: 23
Joined: Thu Jun 16, 2011 7:23 pm

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby HoutanBastani » Mon Mar 20, 2017 4:02 pm

Hi Will,

Do you get the same error as Kate? Does R2016b work for you with Dynare on OS X?
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby wjgatt » Mon Mar 20, 2017 4:41 pm

Yes I was getting the same error message, right after the steady state values are displayed. The problem occurs when dynare calls 'dyn_first_order_solver'

Error in dyn_first_order_solver (line 216)
[err, ss, tt, w, sdim, dr.eigval, info1] =
mjdgges(E, D, DynareOptions.qz_criterium,
DynareOptions.qz_zero_threshold);

Downgraded to Matlab 2016b and dynare runs my mod files fine.

Will
wjgatt
 
Posts: 23
Joined: Thu Jun 16, 2011 7:23 pm

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby JdW » Fri Mar 31, 2017 5:28 pm

Hi everyone,

I encounter the same problem running Dynare 4.4.3 on Matlab R2017a (official release), running on macOS Sierra. The problem remains when using the unstable Dynare release. I would greatly appreciate a solution (other than downgrading Matlab).

Joris
JdW
 
Posts: 9
Joined: Fri Mar 31, 2017 5:23 pm

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby HoutanBastani » Mon Apr 03, 2017 9:49 am

The other solution is to build dynare via homebrew. See this page http://www.dynare.org/DynareWiki/InstallOnMacOSX. Follow the directions for Dynare Unstable (which will be the next version of Dynare), replacing R2014b with R2017a and 8.4 with 9.2. If you want to build Dynare 4.4 (current stable), remove
Code: Select all
--HEAD
from the command.


I am not sure I will have the time to make a new dynare release for 4.4. FYI, we hope to have Dynare 4.5 out in the next month or so.
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby anifab18 » Tue Apr 04, 2017 9:29 pm

Hi everyone
I encounter the same problem running Dynare 4.4.3 on Matlab R2017a (official), running on macOS Sierra. I try as you said to build dynare via homebrew but got an message error in the final step
==> Installing dynare from homebrew/science
Error: You must `brew link ghostscript` before homebrew/science/dynare can be installed
I've tried all the recommended solution but it still don't work
Have any other solution
Fabrice
anifab18
 
Posts: 5
Joined: Tue Apr 04, 2017 9:12 pm

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby anifab18 » Tue Apr 04, 2017 9:36 pm

just got the error message after all this step

brew info dynare
homebrew/science/dynare: stable 4.4.3 (bottled), HEAD
Platform for economic models, particularly DSGE and OLG models
http://www.dynare.org
Not installed
From: https://github.com/Homebrew/homebrew-sc ... /dynare.rb
==> Dependencies
Build: boost ✔, cweb ✔, xz ✔
Required: matlab2tikz ✔, fftw ✔, gsl ✔, hdf5 ✔, libmatio ✔, metis ✔, readline ✔, veclibfort ✔, suite-sparse ✘
Recommended: octave ✘
==> Requirements
Build: tex ✔
Required: fortran ✔
Optional: tex ✔
==> Options
--with-matlab-version=
Matlab version, e.g., 8.2 (to build mex files)
--with-matlab=
Path to Matlab root directory (to build mex files)
--with-tex
Build documentation
--without-octave
Build without octave support
--HEAD
Install HEAD version
==> Caveats
To get started with dynare, open Matlab or Octave and type:

addpath /usr/local/opt/dynare/lib/dynare/matlab
10-232-80-132:~ fabriceanicetparfaitdabire$ brew install dynare --with-matlab=/Applications/MATLAB_R2017a.app --with-matlab-version=9.2 --without-check
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/science).
==> New Formulae
heimdal lapack make openldap openssh tcl-tk
==> Updated Formulae
afl-fuzz homebrew/science/lumpy-sv
app-engine-java homebrew/science/mir-prefer
arangodb homebrew/science/orocos-kdl
aws-sdk-cpp homebrew/science/picard-tools
awscli jboss-forge
bit jetty
cake kubernetes-cli
chromedriver mercurial
fabio node-build
fio node@4
flow node@6
gollum npth
gotags paket
gpa prettyping
homebrew/science/adam pypy
homebrew/science/afra solr
homebrew/science/circlator stern
homebrew/science/dlib syncthing
homebrew/science/genometools tgui
==> Deleted Formulae
srm

==> Installing dynare from homebrew/science
Error: You must `brew link ghostscript` before homebrew/science/dynare can be installed
10-232-80-132:~ fabriceanicetparfaitdabire$
anifab18
 
Posts: 5
Joined: Tue Apr 04, 2017 9:12 pm

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby HoutanBastani » Wed Apr 05, 2017 10:18 am

Right, so follow the instruction in the error message. It says:
Error: You must `brew link ghostscript` before homebrew/science/dynare can be installed

So, at the terminal prompt, type
Code: Select all
brew link ghostscript
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: Invalid MEX-FILE in MATLAB 2017 prerelease version

Postby HoutanBastani » Wed Apr 05, 2017 10:21 am

Also, if you're not going to use Octave, you can execute the following installation command:
Code: Select all
brew install dynare --with-matlab=/Applications/MATLAB_R2017a.app --with-matlab-version=9.2 --without-check --without-octave
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Next

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests