Application of Radiance Perl scripts on Windows

Hello,

I have a question/request with regards to the application of Radiance Perl
scripts on Windows:

I had previously managed to package all Perl scripts in the Radiance/bin
directory via the PAR package for Perl so that there would be an executable
version (.exe) per each .pl format. The reason for such transformation is
the significant impact that calling a ".exe" file has on the overall
workflow using Radiance on Windows in comparison with having to call the
Perl interpreter and passing the given script's path
(Radiance/bin/<filename>.pl) every time that a single Perl script has to be
used on the Windows command line (In particular, Git Bash). However,
recently, there has been changes and I have not managed to use the
open-source PAR package for Perl to package the Radiance perl scripts into
.exe format.

- I was wondering if it is possible to release a ".exe" file for each
Radiance Perl script (corresponding with the release of each update to a
script)?

- Otherwise, I would appreciate if you could guide me on alternative
solutions to transform Perl scripts to .exe files on Windows.

(Other than the open-source PAR package, I have used a trial version of the
commercial Active State Perl Development Kit including PerlApp that allows
you to make executable file for perl scripts. However, once the trial
period is over, the generated .exe files by the application will no longer
work.)

Thank you very much,
Alireza

The PAR package actually wraps an entire copy of the Perl interpreter around each and every Perl script, which is a ridiculous waste of space and a burden on load/run times. If you have Perl and Radiance installed properly you can call perl scripts on Windows (Widows and GitBash shells) just the same as on any other platform. The Radiance-related perl scripts should be installed with all the other Radiance executables, and that location should be in your system PATH. Perl needs to be installed and configured to be the “default application”, or whatever the Windows jargon is, for perl scripts. Once these two things are done, you can call the name of the perl script (e.g. genBSDF.pl) and it will work, from any location.

- Rob

···

On Feb 27, 2016, at 5:20 PM, Alireza Hashemloo <[email protected]> wrote:

Hello,

I have a question/request with regards to the application of Radiance Perl scripts on Windows:

I had previously managed to package all Perl scripts in the Radiance/bin directory via the PAR package for Perl so that there would be an executable version (.exe) per each .pl format. The reason for such transformation is the significant impact that calling a ".exe" file has on the overall workflow using Radiance on Windows in comparison with having to call the Perl interpreter and passing the given script's path (Radiance/bin/<filename>.pl) every time that a single Perl script has to be used on the Windows command line (In particular, Git Bash). However, recently, there has been changes and I have not managed to use the open-source PAR package for Perl to package the Radiance perl scripts into .exe format.

- I was wondering if it is possible to release a ".exe" file for each Radiance Perl script (corresponding with the release of each update to a script)?

- Otherwise, I would appreciate if you could guide me on alternative solutions to transform Perl scripts to .exe files on Windows.

(Other than the open-source PAR package, I have used a trial version of the commercial Active State Perl Development Kit including PerlApp that allows you to make executable file for perl scripts. However, once the trial period is over, the generated .exe files by the application will no longer work.)

Thank you very much,
Alireza

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Rob,

Thank you for your response. Let me elaborate on the difficulty I run into
when I add the Perl interpreter to my environment variable paths on Windows
or calling the interpreter and passing the script's path to it in
comparison with packaging the Perl scripts with PAR or any commercial
product that does such packaging:

Using Git Bash on Windows 7 (64-bit), if I call a Perl script by calling
the interpreter and then the script path such as "$ perl C:/Radiance/bin/
genklemsamp.pl ..." OR by adding the the Perl interpreter to my environment
variable paths so that I just could call the name of the desired script in
the command line such as " $ genklemsamp.pl ...", I would run into the
following error message given as an example:

Command:

"$ genklemsamp.pl -c 10000 -vd 0 -1 0 objects/glazing_outside_pane.rad |
rcontrib -c 10000 -ab 2 -ad 1024 -e MF:4 -f reinhart.cal -b rbin -bn Nrbins
-m sky_glow -fa model_3_phase.oct > daylight_matrices/daymtx_6.dmx"

Error:

"bash: daylight_matrices/daymtx_6.dmx: No such file or directory
C:\Radiance\bin\xform.exe: cannot find file
"objects/glazing_outside_pane.rad"
oconv: warning - (standard input): empty file
C:\Radiance\bin\vwright.exe: illegal horizontal view size
Illegal division by zero at /c/Radiance/bin/genklemsamp.pl line 118"

