Radiance and Ubuntu

Hi everybody!
I am quite new of Radiance (I used to work with Adeline but was long time ago) and Ubuntu. I managed to install Ubuntu through Oracle Virtual box (on Windows 10), so the next step would be to have Radiance up and running on it.
I have looked into other topics but haven’t found a direct answer to my doubt. I apologize in advance if I am doubling someone else topic.
May I just use the “radiance-5.2.91bcc23df3-Linux.tar.gz” archive or should one compile the source instead. Is there any difference?
In the first case, should I just copy the files in the relative folders in Ubuntu (in usr/local?).

Sorry for this very rookie-like questions.

Thank you very much for your time and help.

I’m ASSuming that Virtual Box gives you a unix/bash shell to work from. I’m further ASSuming you want the unix interface versus Windows? I totally understand that, I’m just checking because there IS a Windows installer for Radiance on the NREL GitHub site. There is also the lightweight “Git for Windows” installer here which gives you a fully POSIX compliant BASh shell on Windows.

OK so assuming you really want to interact with Radiance via a bash shell on Windows, then yeah I’d go with Git for Windows since it’s a Ubuntu-based bash shell, and the Radiance linux binaries in that archive you downloaded were built on an Ubuntu system.

Finally, yes, you’d unpack the tarball to wherever, and point to [install_dir]/bin in your system PATH, and [install_dir]/lib in your RAYPATH environment variable. That should work straight out of the box as it were.

  • Rob

Hi Rob,
Thank you for your answer. I have read posts suggesting to run Radiance under Linux -this being preferable than the windows version- and that the windows version doesn’t handle multi processing (for some commands).
Would Git allow for multiprocessing?Also I am not sure I have understood how to install the files. Could you tell me more? Thank you again for your help!

Yes, it’s true that the unix version “just works better”, the biggest one being that multiprocessing dealio. the -n switch on some of the key tools like rtrace and rcontrib is simply ignored when running those executables on Windows.

Interestingly enough, I’ve never actually tested using the multiprocessing features of Radiance on a linux vm running on Windows. It absolutely should work, but I’ve never actually tested it. Has anyone here done this? If I get a chance I’ll test that out myself here soon…

Hi Rob, I did it a few years ago with VirtualBox. There are some issues related to how many processors and memory can be allocated to the VM, but the experience is same as running Radiance on a normal Ubuntu desktop. Additionally, converting bat files with relative paths to shell scripts with the same folder structure is tricky sometimes because Windows adds carriage returns to lines.

OK yeah that makes sense, that only the processors and memory allocated to the VM would be available to the Radiance executables. And yea paths are always a headache. The OpenStudio Radiance measure is loaded wit path workarounds that (usually) work. =)

Thank you both for the elucidations! Talking about paths, I managed to set the environment variables.
Going through the ‘Radiance tutorial’ I got stuck into this error:

fatal - cannot open file “.:/usr/local/lib/meta/:vchars.mta”, mode “r”

I have set a MDIR variable pointing to the folder where the file is but didn’t work. I also tried to create a folder ‘meta’ in /usr/local/lib/ changed the variable to point at it, same result.

Also I have got the feeling that this function would serve only educational purposes, sort of thing newbie like me got stuck while following the tutorial. Something that could be ignored then ?

Any suggestion? Thanks again for your precious help!

Unlike the $RAYPATH environment variable, $MDIR needs to be assigned the exact directory path for your system, including the final path separator. For example, MDIR=/usr/local/lib/meta/ might be valid.

Yeah so that’s a weird one. We package vchars.mta in with the lib files, so if you used the NREL installer or archives you probably want to use: MDIR=/usr/local/radiance/lib

Tried both but didn’t work.
Still getting

fatal - cannot open file “/usr/local/radiance/lib:vchars.mta”, mode “r”

Those are the variables in my .profile file:

PATH=.:/usr/local/radiance/bin:$PATH
RAYPATH=.:/usr/local/radiance/lib
MANPATH=/usr/local/radiance/doc/man/:$MANPATH
MDIR=/usr/local/radiance/lib:$MDIR
export PATH RAYPATH MANPATH MDIR

Any idea?
Thank you very much!

Is vchars.mta really in there? Maybe our lunux package is no good? When you list the contents of /usr/local/radiance/lib you should see 130 files, including vchars.mta…

I think the problem is that you don’t want the final colon and $MDIR at the end – leave that off! It is only appropriate if you are adding to an existing path list, which you are not.

Hi Greg,
yes you are right. Now it works!

Thank you!

I always thought the final colon and reference to the variable itself was to append the existing contents of the env var (if any) to the new path entry. Maybe if the env var didn’t exist previously, this fails.

The MDIR variable isn’t a search path in the same way that RAYPATH or PATH are. It is a single library directory, which is the only place the programs that use it look for their files. It isn’t as flexible as having a path, but we don’t really need that level of flexibility for these particular tools. (Incidentally, the metafile graphics tools predate Radiance by some years. They were used for data reduction and plotting, and are the source of the .cal language used throughout Radiance.)

Ah, well that explains everything, then. Thanks Greg!

I actually used multiprocessing in virtual machines with ubuntu as guest and windows as host. (Virtualbox). It works pretty OKisch. (cpu performance is a bit less than on dual-boot machines).

A good thing to know is that you can start the process on all available cores (e.g. 8), but reduce the number of physical cores used by manipulating the file ($i : 0…7 if you have 8 cores):

/sys/devices/system/cpu/cpu$i/online

So you can reduce the load “on the fly” (e.g. if the user complains…), automating is also possible (e.g. increase load during night).

Jan

1 Like

Thanks Jan, that’s interesting!