Software installation on MAC OS X

G95

1) Go to http://ftp.g95.org/  and dowload "Powerpc OSX" under the menu "G95 Binaries (Current Snapshot)" in a folder of your choice; lets call such a folder "g95folder". You should get a tarball named "g95-powerpc-osx.tgz"
2) From terminal go to the "g95folder" and type

$ tar -zxvf g95-powerpc-osx.tgz
3) In "g95folder" it appears a new folder named "g95-install". Type the following instructions

$ cd g95-install
$ sudo -s
# mkdir /usr/local/lib/g95
# cp -r bin lib /usr/local/lib/g95/
# cd /usr/local/bin
# ln -s ../lib/g95/bin/powerpc-apple-darwin6.8-g95 g95
# exit

After the command "
sudo -s" you are asked to insert the admin password of your Mac.
4) It is now possible to compile using the command

$ g95 name.f90
5) It might happen that during the compilation you get a message saying that some library, e.g., "libf95.a" is out of date. Then you should type the following

$ ranlib /usr/local/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libf95.a

Do this for all the libraries which are out of date.
 

xmgrace

One can find detailed instructions at the following website http://www.eecs.wsu.edu/~schneidj/mac-os-x-10.3.html
However, things are slightly different for intel core 2 Duo processors. I summarize below the main steps

1) If you have already installed the X11 server you need to remove it first. Don't worry. Below it is explained how to get it back. To remove X11 type

$ sudo rm -rf /usr/X11R6 /etc/X11

and insert the root password
2)
The next step is to download the FinkCommander. Go to http://fink.sourceforge.net/ and click on "Download" over the menu on the left. Choose "PowerPC" or "Intel" depending on your processor.  You will get a .dmg file. Double click on it. Now the Fink is mounted.  Double click the Fink package (is the only file with .pkg extension) to install Fink (follow the instructions). Once the installation is completed drag the folder "FinkCommander" into your Applications folder.
3)
Go to your Applications folder, open the "FinkCommander" folder and double click the application "FinkCommander". You will get a window with many applications that you can download. However, those having the Intel processor wont see "grace". In order to solve this problem, go to Preferences in the FinkCommander menu, choose "Fink" and select "use unstable packages". You should now be able to see the application "grace".
4)
Before installing "grace" click on the icon having a folder and a green downarrow on it (should be the fourth icon from the left in the top bar menu). It is the Fink self-update and can take long time. Also, click always "Submit" every time a window pops up during the process.
5)
You are now ready to install xmgrace. Select "grace" from the list of the FinkCommander window and click on the icon with an "h" and a green "+" on it. The installation can take long time. Again, click always "Submit" every time a window pops up during the process.
6)
Once grace is installed you have to restore X11. Take your MAC CDs and reinstall "Xcode Developer Tools" and "X11User". Setting the new path "/sw/bin" you can now run xmgrace by just typing "xmgrace".
7)
For Intel processors you get another g95 which overtakes the one you already have (if you have one). In my case this new g95 didnt create a good executable file if I used libraries. To restore the old g95 just delete the link "g95" that you find in some subdirectory of the main directory "sw".


Lapack

Below you can find a simple procedure for making a library of Lapack subroutines
1)
Create the folder "Lapackfiles" in your home directory and download in it this list of subroutines (you can find them at the url (www.netlib.org/lapack)
2)
Create the folder "lib" in your home. From terminal type the following

$ cd Lapackfiles
$ g95 -c *.f
$ ar -rc liblapack.a *.o
$ ar -s liblapack.a
$ mv liblapack.a ../lib/liblapack.a
$ rm *.o

3)
In order to use the library add the following line in your Makefile

LIBS = -L/HOME/lib -llapack