diff --git a/docs/gauxc/fortran-library.rst b/docs/gauxc/fortran-library.rst index 9ce8994..0caad81 100644 --- a/docs/gauxc/fortran-library.rst +++ b/docs/gauxc/fortran-library.rst @@ -10,6 +10,31 @@ By the end of this tutorial, you will: * Configure the integration grid, load balancer, and XC integrator * Evaluate the exchange-correlation energy and potential +.. _gauxc_fortran_api: + +Before you start +---------------- + +This example assumes that you already have access to a GauXC source tree with Skala support, either because you followed :ref:`gauxc_install` first or because you let this example download GauXC automatically through CMake. +The example CMake files are written to accept either workflow. + +Before configuring the project, make sure you have the following available: + +- a Fortran compiler together with C and C++ compilers +- CMake and Ninja +- HDF5 development libraries +- an installed GauXC with both the C and Fortran APIs enabled, or network access so the example can build GauXC with those APIs enabled for you + +If you want to reproduce the sample ``He_def2-svp.h5`` input file from this guide, you also need the Python ``skala`` package installed. + +For a minimal OpenMP-capable environment for this guide, use the example environment file: + +.. literalinclude:: ../../examples/fortran/gauxc_integration/environment-openmp.yml + :language: yaml + :caption: environment-openmp.yml + +For MPI builds, switch to ``examples/fortran/gauxc_integration/environment-mpi.yml`` so that both MPI and the matching HDF5 variant are available. + Setting up CMake ---------------- @@ -46,7 +71,8 @@ Each dependency gets its own CMake include file. First, we define how to include GauXC, our main dependency. CMake will first attempt to discover an installed GauXC via its config file; if that fails, it will download and build GauXC from source. The options defined in the main CMake file are passed through to GauXC to ensure the library provides the requested features. -After GauXC is available, we verify that our requirements are satisfied—this is especially important for the Skala implementation, which requires the ``GAUXC_HAS_ONEDFT`` feature flag. +After GauXC is available, we verify that our requirements are satisfied. +For the Fortran driver this includes the Skala implementation as well as the C and Fortran APIs, which are checked via :c:macro:`GAUXC_HAS_ONEDFT`, :c:macro:`GAUXC_HAS_C`, and :c:macro:`GAUXC_HAS_FORTRAN`. .. literalinclude:: ../../examples/fortran/gauxc_integration/cmake/skala-gauxc.cmake :language: cmake @@ -58,12 +84,15 @@ For the command-line interface, we use the `FLAP library