Skip to content

Commit

Permalink
Merge pull request #76 from chemphys/master
Browse files Browse the repository at this point in the history
Update to v0.7
  • Loading branch information
chemphys authored May 23, 2022
2 parents e451baa + 5aba648 commit 1e5a5e4
Show file tree
Hide file tree
Showing 434 changed files with 112,512 additions and 16,661 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/github-actions-mbx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,29 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y fftw3-dev
sudo apt-get install libgsl-dev
sudo apt-get install lcov -y
sudo apt-get install autoconf -y
- name: Check out repository code
uses: actions/checkout@v2
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "The workflow is now ready to test your code on the runner."

- name: run-cmake
- name: run-install
run: |
ls ${{ github.workspace }}
rm -rf build install
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_OPENMP=False -DCMAKE_COMPILE_TESTS=TRUE -DCMAKE_CXX_FLAGS=" -fPIC --coverage -O0 -Wall -ftree-vectorize -ftree-vectorizer-verbose=2" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -H. -Bbuild
- name: run-make
run: |
cd build
make -j 2 CXX=g++ CC=gcc
rm -rf install
autoreconf -fi
./configure --disable-optimization --enable-coverage
make install
cd ../
- run: echo "This job's status is ${{ job.status }}."

- run: echo "Running unittests"
- run: ls ${{ github.workspace }}
- name: ctest
run: |
cd ${{ github.workspace }}/install/bin/unittests
ctest --output-on-failure
- name: unittests
run: make check

- name: Submit to codecov.io
run: |
Expand Down
116 changes: 0 additions & 116 deletions CMakeLists.txt

This file was deleted.

74 changes: 74 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Installation Instructions
```
/******************************************************************************
Copyright 2022 The Regents of the University of California.
All Rights Reserved.
Permission to copy, modify and distribute any part of this Software for
educational, research and non-profit purposes, without fee, and without
a written agreement is hereby granted, provided that the above copyright
notice, this paragraph and the following three paragraphs appear in all
copies.
Those desiring to incorporate this Software into commercial products or
use for commercial purposes should contact the:
Office of Innovation & Commercialization
University of California, San Diego
9500 Gilman Drive, Mail Code 0910
La Jolla, CA 92093-0910
Ph: (858) 534-5815
FAX: (858) 534-7345
E-MAIL: [email protected]
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE UNIVERSITY
OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE PROVIDED HEREIN IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS. THE UNIVERSITY OF CALIFORNIA MAKES NO
REPRESENTATIONS AND EXTENDS NO WARRANTIES OF ANY KIND, EITHER IMPLIED OR
EXPRESS, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR THAT THE USE OF THE
SOFTWARE WILL NOT INFRINGE ANY PATENT, TRADEMARK OR OTHER RIGHTS.
******************************************************************************/
```
# Requirements
- GNU C++ compiler 4.9 or higher OR Intel Compilers 2018 or higher
- FFTW libraries (for dynamic library build, the fftw3.so lib is needed)
- GSL libraries

# Optional requirements
- MPI compilers

If not in the path, the variable FFTW_HOME and GSL_HOME must be defined.

# Basic installation of MBX
Installation is as simple as running

```
autoreconf -fi
./configure
make && make install
```

# MPI compilation (For LAMMPS use only)
MPI compilation is needed when using MBX with LAMMPS
If the MPI compilers and libraries are not in the default location,
a variable MPI_HOME needs to be defined.

```
autoreconf -fi
./configure --enable-mpi CXX=mpiicpc
make && make install
```

