# Installing Dynare in Code Ocean

**URL:** <https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651>\
**Category:** Installation and Setup\
**Created:** [26 June 2023 21:03 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651 "2023-06-26T21:03:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgomezpi](https://forum.dynare.org/user_avatar/forum.dynare.org/jgomezpi/32/16823_2.png) [@jgomezpi](https://forum.dynare.org/u/jgomezpi)\
**Post date:** [26 June 2023 21:03 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651/1 "2023-06-26T21:03:25Z")

</div>

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:

> **[The package management system | Help | Code Ocean](https://help.codeocean.com/en/articles/1197548-the-package-management-system)**
>
> Install any libraries, packages, or dependencies your code needs in order to run.

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:

> **[Using the postInstall script for further customization | Help | Code Ocean](https://help.codeocean.com/en/articles/1197555-using-the-postinstall-script-for-further-customization)**
>
> Download, extract, compile – use the full set of tools available on Linux to set up your runtime environment.

> **[Installing user-provided MATLAB toolboxes | Help | Code Ocean](https://help.codeocean.com/en/articles/1110985-installing-user-provided-matlab-toolboxes)**
>
> Downloading and installing CVX, VLFeat, MOSEK, YALMIP, etc. using postInstall functionality.

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?

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://forum.dynare.org/user_avatar/forum.dynare.org/micheljuillard/32/5318_2.png) [@MichelJuillard](https://forum.dynare.org/u/MichelJuillard)\
**Post date:** [27 June 2023 10:53 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651/2 "2023-06-27T10:53:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jgomezpi](https://forum.dynare.org/user_avatar/forum.dynare.org/jgomezpi/32/16823_2.png) [@jgomezpi](https://forum.dynare.org/u/jgomezpi)\
**Post date:** [30 June 2023 21:50 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651/3 "2023-06-30T21:50:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [3 July 2023 20:11 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651/4 "2023-07-03T20:11:38Z")

</div>

@sebastien Do you have any insights?

---

<div class="post-metadata">

**Author:** ![sebastien](https://forum.dynare.org/user_avatar/forum.dynare.org/sebastien/32/19973_2.png) [@sebastien](https://forum.dynare.org/u/sebastien)\
**Post date:** [4 July 2023 09:43 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651/5 "2023-07-04T09:43:44Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![sebastien](https://forum.dynare.org/user_avatar/forum.dynare.org/sebastien/32/19973_2.png) [@sebastien](https://forum.dynare.org/u/sebastien)\
**Post date:** [4 July 2023 09:44 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651/6 "2023-07-04T09:44:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jgomezpi](https://forum.dynare.org/user_avatar/forum.dynare.org/jgomezpi/32/16823_2.png) [@jgomezpi](https://forum.dynare.org/u/jgomezpi)\
**Post date:** [13 July 2023 15:49 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651/7 "2023-07-13T15:49:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jgomezpi](https://forum.dynare.org/user_avatar/forum.dynare.org/jgomezpi/32/16823_2.png) [@jgomezpi](https://forum.dynare.org/u/jgomezpi)\
**Post date:** [14 July 2023 15:09 UTC](https://forum.dynare.org/t/installing-dynare-in-code-ocean/22651/8 "2023-07-14T15:09:36Z")

</div>

Thanks to everyone for all the valuable tips.
