Problem with installing dynare-matlab after upgrading to Ubuntu 20.04

Hello everyone,

today i upgraded my Ubuntu system to 20.04 and now my dynare is no longer working. As there were some problems I also installed the newest version of Matlab R2020a, removed dynare and dynare-matlab and reinstalled via the terminal to get dynare 4.6. But, as last time, something went wrong with the dynare-matlab installation. I tried different workarounds but I don’t seem to be able to solve the probelm.

The latest output is:

$ sudo apt-get install dynare-matlab
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  icu-devtools libboost-graph-dev libboost-graph1.71-dev libboost-graph1.71.0 libboost-regex1.71-dev libboost-regex1.71.0
  libboost-serialization1.71-dev libboost-serialization1.71.0 libboost-test1.71-dev libboost-test1.71.0 libboost1.71-dev libgsl-dev libicu-dev
  libslicot-pic
Suggested packages:
  graphviz libboost1.71-doc libboost-atomic1.71-dev libboost-chrono1.71-dev libboost-container1.71-dev libboost-context1.71-dev
  libboost-contract1.71-dev libboost-coroutine1.71-dev libboost-date-time1.71-dev libboost-exception1.71-dev libboost-fiber1.71-dev
  libboost-filesystem1.71-dev libboost-graph-parallel1.71-dev libboost-iostreams1.71-dev libboost-locale1.71-dev libboost-log1.71-dev
  libboost-math1.71-dev libboost-mpi1.71-dev libboost-mpi-python1.71-dev libboost-numpy1.71-dev libboost-program-options1.71-dev
  libboost-python1.71-dev libboost-random1.71-dev libboost-stacktrace1.71-dev libboost-system1.71-dev libboost-thread1.71-dev
  libboost-timer1.71-dev libboost-type-erasure1.71-dev libboost-wave1.71-dev libboost1.71-tools-dev libmpfrc++-dev libntl-dev icu-doc
The following NEW packages will be installed:
  dynare-matlab icu-devtools libboost-graph-dev libboost-graph1.71-dev libboost-graph1.71.0 libboost-regex1.71-dev libboost-regex1.71.0
  libboost-serialization1.71-dev libboost-serialization1.71.0 libboost-test1.71-dev libboost-test1.71.0 libboost1.71-dev libgsl-dev libicu-dev
  libslicot-pic
