<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<htlm lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <link rel="stylesheet" href="style/manual.css" type="text/css">
  <title>KUCRS-Building</title>
</head>
<body>

<div class="sign">
 (c) 2002&ndash;2025 by <a href="../index.html.en">A.
  Miyoshi</a><br> All rights reserved.
</div>
<div class="title">KUCRS</div>
<div class="subttl">&ndash; Knowledge-basing Utilities for Complex Reaction
 Systems &ndash;<br clear="right"></div>

<hr> <!-- ------------------------------------------------------------ -->
<div class="lang"><a href="building.htm.ja">Japanese</a></div>
<table cellspacing="0"><tr align="center">
 <td class="fold"><a href="index.htm.en">What is<br>KUCRS?</a></td>                 <td class="sm"></td>
 <td class="fold"><a href="overview.htm.en">Overview</a></td>                       <td class="sm"></td>
 <td class="fold"><a href="license.htm.en">Licensing</a></td>                       <td class="sm"></td>
 <td class="fold"><a href="distrib.htm.en">Distribution</a></td>                    <td class="sm"></td>
 <td class="fold"><a href="getstrtd.htm.en">Getting<br>Started</a></td>             <td class="sm"></td>
 <td class="sel">Build</td>                                                         <td class="sm"></td>
 <td class="fold"><a href="manual.htm.en">Input<br>Manual</a></td>                  <td class="sm"></td>
 <td class="fold"><a href="userguid.htm.en">User's<br>Guide</a></td>                <td class="sm"></td>
 <td class="fold"><a href="refman.htm.en">Reference<br>Manual</a></td>              <td class="sm"></td>
 <td class="fold"><a href="verhist.htm.en">Version<br>History</a><br clear="right"></td>
</tr></table>
<hr> <!-- ------------------------------------------------------------ -->

<h1>Building KUCRS</h1>

<div class="main"> <!-- ---------------------------------------------- -->

<blockquote>
 &nbsp; Here is an instruction to build and execute KUCRS on UNIX.&nbsp;
 See <a href="getstrtd.htm.en">Getting Started</a> to use the pre-build
 binaries on Windows.&nbsp; Below may also be helpful to rebuild KUCRS
 on Windows.
</blockquote>

<h2>1. Building</h2>

<div class="ind1mgn">
 &nbsp; In the following instruction, KUCRS is assumed to be extracted
 in the user's home directory, <code>~/</code>, though actual location
 can be anywhere.&nbsp;
 If you have extracted KUCRS in the another location, assume
 <code>~/KUCRS</code> to be the directory where you actually extracted it.&nbsp;
</div>

<div class="ind1mgn">
 <h3>Decompress</h3>
 <div class="ind1smgn">
  &nbsp; Decompress the downloaded zip archive, 'KUCRS-<i>yyyymmdd</i>.zip',
  as follows.
  <div class="cmdl">
    [usr@machine ~]$ <b><font color="brown">unzip KUCRS-<i>yyyymmdd</i>.zip</font></b>
  </div>
 </div>
</div>

<div class="ind1mgn">
 <h3>Compile</h3>
 <div class="ind1smgn">
  Change directory to <code>~/KUCRS/sources</code>.&nbsp; The following makefiles
  are provided.&nbsp; Select appropriate one and edit if necessary.
  <div class="ind1smgn">
   <table border cellspacing="0">
    <tr><td>makeGnu.make</td><td>GNU compiler (UNIX-like platform)</td></tr>
    <tr><td>makeIntel64oapiLinux.make</td><td>Intel oneAPI 2025 & later (Linux)</td></tr>
    <tr><td>makeIntel64oapiWin.make</td><td>Intel oneAPI 2025 & later (Windows)</td></tr>
    <tr><td>makeIntelLinux.make</td><td>Intel compiler (Linux)</td></tr>
    <tr><td>makeIntelWin.make</td><td>Intel compiler (Windows)</td></tr>
   </table>
  </div>
  Execute <code>make</code> (<code>nmake</code> on Windows).
  <div class="cmdl">
    [usr@machine sources]$ <b><font color="brown">make -f </i>selected_make</i>.make</font></b>
  </div>
  After confirming that the compilation has been successfully completed,
  execute the <code>'install'</code> target.&nbsp;
  Executable files will be moved to <code>~/KUCRS/bin</code>.
  <div class="cmdl">
    [usr@machine sources]$ <b><font color="brown">make -f </i>selected_make</i>.make install</font></b>
  </div>
  Execute the <code>'clean'</code> target to remove temporary files.
  <div class="cmdl">
    [usr@machine sources]$ <b><font color="brown">make -f </i>selected_make</i>.make clean</font></b>
  </div>
  Change directory to </code>~/KUCRS</code> and execute the cshell script
  </code>~/KUCRS/prep_envKUCRS</code>.
  <div class="cmdl">
    [usr@machine ~/KUCRS]$ <b><font color="brown">csh prep_envKUCRS</font></b>
  </div>
  This sets execution permission to cshell script files in </code>~/KUCRS/bin</code>
  and generates a file </code>~/KUCRS/work/envKUCRS.csh</code>.
 </div>
