If the executables for your platform are not available from the CMAS web site, you will need to compile SMOKE for your system. You may also need to compile SMOKE if you would like to modify the source code. The following steps will help get you set up to compile SMOKE.
Install SMOKE as described in Section 12.3, “Installing SMOKE”. You may receive an error message indicating that the Assigns file could not be sourced when you run the smoke_install.csh
script.
The
script sets the $EDSS_ROOT
/scripts/setup_edss$EDSS_OS
environment variable based on the results of the uname command. The
uses $EDSS_ROOT
/scripts/platform$EDSS_OS
to determine the appropriate compiler command and options for your system. The platform
script has compiler options for several UNIX systems and you will either need to review these settings for your compiler
or add settings if your system is not included.
Source the platform
script as follows:
cd
$EDSS_ROOT
/scripts
source
platform
If your system is not recognized by the script, you will get an error message and you will need to add your system to the
platform
script. Check the value of the $EDSS_OS
environment variable and add it to the switch statement beginning at line 46. This switch statement sets the EDSS_EXE
environment variable which is then used in the switch statement starting at line 76.
The compiler and its options are set by the switch statement that starts at line 76. If you are not using the Linux2_x86pg
settings, you will need to check (or add) your Fortran compiler (using the environment variable FC
) and the compiler options. The environment variable FFLAGS
sets the Fortran compiler options for the optimized executables and the DBGFLAGS
variable sets the options for the debug executables. You should set your options to match the options used for the Linux
compile of SMOKE as closely as possible. The Linux Portland Group compiler options for the optimized executable are:
Once the platform
file has been updated, enter the following commands from the UNIX prompt:
cd
$EDSS_ROOT
/scripts
source
platform
This sets the EDSS_EXE
environment variable needed in the next steps.
Download and compile the I/O API library version 3.0 from the I/O API home page. The I/O API can be installed in
or you can place symbolic links to the $EDSS_ROOT
/subsys/ioapilibioapi.a
library file and datshift
utility program in the
directory.
$EDSS_ROOT
/subsys/ioapi/$EDSS_EXE
/
Create the
directory by symbolically linking the $EDSS_ROOT
/subsys/ioapi_includes/fixed_src
directory from your I/O API installation.
Collect or create the NetCDF library version 3.6.1 for your platform and create a symbolic link to the libnetcdf.a
library file in the
directory.
$EDSS_ROOT
/subsys/netcdf/$EDSS_EXE
/
If needed, update the files
$EDSS_ROOT
/subsys/edss_tools/setup/sysflags
$EDSS_ROOT
/subsys/filesetapi/sysflags
$EDSS_ROOT
/subsys/smoke/assigns/sysflags
to have the compiler options for your operating system. See the instructions above for the platform
file updates to determine whether you need to do this. All of the same cases available in the platform
file are also available in these three files.
After the appropriate libraries and compile options have been installed, you can source an Assigns file to ensure that your system is configured properly.
cd
$EDSS_ROOT
/subsys/smoke/assigns
source
ASSIGNS.nctox.cmaq.cb4p25.us12-nc
At this point, you may need to create some symbolic links that are normally created by the smoke_install.csh
script. If your system was not in the platform
script, then these links would not have been created. You can use the following shell script to create the symbolic links.
#!/bin/csh cd $SMKROOT/src foreach dir ( biog cntlmat emmod emqa emutil grdmat inc lib \ mo6 mobile point smkinven smkmerge spcmat temporal ) cd $dir ln -s ../../scripts/make/Makeit ./ cd .. end cd $ARDAT echo "#LIST" > arinv.stationary.lst ls $ARDAT/arinv.nonpoint.nti99_NC.new.txt >> arinv.stationary.lst ls $ARDAT/arinv.stationary.nei96_NC.ida.txt >> arinv.stationary.lst cd $MBDAT echo "#LIST" > mbinv.lst ls $MBDAT/mbinv.nei99_NC.ida.txt >> mbinv.lst ln -s mcref.nctox.txt mcref.nctox_18.txt ln -s mvref.nctox.txt mvref.nctox_18.txt cd $INVDIR/nonroad echo "#LIST" > arinv.nonroad.lst ls $INVDIR/nonroad/arinv.nonroad.n* >> arinv.nonroad.lst cd $PTDAT echo "#LIST" > ptinv.lst ls $PTDAT/ptinv.n* >> ptinv.lst
You should now be ready to compile the SMOKE programs. Change directories to
.
$SCRIPTS
/make/
Optionally edit the header of the Makeall
file to turn off building one or more libraries needed for SMOKE (libfileset, libedsstools, libsmoke, or libmo6). You can
turn off these options only if these libraries have been previously compiled for your system.
At the UNIX prompt, type:
Makeall
The only errors that are acceptable when you use this script are errors after the /bin/rm commands. The /bin/rm commands will fail if there are no object files (*.o
files) in your SMOKE source code directories. This will be the case if you have not previously compiled SMOKE.
After running the Makeall
script, you should have the following executables in the $SMK_BIN
directory:
aggwndw
, beld3to2
, bluesky2inv
, cemscan
, cntlmat
, elevpoint
, emisfac
, extractida
, grdmat
, grwinven
, invsplit
, laypoint
, mbsetup
, metcombine
, metscan
, mrgelev
, mrggrid
, normbeis3
, pktreduc
, premobl
, rawbio
, smk2emis
, smkinven
, smkmerge
, smkreport
, spcmat
, surgtool
, temporal
, tmpbeis3
, tmpbio
, uam2ncf
If you would like to compile individual programs, you can do so using the Makeit command in the appropriate source code directory. For example, to make the Smkinven program, type the following:
cd
$IV_SRC
Makeit smkinven
Once you have compiled the SMOKE programs, you can run the SMOKE example scripts following the instructions in Section 4.4, “Running the nctox test case”.