Friday 29 February 2008

Auto-vectorising C++ and Fortran compilers

This page is a good source of informations for High Performance Computing under Mac OS X. The link provides you with binary packages for the GNU C++, C and Fortran compilers for Leopard. The installation is very clean and goes entirely under /usr/local. These compilers allow auto-vectorisation.

On goofy I've installed XCode and Developer Tools, which install their own compilers. Therefore I have placed the GNU auto-vectorised compilers under /user/local, but I haven't included them in the path, as other users may want to use their own favourite compilers. If you want to use the GNU auto-vectorised ones, modify your .profile.

Important: these compilers do not activate objective C. Therefore, if you try to compile something with the -ObjC flag they would return you an error. When you need the -ObjC flag you can use the default Leopard's GCC compilers. 

Ubuntu Linux under Parallels

Parallels is a non-free virtualisation software that allows you to run Windows or Linux under Mac OS X: I'm not talking about dual booting (i.e. a side by side installation, with you deciding which OS you want to load at boot time). What happens here is that you actually run the guest OS at almost native speed in a window of your Mac. Furthermore, you have facilities like copying/pasting from one OS to another, or synchronising folders and so on. Really good if you want to take the best of both worlds (Mac OS and Ubuntu Linux, in my case). 

Installing Parallels is really easy from the installation cd.

Installing Ubuntu 7.10 as a guest OS is not hard. Follow this how-to from Parallels support forum.

Caveats:
  • In my case, I had to select Bridged Ethernet to get an internet connection under Ubuntu (this is something you can change easily once the installation is done: stop the Ubuntu Linux virtualisation and then go to Edit>Virtual Machine and set Network Adapter to be Bridget Ethernet)
  • Don't forget to upgrade to the latest Parallels version and to install the Parallels Tools
  • Copy/Paste and Sinchronisation work well if the guest OS is Windows. It will be supported soon for Ubuntu Linux. 
Update: I've been in contact with one of Parallels developers. First of all, he pointed me to this summary of Parallels Tools for Linux. Second he told that Parallel Tools is not yet compatible with Ubuntu 7.0.4. It's expected to be soon compatible.

BibDesk: LaTeX bibliographic reference manager

BibDesk is a bibliographic reference manager for Mac OS X. BibDesk is designed to help organize and use bibliographic databases in BibTeX .bib format. In addition to manual typing, BibDesk lets you drag/drop or cut/paste .bib files into the bibliographic database and automatically opens files downloaded from PubMed. BibDesk also keeps track of electronic copies of literature on your computer and allows for searching your database through several keys. Easy installation from universal binaries

MacVim

If you are a vim user, MacVim is all you have ever desired. Mac OS X ships already with its own vim, to be called from the Terminal. MacVim is a port Mac OS X that is meant to look better and integrate more seamlessly with the Mac than the existing Carbon port of Vim. Use it and support it. It comes with a universal binary and a UNIX script. Please read this post to change the paths according to the new Leopard paradigm.

On goofy:
  • unix command under /usr/local/macvim/bin
  • path updated in the file /etc/paths.d/Macvim/etc/

Paraview

Paraview is a great free tool to visualise large data files. It works well for parallel applications and it has a very good server/client interface: the large data can be processed remotely on a server, and the client will only take care of the visualisation. 

It is installed easily, being a universal binary. If you want the server/client facility, you will also install the unix commands provided. Please read this post to change the paths according to the new Leopard paradigm.

On goofy:
  •  unix commands under /usr/local/paraview/paraview-3.2.1-Darwin-i386
  • path updated in the file /etc/paths.d/Paraview

Modifying PATH in Leopard

