The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

[WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #1 Posted by Les Wright on 21 Mar 2012, 3:18 p.m.

I am having problems getting wp34s_lib.pl to work in Terminal under OS X. Here is the error that gets thrown when I try to create a library file from a simple text listing:

Leslie-Wrights-Improved-iMac:tools lesliewright$ ./wp34s_lib.pl lib1.txt -olib wp34s-lib.dat
Creating olib 'wp34s-lib.dat' from scratch.
Can't exec "wp34s_asm.pl": No such file or directory at ./wp34s_lib.pl line 819.
Can't exec "wp34s_asm.pl": No such file or directory at ./wp34s_lib.pl line 819.
ERROR: wp34s_lib.pl::split_END: Likely the assembler run failed. Halting wp34s_lib.pl.

The analogous command at the Windows XP command line using the EXE equivalent produces the correct output.

The "bug" seems to be that the script calls wp34s_asm.pl but can't find it, even though it lives in the same directory. However, when I call the assembler script directly using ./wp34s_asm.pl, files get assembled and disassembled just fine.

I am pretty much a novice when it comes to running Perl scripts in a Linux/Unix type of environment, so if I can get some guidance from anyone who knows how to correctly run this command, I would be grateful. I am sure that Linux users run it fine as is, so it is something I am doing in the Mac environment, not the script itself.

Les

      
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #2 Posted by Marcus von Cube, Germany on 21 Mar 2012, 4:34 p.m.,
in response to message #1 by Les Wright

Try to set the $PATH variable to the directory the perl scripts exist. To be precise, add the directory to the PATH.

            
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #3 Posted by Les Wright on 21 Mar 2012, 5:20 p.m.,
in response to message #2 by Marcus von Cube, Germany

Marcus, I am such a noob I have to confess I have no idea how to do that.

I am googling, but so far not fruitful...

                  
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #4 Posted by Les Wright on 21 Mar 2012, 6:00 p.m.,
in response to message #3 by Les Wright

Marcus, there seems to be some vagueness on how to add to $PATH in OS X Lion. Instead, used echo $PATH to see what folders are there and used a favourite utility called EasyFind to locate /usr/bin and drop the three perl scripts into that folder along with wp34s.op.

I know this is probably NOT ideal, but I did get it to work.

If any OS X Lion users out there have figured out how to change or extend the $PATH variable, I'd be much obliged.

Les

                        
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #5 Posted by Egan Ford on 21 Mar 2012, 6:09 p.m.,
in response to message #4 by Les Wright

Are you running from the shell (Terminal)? If so type:

export PATH=$PATH:/path/to/wpstuff
If you want that to stick then put that command in your .bash_common.

Type:

open /Applications/TextEdit.app .bash_common
Then make sure you exit Terminal and relaunch. To test type:
echo $PATH

Edited: 21 Mar 2012, 6:11 p.m.

                              
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #6 Posted by Les Wright on 21 Mar 2012, 9:27 p.m.,
in response to message #5 by Egan Ford

Thanks for your help, Egan (as well as Neil below).

Unfortunately, I don't have a .bash_common file. I've looked!

The use of the "export" command here does what it should.

So far, I am not having any issue with storing those four small files in /usr/bin until I can figure out how, in my setup, I permanently extend $PATH.

Les

                                    
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #7 Posted by Egan Ford on 21 Mar 2012, 11:00 p.m.,
in response to message #6 by Les Wright

Can you run this command for me from Terminal:

ls -la $HOME/.bash*
If you have a .bashrc, then use that.
                                          
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #8 Posted by Les Wright on 21 Mar 2012, 11:57 p.m.,
in response to message #7 by Egan Ford

Only file found with that is .bash_history.

Weird.

Edited: 22 Mar 2012, 12:02 a.m.

                                                
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #9 Posted by Les Wright on 22 Mar 2012, 12:18 a.m.,
in response to message #8 by Les Wright

Egan, I solved the problem by simply creating .bash_profile in my home directory de novo. It has the single line in it:

export PATH = $PATH:$HOME/wp34s

Close shell and Terminal, then restart Terminal, type echo $PATH, and my wp34s directory is there. I will put the perl scripts, my text listings and library files, and various emulator state and flash files (wp34s.dat, wp34s-backup.dat, and wp34s-lib.dat) and work entirely within that directory.

Thanks for the direction. Now, except for the flashing, I can do all of my wp34s work directly in the Mac environment.

Les

Edited: 22 Mar 2012, 12:38 p.m. after one or more responses were posted

                                                      
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #10 Posted by Egan Ford on 22 Mar 2012, 1:02 a.m.,
in response to message #9 by Les Wright

That was going to be my next suggestion, i.e. create .bashrc or .bash_profile or .profile.

I posted here in the past how to flash from OS/X using wine. The trouble is that you have to install wine. If you have Xcode installed, then you can install Macports and after that you can type "sudo port install wine".

Now that you have Xcode installed you can starting porting WP34S to the iPhone. :-)

                                                            
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #11 Posted by pascal_meheut on 22 Mar 2012, 5:53 a.m.,
in response to message #10 by Egan Ford

