Difference between revisions of "GENIE WindowsCompilation"

From SourceWiki
Jump to navigation Jump to search
Line 104: Line 104:
  
 
===Building GENIE===
 
===Building GENIE===
 +
I strongly recommend checking out the GENIE code into a directory that <em>does not</em> contain any space characters. We have not tested builds with paths containing spaces, they may or may not work. Life is simpler without the spaces.
  
 
====Native Microsoft Compilers====
 
====Native Microsoft Compilers====
  
 
====GNU Compilers====
 
====GNU Compilers====
 +
Edit user.sh
 +
  CODEDIR=/cygdrive/drive_letter/path/to/genie
 +
  OUTROOT=/cygdrive/drive_letter/path/to/output
 +
 +
Edit user.mak (please note that despite being a Windows build this is identical to a Linux setup)
 +
  GENIE_ROOT=/cygdrive/drive_letter/path/to/genie
 +
  OUT_DIR=/cygdrive/drive_letter/path/to/output
 +
  F77=g95
 +
  CC=gcc
 +
  CXX=g++
 +
  MACHINE=LINUX
 +
  NETCDF_DIR=<netcdf_root_cygwin>
 +
  NETCDF_NAME=netcdf

Revision as of 16:31, 17 March 2008

Building GENIE on Windows Platforms

The GENIE makefiles have been modified to enable a command line compilation of the framework under Windows using Linux emulation software.

Prerequisites

The build system is known to work with the following software:

Tool Software Versions Notes
Linux emulation CygWin 1.5.12-1  
MinGW (MSYS) 1.0.10 Build only. There is no bash shell available so genie_example.job cannot be executed.
Third party libraries NetCDF 3.5.0, 3.6.0, 3.6.1, 3.6.2 Pre-built dll from UCAR can be used with the native microsoft compilers. We recommend building the NetCDF library locally.
Python 2.3.3+ Available in CygWin. Must be installed separately for MinGW.
Native Microsoft Fortran Compiler Compaq Visual Fortran 6.6C  
Intel Visual Fortran 9.1, 10.0, 10.1  
C/C++ Compiler / Linker Microsoft Visual Studio .NET 2003 7.1.3088  
Microsoft Platform SDK for Server 2003 R2  
Microsoft Visual Studio 2005 8.0.50727.762  
GNU Compilers Fortran Compiler GNU g95 0.91  
C/C++ Compiler / Linker GNU gcc 4.0.3  
GNU ld 2.16.91  

Installing a Linux Emulator

In order to execute the GENIE build process on a Windows platform it is necessary to install a Linux emulator that can process the GNU make files. There are two popular Linux emulation tools for Windows; Cygwin and MinGW. Cygwin provides a comprehensive Linux emulation layer for Windows and can be used to build, execute and manage GENIE. MinGW (Minimalist GNU for Windows) provides a limited set of tools that are sufficient to build GENIE but cannot be used to configure the model for execution. We therefore recommend the Cygwin route but provide details of MinGW for completeness.

Cygwin installation

Download the Cygwin setup executable from the Cygwin website at http://cygwin.com/. Execute the setup program and install Cygwin as directed. When asked to select packages please ensure that the following packages are installed:

  • Base -> bash
  • Devel -> make
  • Interpreters -> python
  • Interpreters -> perl (for documentation)

Download g95-x86-cygwin.tgz from ftp.g95.org. Copy this file to the root of your cygwin distribution. In cygwin:

 cd /
 tar zxvf g95-x86-cygwin.tgz

MinGW installation

MinGW http://www.mingw.org/ provides a build environment capable to generating Windows executables that do not rely on 3rd party dlls.

Building NetCDF

Download NetCDF source release from UCAR:

 http://www.unidata.ucar.edu/downloads/netcdf

Extract the contents of the archive to a convenient location <netcdf_root>.

Microsoft Compilers

GNU Compilers

In a Cygwin environment that has g95 installed, navigate to the NetCDF directory (here <netcdf_root_cygpath> refers to the location of the NetCDF root in the Cygwin path style. e.g. /cygdrive/c/netcdf-3.6.2).

 cd <netcdf_root_cygpath>
 F90=g95 ./configure --prefix=<netcdf_root_cygpath>
 make check
 make install

Building GENIE

I strongly recommend checking out the GENIE code into a directory that does not contain any space characters. We have not tested builds with paths containing spaces, they may or may not work. Life is simpler without the spaces.

Native Microsoft Compilers

GNU Compilers

Edit user.sh

 CODEDIR=/cygdrive/drive_letter/path/to/genie
 OUTROOT=/cygdrive/drive_letter/path/to/output

Edit user.mak (please note that despite being a Windows build this is identical to a Linux setup)

 GENIE_ROOT=/cygdrive/drive_letter/path/to/genie
 OUT_DIR=/cygdrive/drive_letter/path/to/output
 F77=g95
 CC=gcc
 CXX=g++
 MACHINE=LINUX
 NETCDF_DIR=<netcdf_root_cygwin>
 NETCDF_NAME=netcdf