0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/26,0 MB of archives.
After this operation, 238 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package libboost1.71-dev:amd64.
(Reading database ... 439091 files and directories currently installed.)
Preparing to unpack .../00-libboost1.71-dev_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libboost-regex1.71.0:amd64.
Preparing to unpack .../01-libboost-regex1.71.0_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-regex1.71.0:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libboost-graph1.71.0:amd64.
Preparing to unpack .../02-libboost-graph1.71.0_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-graph1.71.0:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package icu-devtools.
Preparing to unpack .../03-icu-devtools_66.1-2ubuntu2_amd64.deb ...
Unpacking icu-devtools (66.1-2ubuntu2) ...
Selecting previously unselected package libicu-dev:amd64.
Preparing to unpack .../04-libicu-dev_66.1-2ubuntu2_amd64.deb ...
Unpacking libicu-dev:amd64 (66.1-2ubuntu2) ...
Selecting previously unselected package libboost-regex1.71-dev:amd64.
Preparing to unpack .../05-libboost-regex1.71-dev_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-regex1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libboost-serialization1.71.0:amd64.
Preparing to unpack .../06-libboost-serialization1.71.0_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-serialization1.71.0:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libboost-serialization1.71-dev:amd64.
Preparing to unpack .../07-libboost-serialization1.71-dev_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-serialization1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libboost-test1.71.0:amd64.
Preparing to unpack .../08-libboost-test1.71.0_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-test1.71.0:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libboost-test1.71-dev:amd64.
Preparing to unpack .../09-libboost-test1.71-dev_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-test1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libboost-graph1.71-dev:amd64.
Preparing to unpack .../10-libboost-graph1.71-dev_1.71.0-6ubuntu6_amd64.deb ...
Unpacking libboost-graph1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Selecting previously unselected package libboost-graph-dev:amd64.
Preparing to unpack .../11-libboost-graph-dev_1.71.0.0ubuntu2_amd64.deb ...
Unpacking libboost-graph-dev:amd64 (1.71.0.0ubuntu2) ...
Selecting previously unselected package libgsl-dev.
Preparing to unpack .../12-libgsl-dev_2.5+dfsg-6build1_amd64.deb ...
Unpacking libgsl-dev (2.5+dfsg-6build1) ...
Selecting previously unselected package libslicot-pic:amd64.
Preparing to unpack .../13-libslicot-pic_5.0+20101122-4build1_amd64.deb ...
Unpacking libslicot-pic:amd64 (5.0+20101122-4build1) ...
Selecting previously unselected package dynare-matlab.
Preparing to unpack .../14-dynare-matlab_4.6.0+dfsg-2_all.deb ...
Unpacking dynare-matlab (4.6.0+dfsg-2) ...
Setting up libgsl-dev (2.5+dfsg-6build1) ...
Setting up libboost1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Setting up icu-devtools (66.1-2ubuntu2) ...
Setting up libboost-regex1.71.0:amd64 (1.71.0-6ubuntu6) ...
Setting up libboost-test1.71.0:amd64 (1.71.0-6ubuntu6) ...
Setting up libboost-serialization1.71.0:amd64 (1.71.0-6ubuntu6) ...
Setting up libslicot-pic:amd64 (5.0+20101122-4build1) ...
Setting up libboost-graph1.71.0:amd64 (1.71.0-6ubuntu6) ...
Setting up libicu-dev:amd64 (66.1-2ubuntu2) ...
Setting up libboost-test1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Setting up libboost-regex1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Setting up libboost-serialization1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Setting up libboost-graph1.71-dev:amd64 (1.71.0-6ubuntu6) ...
Setting up libboost-graph-dev:amd64 (1.71.0.0ubuntu2) ...
Setting up dynare-matlab (4.6.0+dfsg-2) ...
Building Matlab extensions (logfile at /tmp/dynare-matlab-mexbuild-1588945586.10YSdr8)
ar: `u' modifier ignored since `D' is the default (see `U')
dw_switch.c: In function ‘LogProbabilityStates’:
dw_switch.c:2083:1: warning: control reaches end of non-void function [-Wreturn-type]
 2083 | }
  | ^
In file included from /usr/include/string.h:495,
             from mex_top_level.cc:21:
In function ‘char* strncpy(char*, const char*, size_t)’,
inlined from ‘void mexFunction(int, mxArray**, int, const mxArray**)’ at mex_top_level.cc:63:10:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
  |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sbvar_simulate.c:39:18: warning: ‘LargestRoot’ defined but not used [-Wunused-function]
   39 | static PRECISION LargestRoot(TMatrix B)
  |                  ^~~~~~~~~~~
sbvar_impulse_responses.c: In function ‘dw_sbvar_impulse_response_command_line’:
sbvar_impulse_responses.c:1144:13: warning: variable ‘explosive_cutoff’ set but not used [-Wunused-but-set-variable]
 1144 |   PRECISION explosive_cutoff;
  |             ^~~~~~~~~~~~~~~~
sbvar_impulse_responses.c:1143:18: warning: variable ‘sample’ set but not used [-Wunused-but-set-variable]
 1143 |   TVector **IR, *sample=(TVector*)NULL;
  |                  ^~~~~~
sbvar_impulse_responses.c:1139:56: warning: variable ‘T’ set but not used [-Wunused-but-set-variable]
 1139 |   int ergodic, type, s, horizon, thin, draws, i, j, n, T, nposterior_draws;
  |                                                        ^
