Setting Up New or Additional Languages
Last updated
Was this helpful?
Last updated
Was this helpful?
Environment editor provides flexibility to set up your computation environment. After you select a starter environment, you can add additional languages to your capsule.
If you are building a bi or multi-language capsule:
Use a base Ubuntu (18.04 or 16.04) environment, if you are not using a pre-installed language.
Start from an environment with the proprietary language if you are using one, for example Matlab.
Select an environment with GPU access, these will be labeled as such, or will reference CUDA or a deep learning framework, if you are using GPU.
The following are all available as apt-get
packages:
build-essential
for the C/C++ toolchain (gcc/g++, make, etc.);
r-base
for R (note: r-base-dev
will help you install R packages, we recommend adding a for installing archived R packages, see more detail below);
octave
for Octave;
python-pip
for Python 2 and the pip installer;
python3-pip
for Python 3 and the pip3 installer;
perl
for Perl (add cpanm
if needed);
luajit
for Lua (add luarocks
if needed);
default-jdk
for Java;
gfortran
for Fortran.
Once you add R or python, the commands Rscript
or python
will become available, respectively.
In the environment editor, click the gear icon next to apt-get. This will open the apt-get configuration window.
In Additional sources, copy and paste deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
(for R 3.6) or deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/
(for R 4.0). This tells apt-get to search for packages on the R project's own repository.
4. Click Save.
5. Navigate back to the environment editor.
6. Add r-base
as an apt-get dependency, this step is crucial.
Note: the various R installer options will show up automatically, which you can immediately add packages to.
While Code Ocean's environments are based on a recent version of Ubuntu (18.04 code name "Bionic Beaver" or just "Bionic"), the is 3.4.4. To get newer versions of R to install on Code Ocean:
In GPG Keys, copy and paste E298A3A825C0D65DFD57CBB651716619E084DAB9
. This is a piece of information to guarantee the authenticity of the repository.