Essentially, in either way of calling the Perl scripts in
"C:/Radiance/bin/" (without packaging it to an executable and saving it in
"C:/Radiance/bin/" with ".exe" format), it looks like that my current
working directory (project folder) is ignored when the Perl script is
called and therefore, I encounter an error message regarding missing
directories/file as given in the example above. This is despite the fact
that if I run a "pwd" call in Git Bash command line, my current working
directory is still appears to be correctly set to my project folder where
the missing files are located.
Therefore, I end up having to pass the absolute path of each file in my
project to the called Radiance Perl script which is inconvenient.

On the other hand, If I package the Perl scripts into an ".exe" format, I
do not receive any errors with regards to missing project files and I can
pass my project files with relative paths just like passing files to any
other Radiance command that is originally in ".exe" format.

The described issue with missing directories/files error, has been the
primary reason for me, so far, to follow the approach to packaging the Perl
scripts. It would be great if you could guide me through this issue that is
leading me to be dependent on packaging the Perl scripts in Radiance.

Please let me know if you needed any further information.
Best Regards,

Alireza

···

On Sat, Feb 27, 2016 at 4:31 PM, Rob Guglielmetti < [email protected]> wrote:

The PAR package actually wraps an entire copy of the Perl interpreter
around each and every Perl script, which is a ridiculous waste of space and
a burden on load/run times. If you have Perl and Radiance installed
properly you can call perl scripts on Windows (Widows and GitBash shells)
just the same as on any other platform. The Radiance-related perl scripts
should be installed with all the other Radiance executables, and that
location should be in your system PATH. Perl needs to be installed and
configured to be the “default application”, or whatever the Windows jargon
is, for perl scripts. Once these two things are done, you can call the name
of the perl script (e.g. genBSDF.pl) and it will work, from any location.

- Rob

> On Feb 27, 2016, at 5:20 PM, Alireza Hashemloo <[email protected]> wrote:
>
> Hello,
>
> I have a question/request with regards to the application of Radiance
Perl scripts on Windows:
>
>
> I had previously managed to package all Perl scripts in the Radiance/bin
directory via the PAR package for Perl so that there would be an executable
version (.exe) per each .pl format. The reason for such transformation is
the significant impact that calling a ".exe" file has on the overall
workflow using Radiance on Windows in comparison with having to call the
Perl interpreter and passing the given script's path
(Radiance/bin/<filename>.pl) every time that a single Perl script has to be
used on the Windows command line (In particular, Git Bash). However,
recently, there has been changes and I have not managed to use the
open-source PAR package for Perl to package the Radiance perl scripts into
.exe format.
>
> - I was wondering if it is possible to release a ".exe" file for each
Radiance Perl script (corresponding with the release of each update to a
script)?
>
> - Otherwise, I would appreciate if you could guide me on alternative
solutions to transform Perl scripts to .exe files on Windows.
>
> (Other than the open-source PAR package, I have used a trial version of
the commercial Active State Perl Development Kit including PerlApp that
allows you to make executable file for perl scripts. However, once the
trial period is over, the generated .exe files by the application will no
longer work.)
>
> Thank you very much,
> Alireza
>
>
> _______________________________________________
> Radiance-general mailing list
> [email protected]
> http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

That error still looks like a path problem. I generally recommend adding the working directory ( represented by a ".") to both your PATH and RAYPATH environment variables. I use GitBash (which is really just a stripped down install of Cygwin) when I'm forced to use Windows for testing Radiance, and all of the Radiance Perl scripts run fine without packaging them, and definitely without having to provide full paths to every referenced file. Just make sure you've added the dot to those two environment variables, and add them to your SYSTEM env vars rather than the USER ones.

-Rob

Rob,

Thank you for your response. Let me elaborate on the difficulty I run into when I add the Perl interpreter to my environment variable paths on Windows or calling the interpreter and passing the script's path to it in comparison with packaging the Perl scripts with PAR or any commercial product that does such packaging:

Using Git Bash on Windows 7 (64-bit), if I call a Perl script by calling the interpreter and then the script path such as "$ perl C:/Radiance/bin/genklemsamp.pl<http://genklemsamp.pl> ..." OR by adding the the Perl interpreter to my environment variable paths so that I just could call the name of the desired script in the command line such as " $ genklemsamp.pl<http://genklemsamp.pl> ...", I would run into the following error message given as an example:

