| [0b990d] | 1 | 
 | 
|---|
 | 2 | /** \page compile Compiling
 | 
|---|
 | 3 | 
 | 
|---|
 | 4 | <ul>
 | 
|---|
 | 5 |   <li> \ref compilepre   
 | 
|---|
 | 6 |   <li> \ref compilepreopt
 | 
|---|
 | 7 |   <li> \ref compileconf  
 | 
|---|
 | 8 |   <ul>
 | 
|---|
 | 9 |     <li> \ref compilecca
 | 
|---|
 | 10 |   </ul>
 | 
|---|
 | 11 |   <li> \ref compilecomp
 | 
|---|
 | 12 |   <li> \ref compilecheck
 | 
|---|
 | 13 | </ul>
 | 
|---|
 | 14 | 
 | 
|---|
 | 15 | \section compilepre Prerequisites
 | 
|---|
 | 16 | 
 | 
|---|
 | 17 | Make sure that you have the following programs available. Most can be found
 | 
|---|
 | 18 | at any GNU software FTP repository.
 | 
|---|
 | 19 | 
 | 
|---|
 | 20 | <ul>
 | 
|---|
 | 21 | 
 | 
|---|
 | 22 |     <li> Compilers for the C, C++, and FORTRAN languages are needed.  The
 | 
|---|
 | 23 |          FORTRAN compiler is used to determine the linkage conventions for
 | 
|---|
 | 24 |          the BLAS libraries, however, you can turn off the use of a FORTRAN
 | 
|---|
 | 25 |          compiler by giving <tt>--without-f77</tt> as an option to the
 | 
|---|
 | 26 |          configure script, however, this will not work unless you
 | 
|---|
 | 27 |          only want the utility libraries.  The compilers listed below are
 | 
|---|
 | 28 |          known to work.  Other ISO C++ compilers should work as well.
 | 
|---|
 | 29 | 
 | 
|---|
 | 30 |        <ul>
 | 
|---|
 | 31 | 
 | 
|---|
 | 32 |            <li> GCC 2.96 and later, available from <a
 | 
|---|
 | 33 |                 href="http://gcc.gnu.org">http://gcc.gnu.org</a>.  However,
 | 
|---|
 | 34 |                 the 3.0 and 3.0.1 releases of GCC are not recommended.
 | 
|---|
 | 35 | 
 | 
|---|
 | 36 |            <li> IBM xlC 5.0.2 and later work with both 32 and 64 bit modes
 | 
|---|
 | 37 |                 Use the versions of the compilers with the "_r" appended to
 | 
|---|
 | 38 |                 the name, since SC uses multi-threading.  You must also
 | 
|---|
 | 39 |                 specify that RTTI is used: <tt>--with-cxx='xlC_r
 | 
|---|
 | 40 |                 -qrtti'</tt>.
 | 
|---|
 | 41 | 
 | 
|---|
 | 42 |            <li> Compaq/Alpha/Linux with Compaq C++ 6.3.6.8 and later work.
 | 
|---|
 | 43 |                 Special configure options are needed: <tt>--with-cxx='cxx
 | 
|---|
 | 44 |                 -D__USE_STD_IOSTREAM'</tt>
 | 
|---|
 | 45 | 
 | 
|---|
 | 46 |            <li> The Intel 5.0.1 Linux compilers for IA-32 work.  Version
 | 
|---|
 | 47 |                 5.0.1 for IA-64 will not work.
 | 
|---|
 | 48 | 
 | 
|---|
 | 49 |            <li> The KAI version 4.0e1 compiler works.  Special configure
 | 
|---|
 | 50 |                 options are needed: <tt>--with-cxx='KCC
 | 
|---|
 | 51 |                 --one_instantiation_per_object' --with-ar=KCC
 | 
|---|
 | 52 |                 --with-ar-flags=-o</tt>
 | 
|---|
 | 53 | 
 | 
|---|
 | 54 |        </ul>
 | 
|---|
 | 55 | 
 | 
|---|
 | 56 |     <li> The Basic Linear Algebra Subprograms (BLAS) are required.  A
 | 
|---|
 | 57 |          prepackaged version of BLAS is available for most machines.
 | 
|---|
 | 58 |          Consult you operating system documentation for more information.
 | 
|---|
 | 59 |          If precompiled BLAS routines are not available for your machine,
 | 
|---|
 | 60 |          the source can be obtained from <a
 | 
|---|
 | 61 |          href="http://www.netlib.org/blas">http://www.netlib.org/blas</a>.
 | 
|---|
 | 62 |          The file blas.tgz contains the source for all of the BLAS
 | 
|---|
 | 63 |          routines.  If the BLAS library is not named libblas.a or is not
 | 
|---|
 | 64 |          installed in the default library search path, then configure must
 | 
|---|
 | 65 |          be given --with-libs, --with-libdirs, or both.
 | 
|---|
 | 66 | 
 | 
|---|
 | 67 |     <li> The Linear Algebra Package (LAPACK) 3.0 is required.  A
 | 
|---|
 | 68 |          prepackaged version of LAPACK is available for most machines.
 | 
|---|
 | 69 |          Consult you operating system documentation for more information.
 | 
|---|
 | 70 |          If a precompiled LAPACK is not available for your machine, the
 | 
|---|
 | 71 |          source can be obtained from <a
 | 
|---|
 | 72 |          href="http://www.netlib.org/lapack">http://www.netlib.org/lapack</a>.
 | 
|---|
 | 73 |          The file lapack.tgz contains the source for all of the LAPACK
 | 
|---|
 | 74 |          routines.  If the LAPACK library is not named liblapack.a or is
 | 
|---|
 | 75 |          not installed in the default library search path, then configure
 | 
|---|
 | 76 |          must be given --with-libs, --with-libdirs, or both.
 | 
|---|
 | 77 | 
 | 
|---|
 | 78 |     <li> If you modify the scanner source file, then a
 | 
|---|
 | 79 |          lexical analyzer generator is required to generate code to read
 | 
|---|
 | 80 |          input files.  The flex program is used for this purpose.
 | 
|---|
 | 81 |          However, the most common version of flex, 2.5.4a, does
 | 
|---|
 | 82 |          not generate legal C++.  It may be necessary to download,
 | 
|---|
 | 83 |          compile, and install a more recent version of flex from <a
 | 
|---|
 | 84 |          href="http://lex.sourceforge.net">http://lex.sourceforge.net</a>.
 | 
|---|
 | 85 | 
 | 
|---|
 | 86 |          Make sure that <tt>FlexLexer.h</tt> from flex is in your include
 | 
|---|
 | 87 |          path. You may need to give the path to <tt>FlexLexer.h</tt> to
 | 
|---|
 | 88 |          configure with an argument that looks something like:
 | 
|---|
 | 89 |          <tt>--with-include=-I/usr/local/include</tt>
 | 
|---|
 | 90 | 
 | 
|---|
 | 91 |     <li> If you modify a parser source file, then GNU bison (version 1.24
 | 
|---|
 | 92 |          or greater) is needed.  This is a parser generator used to
 | 
|---|
 | 93 |          generate code to read input files.
 | 
|---|
 | 94 | 
 | 
|---|
 | 95 |     <li> GNU gmake (version 3.70 or greater): GNU specific extensions to make
 | 
|---|
 | 96 |          are used extensively.
 | 
|---|
 | 97 | 
 | 
|---|
 | 98 |     <li> perl: This is used to convert template classes to macros, generate
 | 
|---|
 | 99 |          and check the validation suite etc.  To compile SC, either perl 4
 | 
|---|
 | 100 |          or perl 5 will work.  To generate the validation inputs and
 | 
|---|
 | 101 |          automatically check the outputs, perl 5.003 or later is needed.
 | 
|---|
 | 102 | 
 | 
|---|
 | 103 |   </ul>
 | 
|---|
 | 104 | 
 | 
|---|
 | 105 | \section compilepreopt Optional Packages
 | 
|---|
 | 106 | 
 | 
|---|
 | 107 | The following packages are not necessary to compile MPQC, but may provide additional
 | 
|---|
 | 108 | features.
 | 
|---|
 | 109 | 
 | 
|---|
 | 110 | <ul>
 | 
|---|
 | 111 | 
 | 
|---|
 | 112 |     <li> A Message Passing Interface (MPI) is required to use MPQC in
 | 
|---|
 | 113 |          parallel on distributed memory machines.
 | 
|---|
 | 114 | 
 | 
|---|
 | 115 |     <li> The parallel MP2 and MP2-R12 methods require direct access to
 | 
|---|
 | 116 |          remote memory.  This requires one of two features: A thread-safe
 | 
|---|
 | 117 |          MPI (<a href="http://www.mpi-softtech.com">MPI Software
 | 
|---|
 | 118 |          Technology, Inc.</a> has developed a thread-safe MPI) or the <a
 | 
|---|
 | 119 |          href="http://www.emsl.pnl.gov/docs/parsoft/armci/">Aggregate
 | 
|---|
 | 120 |          Remote Memory Copy Interface (ARMCI)</a>.  These respectively
 | 
|---|
 | 121 |          permit remote memory access through the ARMCIMemoryGrp and the
 | 
|---|
 | 122 |          MTMPIMemoryGrp classes, respectively.
 | 
|---|
 | 123 | 
 | 
|---|
 | 124 |     <li> Libint (version 1.1.0 or higher): This is a machine-generated
 | 
|---|
 | 125 |          library that can be used for evaluation of certain molecular
 | 
|---|
 | 126 |          integrals. IntegralCints and MBPT2_R12 classes depend on this
 | 
|---|
 | 127 |          library. The library is freely available under GNU Public License
 | 
|---|
 | 128 |          (GPL) from <a
 | 
|---|
 | 129 |          href="http://www.ccmst.gatech.edu/evaleev/libint/">www.ccmst.gatech.edu/evaleev/libint/</a>.
 | 
|---|
 | 130 | 
 | 
|---|
 | 131 |     <li> Cca-chem-generic (version 0.2.0 or higher, and associated CCA tools):
 | 
|---|
 | 132 |          This package allows both stand-alone and embedded component applications  
 | 
|---|
 | 133 |          to be formed using MPQC-based components.  Visit the
 | 
|---|
 | 134 |          <a href="http://cca-forum.org/~cca-chem">CCA Chemistry Component Toolkit Homepage</a>
 | 
|---|
 | 135 |          for information on the freely available source code.
 | 
|---|
 | 136 | 
 | 
|---|
 | 137 | </ul>
 | 
|---|
 | 138 | 
 | 
|---|
 | 139 | \section compileconf Configuration
 | 
|---|
 | 140 | 
 | 
|---|
 | 141 |  You can build MPQC in the source code directory or you can make a
 | 
|---|
 | 142 | companion directory which will be used to hold all of the files generated
 | 
|---|
 | 143 | by the compilation.  You may name this directory anything you want.
 | 
|---|
 | 144 | Typically, this directory is named to indicate the architecture
 | 
|---|
 | 145 | (e.g. <tt>mpqc.i686-linux</tt>) and will be referred to as the target
 | 
|---|
 | 146 | directory below.
 | 
|---|
 | 147 | 
 | 
|---|
 | 148 |  In the target directory execute the <tt>configure</tt> command which is
 | 
|---|
 | 149 | located in the SC source directory.  Use the absolute pathname to the
 | 
|---|
 | 150 | configure script.  This command should build a hierarchy of target
 | 
|---|
 | 151 | directories and the necessary makefiles. Do a <tt>configure --help</tt> to
 | 
|---|
 | 152 | see a list of options.  Options are specified with an equals sign, as in
 | 
|---|
 | 153 | <tt>configure --prefix=/usr/local</tt>.  Some options, such as all the
 | 
|---|
 | 154 | <tt>enable</tt> and <tt>disable</tt> options, do not require an argument.
 | 
|---|
 | 155 | Useful options to configure include:
 | 
|---|
 | 156 | 
 | 
|---|
 | 157 | <dl>
 | 
|---|
 | 158 | 
 | 
|---|
 | 159 | <dt><tt>--prefix</tt><dd>Specifies the installation directory.  The default
 | 
|---|
 | 160 |   is <tt>/usr/local/mpqc/</tt><i>version-number</i>
 | 
|---|
 | 161 | 
 | 
|---|
 | 162 | <dt><tt>--enable-debug</tt><dd>Options for debugging will be given to the
 | 
|---|
 | 163 |   compiler.  Use <tt>--enable-debug=opt</tt> to use both debugging and
 | 
|---|
 | 164 |   optimization options.
 | 
|---|
 | 165 | 
 | 
|---|
 | 166 | <dt><tt>--with-default-parallel</tt><dd>Gives the default parallism
 | 
|---|
 | 167 |   specializations.  Can be <tt>none</tt> for no default or <tt>mtmpi</tt>
 | 
|---|
 | 168 |   for MTMPIMemoryGrp (MPI must be fully thread-safe) and MPIMessageGrp
 | 
|---|
 | 169 |   specializations.  The parallelism model can be overridden with command
 | 
|---|
 | 170 |   line arguments or environmental variables.
 | 
|---|
 | 171 | 
 | 
|---|
 | 172 | <dt><tt>--enable-always-use-mpi</tt>This can be given if MPIMessageGrp
 | 
|---|
 | 173 |   is to be the only MessageGrp that will be used.  This option should
 | 
|---|
 | 174 |   be given if the real argc and argv must be given to MPI_Init.
 | 
|---|
 | 175 | 
 | 
|---|
 | 176 | <dt><tt>--disable-parallel</tt><dd>Do not try to find communications
 | 
|---|
 | 177 |   libraries.
 | 
|---|
 | 178 | 
 | 
|---|
 | 179 | <dt><tt>--disable-threads</tt><dd>Do not try to find the multi-thread
 | 
|---|
 | 180 |   libraries.
 | 
|---|
 | 181 | 
 | 
|---|
 | 182 | <dt><tt>--enable-shared</tt><dd>Use shared libraries.  This will
 | 
|---|
 | 183 |   reduce the size of executables, if shared libraries are supported
 | 
|---|
 | 184 |   on your system.
 | 
|---|
 | 185 | 
 | 
|---|
 | 186 | <dt><tt>--disable-static</tt><dd>Do not build libraries for static linking.
 | 
|---|
 | 187 | 
 | 
|---|
 | 188 | <dt><tt>--enable-ref-debug</tt><dd>Check for overwrites and overflows of
 | 
|---|
 | 189 |   reference counts.  Implied by ``--enable-debug''.
 | 
|---|
 | 190 | 
 | 
|---|
 | 191 | <dt><tt>--disable-ref-macros</tt><dd>Use template classes for reference
 | 
|---|
 | 192 |   counting.  The default is to use a CPP macro to generate a class
 | 
|---|
 | 193 |   definition.
 | 
|---|
 | 194 | 
 | 
|---|
 | 195 | <dt><tt>--enable-cross-compile</tt><dd>If this option is set then the
 | 
|---|
 | 196 |   configure script will take care to not execute any compiled test
 | 
|---|
 | 197 |   programs.
 | 
|---|
 | 198 | 
 | 
|---|
 | 199 | <dt><tt>--enable-shared-libs</tt><dd>This will generate shared objects and
 | 
|---|
 | 200 |   link with them instead of standard ``.a'' libraries.  This works on a
 | 
|---|
 | 201 |   Linux-ELF system.
 | 
|---|
 | 202 | 
 | 
|---|
 | 203 | <dt><tt>--enable-components</tt><dd>This will generate CCA components and
 | 
|---|
 | 204 |   enable embedded CCA frameworks within MPQC.
 | 
|---|
 | 205 | 
 | 
|---|
 | 206 | <dt><tt>--with-build-id</tt><dd>This is used to generate unique shared
 | 
|---|
 | 207 |   library names and a unique default prefix for an MPQC installation.
 | 
|---|
 | 208 |   Unique shared library names must be used used by package distributors if
 | 
|---|
 | 209 |   a non-official ABI is used.  The official ABI is GCC-3.2.  Earlier
 | 
|---|
 | 210 |   versions of GCC are not compatible.  Installations with multiple C++
 | 
|---|
 | 211 |   compilers that use shared libraries should use --with-build-id to avoid
 | 
|---|
 | 212 |   accidentally dynamically linking with the wrong libraries.
 | 
|---|
 | 213 | 
 | 
|---|
 | 214 | <dt><tt>--with-default-memory</tt><dd>This specifies the default
 | 
|---|
 | 215 | memory allocation, which is used in absense of the memory> keyword in user's input.
 | 
|---|
 | 216 | The default is 32 million bytes (roughly, 32 MB).
 | 
|---|
 | 217 | 
 | 
|---|
 | 218 | <dt><tt>--with-cc</tt><dd>Gives the name of the C compiler.
 | 
|---|
 | 219 | 
 | 
|---|
 | 220 | <dt><tt>--with-cc-optflags</tt><dd>By default configure will attempt to
 | 
|---|
 | 221 |   guess a reasonable set of optimization flags.  These flags will be
 | 
|---|
 | 222 |   overridden by the argument given to this keyword.
 | 
|---|
 | 223 | 
 | 
|---|
 | 224 | <dt><tt>--with-cxx</tt><dd>Gives the name of the C++ compiler.
 | 
|---|
 | 225 | 
 | 
|---|
 | 226 | <dt><tt>--with-cxx-optflags</tt><dd>By default configure will attempt to
 | 
|---|
 | 227 |   guess a reasonable set of optimization flags.  These flags will be
 | 
|---|
 | 228 |   overridden by the argument given to this keyword.
 | 
|---|
 | 229 | 
 | 
|---|
 | 230 | <dt><tt>--with-f77</tt><dd>Gives the name of the FORTRAN compiler.
 | 
|---|
 | 231 | 
 | 
|---|
 | 232 | <dt><tt>--without-f77</tt><dd>configure will not try to find a FORTRAN
 | 
|---|
 | 233 |   compiler.  This can only be used if nothing more than the utility
 | 
|---|
 | 234 |   libraries are needed.
 | 
|---|
 | 235 | 
 | 
|---|
 | 236 | <dt><tt>--with-ranlib</tt><dd>Gives the name of the archive indexing
 | 
|---|
 | 237 |   utility.
 | 
|---|
 | 238 | 
 | 
|---|
 | 239 | <dt><tt>--with-ar</tt><dd>Gives the name of the program that makes
 | 
|---|
 | 240 |   libraries.
 | 
|---|
 | 241 | 
 | 
|---|
 | 242 | <dt><tt>--with-ld</tt><dd>Gives the name of the object linker.
 | 
|---|
 | 243 | 
 | 
|---|
 | 244 | <dt><tt>--with-include</tt><dd>Gives directories in which include files
 | 
|---|
 | 245 |   should be sought.  For example, <tt>--with-include="-I/u/local/inc
 | 
|---|
 | 246 |   -I/u/cljanss/include"</tt>
 | 
|---|
 | 247 | 
 | 
|---|
 | 248 | <dt><tt>--with-libs</tt><dd>Specifies libraries that executables should be
 | 
|---|
 | 249 |   linked with.  For example, <tt>--with-libs=-llapack_IRIX.a</tt>.
 | 
|---|
 | 250 | 
 | 
|---|
 | 251 | <dt><tt>--with-libdirs</tt><dd>Gives the directories in which libraries
 | 
|---|
 | 252 |   should be sought.  For example,
 | 
|---|
 | 253 |   <tt>--with-libdirs=-L/usr/local/lib64</tt>.
 | 
|---|
 | 254 | 
 | 
|---|
 | 255 | <dt><tt>--with-cca-chem-config</tt><dd>Specifies the config script for the
 | 
|---|
 | 256 |   cca-chem-generic package (prerequisite for CCA components).
 | 
|---|
 | 257 | 
 | 
|---|
 | 258 | </dl>
 | 
|---|
 | 259 | 
 | 
|---|
 | 260 |   If you would like to further customize your target directory,
 | 
|---|
 | 261 | you can edit <tt>src/lib/scconfig.h</tt> and <tt>lib/LocalMakefile</tt> to
 | 
|---|
 | 262 | suit your needs.  The next time you run configure, these files and
 | 
|---|
 | 263 | all the makefiles will be overwritten.
 | 
|---|
 | 264 | 
 | 
|---|
 | 265 | \subsection compilecca Notes on CCA Configuration
 | 
|---|
 | 266 | 
 | 
|---|
 | 267 | <ul>
 | 
|---|
 | 268 |   <li> Use the <tt>--enable-components</tt> flag to generate CCA components and enable 
 | 
|---|
 | 269 |        embedded frameworks within MPQC.  
 | 
|---|
 | 270 |   <li> The <tt>cca-chem-config</tt> script must be found in the user's path or 
 | 
|---|
 | 271 |        specified using the <tt>--with-cca-chem-config</tt>.
 | 
|---|
 | 272 |   <li> To fully support runtime configuration of component applications, 
 | 
|---|
 | 273 |        compile using <tt>--enable-shared</tt>.
 | 
|---|
 | 274 |   <li> Run <tt>make install_devel</tt> after compiling to install the <tt>sc-config</tt>
 | 
|---|
 | 275 |        script (required by <tt>cca-chem-apps</tt>).
 | 
|---|
 | 276 | </ul>
 | 
|---|
 | 277 | 
 | 
|---|
 | 278 | \section compilecomp Compilation
 | 
|---|
 | 279 | 
 | 
|---|
 | 280 |  Now you are ready to build the libraries and executables.  Do this by
 | 
|---|
 | 281 | typing <tt>make</tt> in your target directory.  If you are running on a
 | 
|---|
 | 282 | symmetric multi-processor, you can use GNU make to parallelize the
 | 
|---|
 | 283 | compilation.  To compile four files at a time, type <tt>make -j4</tt>.
 | 
|---|
 | 284 | This feature works correctly with GNU make version 3.78.1 or later; for
 | 
|---|
 | 285 | older versions of GNU make use <tt>make JOBS=-j4</tt>.
 | 
|---|
 | 286 | 
 | 
|---|
 | 287 |  You can install the executables and data files with <tt>make install</tt>.
 | 
|---|
 | 288 | 
 | 
|---|
 | 289 |  You can install the libraries and header files with <tt>make
 | 
|---|
 | 290 | install_devel</tt>, however, <tt>make install</tt> must be also be run to
 | 
|---|
 | 291 | install the files needed for run-time support.
 | 
|---|
 | 292 | 
 | 
|---|
 | 293 | \section compilecheck Checking the Compilation
 | 
|---|
 | 294 | 
 | 
|---|
 | 295 | See \ref mpqcval for instructions for checking your compilation.
 | 
|---|
 | 296 | 
 | 
|---|
 | 297 | */
 | 
|---|