Compiling PDECOL 1.1 on MacOS X / PowerPC

These notes refer to a PowerPC G5, using the following software setup:

(*) Binary package downloaded from the High Performance Computing for MacOS X project homepage at http://hpc.sourceforge.net

(**) Source code downloaded from http://www.mit.edu/~wax/Software/pdecol.html

The central problem for those willing to compile PDECOL (or to build any OCTfile that is written in F77) in MacOS X is the proper choice of GCC and fortran compiler versions. After installing the current version of Xcode, the system contains more than one version of gcc, being gcc-3.3 and gcc-4.0 the newest. The default configuration is to use the newest compiler (gcc-4.0). However, when using the mkoctfile script provided by the Octave package, gcc-4.0 and g77 cannot be used together. When using gcc-4.0, gfortran should be used as the fortran compiler. Unfortunately, the combination of gcc_4.0 and gfortran does not successfully builds PDECOL on MacOSX 10.4.5, due to problems involving libcc_dynamic. The solution is simple: install the g77 package, choose gcc-3.3 as the default compiler, modify the mkoctfile script, and build PDECOL.

So, in a step-by-step procedure

  1. make sure the latest Xcode is installed (it can be downloaded from http://developer.apple.com/tools/download/)

  2. install Octave and assure the installation was successful (a binary package can be downloaded from http://hpc.sourceforge.net)

  3. download and install g77 from http://hpc.sourceforge.net (installation instructions are on the HPC homepage and are straightforward)

  4. choose gcc-3.3 as your default compiler: open a Terminal and run sudo gcc_select

  5. download PDECOL from http://www.mit.edu/~wax/Software/pdecol.html

  6. decompress the PDECOL file and place it in the appropriate location on your system

  7. check that /usr/local/bin/mkoctfile-2.1.73 is configured to use G77 as the fortran compiler: search for the line that contains the F77 variable and make sure it reads: ${F77=g77}

  8. cd to the folder where the source code for PDECOL is, rename or delete the original pdecolg.oct binary file included in the PDECOL compressed file (it was compiled on Linux) and run mkPDECOL. You should get a new pdecolg.oct file.

  9. use LOADPATH or update your PATH environment variable so Octave can find pdecolg.oct, and run the example in the EG1 folder in the PDECOL folder.

  10. you can run gcc_select again and choose gcc-4.0 as the default compiler

The instructions above worked in my system, but I am a newbie in the MacOS X world, and I am not educated in Fortran, so I can not guarantee that this procedure will be valid in any MacOS X system. If you choose to follow it, bear in mind that it gives some directions but has not been extensively tested. If you follow it and it fails, I may be of little help, but feel free to contact me at eiffleduarte@gmail.com.


(WWX): Marcus was kind enough to provided precompiled binaries for a few architectures those who might like to use them