1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00
trexio/README.md

118 lines
5.1 KiB
Markdown
Raw Normal View History

2021-03-02 14:30:46 +01:00
# TREXIO
2021-03-29 00:46:06 +02:00
2021-06-25 11:51:06 +02:00
[![build](https://github.com/TREX-CoE/trexio/actions/workflows/actions.yml/badge.svg)](https://github.com/TREX-CoE/trexio/actions/workflows/actions.yml)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/TREX-CoE/trexio)
TREX library for efficient I/O.
2021-05-03 15:27:01 +02:00
2021-05-03 15:58:01 +02:00
## Minimal requirements (for users):
2021-05-03 15:27:01 +02:00
2021-09-08 19:34:16 +02:00
- Autotools (autoconf >= 2.69, automake >= 1.11, libtool >= 2.2)
2021-06-11 09:55:37 +02:00
- C compiler (gcc/icc/clang)
- Fortran compiler (gfortran/ifort)
- HDF5 library (>= 1.8)
2021-05-03 15:58:01 +02:00
## Installation procedure from the tarball (for users):
1. Download the `trexio-<version>.tar.gz` file
2. `gzip -cd trexio-<version>.tar.gz | tar xvf -`
2021-05-05 11:37:48 +02:00
3. `cd trexio-<version>`
2021-06-25 11:51:06 +02:00
4. `./configure --enable-silent-rules`
2021-05-05 11:37:48 +02:00
5. `make`
2021-05-03 15:58:01 +02:00
6. `make check`
2021-05-05 11:37:48 +02:00
7. `sudo make install`
2021-05-03 15:58:01 +02:00
2021-06-25 11:51:06 +02:00
**Note: on systems with no `sudo` access, one can replace `./configure` with `./configure prefix=${PWD}/_install` in order to execute `make install/uninstall` commands without `sudo` privileges.**
2021-05-03 15:58:01 +02:00
## Additional requirements (for developers):
2021-06-11 09:55:37 +02:00
- python3 (>= 3.6)
- Emacs (>= 26.0)
- SWIG (>= 4.0)
2021-05-03 15:58:01 +02:00
## Installation procedure from the GitHub repo clone (for developers):
2021-04-30 14:29:43 +02:00
1. `git clone https://github.com/TREX-CoE/trexio.git`
2021-05-05 11:37:48 +02:00
2. `cd trexio`
2021-05-27 23:29:38 +02:00
3. `./autogen.sh`
2021-06-25 11:51:06 +02:00
4. `TREXIO_DEVEL=1 ./configure --enable-maintainer-mode`
2021-05-27 23:29:38 +02:00
5. `make`
6. `make check`
7. `sudo make install`
2021-05-03 15:27:01 +02:00
2021-10-07 14:06:56 +02:00
## Linking to your program
The `make install` command takes care of installing the TREXIO shared library on the user machine.
Once installed, add `-ltrexio` to the list of compiler options.
In some cases (e.g. when using custom `prefix` during configuration), the TREXIO library might end up installed in a directory, which is absent in the default `$LIBRARY_PATH`.
In order to link the program against TREXIO, the search paths in the current shell can be modified as follows: `export LIBRARY_PATH=$LIBRARY_PATH:<path_to_trexio>/lib` (same holds for `$LD_LIBRARY_PATH`). Do not forget to change `<path_to_trexio>`.
If your compilation relies on some build tools (like Autotools or CMake), feel free to use the built-in functions to locate and link external dependencies automatically.
In Fortran applications, make sure that the `trexio_f.f90` module file is included in the source tree.
You might have to manually copy it into your program source directory.
The `trexio_f.f90` module file can be found in the `include/` directory of the TREXIO source code distribution.
**Note:** there is no need to include `trexio.h` header file during compilation of Fortran programs.
Only the installed library and the Fortran module file are required.
## Naming convention
The primary TREXIO API is composed of the following functions:
- `trexio_open`
- `trexio_write_[group]_[variable]`
- `trexio_read_[group]_[variable]`
- `trexio_has_[group]_[variable]`
- `trexio_close`
2021-09-14 09:48:55 +02:00
where `[group]` and `[variable]` substitutions correspond to the contents of the `trex.json` configuration file
(for more details, see the corresponding [documentation](https://trex-coe.github.io/trexio/trex.html) page).
For example, consider the `coord` variable (array), which belongs to the `nucleus` group. The TREXIO user can write or read it using `trexio_write_nucleus_coord` or `trexio_read_nucleus_coord` functions, respectively.
Note: the `[variable]` names have to be unique only within the corresponding parent `[group]`.
There is no naming conflict when, for example, `num` variable exists both in the `nucleus` group (i.e. the number of nuclei) and in the `mo` group (i.e. the number of molecular orbitals).
These quantities can be accessed using the corresponding `trexio_[has|read|write]_nucleus_num` and `trexio_[has|read|write]_mo_num`, respectively.
2021-09-08 19:34:16 +02:00
## Python API
2021-09-14 09:48:55 +02:00
For more details regarding the installation and usage of the TREXIO Python API,
see [this page](python/README.md).
2021-09-08 19:34:16 +02:00
2021-05-03 15:27:01 +02:00
## Tutorial
TREXIO tutorials in Jupyter notebook format can be found in the
[corresponding GitHub repository](https://github.com/TREX-CoE/trexio-tutorials)
or on [Binder](https://mybinder.org/v2/gh/TREX-CoE/trexio-tutorials/HEAD).
2021-05-03 15:27:01 +02:00
2021-09-14 09:48:55 +02:00
For example, the tutorial covering TREXIO basics using benzene molecule as an example can be viewed and executed online by clicking on this badge:
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/TREX-CoE/trexio-tutorials/HEAD?filepath=notebooks%2Ftutorial_benzene.ipynb)
2021-05-03 15:58:01 +02:00
2021-10-07 14:06:56 +02:00
## Documentation
2021-05-03 15:27:01 +02:00
2021-06-25 11:51:06 +02:00
[Documentation generated from TREXIO org-mode files.](https://trex-coe.github.io/trexio/)
2021-05-03 15:58:01 +02:00
2021-05-03 15:27:01 +02:00
### Miscellaneous
2021-04-30 14:29:43 +02:00
2021-09-14 09:48:55 +02:00
Note: The code should be compliant with the C99
[CERT C coding standard](https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-c-coding-standard-2016-v01.pdf).
This can be checked with the `cppcheck` tool.
2021-05-03 15:58:01 +02:00
2021-07-15 14:43:54 +02:00
-----------------
![European flag](https://trex-coe.eu/sites/default/files/inline-images/euflag.jpg)
[TREX: Targeting Real Chemical Accuracy at the Exascale](https://trex-coe.eu) project has received funding from the European Unions Horizon 2020 - Research and Innovation program - under grant agreement no. 952165. The content of this document does not represent the opinion of the European Union, and the European Union is not responsible for any use that might be made of such content.