Apple has (regrettably, in my opinion) changed the way to modify the bash PATH variable system-wide. The old way was to carefully edit the file /etc/profile. The new way is quite different. Suppose you have the application MyNewApplication in /usr/local and want to include the directory /usr/local/MyNewApplication/bin in the PATH. Then what you do is
  • Go to directory /etc/paths.d (yes, that's a directory) and create a file called MyNewApplication
  • Edit the file MyNewApplication with the directory you want to include, i. e. /usr/local/MyNewApplication/bin. If you want to include more than one path of MyNewApplication, then add more lines (one line per path)
  • Restart the Terminal
I don't agree with this approach which breaks a standard UNIX feature. This is most likely to be the reason why LaTeXiT is having troubles.

OpenTerminal

OpenTerminal allows you to quickly access a Terminal from Finder. The Terminal opens directly in the folder you're browsing with Finder. I find it very handy. There must be other software out there doing the same task (even better, maybe). Let me know if you recall any.

Cyberduck: FTP client

Cyberduck lets you download files from FTP servers. It's quite handy and polished. Painless installation. 

LaTeXiT: create latex formulae to drag and drop

LaTeXiT is a fantastic application: it allows you to input a LaTeX formula, compile it with a single click, and obtain an image that you can drag and drop pretty much everywhere (an existing LaTeX presentation or a plot for instance).
Important: LaTeXit is not yet packaged for Leopard. If you are a Leopard user, then do not install LaTeXiT 1.14.4, but go for LaTeXiT 1.14.3 instead. More about it later.
Update: LaTeXit 1.15.0 has just been released. This version is Leopard-compatible (thanks Bjorn Sandstede).

Skype

Skype seems to work fine on the external network. 

Guest account

I have setup a guest account, that is you can switch on my machine at any time and login with no password. This account allows you to run practically all the applications that are on goofy (my machine's name). The bad news is that you can not access this account remotely (let me know if you need it, I'll work it out for you) and you can not install programs on this account. The great news is that you can access this account at any time (and please feel free to do so). Here is how:
  • If I am not there and goofy is switched off: switch it on and login as a guest. It's enough you click on the guest icon
  • If I am not there and goofy is switched on: go on the menu, top right corner and click on the shaded man. You'll be prompted in another desktop, and whatever I was doing will keep running on the background (no harm for me, then). 
  • If I am there, just come and ask, it takes a second to switch user.
Why this is useful: you may want to use some software that is on goofy but not on your machine, or you may need goofy to be switched on. Just help yourself. A few caveats
  • You can temporarily store files in a guest account, but they will be deleted when you logout
  • My keyboard is Italian (experience the pain I go through every time I sit on a computer with a differently mapped keyboard...)

Thursday 28 February 2008

Installing XCode and Developer Tools

Go to the Apple Developer Connection Website and activate an AppleID if you haven't already done so (when you register for Apple Protection Plan for instance). Go to Download and then, on the right hand side select Developer Tools. Download XCode 3.0 (it's quite bulky) and install it with a few mouse clicks. Among the proposed packages, double click on XcodeTools.mpkg.

Pdf viewer and note taker: Skim

Beside Preview, the standard pdf viewer, I've installed Skim: it allows you to write notes on the pdf. Useful while correcting a LaTeX paper when the source is not available. Skim supports pdfsync (i.e. you will be able to jump from the source .tex file to the corresponding line on the pdf and the other way round)

Configuring a CUPS printer

Update: the howto described below could be valid only for Leopard users. For Tiger users, I have made available my printer online, therefore you should be able to see it with a laptop and print using my settings. My printer is labelled HP LaserJet with Duplexer. If my machine is off, you can turn it on and login as a guest (see this post about the matter). Anyway, the best thing to do is to configure your own printer. This might be done from System Preferences>Print & Fax from which you could input the printer address and settings. If you succeed, please let me know. Also, people seems to have problems to printer under a VPN connection at ENM.

Setup our printer in Room 2.80 (other printers should work similarly)
  1. Open Safari and go to your local CUPS system at http://localhost:631/
  2. Click Add Printer (eventually input your Mac username and password)
  3. Name: DepartmentalPrinter (customise it as you like)
  4. Location: Room 2.80 (customise it as you like)
  5. Description: HP LaserJet with Duplexer (customise it as you like)
  6. Click Continue
  7. Device: Internet Printing Protocol http
  8. Click Continue
  9. Device URI: http://printsrv.enm.bris.ac.uk:631/classes/2.80
  10. Click Continue
  11. Make: HP
  12. Click Continue
  13. Model HP Color Laserjet 4650
  14. Click Continue
  15. Insert userame and password associated with your Mac
  16. Under Options Installed select Duplex Unit Installed
  17. Under General set Page Size to a4 and Paper Source to Tray 2
  18. Click Set Printer Options
  19. Done
For other CUPS printers you have to insert a different URI for the device (this is the CUPS address of your printer, ask your sytem administrator) and you may have to set different Make, Models, Printer Options.

I would be grateful if you reported me (un)successful installations.

Installing LaTeX

I strongly advice to install the MacTeX distribution. It installs nicely and it is exhaustive.

Configuring email

The settings found here seem to work fine.

Right click

Activate immediately the right click facility of the mouse. Under Preferences>Keyboard & Mouse>Mouse. On the right click menu select Secondary Button