From f5dda665b7a5851a6955368aa2d757e21feb69f0 Mon Sep 17 00:00:00 2001 From: Tammo van der Heide Date: Tue, 4 Jul 2023 09:00:28 +0200 Subject: [PATCH 1/3] Add instructions to compile libXC from source --- README.rst | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 39c18294..9b2867ca 100644 --- a/README.rst +++ b/README.rst @@ -46,7 +46,7 @@ Follow the usual CMake build workflow: CMake) or the ``PKG_CONFIG_PATH`` environment variable (if libXC was built with autotools) in order to guide the library search:: - CMAKE_PREFIX_PATH=YOUR_LIBXC_INSTALL_FOLDER FC=gfortan cmake [...] + CMAKE_PREFIX_PATH=$HOME/opt/libxc FC=gfortan cmake [...] PKG_CONFIG_PATH=FOLDER_WITH_LIBXC_PC_FILES FC=gfortran cmake [...] @@ -65,6 +65,39 @@ Follow the usual CMake build workflow: cmake --install _build +Obtaining libXC +--------------- + +Follow the usual CMake build workflow: + +* Clone the official libXC repository and checkout the latest release tag, e.g. + ``6.2.2``:: + + git clone https://gitlab.com/libxc/libxc.git libxc + cd libxc/ + git checkout 6.2.2 + +* Configure the project, specify your compilers (e.g. ``gfortran`` and ``gcc``), + the install location (e.g. ``$HOME/opt/libxc``) and the build directory + (e.g. ``_build``):: + + FC=gfortran CC=gcc cmake -DENABLE_FORTRAN=True -DCMAKE_INSTALL_PREFIX=$HOME/opt/libxc -B _build . + +* If the configuration was successful, build the code :: + + cmake --build _build -- -j + +* After successful build, you should test the code by running :: + + pushd _build + ctest -j + popd + +* If the tests were successful, install the package via :: + + cmake --install _build + + Advanced build configuration ============================ @@ -85,7 +118,7 @@ variable. If you want to load an external toolchain file instead of one from the source tree, you can specify the file path with the ``-DTOOLCHAIN_FILE`` option :: - -DTOOLCHAIN_FILE=/some/path/myintel.cmake + -DTOOLCHAIN_FILE=/path/to/myintel.cmake or with the ``SKPROGS_TOOLCHAIN_FILE`` environment variable. From df878721e399a1c4e37c7b6544ae60a55717b536 Mon Sep 17 00:00:00 2001 From: Tammo van der Heide Date: Mon, 10 Jul 2023 12:37:55 +0200 Subject: [PATCH 2/3] Apply feedback of code review --- README.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 9b2867ca..7f71d9b0 100644 --- a/README.rst +++ b/README.rst @@ -36,17 +36,17 @@ Building the code Follow the usual CMake build workflow: * Configure the project, specify your compilers (e.g. ``gfortran``), - the install location (e.g. ``$HOME/opt/skprogs``) and the build directory - (e.g. ``_build``):: + the install location (i.e. path stored in ``YOUR_SKPROGS_INSTALL_FOLDER``, + e.g. ``$HOME/opt/skprogs``) and the build directory (e.g. ``_build``):: - FC=gfortran cmake -DCMAKE_INSTALL_PREFIX=$HOME/opt/skprogs -B _build . + FC=gfortran cmake -DCMAKE_INSTALL_PREFIX=YOUR_SKPROGS_INSTALL_FOLDER -B _build . If libXC is installed in a non-standard location, you may need to specify either the ``CMAKE_PREFIX_PATH`` environment variable (if libXC was built with CMake) or the ``PKG_CONFIG_PATH`` environment variable (if libXC was built with autotools) in order to guide the library search:: - CMAKE_PREFIX_PATH=$HOME/opt/libxc FC=gfortan cmake [...] + CMAKE_PREFIX_PATH=YOUR_LIBXC_INSTALL_FOLDER FC=gfortan cmake [...] PKG_CONFIG_PATH=FOLDER_WITH_LIBXC_PC_FILES FC=gfortran cmake [...] @@ -78,10 +78,10 @@ Follow the usual CMake build workflow: git checkout 6.2.2 * Configure the project, specify your compilers (e.g. ``gfortran`` and ``gcc``), - the install location (e.g. ``$HOME/opt/libxc``) and the build directory - (e.g. ``_build``):: + the install location (i.e. path stored in ``YOUR_LIBXC_INSTALL_FOLDER``, e.g. + ``$HOME/opt/libxc``) and the build directory (e.g. ``_build``):: - FC=gfortran CC=gcc cmake -DENABLE_FORTRAN=True -DCMAKE_INSTALL_PREFIX=$HOME/opt/libxc -B _build . + FC=gfortran CC=gcc cmake -DENABLE_FORTRAN=True -DCMAKE_INSTALL_PREFIX=YOUR_LIBXC_INSTALL_FOLDER -B _build . * If the configuration was successful, build the code :: From b1708f03bc28b2697b4dcaf3e2c764dd97096906 Mon Sep 17 00:00:00 2001 From: Tammo van der Heide Date: Wed, 9 Aug 2023 15:35:00 +0200 Subject: [PATCH 3/3] Add instructions covering the Conda packages --- README.rst | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index 7f71d9b0..2ce0e3e5 100644 --- a/README.rst +++ b/README.rst @@ -11,8 +11,8 @@ robust. Make sure, you check results as careful as possible. Use at your own risk! -Installing -========== +Installation +============ |build status| @@ -30,8 +30,34 @@ Prerequisites * libXC library with f03 interface (version >=6.0.0) -Building the code ------------------ +Obtaining via Conda +------------------- + +The preferred way of obtaining SkProgs is to install it via the conda package +management framework using `Miniconda +`_ or `Anaconda +`_. Make sure to add/enable the +``conda-forge`` channel in order to be able to access SkProgs:: + + conda config --add channels conda-forge + conda config --set channel_priority strict + +We recommend to set up a dedicated conda environment and to use the +`mamba solver `_ :: + + conda create --name skprogs + conda activate skprogs + conda install conda-libmamba-solver + conda config --set solver libmamba + +to install the latest stable release of SkProgs (Fortran and Python +components):: + + mamba install skprogs skprogs-python + + +Building from source +-------------------- Follow the usual CMake build workflow: @@ -65,8 +91,8 @@ Follow the usual CMake build workflow: cmake --install _build -Obtaining libXC ---------------- +Building libXC from source +-------------------------- Follow the usual CMake build workflow: @@ -134,9 +160,10 @@ Generating SK-files The basic steps of generating the electronic part of the SK-tables are as follows: -* Initialize the necessary environment variables by sourceing the - ``skprogs-activate.sh`` script (provided you have BASH or compatible shell, - otherwise inspect the script and set up the environment variables manually):: +* If you have build SkProgs from source, initialize the necessary environment + variables by sourceing the ``skprogs-activate.sh`` script (provided you have + BASH or a compatible shell, otherwise inspect the script and set up the + environment variables manually):: source /bin/skprogs-activate.sh