Skip to content
Advertisement

Running .EXE or Perl file on Google Colab

I want to process a set of HDR files with an Executable (e.g., falsecolor2.exe) file on google colab.

The source file is here: https://github.com/mostaphaRoudsari/honeybee/blob/master/resources/falsecolor2.exe?raw=true sample HDR files: http://www.anyhere.com/gward/hdrenc/pages/originals.html

The executable takes an HDR file with some arguments and generates a new HDR file. On my local machine and drive, the following code works OK:

JavaScript

I am not sure how to create a similar process in colab; after mounting the gdrive, the following code generates a 0 byte not-working HDR in my gdrive and returns error code 32256.

JavaScript

I read some threads on shell and linux executables but could not replicate any of them successfully.

Advertisement

Answer

You can install Radiance in Google Colab like this:

JavaScript

I ran !lsb_release -a to find out the Linux distribution in Google Colab and it said that it was Ubuntu 18.04. Unfortunately, Radiance does not seem to be available for that version, but only for 16.04. That is why getting it from Github seems to be the next simplest solution. See radiance in Ubuntu Packages:

Exact hits

Package radiance

  • xenial (16.04LTS) (graphics): Lighting Simulation and Rendering System [universe] 4R1+20120125-1.1: amd64 arm64 armhf i386 powerpc ppc64el s390x

Then I tried to run your falsecolor command using one of the sample images you linked and found that the -lp and -z options are not available:

JavaScript

If you remove those options the command runs successfully:

JavaScript

See a demo in this colab.

Advertisement