1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-22 20:35:44 +01:00

Merge branch 'TREX-CoE:master' into master

This commit is contained in:
joguenzl 2023-06-02 15:12:42 +02:00 committed by GitHub
commit 064600afcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 13 deletions

View File

@ -16,7 +16,43 @@ done
# check that both variables are set
if [[ -z ${H5_LDFLAGS_LOCAL} ]] || [[ -z ${H5_CFLAGS_LOCAL} ]]; then
if [[ -z ${H5_LDFLAGS} ]] || [[ -z ${H5_CFLAGS} ]]; then
echo "Paths to the HDF5 installation are not provided. pkgconfig will try to detect them."
which h5cc &> /dev/null
if [[ $? -eq 0 ]] ; then
HDF5_tmp_flags=$(h5cc -showconfig \
| grep 'FLAGS\|Extra libraries:' \
| awk -F: '{printf("%s "), $2}' )
echo $HDF5_tmp_flags
# Find the installation directory and append include/
HDF5_tmp_inst=$(h5cc -showconfig \
| grep 'Installation point:' \
| awk '{print $NF}' )
echo $HDF5_tmp_inst
# Add this to the CPPFLAGS
HDF5_CPPFLAGS="-I${HDF5_tmp_inst}/include"
HDF5_SHOW=$(h5cc -show)
# Now sort the flags out based upon their prefixes
for arg in $HDF5_SHOW $HDF5_tmp_flags ; do
case "$arg" in
-I*) echo $HDF5_CPPFLAGS | grep -e "$arg" 2>&1 >/dev/null \
|| HDF5_CPPFLAGS="$HDF5_CPPFLAGS $arg"
;;
-L*) echo $HDF5_LDFLAGS | grep -e "$arg" 2>&1 >/dev/null \
|| HDF5_LDFLAGS="$HDF5_LDFLAGS $arg"
;;
-l*) echo $HDF5_LIBS | grep -e "$arg" 2>&1 >/dev/null \
|| HDF5_LIBS="$HDF5_LIBS $arg"
;;
esac
done
export H5_LDFLAGS="$HDF5_LDFLAGS"
export H5_CFLAGS="$HDF5_CPPFLAGS"
else
echo "Paths to the HDF5 installation are not provided. pkgconfig will try to detect them."
fi
else
echo "Using exported H5_LDFLAGS and H5_CFLAGS environment variables."
fi

View File

@ -166,7 +166,11 @@ On non-POSIX file systems, the function ~mkdtemp~ might is not defined.
In that case, we define an alternate one, which is not as safe as the original one.
#+begin_src c :tangle basic_text.c
#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L
#if /* Since glibc 2.19: */ _DEFAULT_SOURCE \
|| /* Glibc 2.19 and earlier: */ _BSD_SOURCE \
|| /* Since glibc 2.10: */ _POSIX_C_SOURCE >= 200809L
/* mkdtemp is defined */
#else
char* mkdtemp(char* template) {

View File

@ -46,7 +46,7 @@ static int test_write_dset_sparse (const char* file_name, const back_end_t backe
uint64_t chunk_size = (uint64_t) size/N_CHUNKS;
chunk_size = chunk_size > 0 ? chunk_size : (uint64_t) size;
int n_chunks = size/chunk_size;
printf("chunk_size = %ld\n", chunk_size);
printf("chunk_size = %lld\n", chunk_size);
printf("n_chunks = %d\n", n_chunks);
uint64_t offset_f = 0UL + offset;
@ -55,7 +55,7 @@ static int test_write_dset_sparse (const char* file_name, const back_end_t backe
// write n_chunks times using write_sparse
while(offset_d < size) {
if (offset_d+chunk_size > size) chunk_size = size-offset_d;
printf("chunk_size = %ld\n", chunk_size);
printf("chunk_size = %lld\n", chunk_size);
if (chunk_size == 0L) break;
rc = trexio_write_mo_2e_int_eri(file, offset_f, chunk_size, &index[4*offset_d], &value[offset_d]);
printf("%5d: %s\n", __LINE__, trexio_string_of_error(rc));
@ -163,7 +163,7 @@ static int test_read_dset_sparse (const char* file_name, const back_end_t backen
printf("%5d: %s\n", __LINE__, trexio_string_of_error(rc));
/*
for (int i=0 ; i<chunk_read ; ++i) {
printf("%d %d | %ld %ld %ld\n", i, index_read[i], offset, offset_file_read, chunk_read);
printf("%d %d | %lld %lld %lld\n", i, index_read[i], offset, offset_file_read, chunk_read);
}
*/
//assert(rc == TREXIO_SUCCESS);
@ -184,7 +184,7 @@ static int test_read_dset_sparse (const char* file_name, const back_end_t backen
printf("%5d: %s\n", __LINE__, trexio_string_of_error(rc));
assert(rc == TREXIO_END);
printf("%d %d x\n", (int32_t) index_read[0], (int32_t) (4L*offset_file_read));
printf("%ld %ld\n", chunk_read, eof_read_size_check);
printf("%lld %lld\n", chunk_read, eof_read_size_check);
assert(chunk_read == eof_read_size_check);
printf("%d %d\n", index_read[0] , (int32_t) (offset_file_read - offset));
assert(index_read[0] == (int32_t) offset_file_read - offset);
@ -222,7 +222,7 @@ static int test_read_dset_sparse_size (const char* file_name, const back_end_t b
// read one chunk using the aforementioned parameters
rc = trexio_read_mo_2e_int_eri_size(file, &size_written);
assert(rc == TREXIO_SUCCESS);
printf("%5d: %ld %ld\n", __LINE__, size_written, size_check);
printf("%5d: %lld %lld\n", __LINE__, size_written, size_check);
assert(size_written == size_check);
// close current session

View File

@ -69,8 +69,8 @@ subroutine test_write(file_name, back_end)
double precision :: charge(12)
double precision :: coord(3,12)
character(len=:), allocatable :: sym_str
character(len=:), allocatable :: label(:)
character(len=32), allocatable :: sym_str
character(len=8), allocatable :: label(:)
double precision, allocatable :: energy(:)
integer , allocatable :: spin(:)
@ -131,7 +131,7 @@ subroutine test_write(file_name, back_end)
basis_shell_num = 24
basis_nucleus_index = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 /)
allocate(character(len=8) :: label(12))
allocate(label(12))
label(1) = 'C'
label(2) = 'Na'
label(3) = 'C'

View File

@ -611,13 +611,13 @@ def get_detailed_num_dict (configuration: dict) -> dict:
tmp_dict.update(get_dtype_dict(v2[0], 'num'))
if v2[0] in ['int', 'dim', 'dim readonly']:
tmp_dict['trex_json_int_type'] = v2[0]
tmp_dict['is_index'] = 'false'
tmp_dict['is_index'] = '(false)'
elif v2[0] in ['index']:
tmp_dict['trex_json_int_type'] = v2[0]
tmp_dict['is_index'] = 'file->one_based'
else:
tmp_dict['trex_json_int_type'] = ''
tmp_dict['is_index'] = 'false'
tmp_dict['is_index'] = '(false)'
num_dict[tmp_num] = tmp_dict
@ -721,7 +721,7 @@ def split_dset_dict_detailed (datasets: dict) -> tuple:
if 'index' in datatype:
tmp_dict['is_index'] = 'file->one_based'
else:
tmp_dict['is_index'] = 'false'
tmp_dict['is_index'] = '(false)'
# add the list of dimensions
tmp_dict['dims'] = [dim.replace('.','_') for dim in v[1]]