[WP34S] Problem Running wp34s_lib.pl in Mac OS X



#2

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


#3

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


#4

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...


#5

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


#6

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.


#7

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


#8

Can you run this command for me from Terminal:

ls -la $HOME/.bash*
If you have a .bashrc, then use that.

#9

Only file found with that is .bash_history.

Weird.

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


#10

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


#11

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. :-)


#12

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.


#13

Yes please!! That would be great.


#14

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.


#15

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


- Pauli


#16

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

- Pauli


Waiting for it.

#17

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


#18

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.

#19

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.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing RPL programs on OS X Sean Freeman 18 5,374 11-30-2013, 03:59 PM
Last Post: Sean Freeman
  HP-Prime firmware update on a Mac Javier Goizueta 5 2,235 11-15-2013, 10:52 AM
Last Post: Javier Goizueta
  WP_34S: Patch for wp34s_lib.pl Marcel Samek 0 854 07-05-2013, 12:49 PM
Last Post: Marcel Samek
  Pilbox speedup on Mac OS X Håkan Thörngren 1 1,184 06-07-2013, 03:27 PM
Last Post: Egan Ford
  Fun things found by running strings on the 39gII emulator bhtooefr 11 3,950 05-16-2013, 12:40 AM
Last Post: Mic
  HHC 2013 Website up and running Joe Horn 4 1,804 05-05-2013, 07:17 PM
Last Post: bhtooefr
  PILBox on Mac OS X success Håkan Thörngren 5 2,066 03-25-2013, 11:45 AM
Last Post: Egan Ford
  Saturn on Android_OS and i-OS CompSystems 6 2,283 03-17-2013, 01:40 PM
Last Post: hugh steers
  Flashing a WP34s with a Mac Philippe Cairic 10 3,356 01-08-2013, 12:49 PM
Last Post: Walter B
  [WP34s] Possible problem with matrix inversion Dieter 10 2,745 01-07-2013, 03:07 PM
Last Post: Dieter

Forum Jump: