Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
* ANN functionality is revised and extended, now fully-functional
* Eigen3 is removed from the codebase, build instructions are now set to use the external package
* Added the libint2 support, Libra is linked to the external libint2 libraries and can use them
* Added the MOLDEN-file procedures: constructing the molecular integrals using these files
* Added the CP2k workflow with libint2 support
* Added the xTB (in CP2k) workflow
* Pickling support for various Libra classes
* Simplified and generalized the multithreading calculations and made the workflows more user-friendly
* Added more efficient methods for SD overlap and time-overlap calculations
* Added user-friendly general NA-MD workflows, with a set of new recipes for common types of calculations
* Less memory-demanding saving in the files
* Fixed a memory leak in the NA-MD workflows
  • Loading branch information
alexvakimov committed Nov 17, 2021
2 parents 2a15e10 + daf3f53 commit c61d91a
Show file tree
Hide file tree
Showing 1,810 changed files with 154,155 additions and 346,559 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Alexey V. Akimov <alexeyak@buffalo.edu>
Alexey V. Akimov <alexvakimov@gmail.com>
Brendan Smith <bsmith24@buffalo.edu>
Dr. Brendan Smith <bsmith24@buffalo.edu>
Mr. Mohammad Shakiba <mshakiba.kerman.iran@gmail.com>
Story Temen <storytem@buffalo.edu>
Wei Li <liwei0099@gmail.com>
Kosuke Sato <??>
Expand Down
77 changes: 57 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Set the compiler as described here: https://cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F
#
# Verify that Cmake is up to date
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
#SET(CMAKE_LEGACY_CYGWIN_WIN32 0)


#
# Project name
#


PROJECT("libra")
# Set the compiler as described here: https://cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F
#
# Verify that Cmake is up to date
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
#SET(CMAKE_LEGACY_CYGWIN_WIN32 0)


#
# Project name
#


PROJECT("libra")

#
# User-defined Find modules
Expand All @@ -28,7 +28,9 @@ MESSAGE("Advice: If this search fails, try setting cache variables: -DPYTHON_LIB
MESSAGE("Hint to self: -DPYTHON_INCLUDE_DIR=/home/Alexey_2/Soft/Python-2.6.7/bin/include/python2.6 -DPYTHON_LIBRARY=/home/Alexey_2/Soft/Python-2.6.7/bin/bin")

# For Linux and Cygwin
FIND_PACKAGE(PythonLibs 3.7 REQUIRED)
# Adapt it according to your system
FIND_PACKAGE(PythonLibs 3.6 REQUIRED)
#FIND_PACKAGE(PythonLibs 3.7 REQUIRED)

IF(PYTHONLIBS_FOUND)
MESSAGE("Success!")
Expand All @@ -50,19 +52,22 @@ MESSAGE(${PYTHON_INCLUDE_DIRS})
#
# Boost library
#


MESSAGE("Looking for Boost libraries...")
SET(Boost_NO_BOOST_CMAKE TRUE) # to fix the problem of finding python37 libs
SET(Boost_USE_STATIC_LIBS=OFF)
SET(Boost_USE_MULTITHREADED=OFF)
SET(Boost_USE_STATIC_RUNTIME=OFF)


FIND_PACKAGE(Boost REQUIRED)
# Adapt it according to your system
FIND_PACKAGE(Boost 1.73.0 REQUIRED)
#FIND_PACKAGE(Boost REQUIRED)
IF(Boost_FOUND)
MESSAGE("Success!")
INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}")
FIND_PACKAGE(Boost COMPONENTS python37 regex) # it seems that it is important to find sub-packages too!!!
INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}")
# Adapt it based on your system
FIND_PACKAGE(Boost COMPONENTS python36 regex) # it seems that it is important to find sub-packages too!!!
#FIND_PACKAGE(Boost COMPONENTS python37 regex)
ELSEIF(NOT Boost_FOUND)
MESSAGE(FATAL_ERROR "Unable to find correct Boost version. Did you set BOOST_ROOT?")
ENDIF()
Expand All @@ -73,6 +78,38 @@ MESSAGE("Found Boost include directory: ")
MESSAGE("${Boost_INCLUDE_DIRS}")



FIND_PACKAGE(Eigen3)
IF(EIGEN3_FOUND)
INCLUDE_DIRECTORIES("${EIGEN3_INCLUDE_DIR}")
MESSAGE("Found Eigen3 include directory: ")
MESSAGE("${EIGEN3_INCLUDE_DIR}")
ELSEIF(NOT EIGEN3_FOUND)
MESSAGE(FATAL_ERROR "Unable to find Eigen3")
ENDIF()


SET(EIGEN3_INCLUDE_DIRS "${EIGEN3_INCLUDE_DIR}")

# Remove CMakeCache.txt from the previous build, if you get an error finding libint2 due to problems
# in finding Eigen3

# Libint2 2.7.0 CONFIG REQUIRED COMPONENTS shared gss e5 g5
#FIND_PACKAGE(Libint2 MODULE 2.7.0)
FIND_PACKAGE(Libint2 CONFIG 2.7.0 REQUIRED COMPONENTS shared gss e5 g5)
IF(Libint2_FOUND)
INCLUDE_DIRECTORIES("${Libint2_INCLUDE_DIRS}")
MESSAGE("Found Libint2 include directory: ")
MESSAGE("${Libint2_INCLUDE_DIRS}")
MESSAGE("Found Libint2_LIBRARIES: ")
MESSAGE("${Libint2_LIBRARIES}")
MESSAGE("Found Libint2_LIBRARY: ")
MESSAGE("${Libint2_LIBRARY}")
ELSEIF(NOT Libint2_FOUND)
MESSAGE(FATAL_ERROR "Unable to find correct libint2")
ENDIF()


#
# GNU compiler definitions
#
Expand Down
172 changes: 166 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The program website is [here](https://quantum-dynamics-hub.github.io/libra/index

More:

* [How to install](https://quantum-dynamics-hub.github.io/libra/installation.html)
* [Training & Usage](https://github.com/compchem-cybertraining/Tutorials_Libra)
* [Autogenerated Documentation](https://quantum-dynamics-hub.github.io/libra-code/)

Expand All @@ -27,6 +26,167 @@ for all users with the intent:
knowledge and skills with others;


## Installation (as of after 5/14/2021)

### 1. Install miniconda (for Python 3.8) and activate Conda

mkdir Conda
cd Conda/
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh .
sh ./Miniconda3-latest-Linux-x86_64.sh -b -u -p <install_dir>

Here,

* the `-b` option will accept the license agreement and will skip all the prompts
* the `-u` option will tell the installer to do all the needed updates
* the `-p` option followed by the installation directory path (will be created), tells
the installed where to install the package.

To activate the installed base environment of Conda do:

eval "$(<path to bin/conda> shell.bash hook)"

For instance,

eval "$(/projects/academic/cyberwksp21/Software/Conda/Miniconda3/bin/conda shell.bash hook)"


You will need to run this script every time you want to use a particular Conda and the
corresponding environments, unless you include this command in your .bashrc or .bash_profile

Test it is working by doing:

which conda


### 2. Download Libra

mkdir libra
cd libra
git clone https://github.com/Quantum-Dynamics-Hub/libra-code.git .

and switch to the correct branch or tag - usually, it would be `devel` branch

git checkout devel


### 3. Create the environment equipped with all Libra needs

#### 3.1. Simple way:

Just execute the following script located in the root of Libra distribution:

sh ./libra_env_build.sh

This script will create the environment called `libra` and will install all the
needed stuff in it. You just need to activate it:

conda activate libra

#### 3.2. Detailed instructions on what the script about does:

It first creates and activates the `libra` environment:

conda create -n libra

Update conda install if needed (e.g. if the output suggests it)

conda activate libra

Thne, it installs all the dependencies and tools.

Do this one by one, and in this order (should not matter too much, but who knows it)

> To automate the below procedures, you can use `-y` option to accept prompts (sometimes this will override)
> previous packages/conflicts, so be careful
>
> You can also use `-q` to get rid of all the messages to the output, although i'd keep it to keep track of what's going on

Basic stuff

conda install conda-build
conda install gcc_linux-64
conda install gxx_linux-64
conda install make
conda install boost
conda install cmake
conda install git
conda install -c anaconda h5py
conda install -c conda-forge/label/gcc7 eigen
conda install -c psi4/label/dev libint2
conda install -c anaconda gmp
conda install -c conda-forge/label/gcc7 mpfr

More, but still needed because some Python modules require those.
We need to downgrade Python version here to 3.6 to enable Psi4 installation

conda install python=3.6
conda install -c psi4 psi4
conda install -c conda-forge matplotlib
conda install -c rmg py3dmol
conda install -c anaconda numpy
conda install -c anaconda scipy
conda install -c conda-forge llvm-openmp

You can install Jupyter notebook using the following command. This will be useful and you can set up and access the Jupyter notebook
remotely from a cluster and load the tutorials

conda install -c conda-forge jupyterlab


Used in some of the tutorials

conda install -c conda-forge/label/gcc7 imageio


### 4. Adapt the CMakeLists.txt file according to your system

Because we had to downgrade Python to 3.6, we need to edit the CMakeLists.txt such that
cmake is looking for the correct Python version

FIND_PACKAGE(PythonLibs 3.6 REQUIRED)

and also reflect it in the component of the Boost.Python to be found:

FIND_PACKAGE(Boost COMPONENTS python36 regex)

Same for Boost (see the error messages for what version of Boost the cmake can find). In my current
case, it suggest the version 1.73.0, so be it:

FIND_PACKAGE(Boost 1.73.0 REQUIRED)

### 5. Create the build directory and make the Makefiles

Then in the libra directory, create the build directory:

cd libra
mkdir _build
cd _build
cmake ../

### 6. Compile the package

make -j4

### 7. Setup environmental variables

Add the following exports to your `.bash_profile` file

export PYTHONPATH=<path to the ppackage>/libra/_build/src:$PYTHONPATH
export LD_LIBRARY_PATH=<path to the ppackage>/libra/_build/src:$LD_LIBRARY_PATH

### 8. Restart the terminal or source the bash profile and activate libra conda environment

source .bash_profile
conda activate libra

And you should be ready to use Libra.


* [Old instructions](https://quantum-dynamics-hub.github.io/libra/installation.html)



## Developers and Contributors

* Dr. Alexey Akimov (University at Buffalo, [link](https://akimovlab.github.io/index.html) )
Expand All @@ -37,7 +197,7 @@ for all users with the intent:
Libra/DFTB+, Libra/QE, Libra/ErgoSCF, Libra/CP2K, and Libra/Gaussian interfaces

* Mr. Mohammad Shakiba (Shahid Bahonar University of Kerman, Iran)
Cube file processing scripts, Libra/CP2K and Libra/Gaussian interfaces
Cube file processing scripts, Libra/CP2K and Libra/Gaussian, Libra/Libint2 interfaces

* Mrs. Story Temen (University at Buffalo)
Implementation and testing of the HEOM codes
Expand All @@ -51,10 +211,10 @@ for all users with the intent:
* Dr. Ekadashi Pradhan (York University)
Libra/QE interface, delta-SCF NA-M (Libra-X)

* Dr. Amber Jain (Indian Institute of Technology, Bombay)
* Dr. Amber Jain (Indian Institute of Technology Bombay, India)
Implementation and testing of the HEOM codes

* Dr. Xiang Sun (Indian Institute of Technology, Bombay)
* Dr. Xiang Sun (NYU Shanghai, China)
Implementation and testing of the FGR codes


Expand All @@ -64,9 +224,9 @@ This code is provided in the hope it will be useful.

If you use the code in your research, please cite the following paper(s):

### Parers that describe Libra and its features
### Papers that describe Libra or its features

* [Initial Implementation](http://onlinelibrary.wiley.com/doi/10.1002/jcc.24367/full)
* [The initial implementation](http://onlinelibrary.wiley.com/doi/10.1002/jcc.24367/full)
Akimov, A. V. "Libra: An open-Source 'methodology discovery' library for quantum and classical dynamics simulations"
*J. Comput. Chem.* **2016** 37, 1626-1649

Expand Down
23 changes: 23 additions & 0 deletions libra_env_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
conda create -n libra
conda activate libra
conda install -y conda-build
conda install -y gcc_linux-64
conda install -y gxx_linux-64
conda install -y cmake
conda install -y make
conda install -y git
conda install -y boost=1.73.0
conda install -y -c anaconda h5py
conda install -y -c conda-forge/label/gcc7 eigen
conda install -y -c psi4/label/dev libint2
conda install -y -c anaconda gmp
conda install -y -c conda-forge/label/gcc7 mpfr
conda install -y python=3.6
conda install -y -c psi4 psi4
conda install -y -c conda-forge matplotlib
conda install -y -c rmg py3dmol
conda install -y -c anaconda numpy
conda install -y -c anaconda scipy
conda install -y -c conda-forge/label/gcc7 imageio
conda install -y -c conda-forge llvm-openmp

4 changes: 0 additions & 4 deletions notebooks/Example14_QE_methods/.gitignore

This file was deleted.

Loading

0 comments on commit c61d91a

Please sign in to comment.