| 1 | |
|---|
| 2 | Makefile.README |
|---|
| 3 | |
|---|
| 4 | We have a couple makefiles for a couple different target platforms and |
|---|
| 5 | a couple different compilers. This document attempts to provide an |
|---|
| 6 | intro to building the GISS Model II. For more information please |
|---|
| 7 | contact Ken Mankoff (mankoff@giss.nasa.gov) |
|---|
| 8 | |
|---|
| 9 | Current supported builds are: |
|---|
| 10 | * Windows (XP, Vista) |
|---|
| 11 | * Mac PPC |
|---|
| 12 | * Mac Intel |
|---|
| 13 | |
|---|
| 14 | === Makefile === |
|---|
| 15 | |
|---|
| 16 | This is the top level makefile for Mac systems. Eventually, perhaps, |
|---|
| 17 | it'll detect the current OS and desired target OS and do everything |
|---|
| 18 | for you. Right now it serves the function of modifying README.f.in to |
|---|
| 19 | include PRINT statements about the current date and SVN version # of |
|---|
| 20 | the model. |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | === Windows === |
|---|
| 24 | |
|---|
| 25 | On Windows development is done with Absoft 8.2. I have a Parallels |
|---|
| 26 | Windows XP image for EdGCM development. It would be easiest to use the |
|---|
| 27 | exact same environment and I can clone this image for you. |
|---|
| 28 | |
|---|
| 29 | Assuming Absoft 8.2 is installed in C:\Absoft82 ModelII can be built |
|---|
| 30 | as follows: |
|---|
| 31 | |
|---|
| 32 | * Start Menu > Run > "cmd" (not "command") |
|---|
| 33 | * Run c:\absoft82\bin\absvars.bat or make sure the following |
|---|
| 34 | environment vars are set: |
|---|
| 35 | ABSOFT=C:\Absoft82 |
|---|
| 36 | PATH=C:\Absoft82\BIN;%PATH% |
|---|
| 37 | LIB=C:\Absoft82\LIB;%LIB% |
|---|
| 38 | INCLUDE=C:\Absoft82\CINCLUDE;%INCLUDE% |
|---|
| 39 | |
|---|
| 40 | Set up a share folder between Mac and Windows. This can be done easily |
|---|
| 41 | through Parallels, or at the DOS prompt: |
|---|
| 42 | > net use y: \\.psf\GISS\GCM\modelII\trunk |
|---|
| 43 | |
|---|
| 44 | Navigate to the build directory: |
|---|
| 45 | > y: |
|---|
| 46 | > cd GCM\modelII\trunk |
|---|
| 47 | |
|---|
| 48 | Build the model: |
|---|
| 49 | > amake -f Makefile.win |
|---|
| 50 | |
|---|
| 51 | The result should be a file called "model.exe". If not, make sure you |
|---|
| 52 | can build correctly in OS X. Debug. Email for help. |
|---|
| 53 | |
|---|
| 54 | Makefile.win.gui is the GUI Makefile for using with the Absoft 8.2 |
|---|
| 55 | IDE. I prefer the command line. |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | === Makefile.Mac.PPC === |
|---|
| 59 | |
|---|
| 60 | Your environment should look like this (Customize for the name and |
|---|
| 61 | location of your Absoft install. I am using Absoft 9.2 on an Intel |
|---|
| 62 | MacBook |
|---|
| 63 | |
|---|
| 64 | export SDK="/Developer/SDKs/MacOSX10.4.0.sdk" |
|---|
| 65 | export ABSOFT=/Users/mankoff/local/Applications/Absoft.ppc |
|---|
| 66 | export ABSOFT_AS="as -arch ppc" |
|---|
| 67 | export ABSOFT_LINKER="c++ -isysroot ${SDK} -Wl,-syslibroot,${SDK} -arch ppc |
|---|
| 68 | export PATH=$ABSOFT/bin:$PATH |
|---|
| 69 | export MANPATH=$ABSOFT/man:$MANPATH |
|---|
| 70 | export MACOSX_DEPLOYMENT_TARGET=10.4 |
|---|
| 71 | export COMPILER=Absoft |
|---|
| 72 | |
|---|
| 73 | Then: |
|---|
| 74 | % make -f Makefile.Mac.PPC |
|---|
| 75 | |
|---|
| 76 | should build "modelII_ppc.exe" that will run on both Mac Intel and Mac |
|---|
| 77 | PPC. On Mac Intel it runs in Rosetta, so it runs very slowly. |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | === Makefile.ifort === |
|---|
| 81 | |
|---|
| 82 | We are using the Intel ifort 10.1 compiler for Intel native builds on |
|---|
| 83 | OS X. Your environment should be set like so: |
|---|
| 84 | |
|---|
| 85 | source /opt/intel/fc/10.1.008/bin/ifortvars.sh |
|---|
| 86 | export COMPILER=Intel |
|---|
| 87 | |
|---|
| 88 | Then: |
|---|
| 89 | % make -f Makefile.ifort |
|---|
| 90 | |
|---|
| 91 | should build "modelII_intel.exe" that will run on Mac Intel native, and |
|---|
| 92 | not on Mac PPC. |
|---|
| 93 | |
|---|
| 94 | === Makefile.gfortran === |
|---|
| 95 | |
|---|
| 96 | This is a second Mac Intel native build. We use ifort because it is |
|---|
| 97 | faster, but I provide this Makefile and try to keep it up-to-date so |
|---|
| 98 | that the community can build their own Model II without needing to |
|---|
| 99 | purchase a compiler. |
|---|
| 100 | |
|---|
| 101 | % gfortran -v |
|---|
| 102 | gcc version 4.2.3 |
|---|
| 103 | |
|---|
| 104 | I think this version of GCC comes with installing the iPhone SDK, then |
|---|
| 105 | copying "gcc_select" from a Mac that has it (10.4? PPC?) and then a |
|---|
| 106 | "sudo gcc_select 4.2" |
|---|
| 107 | |
|---|