Command:

"$ genklemsamp.pl<http://genklemsamp.pl> -c 10000 -vd 0 -1 0 objects/glazing_outside_pane.rad | rcontrib -c 10000 -ab 2 -ad 1024 -e MF:4 -f reinhart.cal -b rbin -bn Nrbins -m sky_glow -fa model_3_phase.oct > daylight_matrices/daymtx_6.dmx"

Error:

"bash: daylight_matrices/daymtx_6.dmx: No such file or directory
C:\Radiance\bin\xform.exe: cannot find file "objects/glazing_outside_pane.rad"
oconv: warning - (standard input): empty file
C:\Radiance\bin\vwright.exe: illegal horizontal view size
Illegal division by zero at /c/Radiance/bin/genklemsamp.pl<http://genklemsamp.pl> line 118"

Essentially, in either way of calling the Perl scripts in "C:/Radiance/bin/" (without packaging it to an executable and saving it in "C:/Radiance/bin/" with ".exe" format), it looks like that my current working directory (project folder) is ignored when the Perl script is called and therefore, I encounter an error message regarding missing directories/file as given in the example above. This is despite the fact that if I run a "pwd" call in Git Bash command line, my current working directory is still appears to be correctly set to my project folder where the missing files are located.
Therefore, I end up having to pass the absolute path of each file in my project to the called Radiance Perl script which is inconvenient.

On the other hand, If I package the Perl scripts into an ".exe" format, I do not receive any errors with regards to missing project files and I can pass my project files with relative paths just like passing files to any other Radiance command that is originally in ".exe" format.

The described issue with missing directories/files error, has been the primary reason for me, so far, to follow the approach to packaging the Perl scripts. It would be great if you could guide me through this issue that is leading me to be dependent on packaging the Perl scripts in Radiance.

Please let me know if you needed any further information.
Best Regards,

Alireza

The PAR package actually wraps an entire copy of the Perl interpreter around each and every Perl script, which is a ridiculous waste of space and a burden on load/run times. If you have Perl and Radiance installed properly you can call perl scripts on Windows (Widows and GitBash shells) just the same as on any other platform. The Radiance-related perl scripts should be installed with all the other Radiance executables, and that location should be in your system PATH. Perl needs to be installed and configured to be the "default application", or whatever the Windows jargon is, for perl scripts. Once these two things are done, you can call the name of the perl script (e.g. genBSDF.pl) and it will work, from any location.

- Rob

···

On Feb 27, 2016, at 10:21 PM, Alireza Hashemloo <[email protected]<mailto:[email protected]>> wrote:
On Sat, Feb 27, 2016 at 4:31 PM, Rob Guglielmetti <[email protected]<mailto:[email protected]>> wrote:

On Feb 27, 2016, at 5:20 PM, Alireza Hashemloo <[email protected]<mailto:[email protected]>> wrote:

Hello,

I have a question/request with regards to the application of Radiance Perl scripts on Windows:

I had previously managed to package all Perl scripts in the Radiance/bin directory via the PAR package for Perl so that there would be an executable version (.exe) per each .pl format. The reason for such transformation is the significant impact that calling a ".exe" file has on the overall workflow using Radiance on Windows in comparison with having to call the Perl interpreter and passing the given script's path (Radiance/bin/<filename>.pl) every time that a single Perl script has to be used on the Windows command line (In particular, Git Bash). However, recently, there has been changes and I have not managed to use the open-source PAR package for Perl to package the Radiance perl scripts into .exe format.

- I was wondering if it is possible to release a ".exe" file for each Radiance Perl script (corresponding with the release of each update to a script)?

- Otherwise, I would appreciate if you could guide me on alternative solutions to transform Perl scripts to .exe files on Windows.

(Other than the open-source PAR package, I have used a trial version of the commercial Active State Perl Development Kit including PerlApp that allows you to make executable file for perl scripts. However, once the trial period is over, the generated .exe files by the application will no longer work.)

Thank you very much,
Alireza

_______________________________________________
Radiance-general mailing list
[email protected]<mailto:[email protected]>
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]<mailto:[email protected]>
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]<mailto:[email protected]>
http://www.radiance-online.org/mailman/listinfo/radiance-general