This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Connor, >Date: Fri, 01 Aug 2003 17:00:09 -0700 >From: "Flynn, Connor J" <address@hidden> >Organization: NOAA/PNL >To: Steve Emmerson <address@hidden> >Subject: RE: 20030731: udunits on cygwin The above message contained the following: > I've attached a small shell script (cygwin_setup.sh) that sets the > required environmental variables and also echos the necessary configure > changes to the screen. > > If you don't like attachments, then here is the text of cygwin_setup.sh: > > #/bin/sh > echo > echo > echo This script sets up the environment to compile udunits under Cygwin > > #Set the following environment variables: > CPPFLAGS=3D-Df2cFortran # Most important! > CXX=3Dg++ # Also important! > CC=3Dgcc # Not really a big deal. > CFLAGS=3D-O # Capital O for optimize. > FC=3Dg77 # Fortran compiler > FFLAGS=3D-O # Capital O for optimize. > > echo It sets: > echo CPPFLAGS=3D$CPPFLAGS Important! > echo CXX=3D$CXX Important! > echo CC=3D$CC Not really important > echo CFLAGS=3D$CFLAGS > echo FC=3D$FC > echo FFLAGS=3D$FFLAGS > echo > > #Don't forget to export: > export CPPFLAGS > export CC > export CXX > export CFLAGS > export FC > export FFLAGS > > # The configure file also needs minor modification. In the block of sed > > # substitutions containing the string "s%@CPPFLAGS@%$CPPFLAGS%g" similar > # lines are necessary for the CXX and FC flags. =20 > # Specifically, add the following: > # s%@CXX@%$CXX%g > # s%@FC@%$FC%g > # > > echo You will also need to modify the configure file as follows: > echo After line 5219 containing s%@CPPFLAGS@%\$CPPFLAGS%g > echo also add the following lines: > echo=20 > echo s%@CXX@%\$CXX%g > echo s%@FC@%\$FC%g > echo > echo That should do it... =20 > echo Now run ./configure and make! Why is it important to define a Fortran and C++ compiler (environment variables FC and CXX)? The UDUNITS package doesn't use them. > I'm not experienced with sed or I might have included the modifications > to the configure file as part of the shell script, but I hope this is > clear enough. > > Best regards, > Connor Flynn Regards, Steve Emmerson