[gembud] The long-awaited "How to build GEMPAK/N-AWIPS 5.11.4" on an Intel Mac OS X platform from scratch!

  • To: gembud@xxxxxxxxxxxxxxxx
  • Subject: [gembud] The long-awaited "How to build GEMPAK/N-AWIPS 5.11.4" on an Intel Mac OS X platform from scratch!
  • From: "Kevin R. Tyle" <ktyle@xxxxxxxxxxxxxxxx>
  • Date: Wed, 06 Oct 2010 20:22:35 +0000
Hi all,

It has taken several months, but I have finally gotten around to documenting the procedure to build GEMPAK5.11.4 on Intel Mac OS X 10.6 (Snow Leopard) with the GCC 4.4 compilers. I believe it will also work for 10.5 (Leopard). I cannot say anything about earlier versions/CPU's of OS X. The following steps should lead to a successful build.

1. Install Xcode on the host system. This can be found as an optional install on the install DVD, or you can download the latest disk image of Xcode from the Apple Developer web site (you will have to register in order to download the .dmg file)
http://developer.apple.com/technologies/tools/xcode.html

2. Install the MacPorts package from http://www.macports.org. Once installed, your .profile or .cshrc should have "/opt/local/bin" first in your path. Check to be sure this is the case before proceeding, and resource your .profile or .cshrc if not.

3. Using MacPorts, install several packages (all necessary pre-requisites of each package will automatically be downloaded and installed first, similar to "yum install" in CentOS/Fedora flavors of Linux). Perform some configuration following the installation of some of them. The sequence is as follows: a. Install gcc44 (type: "sudo port install gcc44") This will take a long time . .. perhaps even a couple hours if you are on a slower/low-RAM system!
  b. Install gcc_select (type: "sudo port install gcc_select")
  c. Make gcc44 the default compiler (type:  "sudo gcc_select mp-gcc44").
d. Install a variety of xorg packages, culminating with the "libXtst" package (type: sudo port install xorg-libXtst") e. Install OpenMotif (current MacPorts version 2.3.2, although 2.3.3 has been released) and its prerequisites (type: "sudo port install openmotif").
  f. Install the "xpm" package (type:  "sudo port install xpm").

4. OpenMotif >= 2.3.2 is incompatible with N-AWIPS' "nmap2" program (as has been reported on GEMBUD, the program will build and run, but many of the buttons will not appear). So next we need to download and install OpenMotif 2.3.1. a. Obtain the tarball from http://www.motifzone.net/files/public_downloads/openmotif/2.3/2.3.1/openmotif-2.3.1-1.tar.gz. Untar this in a directory of your choice. b. Once you have extracted OpenMotif 2.3.1-1, you will need to modify one file to avoid a compile-time error: In the subdirectory "clients/uil", modify line 286 of UilDefI.h thusly:
 -#if defined(linux)
 +#if defined(linux) || defined(__APPLE__)
c. Set the CFLAGS and LDFLAGS environment variables: if using a Bourne-like shell, type "export CFLAGS=-I/opt/local/include"; export LDFLAGS="-L/opt/local/lib". If using a C-like shell, type "setenv CFLAGS -I/opt/local/include; setenv LDFLAGS -L/opt/local/lib". d. In the top level of OpenMotif 2.3.1-1, configure, build, and install: (type "configure --prefix=/opt/local", then "make all", and "sudo make install").

5. You are now ready to build GEMPAK/N-AWIPS 5.11.4. Extract the tar file, and modify Gemenviron or Gemenviron.profile depending on your shell so that the environmental variable "NAWIPS" is set to the correct directory path.

6. GCC4.4 has a different version of "libtool" which will cause $NAWIPS/extlibs/netCDF/netcdf-3.6.2 to fail the build. Download netcdf-4.1.1 at ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.1.1.tar.gz and place/extract the tar.gz file in $NAWIPS/extlibs/netCDF. The attached tar file (see below) will change the softlink "netcdf" so it points to 4.1.1., and it also has a couple of changes in $NAWIPS/config/Makeinc.darwin and $NAWIPS/extlibs/netCDF/Makefile that are necessary for it to build.

7. Place the attached tar file (gempak_osx.tar.gz)in the top-level of your GEMPAK/N-AWIPS directory (i.e., in $NAWIPS). This tar file has a number of changes in several files, with the originals saved with a ".orig" extension. Many of these are specific to the OS X build, but a few have general applicability and I describe them below: a. $NAWIPS/extlibs/OHSHEF/sherrm.f has trailing line numbers omitted to avoid compile-time errors with gfortran b. $NAWIPS/config/fortran_wrappers.h has a modification which eliminates segfaults when running GDDIAG c. $NAWIPS/gempak/source/sn/sntser/sntser.f has a modification that allows more times to be used in a time-series.

8. Being sure you are in the top-level NAWIPS directory, extract the tar file (type "tar xvzf gempak_osx.tar.gz").

9. You should be able to build GEMPAK/N-AWIPS normally. Type "make > make.out" and verify there are no errors (there should be two non-critical "Error 2" messages but no "Error 1" messages.

10. If all went well, run "make install" and you should be good-to-go!

CAVEAT: You may have noticed that the 5.11.4 release no longer has Ron McTaggart-Cowan's "speed Patch" functionality that greatly sped up the launching of the GPLT and device driver processes! Michael James is aware of this and hopefully we will get this functionality back with the next release of GEMPAK from Unidata.

CAVEAT2: If the build fails for any reason and/or you need to remake the build, I recommend a fresh extraction of $NAWIPS/extlibs/netCDF/netcdf-4.1.1.tar.gz to eliminate a known bug where netcdf tries to reinstall documentation with the texi2dvi program, which is not present.

Despite my best efforts, no doubt some folks will discover some problems. Although I have done some basic run-time testing once the program has built, I cannot say for sure that there are bugs in the OS X build which are not seen on other platforms. Please let us know via the GEMBUD list what you find, and also let me know about any errors/typos/confusing parts in the steps enumerated above!

--Kevin

______________________________________________________________________
Kevin Tyle, Systems Administrator               **********************
Dept. of Atmospheric & Environmental Sciences   ktyle@xxxxxxxxxxxxxxxx
University at Albany, ES-235                    518-442-4578 (voice)
1400 Washington Avenue                          518-442-5825 (fax)
Albany, NY 12222                                **********************
______________________________________________________________________





Attachment: gempak_osx.tar.gz
Description: GNU Zip compressed data

  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the gembud archives: