Skip to content

Commit

Permalink
Merge pull request #66 from TREX-CoE/configure
Browse files Browse the repository at this point in the history
Automatic maintainer mode
  • Loading branch information
q-posev authored Nov 1, 2021
2 parents 33078ee + c8414c4 commit 37315d5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TREX library for efficient I/O.
1. Download the `trexio-<version>.tar.gz` file
2. `gzip -cd trexio-<version>.tar.gz | tar xvf -`
3. `cd trexio-<version>`
4. `./configure --enable-silent-rules`
4. `./configure`
5. `make`
6. `make check`
7. `sudo make install`
Expand All @@ -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`
Expand All @@ -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:<path_to_trexio>/lib`
`export LIBRARY_PATH=$LIBRARY_PATH:<path_to_trexio>/lib`

(same holds for `$LD_LIBRARY_PATH`). The `<path_to_trexio>` has to be replaced by the prefix used during the installation.

Expand All @@ -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)


Expand All @@ -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.


Expand Down
39 changes: 18 additions & 21 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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])

Expand All @@ -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
Expand Down Expand Up @@ -214,7 +211,7 @@ Package features:
Now type 'make @<:@<target>@:>@'
where the optional <target> is:
all - build C library and Fortran binding
check - run unit tests
install - install the library
check - run unit tests
install - install the library
--------------------------------------------------"

0 comments on commit 37315d5

Please sign in to comment.