</div>

<h2>2. Execution of samples</h2>

<div class="ind1mgn">
 <h3>Setting environment</h3>
 <div class="ind1smgn">
  If you are using a shell other than csh or tcsh, invoke csh or tcsh.&nbsp;
  Then source </code>~/KUCRS/work/envKUCRS.csh</code>.&nbsp;
  Note that this must be done every time you log-in.&nbsp;
  Set the content of </code>~/KUCRS/work/envKUCRS.csh</code> in
  <code>.cshrc</code> if necessary.
  <div class="cmdl">
    [usr@machine work]$ <b><font color="brown">source envKUCRS.csh</font></b>
  </div>
 </div>
</div>

<div class="ind1mgn">
 <h3>Running autogeneration program</h3>
 <div class="ind1smgn">
  Change directory to </code>~/KUCRS/work/sample</code> and type:
  <div class="cmdl">
    [usr@machine sample]$ <b><font color="brown">run_comb i-butane</font></b>
  </div>
  to run autogeneration program with the sample input <code>i-butane.inp</code>.<br>
  &nbsp; If properly executed, this will give following files.<pre>
i-butane.log
i-butane_chm.inp
i-butane_trn.dat</pre>
  Files necessary for Chemkin are 'i-butane_chm.inp' and 'i-butane_trn.dat'.
 </div>
<!--
 <div class="ind1smgn">
  &nbsp; <code>i-butane_mol.log</code> contains information on the chemical structures
  etc. of the chemical species. &nbsp; It contains SMILES representations
  of the chemical structures. &nbsp; If you need a simple list of the names
  and SMILES of the chemical species, convert the KUCRS internal format data
  in <code>i-butane_mol.dat</code> to SMILES representations by the mol2smiles tool. &nbsp;
  For this, type,
  <div class="cmdl">
    [usr@machine sample]$ <b><font color="brown">mol2smiles i-butane_mol.dat i-butane_sml.inp</font></b>
  </div>
  The files <code>i-butane_mol.dat</code> and <code>i-butane_mol.log</code> contain
  the information
  only on the automatically generated chemical species.&nbsp; The C2 species
  or smaller are registered in the base mechanism and the information on these
  base species are written in the corresponding files,
  <code>~/KUCRS/libdat/\mol_main.dat</code> and <code>~/KUCRS/libdata/ref/mol_main.log</code>.
 </div>
-->
 <div class="ind1smgn">
  - The shell script <code>run_com</code> provides the simplest
  way of running the autogeneration program.&nbsp; For simplicity,
  it deletes intermediate outputs which are not necessary to run
  CHEMKIN.&nbsp; To keep all the intermediate outputs, use <code>run_comb_nodel</code>.
 </div>
 <div class="ind1smgn">
  - Use 'run_comb_htnox' script to append the high-temperature NO<sub><i>x</i></sub>
  production mechanism.
 </div>
 <div class="ind1smgn">
  &nbsp; Some more sample inputs other than <code>i-butane.inp</code> can be
  found in <code>~/KUCRS/work/advanced_examples</code>.<pre>
alcohols.inp
alkanes.inp
alkenes.inp
diesel-prf.inp
gasoline-prf.inp</pre>
 </div>
</div>

<div class="ind1mgn">
 <h3>Running tools for chemical species data generation</h3>
 <div class="ind1smgn">
  In </code>~/KUCRS/work/sample</code>, type:
  <div class="cmdl">
    [usr@machine sample]$ <b><font color="brown">proc_smiles spcex</font></b>
  </div>
  to generate following files containing the thermodynamic and transport data from
  the list of species names and SMILES structure representations provided in
  <code>spcex.inp</code><pre>
spcex_thg.dat
spcex_thg.lst
spcex_trn.dat</pre>
  &nbsp; The file <code>spcex_thg.dat</code> contains thermodynamic data in NASA
  polynomial format used by CHEMKIN, <code>spcex_thg.lst</code> contins thermodynamic
  data in list format of THERM, and, <code>spcex_trn.dat</code> contains the
  transport data used by CHEMKIN.&nbsp; The details of the KUCRS components invoked by
  <code>proc_smiles</code> can be found in the 
  <a href="userguid.htm.en">User's Guide</a>.
 </div>
</div>

</div> <!-- ---------------------------------------------------------- -->

<hr> <!-- ------------------------------------------------------------ -->
</body>
</html>
