Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/download_and_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,42 @@ cmake -D CMAKE_CXX_COMPILER=icx CMAKE_Fortran_COMPILER=ifort ..
Again, the built library and any executables will appear in the `build` folder, while the ddX source remains in `src/`.


---

## Building with FPM

[Fortran Package Manager (FPM)](https://fpm.fortran-lang.org/) version 0.8.0 or newer is required.

1. Build and compile:
```bash
fpm build
```
2. Run the standalone with an input file:
```bash
fpm run -- [path/to/input].txt
```
*For instance:*
```bash
fpm run -- tests/Input-example.txt
```
3. Run the test suite:
*Do not* run the usual
```bash
fpm test
```
as a general test command. Currently, FPM does not cleanly support the structure of ddX's test suite,
since there are several tests which require individual command line arguments.
Instead, we provide a Python wrapper, which runs all unit and standalone tests via FPM and analyzes their output:
```bash
python tests/fpm_tester.py
```
For more options, including output verbosity, run:
```bash
python tests/fpm_tester.py --help
```






99 changes: 99 additions & 0 deletions fpm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name = "ddx"
version = "0.7.0"
license = "LGPL-3.0-or-later"
author = "The ddX Developers"
maintainer = "The ddX Developers"
copyright = "Copyright (c) 2022 The ddX Developers"
description = "Continuum solvation models based on the domain decomposition paradigm"
homepage = "https://github.com/ddsolvation/ddX"
keywords = ["fortran", "solvation", "cosmo", "pcm", "lpb"]

[build]
auto-executables = false
auto-examples = false
auto-tests = false
external-modules = ["omp_lib"]
link = ["gomp", "lapack", "blas"]

[fortran]
implicit-typing = true
implicit-external = true
source-form = "default"

[[executable]]
name = "ddx_driver"
source-dir = "src"
main = "ddx_driver.f90"

[[test]]
name = "bessel"
source-dir = "tests"
main = "bessel.f90"

[[test]]
name = "force"
source-dir = "tests"
main = "force.f90"

[[test]]
name = "ddx_driver"
source-dir = "tests"
main = "ddx_driver.f90"

[[test]]
name = "force_ddlpb"
source-dir = "tests"
main = "force_ddlpb.f90"

[[test]]
name = "ddlpb_esolv"
source-dir = "tests"
main = "ddlpb_esolv.f90"

[[test]]
name = "ddx_core"
source-dir = "tests"
main = "ddx_core.f90"

[[test]]
name = "ddx_operators"
source-dir = "tests"
main = "ddx_operators.f90"

[[test]]
name = "error"
source-dir = "tests"
main = "error.f90"

[[test]]
name = "matrix_derivatives"
source-dir = "tests"
main = "matrix_derivatives.f90"

[[test]]
name = "matrix_adjoint"
source-dir = "tests"
main = "matrix_adjoint.f90"

[[test]]
name = "matrix_solvers"
source-dir = "tests"
main = "matrix_solvers.f90"

[[test]]
name = "m2l"
source-dir = "tests"
main = "m2l.f90"

[[test]]
name = "multipolar_solutes"
source-dir = "tests"
main = "multipolar_solutes.f90"

[[test]]
name = "test_gradients"
source-dir = "tests"
main = "test_gradients.f90"

[install]
library = true
2 changes: 2 additions & 0 deletions src/pyddx.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#ifdef BUILD_PYBIND11
#include "ddx.h"
#include <pybind11/eval.h>
#include <pybind11/pybind11.h>
Expand Down Expand Up @@ -60,3 +61,4 @@ solvent_kappa.__doc__ = (
))",
m.attr("__dict__"));
}
#endif
2 changes: 2 additions & 0 deletions src/pyddx_classes.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#ifdef BUILD_PYBIND11
#include "ddx.h"
#include <pybind11/eval.h>
#include <pybind11/numpy.h>
Expand Down Expand Up @@ -773,3 +774,4 @@ void export_pyddx_classes(py::module& m) {
"if requested, forces", "elec_field"_a = py::none(),
"read_guess"_a = false, "tol"_a = DEFAULT_TOLERANCE);
}
#endif
2 changes: 2 additions & 0 deletions src/pyddx_data.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#ifdef BUILD_PYBIND11
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

Expand Down Expand Up @@ -357,3 +358,4 @@ void export_pyddx_data(py::module& m) {
{"water", 1.776}, //
};
}
#endif
Loading
Loading