How to install J64 On a MacBook Pro

As promised, here is a description of how to get 64-bit J working on a
MacBook Pro.

The projects I work on require very large arrays which do not fit into
the 32-bit VAS, but there is no 64-bit version of J for the Mac. Since
I only have 4Gb of RAM but want to work on  64Gb arrays most of the
computations require lots of swap file usage.

The method described here to use 64-bit J on a Mac is to install
64-bit Linux under VMWare fusion as a virtual machine. After many
conversations on the J forums the following solution works which I
thought I would share here in case anybody else wants to use 64-bit J
on a MacBook Pro.

Thanks to everyone who gave advice during the working out of how to do
this. This is not my work but a summary of the forum discussions on
this topic.

I am not an expert on Linux, Mac OSX, J or installing software or
other IT tasks in general but this is an account of what worked for
me. I hope it is useful for others. There may be some errors below or
a much easier solution.

Go to http://www.vmware.com/products/fusion/
Download and install VMWave Fusion trial version

Go to http://www.ubuntu.com/getubuntu/download
Download ubuntu-8.10-desktop-amd64.iso
Make sure to select the 64-bit version.

Create a virtual machine in VMWare Fusion.
Select "continue without disk".
Select "Use operating system installation disk".
Select the .iso file just downloaded.
Select continue.
Leave the operating system choices as-is.
Select on Customise Settings and enter a name (J64).
In the main VMWare window, select the new machine.
Select settings.
All of the settings are okay apart from the default HD size and
possibly the RAM setting.
Since the disk grows as you use it, you don't need to worry about
stating a maximum... but you must set it large enough for a swap file
to work with. The default is only 20Gb, increase it to be the size you
want for a HD plus the amount of swap you will need. In my case I use
a limit of 170GB (the entire HD of the Mac).
Everything works fine with 512Mb.
Click on the "play" button to turn on the virtual machine.
Now you have to install Ubuntu from the .iso file that is inserted
into the CD drive of the virtual machine.
Click through to install Ubuntu.
You will eventually get to a "prepare disk space" window.
Select "manual". This is where we prepare the large swap file.
Select "new partition table"
Select the "free space" to bring up the "create new partition" dialogue.

Create a /boot partition by:
  Type is "primary"
  Size is 64 Mb
  Use as "Ext3"
  Mount point /boot

Create a swap partition:
  Select "free space" again
  Click "new partition"
  Type is logical
  use as "swap area"
  Size is what you want to work with (I use 128Gb)

Use the rest as root:
  Select 'Free space"
  Type is primary
  Leave size alone it is all that is left
  use as "Ext3"
  Mount point is /

Click on forward
Enter a user name to use (your initials?)
Enter a password (remember it!)
Select "log in automatically"
Click through the rest of the installation.
Rebooting Ubuntu took a long time here...

Inside Ubuntu

Select system->preferences->screen resolution
Set the resolution to what you want. I use 1440x900 because that is
what my screen is.

Hopefully your network connection is working inside Ubuntu automatically.

There are usually updates that need to be installed, a bubble will
appear prompting to do it if required. Do the software updates which
took about 20 minutes for me.

You will need to install some Linux packages.
Select System->Administration->Synaptic Package Manager

Search for "xkbset" and mark it for installation.
Search for "sun-java6-jre" and mark it for installation.
Apply the changes (i.e. do the installation.)

The following commands enable the MacBook Pro keyboard to function
correctly. Either type these into the terminal in each session or
preferably append them to the .bashrc file.

Select Applications->Accessories->Terminal
At the terminal type "gedit .bashrc"

Append these lines to the end of the file and save it.

xmodmap -e "keycode 94 = grave asciitilde"
xmodmap -e "keycode 133 = ISO_Level3_Shift"
xmodmap -e "keycode 134 = Multi_key"
xmodmap -e "keycode 108 = Pointer_Button3"
xkbset m

Close the terminal.

(Thanks to http://ubuntuforums.org/showthread.php?t=959249)

Install the VMWare tools:
 Select Applications->Accessories->Terminal
 cp /cdrom/VMwareTool* /tmp     
 cd /tmp
 tar -zxvf VMware*
 cd VMware<tab> (i.e. press tab for auto-complete)
 sudo vmware-install.pl
 enter your password
 accept all default options

You must create an alias java64 for J64 to work:
Type: ln /usr/bin/java /usr/bin/java64

Download the j602a_linux64.sh from www.jsoftware.com using the mozilla
browser that comes with Ubuntu. The default download location is
Desktop.

In a terminal type in:
cd ~/Desktop
chmod u+x j602<tab>
./ j602<tab> -install

cd ~/j64-602/bin/
./jwd

Now you should be running J64 on your 64 bit MacBook Pro with access
to the 64-bit VAS. You will get "out-of-memory" errors only(?) if a
computation requires more space than the size of the swap partition -
although they may go very slowly.

After trying this out, you will need to purchase VMWare fusion once
the trial licence expires. It is cheap (less than $100) and a very
nice program. Hopefully a 64-bit version of VirtualBox will be
released in which case there will be no need to buy VMWare fusion
since VirtualBox is free.

Kind regards,
Matthew.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to