diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 3d69bb1..3195538 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -23,7 +23,7 @@ jobs: - name: configure with autotools run: | ./autogen.sh - TREXIO_DEVEL=1 ./configure --enable-silent-rules + ./configure --enable-silent-rules - name: compile TREXIO run: make -j 2 @@ -63,7 +63,7 @@ jobs: - name: configure with autotools run: | ./autogen.sh - TREXIO_DEVEL=1 ./configure FC=gfortran-10 --enable-silent-rules + ./configure FC=gfortran-10 --enable-silent-rules - name: compile TREXIO run: make -j 2 diff --git a/README.md b/README.md index 95037e7..7470091 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ TREX library for efficient I/O. 1. Download the `trexio-.tar.gz` file 2. `gzip -cd trexio-.tar.gz | tar xvf -` 3. `cd trexio-` -4. `./configure --enable-silent-rules` +4. `./configure` 5. `make` 6. `make check` 7. `sudo make install` @@ -40,7 +40,7 @@ TREX library for efficient I/O. 1. `git clone https://github.com/TREX-CoE/trexio.git` 2. `cd trexio` 3. `./autogen.sh` -4. `TREXIO_DEVEL=1 ./configure --enable-maintainer-mode` +4. `./configure` 5. `make` 6. `make check` 7. `sudo make install` @@ -54,7 +54,7 @@ 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 can be modified as follows: -`export LIBRARY_PATH=$LIBRARY_PATH:/lib` +`export LIBRARY_PATH=$LIBRARY_PATH:/lib` (same holds for `$LD_LIBRARY_PATH`). The `` has to be replaced by the prefix used during the installation. @@ -78,28 +78,28 @@ The primary TREXIO API is composed of the following functions: - `trexio_has_[group]_[variable]` - `trexio_close` -where `[group]` and `[variable]` substitutions correspond to the contents of the `trex.json` configuration file +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). +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. ## Python API -For more details regarding the installation and usage of the TREXIO Python API, +For more details regarding the installation and usage of the TREXIO Python API, see [this page](python/README.md). ## Tutorial -TREXIO tutorials in Jupyter notebook format can be found in the +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). -For example, the tutorial covering TREXIO basics using benzene molecule as an example can be viewed and executed online by clicking on this badge: +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) @@ -110,8 +110,8 @@ For example, the tutorial covering TREXIO basics using benzene molecule as an ex ### Miscellaneous -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). +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. diff --git a/configure.ac b/configure.ac index 55b705d..8899f3a 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,15 @@ AC_PREREQ([2.69]) AC_INIT([trexio], [2.0.0], [https://github.com/TREX-CoE/trexio/issues]) AM_INIT_AUTOMAKE([subdir-objects color-tests parallel-tests silent-rules 1.11]) +AM_MAINTAINER_MODE() + +# Activate developer mode when the source is the git repository. +# Otherwise, it is the source distribution and the developer mode should not be activated. +TEST_IFEXISTS=".git" +AC_CHECK_FILE([$TEST_IFEXISTS], + [enable_maintainer_mode="yes"], +) + AM_MAINTAINER_MODE() LT_PREREQ([2.2]) LT_INIT @@ -29,7 +38,7 @@ AC_DEFINE_UNQUOTED(TREXIO_USER_NAME, ["${UNAME}"], [user name]) AC_SUBST([UNAME]) ## ------------------- -## Checks for programs +## Checks for programs ## ------------------- AC_LANG(C) @@ -131,11 +140,16 @@ AC_TYPE_UINT64_T AC_FUNC_MALLOC AC_CHECK_FUNCS([memset mkdir strerror]) +if test "x$enable_maintainer_mode" == "xyes"; then + TREXIO_DEVEL=" -- Developer mode" +else + TREXIO_DEVEL="" +fi + AM_CONDITIONAL([TREXIO_DEVEL],[test "x$TREXIO_DEVEL" != x]) if test "x${TREXIO_DEVEL}" != "x"; then - TREXIO_DEVEL=" -- Developer mode" AC_PROG_AWK AM_PATH_PYTHON([3.0]) @@ -157,23 +171,6 @@ if test "x${TREXIO_DEVEL}" != "x"; then HAS_CPPCHECK=1 fi -else - - # Throw an error message if the user attempts to configure the GitHub repo clone not in the developer mode. - # Developer mode is required to generate the TREXIO source files from the org-mode templates. - TEST_IFEXISTS=".gitmodules" - AC_CHECK_FILE([$TEST_IFEXISTS], - [AC_MSG_ERROR([ - ---------------------------------------------------------------- - Installation with the current configuration is not possible. - Activate developer mode: TREXIO_DEVEL=1 ./configure - | OR | - Download the tarball with the source code distribution. - ---------------------------------------------------------------- - ])], - [] - ) - fi ## Libm @@ -214,7 +211,7 @@ Package features: Now type 'make @<:@@:>@' where the optional is: all - build C library and Fortran binding - check - run unit tests - install - install the library + check - run unit tests + install - install the library --------------------------------------------------"