Quote:
Now that you have Xcode installed you can starting porting WP34S to the iPhone. :-)

There is a plan for that too. Porting to Android would be easier though.

                                                                  
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #12 Posted by John Abbott (S. Africa) on 22 Mar 2012, 5:55 a.m.,
in response to message #11 by pascal_meheut

Yes please!! That would be great.

                                                                        
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #13 Posted by pascal_meheut on 22 Mar 2012, 7:03 a.m.,
in response to message #12 by John Abbott (S. Africa)

Quote:
Yes please!! That would be great.

Well, the multi-platform flashing tool is working and should soon be over. Then comes a debugger and a few other improvements to the emulator.

And then I hope to have time to work on an iPhone/iPad version.

                                                                              
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #14 Posted by Paul Dale on 22 Mar 2012, 7:05 a.m.,
in response to message #13 by pascal_meheut

No chance, we'll be on to the 43S by then :-)

- Pauli

                                                                                    
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #15 Posted by pascal_meheut on 22 Mar 2012, 2:12 p.m.,
in response to message #14 by Paul Dale

Quote:
No chance, we'll be on to the 43S by then :-)

- Pauli


Waiting for it.

                              
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #16 Posted by Les Wright on 22 Mar 2012, 10:42 p.m.,
in response to message #5 by Egan Ford

Quote:
Are you running from the shell (Terminal)? If so type:

Type:

open /Applications/TextEdit.app .bash_common


Hey, Egan, I am no Unix/Linux guru, but I am proud to share that I found an error in this. The command should be

open -a /Applications/TextEdit.app .bash_common

or, even more simply,

open -e .bash_common

In the Mac OS X implementation, the -e switch is simply a shortcut for "-a /Applications/TextEdit.app".

For noobs like me who are curious, I created my single line .bash_profile file from the command line with

echo "export PATH=$PATH:$HOME/wp34s" >> .bash_profile

then had to run

chmod 777 .bash_profile

to ensure the script was executed when a fresh Terminal window started up in the bash shell.

(Of course, other users may elect to keep the wp34s perl scripts elsewhere--I just happen to choose /Users/[myusername]/wp34s.)

Since, I have been very happily assembling and disassembling wp34s library files without having to leave the OS X environment.

Unfortunately, I cannot get the new Mac flashing tool to work, even though I prep the calc exactly as I do with MySamba. I know that my Mac detects my FTDI converter just fine since I have successfully moved material back and forth between the calc and Mac emulator over my USB-serial connection. Will seek out Pascal's direction. Fortunately, MySamba on Win XP in Fusion still works like a charm.

Les

                                    
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #17 Posted by Egan Ford on 23 Mar 2012, 12:29 a.m.,
in response to message #16 by Les Wright

I didn't know about -e, I actually use vi, but I didn't want to have to explain how to use a terminal-based editor.

You should not need to chmod 777 .bash_profile. It is not executed when /bin/bash starts on login. It's read after bash starts and interrupted. So chmod 777 is not needed. The expected settings are 644. Hopefully Lion did not change that.

As for the "echo", in time you'll want your .bash_profile a bit more organized, I find it best to edit it.

                  
Re: [WP34S] Problem Running wp34s_lib.pl in Mac OS X
Message #18 Posted by Neil Hamilton (Ottawa) on 21 Mar 2012, 6:05 p.m.,
in response to message #3 by Les Wright

Les,

I answered this a few hours ago but it seems to have gone into the moderated-ether... maybe it will return someday. (Apparently you do not allow anyone to send you back-channel mail either.)

The problem is that you need to have your current directory in your path. Unlike DOS/Windows, Unix-style shells (bash, csh, tcsh, sh, etc.) do not look in the current directory but solely access these through the path. DOS/Windows first starts in your current directory and then tries the path if it wasn't found.

This is the reason you had to type the "./" in front of the command in your example of running the ASM by itself.

Depending on your shell, add the following:

(bash type shells) $ export PATH=./:${PATH}

(csh type shells) % setenv PATH "./:${PATH}"

Let me know if that works. Ideally, you should have this set in your login script.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall