From aadaf2db8d6fac37ab83b548235174fb46054f1a Mon Sep 17 00:00:00 2001 From: q-posev Date: Thu, 7 Oct 2021 14:06:56 +0200 Subject: [PATCH 1/3] better README --- README.md | 18 +++++++++++++++++- python/README.md | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9171859..6562200 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,22 @@ TREX library for efficient I/O. 7. `sudo make install` +## 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:/lib` (same holds for `$LD_LIBRARY_PATH`). Do not forget to change ``. +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: @@ -81,7 +97,7 @@ For example, the tutorial covering TREXIO basics using benzene molecule as an ex [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/TREX-CoE/trexio-tutorials/HEAD?filepath=notebooks%2Ftutorial_benzene.ipynb) -## Technical documentation +## Documentation [Documentation generated from TREXIO org-mode files.](https://trex-coe.github.io/trexio/) diff --git a/python/README.md b/python/README.md index b3e3b06..ccbd846 100644 --- a/python/README.md +++ b/python/README.md @@ -11,8 +11,7 @@ can be used to convert data from one input/output file format into another. ## Requirements - python3 (>= 3.6) -- numpy -- C compiler (gcc/icc) +- numpy (>= 1.17.3) ## Installation from PyPI @@ -31,6 +30,7 @@ For more details, see the corresponding part of the [Python documentation](https ## Additional requirements (for installation from source) +- C compiler (gcc/icc) - HDF5 library (>= 1.8) - pkgconfig (Python package) From a8bdb9b00e3ef46813a5f9ff55909f37abb29281 Mon Sep 17 00:00:00 2001 From: q-posev Date: Fri, 8 Oct 2021 13:03:35 +0200 Subject: [PATCH 2/3] update current version to 1.1 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3d9564b..e7308a8 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([trexio], [1.0.0], [https://github.com/TREX-CoE/trexio/issues]) +AC_INIT([trexio], [1.1.0], [https://github.com/TREX-CoE/trexio/issues]) AM_INIT_AUTOMAKE([subdir-objects color-tests parallel-tests silent-rules 1.11]) AM_MAINTAINER_MODE() LT_PREREQ([2.2]) From fb9c95bd61c23888caf6becb55fcb0a3a146e94e Mon Sep 17 00:00:00 2001 From: q-posev Date: Fri, 8 Oct 2021 13:55:56 +0200 Subject: [PATCH 3/3] add version attributes to the Fortran module --- src/templates_front/build.sh | 15 +++++++++++++++ tests/test_f.f90 | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/src/templates_front/build.sh b/src/templates_front/build.sh index 4e78d8f..97e53a3 100644 --- a/src/templates_front/build.sh +++ b/src/templates_front/build.sh @@ -3,6 +3,7 @@ # prefixes cat prefix_front.c > trexio.c cat prefix_front.h > trexio.h + # grep some usefull constants from the config.h echo "" >> trexio.h grep "TREXIO_PACKAGE_VERSION" ../../include/config.h >> trexio.h @@ -11,10 +12,24 @@ grep "TREXIO_VERSION_MINOR" ../../include/config.h >> trexio.h grep "TREXIO_VERSION_PATCH" ../../include/config.h >> trexio.h echo "" >> trexio.h +# parse the config-defined version attributes to pass them to Fortran module file +VERSION_VAL=`grep "TREXIO_PACKAGE_VERSION" ../../include/config.h | cut -d " " -f 3` +VERSION_MAJOR_VAL=`grep "TREXIO_VERSION_MAJOR" ../../include/config.h | cut -d " " -f 3` +VERSION_MINOR_VAL=`grep "TREXIO_VERSION_MINOR" ../../include/config.h | cut -d " " -f 3` +VERSION_PATCH_VAL=`grep "TREXIO_VERSION_PATCH" ../../include/config.h | cut -d " " -f 3` + cat prefix_s_front.h > trexio_s.h cat prefix_fortran.f90 > trexio_f.f90 cat prefix_python.py > trexio.py +# append version string and attributes to the Fortran module file +echo "" >> trexio_f.f90 +echo "character(len = 12) :: TREXIO_PACKAGE_VERSION = ${VERSION_VAL}" >> trexio_f.f90 +echo "integer(4) :: TREXIO_VERSION_MAJOR = ${VERSION_MAJOR_VAL}" >> trexio_f.f90 +echo "integer(4) :: TREXIO_VERSION_MINOR = ${VERSION_MINOR_VAL}" >> trexio_f.f90 +echo "integer(4) :: TREXIO_VERSION_PATCH = ${VERSION_PATCH_VAL}" >> trexio_f.f90 +echo "" >> trexio_f.f90 + # c front end cat populated/pop_*.c >> trexio.c cat populated/pop_*.h >> trexio.h diff --git a/tests/test_f.f90 b/tests/test_f.f90 index 42f9387..0390756 100644 --- a/tests/test_f.f90 +++ b/tests/test_f.f90 @@ -2,6 +2,12 @@ program test_trexio use trexio implicit none + print * , "============================================" + print'(a,a)' , " TREXIO VERSION STRING : ", TREXIO_PACKAGE_VERSION + print'(a,i3)', " TREXIO MAJOR VERSION : ", TREXIO_VERSION_MAJOR + print'(a,i3)', " TREXIO MINOR VERSION : ", TREXIO_VERSION_MINOR + print * , "============================================" + call system('rm -rf test_write_f.dir') print *, 'call test_write(''test_write_f.dir'', TREXIO_TEXT)' call test_write('test_write_f.dir', TREXIO_TEXT)