# Unittesting
It is recommended to first install the code without MPI and optimizations and run
the unittests. To do so:
```
./configure --disable-optimization
make check
```
All tests should pass.
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SUBDIRS = src
dist_doc_DATA = README.md
39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,37 @@
[![MBX testing suite](https://github.com/paesanilab/MBX-dev/actions/workflows/github-actions-mbx.yml/badge.svg)](https://github.com/paesanilab/MBX-dev/actions/workflows/github-actions-mbx.yml)
[![codecov](https://codecov.io/gh/chemphys/MBX/branch/master/graph/badge.svg)](https://codecov.io/gh/chemphys/MBX)
[![Homepage](https://img.shields.io/badge/google%20groups-mbx--users-green)](https://groups.google.com/g/mbx-users)

# MBX
# MBX v0.7
MBX is a C++ software that provides an interface for MD drivers, such as LAMMPS and i-PI, to perform classical and path-integral molecular dynamics simulations using our many-body potential energy functions. The current version of MBX includes the MB-pol many-body water potential (https://doi.org/10.1021/ct400863t, https://doi.org/10.1021/ct500079y, https://pubs.acs.org/doi/abs/10.1021/ct5004115) and the MB-nrg many-body potentials for neat CO2 and mixed CO2/H2O mixtures (https://doi.org/10.1021/acs.jctc.9b01175, https://doi.org/10.1063/5.0080061), and neat CH4 and mixed CH4/H2O mixtures (https://doi.org/10.1021/acs.jpcb.0c08728). MBX also includes the TTM-nrg potentials for the halide (https://doi.org/10.1021/acs.jpcb.5b09562) and alkali-metal (https://doi.org/10.1039/C6CP02553F) ions in water. The MB-nrg many-body potentials for the halide (https://doi.org/10.1021/acs.jctc.6b00302) and alkali-metal (https://doi.org/10.1063/1.4993213) ions in water will become available in the next release of MBX. For more details about the MB-pol, MB-nrg, and TTM-nrg potentials in MBX please visit: https://paesanigroup.ucsd.edu/software/mbx.html.

MBX is periodically updated with performance improvements and the addition of other many-body potentials. For any questions about MBX, please use the MBX Google Group: https://groups.google.com/g/mbx-users.
MBX is periodically updated with performance improvements and the addition of other many-body potentials. For any questions about MBX, installation issues, or general usage inquiries please use the MBX Google Group: https://groups.google.com/g/mbx-users.

## Compilation and Installation
The following requirements need to be fulfilled in order to succesfully install the software
- CMake v3.12.4 or higher
- g++/gcc v4.9 or higher [and icpc/icc v2017 or higher - optional]
- Read the entire README before doing anything

### Setup
The home directory of MBX will be referred as `MBX_HOME`. You must set this environment variable, and can be done with the following command if the home directory of MBX is the current directory.
`export MBX_HOME=$PWD`
Then set up the compiler to use. To keep it general, we will use `g++` and `gcc`, but intel compilers are recommended.
`export MBX_CXX=g++`
`export MBX_CC=gcc`
If the user wants to activate OpenMP parallelization, it needs to be activated. Otherwise set the following variable to `False`.
`export MBX_USEOPENMP=True`

### Compilation
Run the following commands, and MBX should compile. When using optimizations, compilation may be memory consuming and it may take 5-10 minutes.
```
cd ${MBX_HOME}
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_TESTS=True -DCMAKE_CXX_FLAGS="-fPIC -Wall" -DCMAKE_CXX_COMPILER=${MBX_CXX} -DCMAKE_C_COMPILER=${MBX_CC} -DUSE_OPENMP=${MBX_USEOPENMP} -H. -Bbuild
cd build
make
make install
```
At this point, a folder called `install` should have been created.
Please read the INSTALL.md instructions. After installation, a folder
called `install` should have been created if no prefix has been given to `configure`.

## Testing
After installation, running the unittests is highly recomended. Run the following commands to run the tests.
```
cd ${MBX_HOME}/install/bin/unittests
ctest
make check
```
All tests must pass. Please contact the code owners if there is any issue.

## Json File
To make life easier for you, a json configuration file can be used to pass all the information that MBX needs. Usually, one does not need to change anything except a couple of options. In any case, all the options of the json file are explained below.
To make life easier for you, a json configuration file must be used to pass
all the information that MBX needs. Usually, one does not need to change
anything except a couple of options. In any case, all the options of the
json file are explained below.

The json file template is the following:
```
Expand Down Expand Up @@ -87,7 +77,7 @@ In this file:
- `localhost` is the name of the socket. It MUST match the name in the xml file, otherwise it will send an error saying that the socket was not found.

## Main executables
After installation, there will be the main executables in `$MBX_HOME/install/bin/main`.
After installation, there will be the main executables in `$MBX_HOME/install/bin`.
- `single_point` will return the energy (Binding Energy) in kcal/mol for a given configuration. One can have multiple systems in the nrg file, and single point will return the energies of each one of them. If the flag to print gradients is activated (`PRINT_GRADS`; see source code in `$MBX_HOME/src/main/single_point.cpp`) it will also print the gradients.
- `optimize` will optimize a given configuration. You can optimize a single nrg system, or pass an XYZ file with a set of configurations, in which all of them will be optimized.

Expand Down Expand Up @@ -119,6 +109,9 @@ export LD_LIBRARY_PATH=MBX_HOME/install/lib/:$LD_LIBRARY_PATH
export PYTHONPATH=${PYTHONPATH}:${MBX_HOME}/plugins/python/mbx
```

Note that for these interfaces to work, they need the dynamic library of MBX.
You may need to rerun the `configure` script with the --enable-shared option.

### i-pi
This software is already interfaced with i-pi. In order to run molecular dynamics using the MB-nrg PEFs, you will need to install i-pi first. Please go to [the i-pi github page](https://github.com/i-pi/i-pi) and clone and follow the instructions to install i-pi. Before continuing with this, make sure i-pi is working. If you have any problems with the i-pi installation, you can ask a question in [the i-pi-user forum](https://groups.google.com/forum/#!forum/ipi-users). However, there is no need to install anything in i-pi. Just have it on your computer, so if you want skip the testing (PROCEED AT YOUR OWN RISK), you can skip testing i-pi and assume it works.

Expand Down Expand Up @@ -155,14 +148,14 @@ First of all you will need to download LAMMPS from their webpage (https://lammps
MBX needs to be normally installed following the instructions provided in the previous sections. After installation:
```
cd MBX_HOME/plugins/lammps
vi Makefile.mpi_mbx.lab
vi Makefile.mpi_mbx
```
Make sure that the `MBX` variable is pointing to the right place. If you have your `MBX_HOME` environment varible you should be fine.

Let's call the directory where LAMMPS has been put/unpacked `LAMMPS_HOME`.
Do the following:
```
cp Makefile.mpi_mbx.lab LAMMPS_HOME/src/MAKE/Makefile.mpi_mbx
cp Makefile.mpi_mbx LAMMPS_HOME/src/MAKE/Makefile.mpi_mbx
cd LAMMPS_HOME/src/
make yes-USER-MBX yes-MOLECULE
make mpi_mbx -j 4
Expand Down
Loading

0 comments on commit 1e5a5e4

Please sign in to comment.