Code Ocean offers many base environments with different languages pre-installed. You can also use the environment & configuration options to install multiple languages in one compute capsule. Available package managers will suffice for many common languages; less common languages will likely require a setup script.
Which language should I start with?
- are not using a pre-installed language, use the "Other" base environment;
- need proprietary software, such as MATLAB or Stata, start from the proprietary language;
- use a GPU, start from the language that offers native GPU support (currently C/C++, MATLAB, Python, and Lua) and switch to a base environment with GPU access.
Otherwise, start from the language that most of your code is in.
Installing a language using package managers:
The following are all available as apt-get packages:
build-essentialfor the C/C++ toolchain (gcc/g++, make, etc.);
r-basefor R (
r-base-devwill help you install R packages);
pythonfor Python (add
python-pipfor pip installer support);
perlfor Perl (add
luajitfor Lua (add
Once you add R or python, the commands
python will become available, respectively.
Installing langauges through Conda
pythonis available by default;
juliais available through conda-forge;
ris available from channel r .
Installing languages using the Setup Script:
Less common languages will likely require specialized setup scripts to install. For example:
Mono is an open source implementation of Microsoft's .NET Framework. The Mono project website has instructions for installing Mono on Ubuntu 16.04.
Start by choosing the "Other" language, which will get you a minimal Ubuntu environment. You can then write a setup script using the commands from Mono's instructions as is, with one small change:
sudo is not required (nor available by default) on Code Ocean. The resulting Setup Script, with
sudo taken out, looks like this:
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | tee /etc/apt/sources.list.d/mono-official.list
apt-get update -qq && apt-get install -y mono-devel
As a side note, in order to build your project and run it, use the following commands in your
run.sh shell script:
xbuild /p:Configuration=Release myproject.csproj
Run the following setup script:
buildDeps="ca-certificates gcc gnat make zlib1g-dev"
apt-get update && apt-get install -y $buildDeps
release="20181129" # or whichever release is appropriate
curl -L https://github.com/ghdl/ghdl/archive/$release.tar.gz | tar xz
make && make install
apt-get purge -y --autoremove $buildDeps && rm -rf /var/lib/apt/lists/*
Run the following setup script:
apt-get update && apt-get install -y lsb-release
for deb in deb deb-src; do echo "$deb http://build.openmodelica.org/apt `lsb_release -cs` nightly"; done | tee /etc/apt/sources.list.d/openmodelica.list
curl -s http://build.openmodelica.org/apt/openmodelica.asc | apt-key add -
apt update -qq && apt install -y openmodelica
apt-get purge -y --autoremove lsb-release && rm -rf /var/lib/apt/lists/*
What if I need proprietary software that isn't currently supported?
Contact us at firstname.lastname@example.org and we will be happy to look into it.