Posts: 1,368
Threads: 212
Joined: Dec 2006
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
Posts: 3,283
Threads: 104
Joined: Jul 2005
Try to set the $PATH variable to the directory the perl scripts exist. To be precise, add the directory to the PATH.
Posts: 1,368
Threads: 212
Joined: Dec 2006
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...
Posts: 1,368
Threads: 212
Joined: Dec 2006
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
Posts: 255
Threads: 22
Joined: May 2011
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.
Posts: 1,619
Threads: 147
Joined: May 2006
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.
Posts: 1,368
Threads: 212
Joined: Dec 2006
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
Posts: 1,619
Threads: 147
Joined: May 2006
Can you run this command for me from Terminal:
ls -la $HOME/.bash*
If you have a .bashrc, then use that.
Posts: 1,368
Threads: 212
Joined: Dec 2006
Only file found with that is .bash_history.
Weird.
Edited: 22 Mar 2012, 12:02 a.m.
Posts: 1,368
Threads: 212
Joined: Dec 2006
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
Posts: 1,619
Threads: 147
Joined: May 2006
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. :-)
Posts: 225
Threads: 13
Joined: Jun 2011
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.
Posts: 96
Threads: 20
Joined: Sep 2011
Yes please!! That would be great.
Posts: 225
Threads: 13
Joined: Jun 2011
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.
Posts: 3,229
Threads: 42
Joined: Jul 2006
No chance, we'll be on to the 43S by then :-)
- Pauli
Posts: 225
Threads: 13
Joined: Jun 2011
Quote:
No chance, we'll be on to the 43S by then :-)
- Pauli
Waiting for it.
Posts: 1,368
Threads: 212
Joined: Dec 2006
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
Posts: 1,619
Threads: 147
Joined: May 2006
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.
|