Definition of rpn expression doesn't work

Moderators: cyao, michael_borland

fenggy
Posts: 9
Joined: 16 Dec 2008, 22:03

Definition of rpn expression doesn't work

Post by fenggy » 03 Feb 2012, 06:07

Hello,

I wrote a lattice file which includes two lines like this:
% 1.46625 2 * sto Labc
DL : DRIFT, L="Labc"

When I run the program, an error occurred with a warning:
unable to open 1.46625 2 * sto Labc in mode r: No such file or directory
ensure the RPN_DEFNS environment variable is set

I checked the environment variable setting. It seems that is ok.
I wonder if you can tell me what I should do? Thank you.

Fenggy

BTW: Windows7 system is used.
Attachments
Environment Variables.jpg

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Definition of rpn expression doesn't work

Post by michael_borland » 07 Feb 2012, 09:38

Fenggy,

This definitely has the symptoms I would associate with a problem with the RPN_DEFNS environment variable.

Can you check that the defns.rpn file is actually in the location named by RPN_DEFNS?

Also, at the commandline, type "echo $RPN_DEFNS" and see if it returns the expected value.

--Michael

fenggy
Posts: 9
Joined: 16 Dec 2008, 22:03

Re: Definition of rpn expression doesn't work

Post by fenggy » 07 Feb 2012, 11:25

Hello Michael,

I have checked the file's location. They are shown in the figures bellow:
Attachments
SX7A]S`3)Q[_R]IXN2~JCOE.jpg
SX7A]S`3)Q[_R]IXN2~JCOE.jpg (16.49 KiB) Viewed 3957 times
MK0${8K@RKRUYGO[TWI[E}X.jpg

soliday
Posts: 393
Joined: 28 May 2008, 09:15

Re: Definition of rpn expression doesn't work

Post by soliday » 07 Feb 2012, 11:34

When I type echo $RPN_DEFNS I get:
C:\WINDOWS\defns.rpn

I am guessing the problem is that elegant does not understand the cygwin directory structure. Somewhere in your cygwin shell it is overwriting the RPN_DEFNS value. Try setting it back to C:\WINDOWS\defns.rpn and see if the problem disappears.

fenggy
Posts: 9
Joined: 16 Dec 2008, 22:03

Re: Definition of rpn expression doesn't work

Post by fenggy » 07 Feb 2012, 11:52

Hello,
Thank you for your help! I have setting it back to C:\WINDOWS\defns.rpn as you told.But it still doesn't work.

soliday wrote:When I type echo $RPN_DEFNS I get:
C:\WINDOWS\defns.rpn

I am guessing the problem is that elegant does not understand the cygwin directory structure. Somewhere in your cygwin shell it is overwriting the RPN_DEFNS value. Try setting it back to C:\WINDOWS\defns.rpn and see if the problem disappears.
Attachments
J]DT32Q$04_Q4ZPD%[$Y)SQ.jpg
J]DT32Q$04_Q4ZPD%[$Y)SQ.jpg (16.03 KiB) Viewed 3942 times

soliday
Posts: 393
Joined: 28 May 2008, 09:15

Re: Definition of rpn expression doesn't work

Post by soliday » 07 Feb 2012, 13:10

Hmm, okay, I tested this on my Windows XP laptop. The easy way to test this is with the rpnl command:

$ export RPN_DEFNS=/home/soliday/.defns.rpn
$ echo $RPN_DEFNS
/home/soliday/.defns.rpn
$ ls -ltr /home/soliday/.defns.rpn
-rwx------ 1 soliday None 6622 2010-06-22 13:57 /home/soliday/.defns.rpn
$ rpnl "1.46625 2 * sto Labc"
unable to open /home/soliday/.defns.rpn in mode r: No such file or directory
ensure the RPN_DEFNS environment variable is set

----------------------------------------------------------------------------

$ export RPN_DEFNS=c:/windows/defns.rpn
$ echo $RPN_DEFNS
c:/windows/defns.rpn
$ ls -ltr c:/windows/defns.rpn
-rw-r--r-- 1 soliday None 6622 2006-08-22 10:56 c:/windows/defns.rpn
$ rpnl "1.46625 2 * sto Labc"
2.9325

---------------------------------------------------------------------------

$ export RPN_DEFNS=c:\\windows\\defns.rpn
$ echo $RPN_DEFNS
c:\windows\defns.rpn
$ rpnl "1.46625 2 * sto Labc"
2.9325

-------------------------------------------------------------------------

Can you test to see if the rpnl program works? Also verify c:\windows\defns.rpn exists on your system.

fenggy
Posts: 9
Joined: 16 Dec 2008, 22:03

Re: Definition of rpn expression doesn't work

Post by fenggy » 08 Feb 2012, 04:38

Hello soliday,
Thank you for your advice. I have tested this. There is a little bit difference:
1. (same with you)
$ export RPN_DEFNS=/home/fenggy/.defns.rpn
$ echo $RPN_DEFNS
/home/fenggy/.defns.rpn
$ ls -ltr /home/fenggy/.defns.rpn
-rwxr-xr-x 1 fenggy Domain users 6622 Aug 22 /home/fenggy/.defns.rpn
$ rpnl "1.46625 2 * sto Labc"
unable to open /home/fenggy/.defns.rpn in mode r: No such file or directory
ensure the RPN_DEFNS environment variable is set

2.
$ export RPN_DEFNS=c:/windows/defns.rpn
$ echo $RPN_DEFNS
c:/windows/defns.rpn
$ ls -ltr c:/windows/defns.rpn
cygwin warning:
MS-DOS stye path detected: c:/windows/defns.rpn
preferred POSIX equivalent is: /cygdrive/c/windows/defns.rpn
CYGWIN environment variable option "nodosfilewarning"turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
-rw-r--r-- 1 fenggy Domain users 7048 Feb 8 09:12 c:/windows/defns.rpn
$ rpnl "1.46625 2 * sto Labc"
2.9325

3.
$ export RPN_DEFNS=c:\\windows\\defns.rpn
$ echo $RPN_DEFNS
c:\windows\defns.rpn
$ ls -ltr c:\\windows\\defns.rpn
$ -rw-r--r-- 1 fenggy Domain users 7048 Feb 8 09:12 c:\windows\defns.rpn
$ rpnl "1.46625 2 * sto Labc"
2.9325

I try to run the software again. Unfortunately,it still doesn't work.

fenggy
Posts: 9
Joined: 16 Dec 2008, 22:03

Re: Definition of rpn expression doesn't work

Post by fenggy » 08 Feb 2012, 05:26

It seems that maybe there is some thing wrong about the percent sign % .
When I change the parameters setting like:
% 1.46625 2 * sto Labc
DL : DRIFT, L= 2.9325
it means parameters of elements are independent on the variable "Labc". But it still doesn't work.

fenggy
Posts: 9
Joined: 16 Dec 2008, 22:03

Re: Definition of rpn expression doesn't work

Post by fenggy » 08 Feb 2012, 05:55

Maybe it is ok about the rpn expression. When I change the lattice file like:
! % 1.46625 2 * sto Labc
DL : DRIFT, L= 1.46625 2 *
It works well.

If the file is modified like:
% 2.9325 sto Labc
DL : DRIFT, L= "Labc"
or like:
% 2.9325 sto Labc
DL : DRIFT, L= 2.9325

They all don't work.
I doubt the value of "Labc" is really 2.9325 now.

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Definition of rpn expression doesn't work

Post by michael_borland » 08 Feb 2012, 09:23

Fenggy,

I just verified that the "%" feature in the lattice file works as expected, so it is apparently a misconfiguration problem on your system.

Can you upload the command file, lattice file, and defns.rpn files you are using so we can try to replicate the problem?

--Michael

Post Reply