Starting with radiance

Hi Radiance Community!

As I’m pretty-much new with this thing, I have few questions about setting up the environment for radiance, and tools I’ve seen in tutorials.

  1. It seems that is the best to run Radiance under the Unix-like OS. Is there any suggestion which distro to choose?
  2. I’ve found some tutorials by Axel Jacobs and few others as well, but I’m struggling with some parts. Some tools used in tutorials I don’t have or I’m missing something. Those are objline, objpict, etc. Also, piping to x11meta doesn’t work, as I’m missing x11meta.

Probably there will be more questions, but that’s all for now :slight_smile:

Regards,
Pavle

Hi Pavle,

  1. Yes, Radiance run best under UNIX (which would include MacOS). If you’re on a Windows box, look into WSL (Windows subsystem for LINUX). There has been a thread or two recently on this mailing list. Ubuntu seems to be a good choice. I’d recommend an LTS (long-term support) release. These come out every 2 years. The most recent one is 20.04
  2. Correct. x11meta doesn’t work under Windows. Try piping objline, objpict into psmeta. This produces EPS (encapsulated postscript) files, which you should be able to open with Adobe Illustrator or Inkscape.

Hope this helps.

Hi Axel :slight_smile:

Yes, I was running it under the latest ubuntu LTS, focal, but have had issues with those tools as well. This x11meta is part of radiance?

What’s the best, to download the source and run install script or to download .tar.gz prepared for e.g. Linux?

Yes, x11meta is part of Radiance. Do you have it in your install directory?

Type ‘which oconv’ to find out where your Radiance binaries are installed. In this folder, you should also have x11meta

If you are on WSL, you also have to install an X11 server. I have not tried this myself, so can’t help you with this. Otherwise, you can only use command-line tools, but can’t run ximage, objview, rvu, x11meta, trad

See Mattia’s post from Sep 9th:


This should help

Thank you, I’ve managed to set it up.

It’s worth mentioning this post from Mattia Bressanelli

Regarding X Window server, there is a fix if you’re getting “cannot open display” error:
StackOverflow

It seems that everything ok, but when I try to follow this:
objline objects/things.rad | x11meta
I’m getting just a white screen:

After resizing the screen, in wsl i’ve got following error: fatal - cannot open file “/usr/local/lib/meta/vchars.mta”, mode “r”

It seems that “precompiled” version have some issues with x11meta, I’ll try to download source and install it using install script.

EDIT:

I’m getting the same error after installing from source…

i am really sorry, Pavlek. Cannot help you with this. My company is currently rolling Win10, but i’m still on Win7, so can’t advise on this… It does look like some kind of RAYPATH issue to me

On Win7 this x11meta thing is working?

We’re looking into it. Must be some build issue related to the library path for the metafile graphics, which predate even Radiance. Meanwhile, you could try creating a soft link from /usr/local/lib/meta to /usr/local/lib/ray/meta (assuming that’s where the files live) to see if that fixes it.

It seems that’s something with permissions :slight_smile:

I’ve created this meta dir, and also created this vchars.mta file, both with 777. Now, when I start objline chair.rad | x11meta it fires up empty x11meta, but when I resize it there is a chair :slight_smile:

It works now.

Thank you all

Hi @pavlek86,

I am looking into this X11meta issue, did you manage it by using the pre-compiled Radiance from LBNL or you build the source by yourself?

Hi @Axel_Jacobs2

Could you please help me to understand this better?
Do you mean we can’t also compile x11meta in the command-line only environment without x11 server?

Hi @Greg_Ward,
I just checked the build logs for x11meta on Mac and Ubuntu, it exists in output build/bin, and I don’t see any compiling error. Would it be possible to add a unit test for this case, so that we can expose and capture it in CI/CD?

It seems to be an issue with installing the auxiliary files, not the compilation itself. The vchars.mta and a number of other files are supposed to get copied to a location that is either identical to the default MDIR macro in meta.h, or an environment variable of the same name. I don’t know how this is done on Windows, and having a test case wouldn’t help because it’s a target configuration issue.

Ok, if it is installing issue, it makes more sense, because the current installer for mac doesn’t do anything except unzipping the compiled files to target directory, and there is no installer built for linux, currently it is just a zip file includes everything. For Windows, we actually has an installer, it has additional scripts to set up the environment variables for Radiance path.

If we need to install the auxiliary files to somewhere else other than the Radiance folder, and we might need to redesign the installers for each system. @Rob_Guglielmetti do you have any suggestions on this?

I don’t exactly know how to help with the cmake build system, but Rmakefile has compile lines like:

cc -DMDIR=\"/usr/local/lib/ray/meta/\" -O2 -DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib -I…/common -L…/lib -o bgraph bgraph.o mgvars.o mgraph.o
-lmeta -lrtrad -lm

and does the following operations at the end:

cp symbols.met vchars.met boxw.plt curve.plt line.plt scatter.plt cartesian.plt function.plt polar.plt standard.plt /usr/local/lib/ray/meta
./cv symbols.met > /usr/local/lib/ray/meta/symbols.mta
./cv vchars.met > /usr/local/lib/ray/meta/vchars.mta

As you can see, the compiled-in setting for the MDIR macro is “/usr/local/lib/ray/meta/” in this case. If you want to install these files in the standard Radiance auxiliary file location rather than a subdirectory, you can do so, but you’ll want to redefine the MDIR macro in that case to point to this, instead. Alternatively, you can set the MDIR environment variable to wherever you put these files. Note that unlike RAYPATH, you can only specify one directory, and there has to be a trailing “/” character at the end.

I don’t know how any of this happens with cmake, unfortunately. Still hoping to hear from @Rob_Guglielmetti on that…

I’m so sorry for the radio silence, I’ve been busy and distracted. I do recall resolving this locally on a per-case basis (with MDIR) and never sorted it within the cmake framework. @Mingbo, there must be a way(s) to make post-installation mods to the environment on the Mac installers, no? I’ll hit you guys up offline.