-
Notifications
You must be signed in to change notification settings - Fork 435
3_Building
This page is currently out of date. Please help deprecate it by moving useful information into the docs. Please see CMakeLists.txt
in the primary directory for up to date information.
This section outlines the main steps of configuring, compiling, and installing Psi. More detail is given here.
>>> cd $top-level-psi4-dir
>>> ./setup --help
>>> ./setup [your compilation configuration options] objdir
>>> cd objdir
>>> make -j`getconf _NPROCESSORS_ONLN`
>>> make install
-
Get ahold of the Psi4 codebase, and navigate to the top level source directory,
$top-level-psi4-dir
.
cd $top-level-psi4-dir ```
Choose a compilation directory, hereafter $objdir
* How to compile elsewhere than $top-level-psi4-dir/objdir
* How to choose the compilation directory, $objdir
Choose an installation directory, hereafter $prefix
* How to install elsewhere than /usr/local/psi4
-
Examine the strict and optional software requirements to make sure the target computer has all the necessary dependencies installed.
- What are the tools and dependencies strictly required for building Psi4
- What are the add-on capabilities for Psi4 and what are their dependencies
Prepare any necessary or desired configuration options for
setup
, hereafter[your compilation configuration options]
-
Run the configuration script with planned options and directories, as below. It, in turn, invokes CMake which reports on software found or unfound as it scans the computer, then (upon success) creates
$objdir
ready for compilation.
./setup [your compilation configuration options] --prefix $prefix $objdir ```
-
Compile the code (optional
-j
triggers parallel compilation).
cd $objdir make -j
getconf _NPROCESSORS_ONLN
```
-
Optionally, use CTest to test the build.
ctest -j
getconf _NPROCESSORS_ONLN
```
-
If tests pass, install the code.
make install ```
-
To run Psi4 after installation, you need to configure a few variables:
Besides ``--prefix``, PSI often needs a few additional options for the
configure script. To make it easy to recompile later (especially if
you're a developer), it can be convenient (but not necessary) to to put
the configure options in a small executable file, so you can re-do the
configuration later very easily. Let us assume that we will be putting
the configure options in a file named do-configure, in the top-level
psi4 directory (we'll keep it up there instead of down in the compilation
directory $objdir, so that if we delete the compilation directory later,
we'll still have the do-configure file). All configure options must be
on one line in the do-configure script.
.. note:: The configure options below are for the most common architectures and
compilers. The developers would appreciate it if you would share any special
configuration options that might be needed for less commonly encountered
situations.
For g++, if you have BLAS and LAPACK in standard locations (like ``/usr/lib64``),
configuration is very easy. Pick one of the following scenarios, and place the
text given in the psi4/do-configure file (all on one long line). Replace the
text after prefix with whatever directory you want to use for your
installation directory.
* Intel compiler with MKL math library [highly recommended; if you don't use
this, then at least make sure you have a threaded BLAS (see BLAS
recommendations at :ref:`Section IV <sec:install_IV>` below)] ::
* Gnu compiler with ACML math library (better than MKL for AMD processors) ::
* g++, optimized ::
* g++, for debugging ::
* Compiling for Mac