Installing Dynare for Octave from AUR (and problem with SLICOT)

Hi all, apologies but I seem to have a problem and searching around hasn’t helped.

I’m running Manjaro, and I tried to install Dynare from the AUR using pamac. The building always stops at /mex/build/octave/mjdgges, giving this error:

Making all in mex/build/octave
make[1]: Entering directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave'
Making all in mjdgges
make[2]: Entering directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave/mjdgges'
ln -s -f ../../../sources/mjdgges/mjdgges.cc mjdgges.cc
make  all-am
make[3]: Entering directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave/mjdgges'
g++ -std=gnu++17 -DPACKAGE_NAME=\"dynare\" -DPACKAGE_TARNAME=\"dynare\" -DPACKAGE_VERSION=\"4.6.1\" -DPACKAGE_STRING=\"dynare\ 4.6.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE
=\"dynare\" -DVERSION=\"4.6.1\" -DHAVE_CXX17=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INT
TYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBM=1 -DHAVE_LIBZ=1 -DHAVE_LIBSZ=1 -DHAVE_LIBHDF5=1 -DOCTAVE_MEX_FILE -DMEXEXT=\".mex\" -I.  -D_FORTIFY_SOURCE=2 -I/usr/include/octave
-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave -I../../../sources -D_FORTIFY_SOURCE=2 -fPIC -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wno-parentheses -Wold-style-cast -MT
mjdgges.o -MD -MP -MF .deps/mjdgges.Tpo -c -o mjdgges.o mjdgges.cc
mv -f .deps/mjdgges.Tpo .deps/mjdgges.Po
g++ -std=gnu++17 -fPIC -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wno-parentheses -Wold-style-cast -shared -Wl,-Bsymbolic -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o m
jdgges.mex mjdgges.o  -loctinterp -loctave  -lblas -llapack  -lfftw3_threads -lfftw3   -lfftw3f_threads -lfftw3f  -lutil  -lm   -L/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0 -L/usr/lib/gcc/x86
_64-pc-linux-gnu/10.1.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../.. -lgfortran -lm -lquadmath
/usr/bin/ld: cannot find -loctinterp
/usr/bin/ld: cannot find -loctave
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:387: mjdgges.mex] Error 1
make[3]: Leaving directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave/mjdgges'
make[2]: *** [Makefile:308: all] Error 2
make[2]: Leaving directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave/mjdgges'
make[1]: *** [Makefile:387: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave'
make: *** [Makefile:421: all-recursive] Error 1
==> ERROR: A failure occurred in build().
   Aborting...

The weird thing is that I’m able to build Dynare from source by cloning the git repository, and things seem to work after adding the Dynare path to Octave. But I would still like to get the AUR version working if possible.

As a side note, I was also unable to figure out how to get the installation working without passing the --disable-mex-kalman-steady-state option. It seems that this has something to do with SLICOT, but I have absolutely no idea how to get that working.

If it makes a difference, when building from AUR, the options I entered when building Dynare were --prefix=/usr --disable-matlab --disable-mex-kalman-steady-state, whereas when building from source I entered ./configure --disable-matlab --disable-mex-kalman-steady-state since the README didn’t mention --prefix=/usr (which was already there when I first tried to build from AUR).

Thank you!

@sebastien Do you have any insights?

There was a similar problem when compiling on Fedora against Octave 5.

I have applied the following patch: https://git.dynare.org/Dynare/dynare/-/commit/5389fa20a9ca7be94d063d72fc9b6fb3de0ecfbe

@SamuelLeeD Can you confirm that manually applying this patch on your source tree fixes the problem?

1 Like

Thanks for the help!

I no longer get the error about -loctinerp or -loctave, but I do get the following error:

Making all in mex/build/octave
make[1]: Entering directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave'
Making all in mjdgges
make[2]: Entering directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave/mjdgges'
 cd .. && /bin/sh /var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave/missing automake-1.16 --foreign mjdgges/Makefile
configure.ac:23: error: version mismatch.  This is Automake 1.16.2,
configure.ac:23: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:23: comes from Automake 1.16.1.  You should recreate
configure.ac:23: aclocal.m4 with aclocal and run automake again.
WARNING: 'automake-1.16' is probably too old.
         You should only need it if you modified 'Makefile.am' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'automake' program is part of the GNU Automake package:
         <https://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <https://www.gnu.org/software/autoconf>
         <https://www.gnu.org/software/m4/>
         <https://www.perl.org/>
make[2]: *** [Makefile:313: Makefile.in] Error 63
make[2]: Leaving directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave/mjdgges'
make[1]: *** [Makefile:387: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/mex/build/octave'
make: *** [Makefile:421: all-recursive] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

I have a feeling that this is something I should be able to solve myself, but I have no idea how to proceed from here.

Try to run autoreconf in the top-level source directory.

I ran into one more error, this time regarding Sphinx.

Exception occurred:
  File "/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/doc/manual/utils/dynare_dom.py", line 37, in <module>
    from sphinx.locale import l_, _
ImportError: cannot import name 'l_' from 'sphinx.locale' (/usr/lib/python3.8/site-packages/sphinx/locale/__init__.py)
The full traceback has been saved in /tmp/sphinx-err-aauwufvu.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make[2]: *** [Makefile:461: build/html/index.html] Error 2
make[2]: Leaving directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/doc/manual'
make[1]: *** [Makefile:368: html-recursive] Error 1
make[1]: Leaving directory '/var/tmp/pamac-build-samuel/dynare/src/dynare-4.6.1/doc'
make: *** [Makefile:420: html-recursive] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

My sense is that this isn’t the most important since it only affects the documentation, but do you know of a way to fix this? Thanks for your help so far!

Edit: from my snooping around it seems (though I’m not entirely sure) that the l_ function in sphinx.locale was replaced by _, whereas /doc/manual/utils/dynare_dom.py uses both l_ and _. This seemed to be fixed in the git version, so I’ll try patching dynare_dom.py.

Edit2: It worked! Thank you for all your help!

As a side note, do you know what I might need to do to fix the issue with the Kalman MEX? I think I need to have SLICOT and I see a website for it but I have no idea what to do.

The sphinx problem is a known bug in Dynare 4.6.1, that was fixed in Dynare 4.6.2.

Your manual fix is fine too, even though it’s always better to use the latest stable release.

You need to compile SLICOT by hand if it’s not packaged in your distribution. You can follow the instructions that are given for Fedora, I guess they will also work for Arch Linux, see: https://git.dynare.org/Dynare/dynare/-/blob/master/README.md#fedora-centos-or-rhel

Thank you! I had actually just figured that out yesterday (and was going to update here) but I appreciate all the help.