dw_csminwel.c: In function ‘csminwel’:
dw_csminwel.c:321:26: warning: ‘badg[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  321 |       else if (f[2]<f[0] && badg[2]==0) {
  |                ~~~~~~~~~~^~~~~~~~~~~~~
dw_csminwel.c:154:16: warning: ‘badg[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  154 |    int done=0, badg[4], badgh, nogh=1, stuck=0;
  |                ^~~~
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
W: Operation was interrupted before it could finish

Before that I was getting a similar error message that many people get:

E: Sub-process /usr/bin/dpkg returned an error code (1)

I don’t know what I am doing wrong. I removed the old Matlab install and all packages and put the new version in the folder it belongs: /usr/local/Matlab/R2020a

In @wmutschl’s amazing YouTube-tutorials I see that he is using the newest version of Matlab and dynare in Ubuntu 20.04, so I guess it should work together.

@sebastien I hope it is OK if I directly send this question your way as you helped me last time as well.

Thank you very much

I think the dynare package in Ubuntu does not support R2020a yet, so if you have an older one try to reinstall it with R2019b or similar. That is,

sudo apt remove - -purge dynare dynare-matlab
sudo apt install dynare dynare-matlab

I always install dynare from source using git. It is described on git.dynare.org/Dynare/dynare.git
I will make a video on that the coming week. You should probably checkout the 4.6 branch with git.

Thank you for your quick reply. I don’t feel very confident with installing it from source. I had a backup with Timeshift and just went back to Ubuntu 19.10 where everything works. Will just wait until the new Matlab and Dynare version work together, it is not that urgent to upgrade my system. Working programs are more important :wink:
Thank you again for your answering and I can’t wait to watch your new videos.

Best

Glad you found a solution that works for you, I also love and support Timeshift (I actually have forked a small extension to it which creates automatic snapshots during any APT operation which you might find also helpful: https://github.com/wmutschl/timeshift-autosnap-apt)

Anyways, compiling from source, especially in Ubuntu, is VERY easy and you are so much more flexible whether you use the unstable branch or the current 4.6. branch, and you can stay up-to-date as it has all the fixes for the next official release (and in particular the matlab R2020a support). I hope to make the video this week, so you can decide for yourself.

1 Like

Thank you for the cool Timeshift tool. Also can’t wait for your video, will definitely attempt on building it from source after watching it. I always want to learn new things like that about my computer and software I use.

Hi DoubleBass,

The log that you attached to your first message does not show any error. Actually, it seems to suggest that the Dynare installation went fine. More information may be available in the additional logfile (/tmp/dynare-matlab-mexbuild-1588945586.10YSdr8 in this case, as mentioned in the output), but you did not attach that file to your post.

Also, you may want to check that the right version of MATLAB is configured in your system. What is the output of the following command:
update-alternatives --display matlab

Hi sebastien,

thank you very much for coming back to me. Like I wrote above, for now I went back to my old install of Ubuntu, Matlab, and Dynare. Will most likely give it another shot this weekend when wmutschl recorded the video.
If it is still not workig then, I will definitely send you the output of the command in this thread and would be very happy to fix it together. Thank you so much for your help.

Dear all,

sorry for restarting this old post. I gave upgrading to Ubuntu 20.04 a new try as my old (19.10) version was no longer supported. I, again, run into the same problems with installing dynare-matlab.
Now, I am trying to build dynare from source, which I have never done, and am facing some problems. I followed the guide online and still get an error that UMFPACK can’t be found. But I am somehow not able to install it. Maybe you have any advise @wmutschl.

This is the output I get:

stefan@stefan-P65Q:~/dynare$ ./configure --with-matlab=/usr/local/MATLAB/R2020a MATLAB_VERSION=9.8
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports C++17 features with -std=gnu++17... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for ar... ar
checking for ranlib... ranlib
checking the archiver (ar) interface... ar
checking whether ln -s works... yes
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... none needed
checking whether yytext is a pointer... no
checking for bison... bison
checking for pdflatex... pdflatex
checking for bibtex... bibtex
checking for sphinx-build... sphinx-build
checking for usability of class beamer... yes
checking for g77... no
checking for xlf... no
checking for f77... f77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether f77 accepts -g... yes
checking how to get verbose linking output from f77... -v
checking for Fortran 77 libraries of f77...  -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -lgfortran -lm -lquadmath
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking if sgemm_ is being linked in already... no
checking for sgemm_ in -lopenblas... no
checking for ATL_xerbla in -latlas... no
checking for sgemm_ in -lblas... yes
checking for dgemm_ in -ldgemm... no
checking for sgemm_ in -lmkl_intel_lp64... no
checking for sgemm_ in -lmkl... no
checking for sgemm_ in -framework vecLib... no
checking for sgemm_ in -lcxml... no
checking for sgemm_ in -ldxml... no
checking for sgemm_ in -lscs... no
checking for sgemm_ in -lcomplib.sgimath... no
checking for sgemm_ in -lblas... (cached) yes
checking for sgemm_ in -lessl... no
checking for sgemm_ in -lblas... (cached) yes
checking for cheev_... no
checking for cheev_ in -llapack... yes
checking how to run the C++ preprocessor... g++ -std=gnu++17 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for compress in -lz... yes
checking for SZ_Compress in -lszip... no
checking for SZ_Compress in -lsz... no
checking for H5Fcreate in -lhdf5... no
checking matio.h usability... yes
checking matio.h presence... yes
checking for matio.h... yes
checking for Mat_Open in -lmatio... yes
checking for MATLAB prefix... /usr/local/MATLAB/R2020a
checking whether to enable MATLAB support... yes
checking for MEX-file suffix... mexa64
checking for MATLAB machine architecture... glnxa64
checking for MATLAB version... 9.8
checking for octave... octave
configure:

Dynare is now configured for building the following components...

Binaries (with "make"):
 Dynare++:                              yes

Documentation (with "make html pdf"):
 Manual and other documents             yes
 Dynare internal doc:                   no

Testsuites (run with "make check"):
 Dynare for MATLAB:                     yes
 Dynare for Octave:                     yes
 Dynare++:                              yes

checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating VERSION
config.status: creating doc/Makefile
config.status: creating doc/manual/Makefile
config.status: creating doc/manual/utils/version.py
config.status: creating doc/parallel/Makefile
config.status: creating doc/internals/Makefile
config.status: creating doc/gsa/Makefile
config.status: creating doc/dseries-and-reporting/Makefile
config.status: creating tests/Makefile
config.status: creating matlab/dynare_version.m
config.status: creating dynare++/Makefile
config.status: creating dynare++/parser/cc/Makefile
config.status: creating dynare++/sylv/Makefile
config.status: creating dynare++/sylv/cc/Makefile
config.status: creating dynare++/sylv/testing/Makefile
config.status: creating dynare++/tl/Makefile
config.status: creating dynare++/tl/cc/Makefile
config.status: creating dynare++/tl/testing/Makefile
config.status: creating dynare++/doc/Makefile
config.status: creating dynare++/utils/cc/Makefile
config.status: creating dynare++/integ/Makefile
config.status: creating dynare++/integ/cc/Makefile
config.status: creating dynare++/integ/src/Makefile
config.status: creating dynare++/integ/testing/Makefile
config.status: creating dynare++/kord/Makefile
config.status: creating dynare++/src/Makefile
config.status: creating dynare++/tests/Makefile
config.status: creating mex/sources/Makefile
config.status: executing depfiles commands
=== configuring in preprocessor (/home/stefan/dynare/preprocessor)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local'  '--with-matlab=/usr/local/MATLAB/R2020a' 'MATLAB_VERSION=9.8' --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports C++17 features with -std=gnu++17... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for ar... ar
checking for ranlib... ranlib
checking the archiver (ar) interface... ar
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... none needed
checking whether yytext is a pointer... no
checking for flex... /usr/bin/flex
checking for bison... bison
checking for boostlib >= 1.36 (103600)... yes
checking how to run the C++ preprocessor... g++ -std=gnu++17 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking boost/graph/adjacency_list.hpp usability... yes
checking boost/graph/adjacency_list.hpp presence... yes
checking for boost/graph/adjacency_list.hpp... yes
checking boost/algorithm/string/trim.hpp usability... yes
checking boost/algorithm/string/trim.hpp presence... yes
checking for boost/algorithm/string/trim.hpp... yes
checking boost/algorithm/string/split.hpp usability... yes
checking boost/algorithm/string/split.hpp presence... yes
checking for boost/algorithm/string/split.hpp... yes
checking for doxygen... no
checking for pdflatex... pdflatex
checking for bibtex... bibtex
checking for usability of class beamer... (cached) yes
configure:

The Dynare Preprocessor is now configured to build...

Binaries (with "make")
 Dynare preprocessor:                         yes

PDF documentation (with "make pdf"):
 Preprocessor & Macroprocessor presentations: yes

HTML documentation (with "make html"):
 Dynare preprocessor internal doc:            no (missing doxygen)


checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/macro/Makefile
config.status: creating doc/Makefile
config.status: creating doc/preprocessor/Makefile
config.status: creating doc/macroprocessor/Makefile
config.status: executing depfiles commands
=== configuring in mex/build/matlab (/home/stefan/dynare/mex/build/matlab)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local'  '--with-matlab=/usr/local/MATLAB/R2020a' 'MATLAB_VERSION=9.8' --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for MATLAB prefix... /usr/local/MATLAB/R2020a
checking whether to enable MATLAB support... yes
checking for MATLAB version... 9.8
checking for MEX-file suffix... mexa64
setting MEX-file suffix to .mexa64
checking for MATLAB machine architecture... glnxa64
checking for a sed that does not truncate output... /usr/bin/sed
checking for options to compile MEX for MATLAB... ok
checking for gfortran... gfortran
checking whether the Fortran compiler works... yes
checking for Fortran compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports C++17 features with -std=gnu++17... yes
checking for ranlib... ranlib
checking whether ln -s works... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking for dlopen in -ldl... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gsl/gsl_cdf.h usability... yes
checking gsl/gsl_cdf.h presence... yes
checking for gsl/gsl_cdf.h... yes
checking for cos in -lm... yes
checking for cblas_dgemm in -lgslcblas... yes
checking for gsl_cdf_ugaussian_P in -lgsl... yes
checking for compress in -lz... yes
checking for SZ_Compress in -lszip... no
checking for SZ_Compress in -lsz... no
checking for H5Fcreate in -lhdf5... no
checking matio.h usability... yes
checking matio.h presence... yes
checking for matio.h... yes
checking for Mat_Open in -lmatio... yes
checking how to get verbose linking output from gfortran... -v
checking for Fortran libraries of gfortran...  -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -lgfortran -lm -lquadmath
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... lower case, underscore, no extra underscore
checking for sb02od_ in -lslicot64_pic... yes
configure:

Dynare is now configured for building the following components...

Binaries (with "make"):
 MEX files for MATLAB (except those listed below):                   yes
 Gensylv, k-order and dynare_simul MEX files for MATLAB:             yes
 MS-SBVAR MEX files for MATLAB:                                      yes
 Kalman Steady State MEX file for MATLAB:                            yes
 M2HTML documentation:                                               no


checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mjdgges/Makefile
config.status: creating kronecker/Makefile
config.status: creating bytecode/Makefile
config.status: creating libdynare++/Makefile
config.status: creating gensylv/Makefile
config.status: creating k_order_perturbation/Makefile
config.status: creating dynare_simul_/Makefile
config.status: creating kalman_steady_state/Makefile
config.status: creating ms_sbvar/Makefile
config.status: creating block_kalman_filter/Makefile
config.status: creating sobol/Makefile
config.status: creating local_state_space_iterations/Makefile
config.status: creating perfect_foresight_problem/Makefile
config.status: creating num_procs/Makefile
config.status: creating disclyap_fast/Makefile
config.status: executing depfiles commands
=== configuring in mex/build/octave (/home/stefan/dynare/mex/build/octave)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local'  '--with-matlab=/usr/local/MATLAB/R2020a' 'MATLAB_VERSION=9.8' --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for mkoctfile... mkoctfile
warning: LFLAGS is deprecated and will be removed in a future version of Octave, use LDFLAGS instead
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gfortran... gfortran
checking whether the Fortran compiler works... yes
checking for Fortran compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports C++17 features with -std=gnu++17... yes
checking for ranlib... ranlib
checking whether ln -s works... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking for dlopen in -ldl... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gsl/gsl_cdf.h usability... yes
checking gsl/gsl_cdf.h presence... yes
checking for gsl/gsl_cdf.h... yes
checking for cos in -lm... yes
checking for cblas_dgemm in -lgslcblas... yes
checking for gsl_cdf_ugaussian_P in -lgsl... yes
checking for compress in -lz... yes
checking for SZ_Compress in -lszip... no
checking for SZ_Compress in -lsz... no
checking for H5Fcreate in -lhdf5... no
checking matio.h usability... yes
checking matio.h presence... yes
checking for matio.h... yes
checking for Mat_Open in -lmatio... yes
checking how to get verbose linking output from gfortran... -v
checking for Fortran libraries of gfortran...  -L/usr/lib/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -lgfortran -lm -lquadmath
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... lower case, underscore, no extra underscore
warning: LFLAGS is deprecated and will be removed in a future version of Octave, use LDFLAGS instead
checking for sb02od_ in -lslicot... no
checking for sb02od_ in -lslicot_pic... yes
checking for umfpack_dl_defaults in -lumfpack... no
configure: error: Can't find UMFPACK
configure: error: ./configure failed for mex/build/octave

I would be very glad to give more details, could also install it the ‘normal’ way again and supply the error-logs.

Thank you already in advance as now, I really have to make this work :wink:

Cheers.

You are probably missing some packages (my guess is ibsuitesparse-dev or libumfpack5), which need to be installed only once. Just to be sure run the following command to install all required packages:

sudo apt install -y build-essential gfortran liboctave-dev libboost-graph-dev libgsl-dev libmatio-dev libslicot-dev libslicot-pic libsuitesparse-dev flex bison autoconf automake texlive texlive-publishers texlive-latex-extra texlive-fonts-extra texlive-latex-recommended texlive-science texlive-plain-generic lmodern python3-sphinx latexmk libjs-mathjax doxygen
sudo apt install -y x13as

Then to install the current stable release do the following

# Create a Dynare directory
mkdir -p /home/$USER/dynare
# Download from git the stable version
git clone --recurse-submodules --single-branch --branch 4.6 https://git.dynare.org/Dynare/dynare.git /home/$USER/dynare/stable-4.6
cd /home/$USER/dynare/stable-4.6
# Compile from source for use in MATLAB
./configure --with-matlab=/usr/local/MATLAB/R2020a MATLAB_VERSION=R2020a --disable-octave
make
# for faster compilation use the following make command
make -j$((`nproc`+1))

This works for me under Ubuntu 20.04. Let me know if you are still struggling.

1 Like

Actually this shows that something is not correct with your Octave install, but as far as you don’t need it, the --disable-octave configuration flag should work for you.

Thank you so much for the quick reply. I managed to install it but there is still a problem when trying to run a mod file in Matlab.
I get:

Using 64-bit preprocessor
Starting Dynare (version 4.6.2).
Calling Dynare with arguments: none
/home/stefan/dynare/stable-4.6/matlab/preprocessor64/dynare_m: /usr/local/MATLAB/R2020a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/stefan/dynare/stable-4.6/matlab/preprocessor64/dynare_m)

The thing is that I do have the newest version of libstdc++ installed. Are you maybe familiar with this error?

Thank you :slight_smile:

This is a known issue as Matlab ships its own precompiled libraries which should be renamed. The easiest way is to install matlab-support

sudo apt install matlab-support

and let the script rename the binaries.

1 Like

This fixed it, had to first remove it and then install it again. Now it is running.
Thank you so much, you are amazing :slight_smile:

Guys, I am geting the same error message

Starting Dynare (version 4.7-unstable).
Calling Dynare with arguments: none
/home/anton/dynare/matlab/preprocessor64/dynare_m: /usr/local/MATLAB/R2020b/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26’ not found (required by /home/anton/dynare/matlab/preprocessor64/dynare_m)

But sudo apt install matlab-support doesn’t fix it, any other suggestions?

@sebastien Could you please have a look?

The problem comes from a library shipped by MATLAB, which conflicts with the Ubuntu libraries. The matlab-support package normally deals with this problem; I guess you did not give it the location of your MATLAB R2020b installation.

Alternatively, you can fix this by hand, by renaming (or even deleting) the following file: /usr/local/MATLAB/R2020b/sys/os/glnxa64/libstdc++.so.6

Beautiful! That solved it, thank you so much Sebastien!!