Installing Dynare in Code Ocean

Hello. We are trying to to use Dynare in the collaboration tool called Code Ocean that allows for replication of research and codes online. To the best of our knowledge Dynare has not yet been used in Code Ocean.

Our problem is that the installation of Dynare is not completedand the Dynare codes do not run.

We have completed the installation based on this link:

However, Ocean Code does not recognize Dynare.

We also have thse two examples about how to install the toolboxes in Code Ocean using a bash script:

However, we still do not have a good idea about how to make the Dynare codes run.

Could you please give a hint as to how to install Dynare in Code Ocean?

  1. Can you get the help of Code Ocean help desk?
  2. Does code Ocean run on Linux?
  3. Try using Debian package dynare

Thank you very much for your response.

  1. Yes we are getting support from the Code Ocean help desk, we have had a couple of iterations with them. I have also had support from the IT department here in the central bank, however, it seems that more iterations will be needed before Dynare can run in Code Ocean.
  2. Yes Code Ocean runs on Linux
  3. We do nos see a way to choose Debian or a way to see whether the installation chooses Debian or Ubuntu. After one of the error messages we were not sure whether there is indeed a Debian version of matlab in Code Ocean.

We have tried different forms of installation and we have had issues with the paths, the directory where Dynare is placed and the permissions.

It would be nice to have Dynare in Code Ocean, I hope eventually that can be done.

Thank you very much

@sebastien Do you have any insights?

Code Ocean seems to run on Ubuntu and/or Debian, according to their documentation.

So, as @MichelJuillard said, one possibility is to use the package manager to install Dynare, i.e.:

  • apt-get install dynare to get the Octave-based version of Dynare
  • apt-get install dynare-matlab to get the MATLAB-based version (that will only work, of course, if MATLAB is installed in the container; the installation process will ask for the location of the MATLAB binary)

If for some reasons those packages do not fulfil your needs (e.g. because they are too old, depending on the version of Debian/Ubuntu that is installed), then the only option is to compile from source, as documented on our website.

In the future, I hope that we can provide universal Linux binaries (those are currently hard to produce with our autotools-based build system, but I plan to rewrite our build system using Meson, which should in particular facilitate this).

I forgot to mention that since Ubuntu is based on Debian, the APT packages are also available under Ubuntu.

Dynare is now running well in Code Ocean.
The following is the list of packages that the Code Ocean help desk installed in the model capsule:

build-essential 12.8ubuntu1.1
dynare 4.6.0+dfsg-2
g++ 4:9.3.0-1ubuntu2
gcc 4:9.3.0-1ubuntu2
gfortran 4:9.3.0-1ubuntu2
libboost-graph-dev 1.71.0.0ubuntu2
libgsl-dev 2.5+dfsg-6build1
libmatio-dev 1.5.17-3
libslicot-pic 5.0+20101122-4build1
make 4.2.1-1.2
sudo 1.8.31-1ubuntu1.5
wget 1.20.3-1ubuntu2
x13as 1.1-B39-1build1

When reading data or preparing data to be readable in a mod file, you may want to check that you are using the right directory, either /code/Data_file_name or /data/Data_file_name.

José Manuel Gamarra provided excellent research assistance.

1 Like

Thanks to everyone for all the valuable tips.